From a96083c02641ce121437513f9fafe0a93a046275 Mon Sep 17 00:00:00 2001 From: Matheus Morett Date: Sat, 6 Sep 2025 13:05:29 -0300 Subject: [PATCH 01/12] fix(util/remove-binding): handle scenario where have alias in require --- utils/src/ast-grep/remove-binding.test.ts | 25 ++++++++++++++++++++++- utils/src/ast-grep/remove-binding.ts | 22 ++++++++++++++++++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/utils/src/ast-grep/remove-binding.test.ts b/utils/src/ast-grep/remove-binding.test.ts index 1c1d6b16..0f2e2d91 100644 --- a/utils/src/ast-grep/remove-binding.test.ts +++ b/utils/src/ast-grep/remove-binding.test.ts @@ -1,5 +1,5 @@ import assert from "node:assert/strict"; -import { describe, it } from "node:test"; +import { describe, it, only } from "node:test"; import astGrep from "@ast-grep/napi"; import dedent from "dedent"; import { removeBinding } from "./remove-binding.ts"; @@ -29,6 +29,29 @@ describe("remove-binding", () => { }); }); + only("should not remove non-related named requires", () => { + const code = dedent` + const { assert: nodeAssert, env } = require("process"); + `; + + const rootNode = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = rootNode.root(); + + const requireStatement = node.find({ + rule: { + kind: "lexical_declaration", + }, + }); + + const change = removeBinding(requireStatement!, "nodeAssert"); + + const sourceCode = node.commitEdits([change?.edit!]); + assert.strictEqual(sourceCode, `const { env } = require("process");`); + + assert.notEqual(change, null); + assert.strictEqual(change?.lineToRemove, undefined); + }) + it("should return undefined when the binding does not match the imported name", () => { const code = dedent` const util = require('node:util'); diff --git a/utils/src/ast-grep/remove-binding.ts b/utils/src/ast-grep/remove-binding.ts index 04c1f44e..a099276e 100644 --- a/utils/src/ast-grep/remove-binding.ts +++ b/utils/src/ast-grep/remove-binding.ts @@ -184,7 +184,14 @@ function handleNamedRequireBindings( const declarations = node.findAll({ rule: { - kind: "shorthand_property_identifier_pattern", + any: [ + { + kind: "pair_pattern", + }, + { + kind: "shorthand_property_identifier_pattern", + }, + ] }, }); @@ -195,7 +202,18 @@ function handleNamedRequireBindings( } if (declarations.length > 1) { - const restDeclarations = declarations.map((d) => d.text()).filter((d) => d !== binding); + const restDeclarations = declarations.map((d) => { + if (d.kind() === 'pair_pattern') { + const alias = d.find({ + rule: { + kind: 'identifier', + } + }) + + return alias.text() + } + return d.text() + }).filter((d) => d !== binding); return { edit: objectPattern.replace(`{ ${restDeclarations.join(", ")} }`), From 48c4a1d959fef7b3bf7b9d92fd4bef65af828432 Mon Sep 17 00:00:00 2001 From: Matheus Morett Date: Sat, 6 Sep 2025 13:06:05 -0300 Subject: [PATCH 02/12] feat(process-assert-to-assert): introduce --- package-lock.json | 15 +++ recipes/process-assert-to-assert/README.md | 20 +++ recipes/process-assert-to-assert/codemod.yaml | 21 +++ recipes/process-assert-to-assert/package.json | 25 ++++ .../process-assert-to-assert/src/workflow.ts | 122 ++++++++++++++++++ .../tests/expected/inside-a-function.js | 5 + .../tests/expected/mixed-assert-usages.js | 3 + .../tests/expected/simple-usage.js | 2 + .../tests/expected/using-common-js.cjs | 2 + .../tests/expected/using-process-import.js | 3 + .../tests/expected/using-process-require.js | 3 + .../tests/expected/using-require.js | 3 + .../tests/input/inside-a-function.js | 4 + .../tests/input/mixed-assert-usages.js | 4 + .../tests/input/simple-usage.js | 1 + .../tests/input/using-common-js.cjs | 1 + .../tests/input/using-process-import.js | 2 + .../tests/input/using-process-require.js | 2 + .../tests/input/using-require.js | 2 + .../process-assert-to-assert/workflow.yaml | 25 ++++ 20 files changed, 265 insertions(+) create mode 100644 recipes/process-assert-to-assert/README.md create mode 100644 recipes/process-assert-to-assert/codemod.yaml create mode 100644 recipes/process-assert-to-assert/package.json create mode 100644 recipes/process-assert-to-assert/src/workflow.ts create mode 100644 recipes/process-assert-to-assert/tests/expected/inside-a-function.js create mode 100644 recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js create mode 100644 recipes/process-assert-to-assert/tests/expected/simple-usage.js create mode 100644 recipes/process-assert-to-assert/tests/expected/using-common-js.cjs create mode 100644 recipes/process-assert-to-assert/tests/expected/using-process-import.js create mode 100644 recipes/process-assert-to-assert/tests/expected/using-process-require.js create mode 100644 recipes/process-assert-to-assert/tests/expected/using-require.js create mode 100644 recipes/process-assert-to-assert/tests/input/inside-a-function.js create mode 100644 recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js create mode 100644 recipes/process-assert-to-assert/tests/input/simple-usage.js create mode 100644 recipes/process-assert-to-assert/tests/input/using-common-js.cjs create mode 100644 recipes/process-assert-to-assert/tests/input/using-process-import.js create mode 100644 recipes/process-assert-to-assert/tests/input/using-process-require.js create mode 100644 recipes/process-assert-to-assert/tests/input/using-require.js create mode 100644 recipes/process-assert-to-assert/workflow.yaml diff --git a/package-lock.json b/package-lock.json index 6b046abb..99501226 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1432,6 +1432,10 @@ "resolved": "recipes/import-assertions-to-attributes", "link": true }, + "node_modules/@nodejs/process-assert-to-assert": { + "resolved": "recipes/process-assert-to-assert", + "link": true + }, "node_modules/@nodejs/process-main-module": { "resolved": "recipes/process-main-module", "link": true @@ -4118,6 +4122,17 @@ "@codemod.com/jssg-types": "^1.0.3" } }, + "recipes/process-assert-to-assert": { + "name": "@nodejs/process-assert-to-assert", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@nodejs/codemod-utils": "*" + }, + "devDependencies": { + "@codemod.com/jssg-types": "^1.0.3" + } + }, "recipes/process-main-module": { "name": "@nodejs/process-main-module", "version": "1.0.1", diff --git a/recipes/process-assert-to-assert/README.md b/recipes/process-assert-to-assert/README.md new file mode 100644 index 00000000..7fb6e9b8 --- /dev/null +++ b/recipes/process-assert-to-assert/README.md @@ -0,0 +1,20 @@ +# `process.assert` DEP0100 + +This recipe transforms the usage of `process.assert` to use `assert` module. + +See [DEP0100](https://github.com/nodejs/userland-migrations/issues/197). + +## Example + +**Before:** + +```js +process.assert(condition, "Assertion failed"); +``` + +**After:** + +```js +import assert from "node:assert"; +assert(condition, "Assertion failed"); +``` diff --git a/recipes/process-assert-to-assert/codemod.yaml b/recipes/process-assert-to-assert/codemod.yaml new file mode 100644 index 00000000..abd4f604 --- /dev/null +++ b/recipes/process-assert-to-assert/codemod.yaml @@ -0,0 +1,21 @@ +schema_version: "1.0" +name: "@nodejs/process-assert-to-assert" +version: 1.0.0 +description: Handle DEP0100 via transforming `process.assert` to `assert`. +author: matheusmorett2 +license: MIT +workflow: workflow.yaml +category: migration + +targets: + languages: + - javascript + - typescript + +keywords: + - transformation + - migration + +registry: + access: public + visibility: public diff --git a/recipes/process-assert-to-assert/package.json b/recipes/process-assert-to-assert/package.json new file mode 100644 index 00000000..ddddbb65 --- /dev/null +++ b/recipes/process-assert-to-assert/package.json @@ -0,0 +1,25 @@ +{ + "name": "@nodejs/process-assert-to-assert", + "version": "1.0.0", + "description": "Handle DEP0100 via transforming `process.assert` to `assert`.", + "type": "module", + "scripts": { + "test": "npx codemod jssg test -l typescript --ignore-whitespace ./src/workflow.ts ./", + "test:u": "npx codemod jssg test -l typescript -u ./src/workflow.ts ./" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/userland-migrations.git", + "directory": "recipes/process-assert-to-assert", + "bugs": "https://github.com/nodejs/userland-migrations/issues" + }, + "author": "matheusmorett2", + "license": "MIT", + "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/process-assert-to-assert/README.md", + "devDependencies": { + "@codemod.com/jssg-types": "^1.0.3" + }, + "dependencies": { + "@nodejs/codemod-utils": "*" + } +} \ No newline at end of file diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts new file mode 100644 index 00000000..6428b362 --- /dev/null +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -0,0 +1,122 @@ +import type { Edit, Range, Rule, SgNode, SgRoot } from "@codemod.com/jssg-types/main"; +import { getNodeRequireCalls } from "@nodejs/codemod-utils/ast-grep/require-call"; +import { getNodeImportStatements } from "@nodejs/codemod-utils/ast-grep/import-statement"; +import { resolveBindingPath } from "@nodejs/codemod-utils/ast-grep/resolve-binding-path"; +import { removeBinding } from "@nodejs/codemod-utils/ast-grep/remove-binding"; +import { removeLines } from "@nodejs/codemod-utils/ast-grep/remove-lines"; + +/** + * Transforms deprecated `process.assert` usage to the standard `assert` module. + * + * Transformations: + * 1. Replaces all `process.assert` references with `assert` + * 2. Adds the necessary import/require statement if not already present: + * - For ESM or files without require calls: adds `import assert from "node:assert"` + * - For CommonJS (.cjs files or files using require): adds `const assert = require("node:assert")` + * + * Examples: + * + * Before: + * ```js + * process.assert(value); + * process.assert.strictEqual(a, b); + * ``` + * + * After: + * ```js + * import assert from "node:assert"; + * assert(value); + * assert.strictEqual(a, b); + * ``` + */ +export default function transform(root: SgRoot): string | null { + const rootNode = root.root(); + const edits: Edit[] = []; + const linesToRemove: Range[] = []; + const replaceRules: Array< + { + importNode?: SgNode + binding?: string + rule: Rule + } + > = [{ + rule: { + kind: 'member_expression', + pattern: "process.assert", + } + }]; + + const requireProcess = getNodeRequireCalls(root, "process"); + const importProcess = getNodeImportStatements(root, "process"); + + const allProcessImports = [...requireProcess, ...importProcess] + + for (const processImport of allProcessImports) { + const binding = resolveBindingPath(processImport, "$.assert"); + replaceRules.push( + { + importNode: processImport, + binding, + rule: { + kind: "identifier", + regex: binding, + inside: { + kind: 'call_expression', + } + } + } + ) + } + + for (const replaceRule of replaceRules) { + const nodes = rootNode.findAll({ + rule: replaceRule.rule + }) + + for (const node of nodes) { + if (replaceRule.importNode) { + const removeBind = removeBinding(replaceRule.importNode, replaceRule.binding) + + if (removeBind.edit) { + edits.push(removeBind.edit); + } + + if (removeBind.lineToRemove) { + linesToRemove.push(removeBind.lineToRemove) + } + } + + + edits.push(node.replace("assert")) + } + } + + let sourceCode = rootNode.commitEdits(edits); + sourceCode = removeLines(sourceCode, linesToRemove); + + const alreadyRequiringAssert = getNodeRequireCalls(root, "assert"); + const alreadyImportingAssert = getNodeImportStatements(root, "assert"); + + if (!alreadyRequiringAssert.length && !alreadyImportingAssert.length) { + const usingRequire = rootNode.find({ + rule: { + kind: 'call_expression', + has: { + kind: 'identifier', + field: 'function', + regex: 'require' + } + } + }) + + const isCommonJs = root.filename().includes('.cjs') + + if (Boolean(usingRequire) || isCommonJs) { + return `const assert = require("node:assert");\n${sourceCode}` + } + + return `import assert from "node:assert";\n${sourceCode}` + } + + return sourceCode +} diff --git a/recipes/process-assert-to-assert/tests/expected/inside-a-function.js b/recipes/process-assert-to-assert/tests/expected/inside-a-function.js new file mode 100644 index 00000000..af136bd6 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/inside-a-function.js @@ -0,0 +1,5 @@ +import assert from "node:assert"; +function validateInput(input) { + assert(typeof input === "string", "Input must be string"); + return input.trim(); +} \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js b/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js new file mode 100644 index 00000000..e8899150 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(config.port, "Port must be configured"); +assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/simple-usage.js b/recipes/process-assert-to-assert/tests/expected/simple-usage.js new file mode 100644 index 00000000..85415fe8 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/simple-usage.js @@ -0,0 +1,2 @@ +import assert from "node:assert"; +assert(condition, "Assertion failed"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs b/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs new file mode 100644 index 00000000..8c0aabc8 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs @@ -0,0 +1,2 @@ +const assert = require("node:assert"); +assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-process-import.js b/recipes/process-assert-to-assert/tests/expected/using-process-import.js new file mode 100644 index 00000000..c3fcd651 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/using-process-import.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +import { env } from "process"; +assert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-process-require.js b/recipes/process-assert-to-assert/tests/expected/using-process-require.js new file mode 100644 index 00000000..1d6170b8 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/using-process-require.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +const { env } = require("process"); +assert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-require.js b/recipes/process-assert-to-assert/tests/expected/using-require.js new file mode 100644 index 00000000..2fe012fc --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/using-require.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +const util = require("node:util"); +assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/inside-a-function.js b/recipes/process-assert-to-assert/tests/input/inside-a-function.js new file mode 100644 index 00000000..e043af1a --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/inside-a-function.js @@ -0,0 +1,4 @@ +function validateInput(input) { + process.assert(typeof input === "string", "Input must be string"); + return input.trim(); +} diff --git a/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js b/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js new file mode 100644 index 00000000..eda05135 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js @@ -0,0 +1,4 @@ +import assert from "node:assert"; + +process.assert(config.port, "Port must be configured"); +assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/simple-usage.js b/recipes/process-assert-to-assert/tests/input/simple-usage.js new file mode 100644 index 00000000..407b2efd --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/simple-usage.js @@ -0,0 +1 @@ +process.assert(condition, "Assertion failed"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-common-js.cjs b/recipes/process-assert-to-assert/tests/input/using-common-js.cjs new file mode 100644 index 00000000..b9bc9299 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/using-common-js.cjs @@ -0,0 +1 @@ +process.assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-process-import.js b/recipes/process-assert-to-assert/tests/input/using-process-import.js new file mode 100644 index 00000000..beed0a04 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/using-process-import.js @@ -0,0 +1,2 @@ +import { assert as nodeAssert, env } from "process"; +nodeAssert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-process-require.js b/recipes/process-assert-to-assert/tests/input/using-process-require.js new file mode 100644 index 00000000..70118a70 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/using-process-require.js @@ -0,0 +1,2 @@ +const { assert: nodeAssert, env } = require("process"); +nodeAssert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-require.js b/recipes/process-assert-to-assert/tests/input/using-require.js new file mode 100644 index 00000000..22df180b --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/using-require.js @@ -0,0 +1,2 @@ +const util = require("node:util"); +process.assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/workflow.yaml b/recipes/process-assert-to-assert/workflow.yaml new file mode 100644 index 00000000..b2db413f --- /dev/null +++ b/recipes/process-assert-to-assert/workflow.yaml @@ -0,0 +1,25 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/codemod-com/codemod/refs/heads/main/schemas/workflow.json + +version: "1" + +nodes: + - id: apply-transforms + name: Apply AST Transformations + type: automatic + steps: + - name: Handle DEP0100 via transforming `process.assert` to `assert`. + js-ast-grep: + js_file: src/workflow.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.cts" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript From 91b0098fd1309c768ef0ef66243ab8f055138ef4 Mon Sep 17 00:00:00 2001 From: Matheus Morett Date: Sat, 6 Sep 2025 13:15:24 -0300 Subject: [PATCH 03/12] fix: remove test only --- recipes/process-assert-to-assert/src/workflow.ts | 1 - utils/src/ast-grep/remove-binding.test.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index 6428b362..2559d9fb 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -86,7 +86,6 @@ export default function transform(root: SgRoot): string | null { } } - edits.push(node.replace("assert")) } } diff --git a/utils/src/ast-grep/remove-binding.test.ts b/utils/src/ast-grep/remove-binding.test.ts index 0f2e2d91..99e097cf 100644 --- a/utils/src/ast-grep/remove-binding.test.ts +++ b/utils/src/ast-grep/remove-binding.test.ts @@ -1,5 +1,5 @@ import assert from "node:assert/strict"; -import { describe, it, only } from "node:test"; +import { describe, it } from "node:test"; import astGrep from "@ast-grep/napi"; import dedent from "dedent"; import { removeBinding } from "./remove-binding.ts"; @@ -29,7 +29,7 @@ describe("remove-binding", () => { }); }); - only("should not remove non-related named requires", () => { + it("should not remove non-related named requires", () => { const code = dedent` const { assert: nodeAssert, env } = require("process"); `; From ccec01a9c815f26ce2dda7747eb9757dc6af55a7 Mon Sep 17 00:00:00 2001 From: Matheus Morett Date: Sat, 6 Sep 2025 17:13:59 -0300 Subject: [PATCH 04/12] fix: apply comments suggestions --- recipes/process-assert-to-assert/package.json | 3 +- .../process-assert-to-assert/src/workflow.ts | 126 +++++++++++++----- .../01-basic-global-process-assert.js | 3 + .../tests/expected/02-basic-commonjs.cjs | 3 + .../tests/expected/03-esm-import-process.mjs | 3 + .../tests/expected/04-mixed-process-usage.js | 5 + .../tests/expected/05-require-process.js | 3 + .../expected/06-destructured-assert-only.js | 3 + .../07-destructured-mixed-bindings.js | 4 + .../08-aliased-destructured-assert.js | 3 + .../expected/09-aliased-destructured-mixed.js | 5 + .../tests/expected/10-require-destructured.js | 3 + .../expected/11-already-has-assert-import.js | 3 + .../expected/12-already-has-assert-require.js | 3 + .../tests/expected/13-no-process-assert.js | 6 + .../tests/expected/14-nested-in-function.js | 10 ++ .../expected/15-multiple-assert-methods.js | 6 + .../expected/16-mixed-require-and-assert.js | 9 ++ .../tests/expected/17-complex-nested-class.js | 19 +++ .../tests/expected/inside-a-function.js | 5 - .../tests/expected/mixed-assert-usages.js | 3 - .../tests/expected/simple-usage.js | 2 - .../tests/expected/using-common-js.cjs | 2 - .../tests/expected/using-process-import.js | 3 - .../tests/expected/using-process-require.js | 3 - .../tests/expected/using-require.js | 3 - .../input/01-basic-global-process-assert.js | 2 + .../tests/input/02-basic-commonjs.cjs | 2 + .../tests/input/03-esm-import-process.mjs | 3 + .../tests/input/04-mixed-process-usage.js | 4 + .../tests/input/05-require-process.js | 3 + .../input/06-destructured-assert-only.js | 3 + .../input/07-destructured-mixed-bindings.js | 3 + .../input/08-aliased-destructured-assert.js | 3 + .../input/09-aliased-destructured-mixed.js | 4 + .../tests/input/10-require-destructured.js | 3 + .../input/11-already-has-assert-import.js | 3 + .../input/12-already-has-assert-require.js | 3 + .../tests/input/13-no-process-assert.js | 6 + .../tests/input/14-nested-in-function.js | 9 ++ .../tests/input/15-multiple-assert-methods.js | 5 + .../input/16-mixed-require-and-assert.js | 8 ++ .../tests/input/17-complex-nested-class.js | 18 +++ .../tests/input/inside-a-function.js | 4 - .../tests/input/mixed-assert-usages.js | 4 - .../tests/input/simple-usage.js | 1 - .../tests/input/using-common-js.cjs | 1 - .../tests/input/using-process-import.js | 2 - .../tests/input/using-process-require.js | 2 - .../tests/input/using-require.js | 2 - 50 files changed, 268 insertions(+), 71 deletions(-) create mode 100644 recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js create mode 100644 recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs create mode 100644 recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs create mode 100644 recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js create mode 100644 recipes/process-assert-to-assert/tests/expected/05-require-process.js create mode 100644 recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js create mode 100644 recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js create mode 100644 recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js create mode 100644 recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js create mode 100644 recipes/process-assert-to-assert/tests/expected/10-require-destructured.js create mode 100644 recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js create mode 100644 recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js create mode 100644 recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js create mode 100644 recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js create mode 100644 recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js create mode 100644 recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js create mode 100644 recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/inside-a-function.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/simple-usage.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/using-common-js.cjs delete mode 100644 recipes/process-assert-to-assert/tests/expected/using-process-import.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/using-process-require.js delete mode 100644 recipes/process-assert-to-assert/tests/expected/using-require.js create mode 100644 recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js create mode 100644 recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs create mode 100644 recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs create mode 100644 recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js create mode 100644 recipes/process-assert-to-assert/tests/input/05-require-process.js create mode 100644 recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js create mode 100644 recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js create mode 100644 recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js create mode 100644 recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js create mode 100644 recipes/process-assert-to-assert/tests/input/10-require-destructured.js create mode 100644 recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js create mode 100644 recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js create mode 100644 recipes/process-assert-to-assert/tests/input/13-no-process-assert.js create mode 100644 recipes/process-assert-to-assert/tests/input/14-nested-in-function.js create mode 100644 recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js create mode 100644 recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js create mode 100644 recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js delete mode 100644 recipes/process-assert-to-assert/tests/input/inside-a-function.js delete mode 100644 recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js delete mode 100644 recipes/process-assert-to-assert/tests/input/simple-usage.js delete mode 100644 recipes/process-assert-to-assert/tests/input/using-common-js.cjs delete mode 100644 recipes/process-assert-to-assert/tests/input/using-process-import.js delete mode 100644 recipes/process-assert-to-assert/tests/input/using-process-require.js delete mode 100644 recipes/process-assert-to-assert/tests/input/using-require.js diff --git a/recipes/process-assert-to-assert/package.json b/recipes/process-assert-to-assert/package.json index ddddbb65..6c773436 100644 --- a/recipes/process-assert-to-assert/package.json +++ b/recipes/process-assert-to-assert/package.json @@ -4,8 +4,7 @@ "description": "Handle DEP0100 via transforming `process.assert` to `assert`.", "type": "module", "scripts": { - "test": "npx codemod jssg test -l typescript --ignore-whitespace ./src/workflow.ts ./", - "test:u": "npx codemod jssg test -l typescript -u ./src/workflow.ts ./" + "test": "npx codemod jssg test -l typescript --ignore-whitespace ./src/workflow.ts ./" }, "repository": { "type": "git", diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index 2559d9fb..16d39a1b 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -4,6 +4,7 @@ import { getNodeImportStatements } from "@nodejs/codemod-utils/ast-grep/import-s import { resolveBindingPath } from "@nodejs/codemod-utils/ast-grep/resolve-binding-path"; import { removeBinding } from "@nodejs/codemod-utils/ast-grep/remove-binding"; import { removeLines } from "@nodejs/codemod-utils/ast-grep/remove-lines"; +import { EOL } from "node:os"; /** * Transforms deprecated `process.assert` usage to the standard `assert` module. @@ -13,16 +14,18 @@ import { removeLines } from "@nodejs/codemod-utils/ast-grep/remove-lines"; * 2. Adds the necessary import/require statement if not already present: * - For ESM or files without require calls: adds `import assert from "node:assert"` * - For CommonJS (.cjs files or files using require): adds `const assert = require("node:assert")` + * 3. Removes process import/require if it was only used for assert * * Examples: * - * Before: + * **Before**: * ```js + * import process from "node:process"; * process.assert(value); * process.assert.strictEqual(a, b); * ``` * - * After: + * **After**: * ```js * import assert from "node:assert"; * assert(value); @@ -33,28 +36,29 @@ export default function transform(root: SgRoot): string | null { const rootNode = root.root(); const edits: Edit[] = []; const linesToRemove: Range[] = []; - const replaceRules: Array< - { - importNode?: SgNode - binding?: string - rule: Rule - } - > = [{ + const replaceRules: Array<{ + importNode?: SgNode; + binding?: string; + rule: Rule; + replaceWith?: string; + }> = [{ rule: { kind: 'member_expression', pattern: "process.assert", - } + }, + replaceWith: "assert" }]; - const requireProcess = getNodeRequireCalls(root, "process"); - const importProcess = getNodeImportStatements(root, "process"); + const processImportsToRemove = new Set(); - const allProcessImports = [...requireProcess, ...importProcess] + function processImports(moduleName: "process" | "node:process") { + const requireCalls = getNodeRequireCalls(root, moduleName); + const importStatements = getNodeImportStatements(root, moduleName); + const allImports = [...requireCalls, ...importStatements]; - for (const processImport of allProcessImports) { - const binding = resolveBindingPath(processImport, "$.assert"); - replaceRules.push( - { + for (const processImport of allImports) { + const binding = resolveBindingPath(processImport, "$.assert"); + replaceRules.push({ importNode: processImport, binding, rule: { @@ -63,36 +67,94 @@ export default function transform(root: SgRoot): string | null { inside: { kind: 'call_expression', } + }, + replaceWith: "assert" + }); + + if (binding) { + replaceRules.push({ + importNode: processImport, + binding, + rule: { + kind: "member_expression", + has: { + kind: "identifier", + regex: `^${binding}$`, + field: "object" + } + }, + replaceWith: "assert" + }); + } + + const processUsages = rootNode.findAll({ + rule: { + kind: 'member_expression', + has: { + kind: 'identifier', + regex: '^process$' + } + } + }); + + let hasNonAssertUsage = false; + for (const usage of processUsages) { + const propertyNode = usage.field("property"); + if (propertyNode && propertyNode.text() !== "assert") { + hasNonAssertUsage = true; + break; } } - ) + + if (!hasNonAssertUsage && processUsages.length > 0) { + processImportsToRemove.add(processImport); + linesToRemove.push(processImport.range()); + } + } } + processImports("process"); + processImports("node:process"); + for (const replaceRule of replaceRules) { const nodes = rootNode.findAll({ rule: replaceRule.rule - }) + }); for (const node of nodes) { if (replaceRule.importNode) { - const removeBind = removeBinding(replaceRule.importNode, replaceRule.binding) + if (!processImportsToRemove.has(replaceRule.importNode)) { + const removeBind = removeBinding(replaceRule.importNode, replaceRule.binding); - if (removeBind.edit) { - edits.push(removeBind.edit); - } + if (removeBind.edit) { + edits.push(removeBind.edit); + } - if (removeBind.lineToRemove) { - linesToRemove.push(removeBind.lineToRemove) + if (removeBind.lineToRemove) { + linesToRemove.push(removeBind.lineToRemove); + } } } - edits.push(node.replace("assert")) + if (replaceRule.rule.kind === "member_expression" && replaceRule.binding) { + const objectNode = node.field("object"); + if (objectNode) { + edits.push(objectNode.replace("assert")); + } + } else { + const replaceText = replaceRule.replaceWith || "assert"; + edits.push(node.replace(replaceText)); + } } } let sourceCode = rootNode.commitEdits(edits); sourceCode = removeLines(sourceCode, linesToRemove); + if (edits.length === 0 && linesToRemove) { + return sourceCode; + } + const alreadyRequiringAssert = getNodeRequireCalls(root, "assert"); const alreadyImportingAssert = getNodeImportStatements(root, "assert"); @@ -106,16 +168,16 @@ export default function transform(root: SgRoot): string | null { regex: 'require' } } - }) + }); - const isCommonJs = root.filename().includes('.cjs') + const isCommonJs = root.filename().includes('.cjs'); if (Boolean(usingRequire) || isCommonJs) { - return `const assert = require("node:assert");\n${sourceCode}` + return `const assert = require("node:assert");${EOL}${sourceCode}`; } - return `import assert from "node:assert";\n${sourceCode}` + return `import assert from "node:assert";${EOL}${sourceCode}`; } - return sourceCode -} + return sourceCode; +} \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js b/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js new file mode 100644 index 00000000..08f8977f --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(condition, "Basic assertion"); +assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs b/recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs new file mode 100644 index 00000000..3ae76b87 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +assert(condition, "Basic assertion"); +assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs b/recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs new file mode 100644 index 00000000..18f54fdb --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(value, "Process assertion"); +assert.strictEqual(obj1, obj2); diff --git a/recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js b/recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js new file mode 100644 index 00000000..4d46b15f --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js @@ -0,0 +1,5 @@ +import assert from "node:assert"; +import process from "node:process"; +assert(value, "Process assertion"); +process.env.NODE_ENV = "test"; +console.log(process.pid); diff --git a/recipes/process-assert-to-assert/tests/expected/05-require-process.js b/recipes/process-assert-to-assert/tests/expected/05-require-process.js new file mode 100644 index 00000000..e54c017d --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/05-require-process.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +assert(value, "Process assertion"); +assert.throws(() => { throw new Error(); }); diff --git a/recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js b/recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js new file mode 100644 index 00000000..24569401 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(condition, "Assertion from destructured import"); +assert.throws(() => { throw new Error("test"); }); diff --git a/recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js b/recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js new file mode 100644 index 00000000..0aff0c40 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js @@ -0,0 +1,4 @@ +import assert from "node:assert"; +import { env } from "node:process"; +assert(value, "Using destructured assert"); +console.log(env.NODE_ENV); diff --git a/recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js b/recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js new file mode 100644 index 00000000..cf8634e6 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(value, "Using aliased assert"); +assert.notStrictEqual(a, b); diff --git a/recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js b/recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js new file mode 100644 index 00000000..e1b0edd5 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js @@ -0,0 +1,5 @@ +import assert from "node:assert"; +import { env } from "node:process"; +assert(value, "Using aliased assert"); +assert.strictEqual(a, b); +console.log(env.NODE_ENV); diff --git a/recipes/process-assert-to-assert/tests/expected/10-require-destructured.js b/recipes/process-assert-to-assert/tests/expected/10-require-destructured.js new file mode 100644 index 00000000..78b4324f --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/10-require-destructured.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +assert(value, "Destructured assert from require"); +assert.strictEqual(a, b, "Should be equal"); diff --git a/recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js b/recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js new file mode 100644 index 00000000..db459c1a --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +assert(value, "This should be transformed"); +assert.strictEqual(a, b, "This should remain unchanged"); diff --git a/recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js b/recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js new file mode 100644 index 00000000..a0f7c1b4 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +assert(value, "This should be transformed"); +assert.strictEqual(a, b, "This should remain unchanged"); diff --git a/recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js b/recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js new file mode 100644 index 00000000..d7717c73 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js @@ -0,0 +1,6 @@ +const config = { + port: 3000, + host: "localhost" +}; + +console.log("Server config:", config); diff --git a/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js b/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js new file mode 100644 index 00000000..92d74048 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js @@ -0,0 +1,10 @@ +import assert from "node:assert"; +function testFunction() { + assert(condition, "Assertion inside function"); + + if (someCondition) { + assert.deepStrictEqual(obj1, obj2, "Deep comparison"); + } + + return assert.ok(value) && true; +} diff --git a/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js b/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js new file mode 100644 index 00000000..5db73614 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js @@ -0,0 +1,6 @@ +import assert from "node:assert"; +assert(condition); +assert.ok(value); +assert.strictEqual(a, b); +assert.notStrictEqual(a, c); +assert.throws(() => { throw new Error(); }); diff --git a/recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js b/recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js new file mode 100644 index 00000000..e0389c84 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js @@ -0,0 +1,9 @@ +const assert = require("node:assert"); +const fs = require("fs"); + +function readConfig(path) { + assert(fs.existsSync(path), "Config file must exist"); + const data = fs.readFileSync(path, "utf8"); + assert.ok(data.length > 0, "Config file cannot be empty"); + return JSON.parse(data); +} diff --git a/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js b/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js new file mode 100644 index 00000000..1cd40c48 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js @@ -0,0 +1,19 @@ +import assert from "node:assert"; +class Validator { + static validate(data) { + assert(data, "Data is required"); + + try { + assert.strictEqual(typeof data, "object", "Data must be object"); + } catch (error) { + assert.fail("Validation failed"); + } + + const results = [1, 2, 3].map(item => { + assert.ok(item > 0, "Item must be positive"); + return item * 2; + }); + + return results; + } +} diff --git a/recipes/process-assert-to-assert/tests/expected/inside-a-function.js b/recipes/process-assert-to-assert/tests/expected/inside-a-function.js deleted file mode 100644 index af136bd6..00000000 --- a/recipes/process-assert-to-assert/tests/expected/inside-a-function.js +++ /dev/null @@ -1,5 +0,0 @@ -import assert from "node:assert"; -function validateInput(input) { - assert(typeof input === "string", "Input must be string"); - return input.trim(); -} \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js b/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js deleted file mode 100644 index e8899150..00000000 --- a/recipes/process-assert-to-assert/tests/expected/mixed-assert-usages.js +++ /dev/null @@ -1,3 +0,0 @@ -import assert from "node:assert"; -assert(config.port, "Port must be configured"); -assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/simple-usage.js b/recipes/process-assert-to-assert/tests/expected/simple-usage.js deleted file mode 100644 index 85415fe8..00000000 --- a/recipes/process-assert-to-assert/tests/expected/simple-usage.js +++ /dev/null @@ -1,2 +0,0 @@ -import assert from "node:assert"; -assert(condition, "Assertion failed"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs b/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs deleted file mode 100644 index 8c0aabc8..00000000 --- a/recipes/process-assert-to-assert/tests/expected/using-common-js.cjs +++ /dev/null @@ -1,2 +0,0 @@ -const assert = require("node:assert"); -assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-process-import.js b/recipes/process-assert-to-assert/tests/expected/using-process-import.js deleted file mode 100644 index c3fcd651..00000000 --- a/recipes/process-assert-to-assert/tests/expected/using-process-import.js +++ /dev/null @@ -1,3 +0,0 @@ -import assert from "node:assert"; -import { env } from "process"; -assert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-process-require.js b/recipes/process-assert-to-assert/tests/expected/using-process-require.js deleted file mode 100644 index 1d6170b8..00000000 --- a/recipes/process-assert-to-assert/tests/expected/using-process-require.js +++ /dev/null @@ -1,3 +0,0 @@ -const assert = require("node:assert"); -const { env } = require("process"); -assert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/expected/using-require.js b/recipes/process-assert-to-assert/tests/expected/using-require.js deleted file mode 100644 index 2fe012fc..00000000 --- a/recipes/process-assert-to-assert/tests/expected/using-require.js +++ /dev/null @@ -1,3 +0,0 @@ -const assert = require("node:assert"); -const util = require("node:util"); -assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js b/recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js new file mode 100644 index 00000000..f96e309c --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js @@ -0,0 +1,2 @@ +process.assert(condition, "Basic assertion"); +process.assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs b/recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs new file mode 100644 index 00000000..f96e309c --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs @@ -0,0 +1,2 @@ +process.assert(condition, "Basic assertion"); +process.assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs b/recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs new file mode 100644 index 00000000..8137a947 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs @@ -0,0 +1,3 @@ +import process from "node:process"; +process.assert(value, "Process assertion"); +process.assert.strictEqual(obj1, obj2); diff --git a/recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js b/recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js new file mode 100644 index 00000000..4c0286f3 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js @@ -0,0 +1,4 @@ +import process from "node:process"; +process.assert(value, "Process assertion"); +process.env.NODE_ENV = "test"; +console.log(process.pid); diff --git a/recipes/process-assert-to-assert/tests/input/05-require-process.js b/recipes/process-assert-to-assert/tests/input/05-require-process.js new file mode 100644 index 00000000..8467b5b4 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/05-require-process.js @@ -0,0 +1,3 @@ +const process = require("node:process"); +process.assert(value, "Process assertion"); +process.assert.throws(() => { throw new Error(); }); diff --git a/recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js b/recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js new file mode 100644 index 00000000..bfd159da --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js @@ -0,0 +1,3 @@ +import { assert } from "node:process"; +assert(condition, "Assertion from destructured import"); +assert.throws(() => { throw new Error("test"); }); diff --git a/recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js b/recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js new file mode 100644 index 00000000..dcb14937 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js @@ -0,0 +1,3 @@ +import { assert, env } from "node:process"; +assert(value, "Using destructured assert"); +console.log(env.NODE_ENV); diff --git a/recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js b/recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js new file mode 100644 index 00000000..3fe72101 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js @@ -0,0 +1,3 @@ +import { assert as nodeAssert } from "node:process"; +nodeAssert(value, "Using aliased assert"); +nodeAssert.notStrictEqual(a, b); diff --git a/recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js b/recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js new file mode 100644 index 00000000..ee1ad631 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js @@ -0,0 +1,4 @@ +import { assert as nodeAssert, env } from "node:process"; +nodeAssert(value, "Using aliased assert"); +nodeAssert.strictEqual(a, b); +console.log(env.NODE_ENV); diff --git a/recipes/process-assert-to-assert/tests/input/10-require-destructured.js b/recipes/process-assert-to-assert/tests/input/10-require-destructured.js new file mode 100644 index 00000000..aeda6e77 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/10-require-destructured.js @@ -0,0 +1,3 @@ +const { assert } = require("node:process"); +assert(value, "Destructured assert from require"); +assert.strictEqual(a, b, "Should be equal"); diff --git a/recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js b/recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js new file mode 100644 index 00000000..f1c2bd59 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js @@ -0,0 +1,3 @@ +import assert from "node:assert"; +process.assert(value, "This should be transformed"); +assert.strictEqual(a, b, "This should remain unchanged"); diff --git a/recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js b/recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js new file mode 100644 index 00000000..3d98a928 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js @@ -0,0 +1,3 @@ +const assert = require("node:assert"); +process.assert(value, "This should be transformed"); +assert.strictEqual(a, b, "This should remain unchanged"); diff --git a/recipes/process-assert-to-assert/tests/input/13-no-process-assert.js b/recipes/process-assert-to-assert/tests/input/13-no-process-assert.js new file mode 100644 index 00000000..d7717c73 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/13-no-process-assert.js @@ -0,0 +1,6 @@ +const config = { + port: 3000, + host: "localhost" +}; + +console.log("Server config:", config); diff --git a/recipes/process-assert-to-assert/tests/input/14-nested-in-function.js b/recipes/process-assert-to-assert/tests/input/14-nested-in-function.js new file mode 100644 index 00000000..336d1695 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/14-nested-in-function.js @@ -0,0 +1,9 @@ +function testFunction() { + process.assert(condition, "Assertion inside function"); + + if (someCondition) { + process.assert.deepStrictEqual(obj1, obj2, "Deep comparison"); + } + + return process.assert.ok(value) && true; +} diff --git a/recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js b/recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js new file mode 100644 index 00000000..086caef7 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js @@ -0,0 +1,5 @@ +process.assert(condition); +process.assert.ok(value); +process.assert.strictEqual(a, b); +process.assert.notStrictEqual(a, c); +process.assert.throws(() => { throw new Error(); }); diff --git a/recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js b/recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js new file mode 100644 index 00000000..34229dbf --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js @@ -0,0 +1,8 @@ +const fs = require("fs"); + +function readConfig(path) { + process.assert(fs.existsSync(path), "Config file must exist"); + const data = fs.readFileSync(path, "utf8"); + process.assert.ok(data.length > 0, "Config file cannot be empty"); + return JSON.parse(data); +} diff --git a/recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js b/recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js new file mode 100644 index 00000000..7306d2e7 --- /dev/null +++ b/recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js @@ -0,0 +1,18 @@ +class Validator { + static validate(data) { + process.assert(data, "Data is required"); + + try { + process.assert.strictEqual(typeof data, "object", "Data must be object"); + } catch (error) { + process.assert.fail("Validation failed"); + } + + const results = [1, 2, 3].map(item => { + process.assert.ok(item > 0, "Item must be positive"); + return item * 2; + }); + + return results; + } +} diff --git a/recipes/process-assert-to-assert/tests/input/inside-a-function.js b/recipes/process-assert-to-assert/tests/input/inside-a-function.js deleted file mode 100644 index e043af1a..00000000 --- a/recipes/process-assert-to-assert/tests/input/inside-a-function.js +++ /dev/null @@ -1,4 +0,0 @@ -function validateInput(input) { - process.assert(typeof input === "string", "Input must be string"); - return input.trim(); -} diff --git a/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js b/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js deleted file mode 100644 index eda05135..00000000 --- a/recipes/process-assert-to-assert/tests/input/mixed-assert-usages.js +++ /dev/null @@ -1,4 +0,0 @@ -import assert from "node:assert"; - -process.assert(config.port, "Port must be configured"); -assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/simple-usage.js b/recipes/process-assert-to-assert/tests/input/simple-usage.js deleted file mode 100644 index 407b2efd..00000000 --- a/recipes/process-assert-to-assert/tests/input/simple-usage.js +++ /dev/null @@ -1 +0,0 @@ -process.assert(condition, "Assertion failed"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-common-js.cjs b/recipes/process-assert-to-assert/tests/input/using-common-js.cjs deleted file mode 100644 index b9bc9299..00000000 --- a/recipes/process-assert-to-assert/tests/input/using-common-js.cjs +++ /dev/null @@ -1 +0,0 @@ -process.assert(config.port, "Port must be configured"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-process-import.js b/recipes/process-assert-to-assert/tests/input/using-process-import.js deleted file mode 100644 index beed0a04..00000000 --- a/recipes/process-assert-to-assert/tests/input/using-process-import.js +++ /dev/null @@ -1,2 +0,0 @@ -import { assert as nodeAssert, env } from "process"; -nodeAssert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-process-require.js b/recipes/process-assert-to-assert/tests/input/using-process-require.js deleted file mode 100644 index 70118a70..00000000 --- a/recipes/process-assert-to-assert/tests/input/using-process-require.js +++ /dev/null @@ -1,2 +0,0 @@ -const { assert: nodeAssert, env } = require("process"); -nodeAssert(condition, "Assertion valid"); \ No newline at end of file diff --git a/recipes/process-assert-to-assert/tests/input/using-require.js b/recipes/process-assert-to-assert/tests/input/using-require.js deleted file mode 100644 index 22df180b..00000000 --- a/recipes/process-assert-to-assert/tests/input/using-require.js +++ /dev/null @@ -1,2 +0,0 @@ -const util = require("node:util"); -process.assert(config.port, "Port must be configured"); \ No newline at end of file From a9fb7f197f3b67f154bd8cf6ca4f45863930a320 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 1 Nov 2025 12:25:16 +0100 Subject: [PATCH 05/12] doc: update --- recipes/process-assert-to-assert/README.md | 6 +++--- recipes/process-assert-to-assert/package.json | 4 ++-- recipes/process-assert-to-assert/workflow.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/process-assert-to-assert/README.md b/recipes/process-assert-to-assert/README.md index 7fb6e9b8..1540eddd 100644 --- a/recipes/process-assert-to-assert/README.md +++ b/recipes/process-assert-to-assert/README.md @@ -1,8 +1,8 @@ -# `process.assert` DEP0100 +# `process.assert` to `node:assert` DEP0100 -This recipe transforms the usage of `process.assert` to use `assert` module. +This recipe transforms the usage of `process.assert` to use `node:assert` module. -See [DEP0100](https://github.com/nodejs/userland-migrations/issues/197). +See [DEP0100](https://nodejs.org/api/deprecations.html#DEP0100). ## Example diff --git a/recipes/process-assert-to-assert/package.json b/recipes/process-assert-to-assert/package.json index 6c773436..4cd457c0 100644 --- a/recipes/process-assert-to-assert/package.json +++ b/recipes/process-assert-to-assert/package.json @@ -1,7 +1,7 @@ { "name": "@nodejs/process-assert-to-assert", "version": "1.0.0", - "description": "Handle DEP0100 via transforming `process.assert` to `assert`.", + "description": "Handle DEP0100 via transforming `process.assert` to `node:assert`.", "type": "module", "scripts": { "test": "npx codemod jssg test -l typescript --ignore-whitespace ./src/workflow.ts ./" @@ -21,4 +21,4 @@ "dependencies": { "@nodejs/codemod-utils": "*" } -} \ No newline at end of file +} diff --git a/recipes/process-assert-to-assert/workflow.yaml b/recipes/process-assert-to-assert/workflow.yaml index b2db413f..7aa67a1d 100644 --- a/recipes/process-assert-to-assert/workflow.yaml +++ b/recipes/process-assert-to-assert/workflow.yaml @@ -7,7 +7,7 @@ nodes: name: Apply AST Transformations type: automatic steps: - - name: Handle DEP0100 via transforming `process.assert` to `assert`. + - name: Handle DEP0100 via transforming `process.assert` to `node:assert`. js-ast-grep: js_file: src/workflow.ts base_path: . From 679f07764e67264f6b1e6444ee73467d7ea4e278 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 1 Nov 2025 12:49:52 +0100 Subject: [PATCH 06/12] update --- .../process-assert-to-assert/src/workflow.ts | 259 ++++++++++-------- .../01-basic-global-process-assert.js | 2 +- .../tests/expected/14-nested-in-function.js | 2 +- .../expected/15-multiple-assert-methods.js | 2 +- .../tests/expected/17-complex-nested-class.js | 2 +- 5 files changed, 143 insertions(+), 124 deletions(-) diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index 16d39a1b..bd94b258 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -1,130 +1,132 @@ -import type { Edit, Range, Rule, SgNode, SgRoot } from "@codemod.com/jssg-types/main"; -import { getNodeRequireCalls } from "@nodejs/codemod-utils/ast-grep/require-call"; -import { getNodeImportStatements } from "@nodejs/codemod-utils/ast-grep/import-statement"; -import { resolveBindingPath } from "@nodejs/codemod-utils/ast-grep/resolve-binding-path"; -import { removeBinding } from "@nodejs/codemod-utils/ast-grep/remove-binding"; -import { removeLines } from "@nodejs/codemod-utils/ast-grep/remove-lines"; -import { EOL } from "node:os"; +import { EOL } from 'node:os'; +import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import { removeBinding } from '@nodejs/codemod-utils/ast-grep/remove-binding'; +import { removeLines } from '@nodejs/codemod-utils/ast-grep/remove-lines'; +import type { + Edit, + Range, + Rule, + SgNode, + SgRoot, +} from '@codemod.com/jssg-types/main'; +import type JS from '@codemod.com/jssg-types/langs/javascript'; + +type ReplaceRule = { + importNode?: SgNode; + binding?: string; + rule: Rule; + replaceWith?: string; +}; /** - * Transforms deprecated `process.assert` usage to the standard `assert` module. - * - * Transformations: - * 1. Replaces all `process.assert` references with `assert` - * 2. Adds the necessary import/require statement if not already present: - * - For ESM or files without require calls: adds `import assert from "node:assert"` - * - For CommonJS (.cjs files or files using require): adds `const assert = require("node:assert")` - * 3. Removes process import/require if it was only used for assert - * - * Examples: - * - * **Before**: - * ```js - * import process from "node:process"; - * process.assert(value); - * process.assert.strictEqual(a, b); - * ``` - * - * **After**: - * ```js - * import assert from "node:assert"; - * assert(value); - * assert.strictEqual(a, b); - * ``` + * Transform function that converts deprecated `process.assert` usage to the `node:assert` module. + * + * Handles: + * 1. Replaces `process.assert(...)` member expressions/calls with `assert(...)` or `assert.xxx` as appropriate. + * 2. Handles cases where `process` is imported/required under a different binding (resolves binding paths). + * 3. Removes the original `process` import/require when it's only used for `assert` and removes the import line when empty. + * 4. Adds `import assert from "node:assert";` or `const assert = require("node:assert");` at the top + * when the file does not already import/require `assert`. + * + * Steps: + * - Find all `process` import/require statements and resolve any binding for `assert`. + * - Replace call and member-expression usages that reference `process.assert` (or the resolved binding) with `assert`. + * - Remove or update the original import/require for `process` when it's no longer needed. + * - If `assert` is not already present, insert the appropriate `import` or `require` line depending on the module style. + * + * @param root - The AST root node provided by jssg for the file being transformed. + * @returns The transformed source code as a string, or `null` when no edits are required. */ -export default function transform(root: SgRoot): string | null { +export default function transform(root: SgRoot): string | null { const rootNode = root.root(); const edits: Edit[] = []; const linesToRemove: Range[] = []; - const replaceRules: Array<{ - importNode?: SgNode; - binding?: string; - rule: Rule; - replaceWith?: string; - }> = [{ + const replaceRules: ReplaceRule[] = [ + { + rule: { + kind: 'member_expression', + pattern: 'process.assert', + }, + replaceWith: 'assert', + }, + ]; + + const processImportsToRemove = new Set>(); + + const requireCalls = getNodeRequireCalls(root, 'process'); + const importStatements = getNodeImportStatements(root, 'process'); + const allImports = [...requireCalls, ...importStatements]; + const processUsages = rootNode.findAll({ rule: { kind: 'member_expression', - pattern: "process.assert", + has: { + kind: 'identifier', + regex: '^process$', + }, }, - replaceWith: "assert" - }]; + }); - const processImportsToRemove = new Set(); + for (const processImport of allImports) { + const binding = resolveBindingPath(processImport, '$.assert'); - function processImports(moduleName: "process" | "node:process") { - const requireCalls = getNodeRequireCalls(root, moduleName); - const importStatements = getNodeImportStatements(root, moduleName); - const allImports = [...requireCalls, ...importStatements]; + replaceRules.push({ + importNode: processImport, + binding, + rule: { + kind: 'identifier', + regex: binding, + inside: { + kind: 'call_expression', + }, + }, + replaceWith: 'assert', + }); - for (const processImport of allImports) { - const binding = resolveBindingPath(processImport, "$.assert"); + if (binding) { replaceRules.push({ importNode: processImport, binding, - rule: { - kind: "identifier", - regex: binding, - inside: { - kind: 'call_expression', - } - }, - replaceWith: "assert" - }); - - if (binding) { - replaceRules.push({ - importNode: processImport, - binding, - rule: { - kind: "member_expression", - has: { - kind: "identifier", - regex: `^${binding}$`, - field: "object" - } - }, - replaceWith: "assert" - }); - } - - const processUsages = rootNode.findAll({ rule: { kind: 'member_expression', has: { kind: 'identifier', - regex: '^process$' - } - } + regex: `^${binding}$`, + field: 'object', + }, + }, + replaceWith: 'assert', }); + } - let hasNonAssertUsage = false; - for (const usage of processUsages) { - const propertyNode = usage.field("property"); - if (propertyNode && propertyNode.text() !== "assert") { - hasNonAssertUsage = true; - break; - } + let hasNonAssertUsage = false; + for (const usage of processUsages) { + const propertyNode = usage.field('property'); + if (propertyNode && propertyNode.text() !== 'assert') { + hasNonAssertUsage = true; + break; } + } - if (!hasNonAssertUsage && processUsages.length > 0) { - processImportsToRemove.add(processImport); - linesToRemove.push(processImport.range()); - } + if (!hasNonAssertUsage && processUsages.length > 0) { + processImportsToRemove.add(processImport); + linesToRemove.push(processImport.range()); } } - processImports("process"); - processImports("node:process"); - for (const replaceRule of replaceRules) { const nodes = rootNode.findAll({ - rule: replaceRule.rule + rule: replaceRule.rule, }); for (const node of nodes) { if (replaceRule.importNode) { if (!processImportsToRemove.has(replaceRule.importNode)) { - const removeBind = removeBinding(replaceRule.importNode, replaceRule.binding); + const removeBind = removeBinding( + replaceRule.importNode, + replaceRule.binding, + ); if (removeBind.edit) { edits.push(removeBind.edit); @@ -136,48 +138,65 @@ export default function transform(root: SgRoot): string | null { } } - if (replaceRule.rule.kind === "member_expression" && replaceRule.binding) { - const objectNode = node.field("object"); + if ( + replaceRule.rule.kind === 'member_expression' && + replaceRule.binding + ) { + const objectNode = node.field('object'); if (objectNode) { - edits.push(objectNode.replace("assert")); + edits.push(objectNode.replace('assert')); } } else { - const replaceText = replaceRule.replaceWith || "assert"; + const replaceText = replaceRule.replaceWith || 'assert'; edits.push(node.replace(replaceText)); } } } let sourceCode = rootNode.commitEdits(edits); + sourceCode = removeLines(sourceCode, linesToRemove); - if (edits.length === 0 && linesToRemove) { - return sourceCode; - } + if (edits.length === 0 && linesToRemove) return sourceCode; - const alreadyRequiringAssert = getNodeRequireCalls(root, "assert"); - const alreadyImportingAssert = getNodeImportStatements(root, "assert"); + const alreadyRequiringAssert = getNodeRequireCalls(root, 'assert'); + const alreadyImportingAssert = getNodeImportStatements(root, 'assert'); - if (!alreadyRequiringAssert.length && !alreadyImportingAssert.length) { - const usingRequire = rootNode.find({ - rule: { - kind: 'call_expression', - has: { - kind: 'identifier', - field: 'function', - regex: 'require' - } - } - }); + if (alreadyRequiringAssert.length && alreadyImportingAssert.length) + return sourceCode; + + const usingRequire = rootNode.find({ + rule: { + kind: 'call_expression', + has: { + kind: 'identifier', + field: 'function', + regex: 'require', + }, + }, + }); + const usingImport = rootNode.find({ + rule: { + kind: 'import_statement', + }, + }); - const isCommonJs = root.filename().includes('.cjs'); + const isCjsFile = root.filename().endsWith('.cjs'); + const isMjsFile = root.filename().endsWith('.mjs'); - if (Boolean(usingRequire) || isCommonJs) { - return `const assert = require("node:assert");${EOL}${sourceCode}`; - } + if (usingRequire || isCjsFile) { + return `const assert = require("node:assert");${EOL}${sourceCode}`; + } + if (usingImport || isMjsFile) { return `import assert from "node:assert";${EOL}${sourceCode}`; } - return sourceCode; -} \ No newline at end of file + // @todo(AugustinMauroy): after codemod response of capabilities on workflow step + // enable fs to read package.json to determine module type + console.warn( + `[process-assert-to-assert] Unable to determine module type for file: ${root.filename()}. No import added.`, + ); + + return `// Unable to determine module type; please add the appropriate import for 'assert'${EOL}${sourceCode}`; +} diff --git a/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js b/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js index 08f8977f..83513e93 100644 --- a/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js +++ b/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js @@ -1,3 +1,3 @@ -import assert from "node:assert"; +// Unable to determine module type; please add the appropriate import for 'assert' assert(condition, "Basic assertion"); assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js b/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js index 92d74048..f6e3df4f 100644 --- a/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js +++ b/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js @@ -1,4 +1,4 @@ -import assert from "node:assert"; +// Unable to determine module type; please add the appropriate import for 'assert' function testFunction() { assert(condition, "Assertion inside function"); diff --git a/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js b/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js index 5db73614..32f5a659 100644 --- a/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js +++ b/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js @@ -1,4 +1,4 @@ -import assert from "node:assert"; +// Unable to determine module type; please add the appropriate import for 'assert' assert(condition); assert.ok(value); assert.strictEqual(a, b); diff --git a/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js b/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js index 1cd40c48..0a996d2a 100644 --- a/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js +++ b/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js @@ -1,4 +1,4 @@ -import assert from "node:assert"; +// Unable to determine module type; please add the appropriate import for 'assert' class Validator { static validate(data) { assert(data, "Data is required"); From 85589a2e5a88f67875c5f5dd789008aa22648d6a Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 1 Nov 2025 13:04:52 +0100 Subject: [PATCH 07/12] update logic for import type --- .../process-assert-to-assert/src/workflow.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index bd94b258..d0a6ed5c 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -143,6 +143,7 @@ export default function transform(root: SgRoot): string | null { replaceRule.binding ) { const objectNode = node.field('object'); + if (objectNode) { edits.push(objectNode.replace('assert')); } @@ -162,7 +163,7 @@ export default function transform(root: SgRoot): string | null { const alreadyRequiringAssert = getNodeRequireCalls(root, 'assert'); const alreadyImportingAssert = getNodeImportStatements(root, 'assert'); - if (alreadyRequiringAssert.length && alreadyImportingAssert.length) + if (alreadyRequiringAssert.length || alreadyImportingAssert.length) return sourceCode; const usingRequire = rootNode.find({ @@ -180,18 +181,22 @@ export default function transform(root: SgRoot): string | null { kind: 'import_statement', }, }); - - const isCjsFile = root.filename().endsWith('.cjs'); - const isMjsFile = root.filename().endsWith('.mjs'); + const filename = root.filename(); + const isCjsFile = filename.endsWith('.cjs'); + const isMjsFile = filename.endsWith('.mjs'); + + // Prefer adding an ES module import when the file already uses ESM syntax + // (contains `import` statements) or is an `.mjs` file. This avoids injecting a + // CommonJS `require` into an ES module source (even if the file references + // `createRequire`). + if (usingImport || isMjsFile) { + return `import assert from "node:assert";${EOL}${sourceCode}`; + } if (usingRequire || isCjsFile) { return `const assert = require("node:assert");${EOL}${sourceCode}`; } - if (usingImport || isMjsFile) { - return `import assert from "node:assert";${EOL}${sourceCode}`; - } - // @todo(AugustinMauroy): after codemod response of capabilities on workflow step // enable fs to read package.json to determine module type console.warn( From 6b636dea28194a1e24f3e531e6962052108d6356 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Fri, 7 Nov 2025 09:15:04 +0100 Subject: [PATCH 08/12] Apply suggestions from code review Co-authored-by: Bruno Rodrigues --- .../process-assert-to-assert/src/workflow.ts | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index d0a6ed5c..bf266fd8 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -63,7 +63,7 @@ export default function transform(root: SgRoot): string | null { kind: 'member_expression', has: { kind: 'identifier', - regex: '^process$', + pattern: 'process', }, }, }); @@ -71,19 +71,6 @@ export default function transform(root: SgRoot): string | null { for (const processImport of allImports) { const binding = resolveBindingPath(processImport, '$.assert'); - replaceRules.push({ - importNode: processImport, - binding, - rule: { - kind: 'identifier', - regex: binding, - inside: { - kind: 'call_expression', - }, - }, - replaceWith: 'assert', - }); - if (binding) { replaceRules.push({ importNode: processImport, @@ -91,9 +78,8 @@ export default function transform(root: SgRoot): string | null { rule: { kind: 'member_expression', has: { - kind: 'identifier', - regex: `^${binding}$`, - field: 'object', + kind: binding.includes('.') ? 'member_expression' : 'identifier', + pattern: binding, }, }, replaceWith: 'assert', From c6996a106a191503965ffadef758dfec19a22651 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Fri, 7 Nov 2025 16:46:03 +0100 Subject: [PATCH 09/12] Update package-lock.json --- package-lock.json | 1178 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1061 insertions(+), 117 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2996735..b998b8b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,19 +18,10 @@ "@typescript/native-preview": "^7.0.0-dev.20251104.1" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "license": "Apache-2.0", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@ast-grep/cli": { "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli/-/cli-0.25.7.tgz", + "integrity": "sha512-vklcPRFHPHkwHq05nb2Fuaj4BYNWxhr8GIdB6la090jWob9FdbM/Jz86vlQp2tRELb2rKzuHeksG8qDrbX4REg==", "hasInstallScript": true, "dependencies": { "detect-libc": "2.0.3" @@ -54,6 +45,8 @@ }, "node_modules/@ast-grep/cli-darwin-arm64": { "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-darwin-arm64/-/cli-darwin-arm64-0.25.7.tgz", + "integrity": "sha512-dkj8hy32mWuQwCJUEpnKwTS8tLE+e7dhvu6is+v5Q6AumOVlcL6PJWQsyaA4vedDm6XOGK9+WnyFpCnV3b5ouA==", "cpu": [ "arm64" ], @@ -66,8 +59,106 @@ "node": ">= 10" } }, + "node_modules/@ast-grep/cli-darwin-x64": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-darwin-x64/-/cli-darwin-x64-0.25.7.tgz", + "integrity": "sha512-FBdv7GH3llH5LI0S2yeqgQM5QEUHeoYMhw1pv+C439UeL5BBFFjI+LYVALciwsYzuq/DQDTnT2cM0JhYGajDLQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/cli-linux-arm64-gnu": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-0.25.7.tgz", + "integrity": "sha512-lsE+cSe4rFO8rvLhMM7PM3T83LlmV60H9dOH+1hq8thkWhLCL6vAJijEVWgAQDDvvZf3xnNVgG2GG4jOMfTuTQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/cli-linux-x64-gnu": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-linux-x64-gnu/-/cli-linux-x64-gnu-0.25.7.tgz", + "integrity": "sha512-uuF5GXgeUZtBrftJJYuQU7PvDT7Q9fJkKKwpIscEfQqLndri1tdYzzT9jKj2taWFlhiCVqLaDEHsdfTeWaVjZQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/cli-win32-arm64-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-0.25.7.tgz", + "integrity": "sha512-GSWRjOnWybzNP5rnvPb6lQ7lSPoEIl64gk4uHE1h+a2nnFhT9REWTKFcmNB2aG8VmKEz1gu0pxpg9HmBe2OUBA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/cli-win32-ia32-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-0.25.7.tgz", + "integrity": "sha512-5p9PWbTeXaivQYixB+JkkpFKgY7G1Tm6R46Dhq6cHvKksiQ6lWlTOOmhl0QARtY7y3XP0MWuvjDEWCYrvYtO4A==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/cli-win32-x64-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/cli-win32-x64-msvc/-/cli-win32-x64-msvc-0.25.7.tgz", + "integrity": "sha512-WjsRuyKTCeGWpMhvobzU/6HaWbseENPl5mNMZIKs8gsCpkUyTUfvV8/A2W29oHCgbDWRtixYppWtd87Qjpm6cg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@ast-grep/lang-bash": { "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-bash/-/lang-bash-0.0.4.tgz", + "integrity": "sha512-i9Zpv+phyy94dE5hv5xZT3qqJ6YINi/YhGGhmJvagl+uWBwEkD+Ve5cDqwH+AkGad2xy8+decNE4TkllJEGPww==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -85,6 +176,8 @@ }, "node_modules/@ast-grep/lang-json": { "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-json/-/lang-json-0.0.4.tgz", + "integrity": "sha512-ig+N5Ub+gV3qEBOZeKOS3e2ms/pYPHfbtC2VyEcW9EnWfRwYChVDEaMtmv8UxnWbAIRIrxHoGUnCh0L4slIbRQ==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -101,26 +194,30 @@ } }, "node_modules/@ast-grep/napi": { - "version": "0.39.7", + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi/-/napi-0.39.9.tgz", + "integrity": "sha512-qtLLQq1a3isK0iaq0Drl7Qt4PqeyjTrpFxNdA/20O/jYkGiA/oJA8DLMn1bzczsfjlUohe4dg39bpeAqG02uvA==", "dev": true, "license": "MIT", "engines": { "node": ">= 10" }, "optionalDependencies": { - "@ast-grep/napi-darwin-arm64": "0.39.7", - "@ast-grep/napi-darwin-x64": "0.39.7", - "@ast-grep/napi-linux-arm64-gnu": "0.39.7", - "@ast-grep/napi-linux-arm64-musl": "0.39.7", - "@ast-grep/napi-linux-x64-gnu": "0.39.7", - "@ast-grep/napi-linux-x64-musl": "0.39.7", - "@ast-grep/napi-win32-arm64-msvc": "0.39.7", - "@ast-grep/napi-win32-ia32-msvc": "0.39.7", - "@ast-grep/napi-win32-x64-msvc": "0.39.7" + "@ast-grep/napi-darwin-arm64": "0.39.9", + "@ast-grep/napi-darwin-x64": "0.39.9", + "@ast-grep/napi-linux-arm64-gnu": "0.39.9", + "@ast-grep/napi-linux-arm64-musl": "0.39.9", + "@ast-grep/napi-linux-x64-gnu": "0.39.9", + "@ast-grep/napi-linux-x64-musl": "0.39.9", + "@ast-grep/napi-win32-arm64-msvc": "0.39.9", + "@ast-grep/napi-win32-ia32-msvc": "0.39.9", + "@ast-grep/napi-win32-x64-msvc": "0.39.9" } }, "node_modules/@ast-grep/napi-darwin-arm64": { - "version": "0.39.7", + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-arm64/-/napi-darwin-arm64-0.39.9.tgz", + "integrity": "sha512-0gdBC2oPBkIBsh89yUXxJeK37QYRbp1qNZVuRGizT666ljgCw+2NIxHeQGNjwWuI0+g3exrd8FyqD3gMixRx3w==", "cpu": [ "arm64" ], @@ -134,13 +231,153 @@ "node": ">= 10" } }, + "node_modules/@ast-grep/napi-darwin-x64": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-x64/-/napi-darwin-x64-0.39.9.tgz", + "integrity": "sha512-7QuQNFwcVj71hDAMBErF+mVq2h92vUdHLKa/vq58HdRpix5G3DZqcTKoFjwhCNzc2wsNRAjV+BiIR01znQSxLA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-gnu": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-gnu/-/napi-linux-arm64-gnu-0.39.9.tgz", + "integrity": "sha512-qXTjhagRYkPyHNACEzGi5q26OMRdSvLRRqi799oZaSDf96Xj+8tcB5+tFlH0NpqaP84GsZoQ15SfDXeoP4qdmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-musl": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-musl/-/napi-linux-arm64-musl-0.39.9.tgz", + "integrity": "sha512-U9KVohyburVGEWiiREFq+iTxdMdSbRyXL+yzCVvGPmLPW4Ca4zpX9Cret4jCJBp8dljSIK0C7txXAc7fM+6rag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-gnu": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-gnu/-/napi-linux-x64-gnu-0.39.9.tgz", + "integrity": "sha512-C5WwiNr/eE7lS0vl9bNdSXrsGIUAga2SaqV3G+ogVl9HeRU2jtGhv+3AgzGvYWj+PtnbtuZ2Nxkm10gEVPhv1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-musl": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-musl/-/napi-linux-x64-musl-0.39.9.tgz", + "integrity": "sha512-KutzZSMhHP3P43nQ+kNSbuiDaqkCcdqOcXLnq28MRvS+qwvW+01dJ8eWRlpMJC9vCJmaJAZfI7xkNSp74WkdxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-arm64-msvc": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-arm64-msvc/-/napi-win32-arm64-msvc-0.39.9.tgz", + "integrity": "sha512-S2kC6K9I7e70oMVn2FDICzVlz7SPZVWNCRKCBD+Dgy1OTn0byzmMLaGpjth3pqN93UCssEC03ooP3tuclS0JSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-ia32-msvc": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-ia32-msvc/-/napi-win32-ia32-msvc-0.39.9.tgz", + "integrity": "sha512-n18Dqtc7O5q8ZM9gBNkvLd+ajdjLNraw4ZoIcHelI7TnTvh1m6zR3tUuHNxPhL+IJfdKx3ne7ATKlEeiSlMn4g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-x64-msvc": { + "version": "0.39.9", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-x64-msvc/-/napi-win32-x64-msvc-0.39.9.tgz", + "integrity": "sha512-YOF7mO+6nvyRtMC179u82Vr1qIGOmoE1yjwr4cmAf7DVNd+vs42y9tbQGYwLmVY8M3Hg1PviB8XX7FQKewuOGQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@ast-grep/setup-lang": { "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@ast-grep/setup-lang/-/setup-lang-0.0.4.tgz", + "integrity": "sha512-us5L9CU4pc/yLQbO82v7gkpwa66qRoQRJ3P+s36EC6ZXiYpQVbd13PLgh9bQ/LhGljEb/pcli0uclN/+S3IMSw==", "dev": true, "license": "ISC" }, "node_modules/@babel/code-frame": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", @@ -152,27 +389,31 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", "license": "MIT", "peer": true, "dependencies": { - "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.0", + "@babel/generator": "^7.28.5", "@babel/helper-compilation-targets": "^7.27.2", - "@babel/helper-module-transforms": "^7.27.3", - "@babel/helpers": "^7.27.6", - "@babel/parser": "^7.28.0", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", "@babel/template": "^7.27.2", - "@babel/traverse": "^7.28.0", - "@babel/types": "^7.28.0", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -188,11 +429,13 @@ } }, "node_modules/@babel/generator": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", "license": "MIT", "dependencies": { - "@babel/parser": "^7.28.0", - "@babel/types": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -203,6 +446,8 @@ }, "node_modules/@babel/helper-annotate-as-pure": { "version": "7.27.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz", + "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==", "license": "MIT", "dependencies": { "@babel/types": "^7.27.3" @@ -213,6 +458,8 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", "license": "MIT", "dependencies": { "@babel/compat-data": "^7.27.2", @@ -226,15 +473,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.27.1", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.5.tgz", + "integrity": "sha512-q3WC4JfdODypvxArsJQROfupPBq9+lMwjKq7C33GhbFYJsufD0yd/ziwD+hJucLeWsnFPWZjsU2DNFqBPE7jwQ==", "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.27.1", - "@babel/helper-member-expression-to-functions": "^7.27.1", + "@babel/helper-annotate-as-pure": "^7.27.3", + "@babel/helper-member-expression-to-functions": "^7.28.5", "@babel/helper-optimise-call-expression": "^7.27.1", "@babel/helper-replace-supers": "^7.27.1", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", - "@babel/traverse": "^7.27.1", + "@babel/traverse": "^7.28.5", "semver": "^6.3.1" }, "engines": { @@ -246,17 +495,21 @@ }, "node_modules/@babel/helper-globals": { "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.27.1", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.28.5.tgz", + "integrity": "sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==", "license": "MIT", "dependencies": { - "@babel/traverse": "^7.27.1", - "@babel/types": "^7.27.1" + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -264,6 +517,8 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", "license": "MIT", "dependencies": { "@babel/traverse": "^7.27.1", @@ -274,12 +529,14 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.27.3", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.3" + "@babel/traverse": "^7.28.3" }, "engines": { "node": ">=6.9.0" @@ -290,6 +547,8 @@ }, "node_modules/@babel/helper-optimise-call-expression": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz", + "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==", "license": "MIT", "dependencies": { "@babel/types": "^7.27.1" @@ -300,6 +559,8 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz", + "integrity": "sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -307,6 +568,8 @@ }, "node_modules/@babel/helper-replace-supers": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.27.1.tgz", + "integrity": "sha512-7EHz6qDZc8RYS5ElPoShMheWvEgERonFCs7IAonWLLUTXW59DP14bCZt89/GKyreYn8g3S83m21FelHKbeDCKA==", "license": "MIT", "dependencies": { "@babel/helper-member-expression-to-functions": "^7.27.1", @@ -322,6 +585,8 @@ }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz", + "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==", "license": "MIT", "dependencies": { "@babel/traverse": "^7.27.1", @@ -333,13 +598,17 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.27.1", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -347,27 +616,33 @@ }, "node_modules/@babel/helper-validator-option": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.28.2", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", "license": "MIT", "dependencies": { "@babel/template": "^7.27.2", - "@babel/types": "^7.28.2" + "@babel/types": "^7.28.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", "license": "MIT", "dependencies": { - "@babel/types": "^7.28.0" + "@babel/types": "^7.28.5" }, "bin": { "parser": "bin/babel-parser.js" @@ -378,6 +653,8 @@ }, "node_modules/@babel/plugin-syntax-flow": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.27.1.tgz", + "integrity": "sha512-p9OkPbZ5G7UT1MofwYFigGebnrzGJacoBSQM0/6bi/PUMVE+qlWDD/OalvQKbwgQzU6dl0xAv6r4X7Jme0RYxA==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" @@ -391,6 +668,8 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz", + "integrity": "sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" @@ -404,6 +683,8 @@ }, "node_modules/@babel/plugin-syntax-typescript": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.27.1.tgz", + "integrity": "sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" @@ -417,6 +698,8 @@ }, "node_modules/@babel/plugin-transform-class-properties": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.27.1.tgz", + "integrity": "sha512-D0VcalChDMtuRvJIu3U/fwWjf8ZMykz5iZsg77Nuj821vCKI3zCyRLwRdWbsuJ/uRwZhZ002QtCqIkwC/ZkvbA==", "license": "MIT", "dependencies": { "@babel/helper-create-class-features-plugin": "^7.27.1", @@ -431,6 +714,8 @@ }, "node_modules/@babel/plugin-transform-flow-strip-types": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.27.1.tgz", + "integrity": "sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", @@ -445,6 +730,8 @@ }, "node_modules/@babel/plugin-transform-modules-commonjs": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz", + "integrity": "sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw==", "license": "MIT", "dependencies": { "@babel/helper-module-transforms": "^7.27.1", @@ -459,6 +746,8 @@ }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.27.1.tgz", + "integrity": "sha512-aGZh6xMo6q9vq1JGcw58lZ1Z0+i0xB2x0XaauNIUXd6O1xXc3RwoWEBlsTQrY4KQ9Jf0s5rgD6SiNkaUdJegTA==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1" @@ -471,7 +760,9 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.27.1", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.28.5.tgz", + "integrity": "sha512-N6fut9IZlPnjPwgiQkXNhb+cT8wQKFlJNqcZkWlcTqkcqx6/kU4ynGmLFoa4LViBSirn05YAwk+sQBbPfxtYzQ==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", @@ -486,6 +777,8 @@ }, "node_modules/@babel/plugin-transform-private-methods": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.27.1.tgz", + "integrity": "sha512-10FVt+X55AjRAYI9BrdISN9/AQWHqldOeZDUoLyif1Kn05a56xVBXb8ZouL8pZ9jem8QpXaOt8TS7RHUIS+GPA==", "license": "MIT", "dependencies": { "@babel/helper-create-class-features-plugin": "^7.27.1", @@ -499,11 +792,13 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.5.tgz", + "integrity": "sha512-x2Qa+v/CuEoX7Dr31iAfr0IhInrVOWZU/2vJMJ00FOR/2nM0BcBEclpaf9sWCDc+v5e9dMrhSH8/atq/kX7+bA==", "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.27.3", - "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-create-class-features-plugin": "^7.28.5", "@babel/helper-plugin-utils": "^7.27.1", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1" @@ -517,6 +812,8 @@ }, "node_modules/@babel/preset-flow": { "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.27.1.tgz", + "integrity": "sha512-ez3a2it5Fn6P54W8QkbfIyyIbxlXvcxyWHHvno1Wg0Ej5eiJY5hBb8ExttoIOJJk7V2dZE6prP7iby5q2aQ0Lg==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", @@ -531,14 +828,16 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.27.1", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.28.5.tgz", + "integrity": "sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==", "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", "@babel/helper-validator-option": "^7.27.1", "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-typescript": "^7.27.1" + "@babel/plugin-transform-typescript": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -548,7 +847,9 @@ } }, "node_modules/@babel/register": { - "version": "7.27.1", + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.28.3.tgz", + "integrity": "sha512-CieDOtd8u208eI49bYl4z1J22ySFw87IGwE+IswFEExH7e3rLgKb0WNQeumnacQ1+VoDJLYI5QFA3AJZuyZQfA==", "license": "MIT", "dependencies": { "clone-deep": "^4.0.1", @@ -566,6 +867,8 @@ }, "node_modules/@babel/template": { "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", @@ -577,15 +880,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.28.0", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.0", + "@babel/generator": "^7.28.5", "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.0", + "@babel/parser": "^7.28.5", "@babel/template": "^7.27.2", - "@babel/types": "^7.28.0", + "@babel/types": "^7.28.5", "debug": "^4.3.1" }, "engines": { @@ -593,11 +898,13 @@ } }, "node_modules/@babel/types": { - "version": "7.28.2", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1" + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -768,11 +1075,15 @@ }, "node_modules/@codemod.com/jssg-types": { "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@codemod.com/jssg-types/-/jssg-types-1.0.9.tgz", + "integrity": "sha512-j+O2nvYnBcmBy0mG5bSmBD7Cn7q3fgp4tI6aqIuF7pVu7j8Dgs45Ohgkpzx9mwqcmAE7vC9CEc8zQZOfwfICyw==", "dev": true, "license": "Apache-2.0" }, "node_modules/@codemod.com/workflow": { "version": "0.0.31", + "resolved": "https://registry.npmjs.org/@codemod.com/workflow/-/workflow-0.0.31.tgz", + "integrity": "sha512-8xmbxwjxr6d0ZUm3RS/eQqud2mUGXwQgf2v+YEjwQQVwOse6yShgoFljrg7ujvJlhzymivYloL0T0VSS9YubNw==", "license": "Apache-2.0", "dependencies": { "@ast-grep/cli": "^0.25.4", @@ -801,6 +1112,8 @@ }, "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi": { "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi/-/napi-0.25.7.tgz", + "integrity": "sha512-kDw/JNyOLttVbm2hl+55C9lXuUcuIFt31LQIpSptUkyTgI+2Cdqdeah2bNPe4/GQM2ysDjBDS4y1+9iQxMdJiw==", "license": "MIT", "engines": { "node": ">= 10" @@ -819,6 +1132,8 @@ }, "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-darwin-arm64": { "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-arm64/-/napi-darwin-arm64-0.25.7.tgz", + "integrity": "sha512-qqI1JvB6ULgOUOVE3YviQNQ6KAYOnkiE8W5fNwVJGUgMkUuM8tUm1Nal3vfKCI7dnYgpcNlKxdTWGlbt7aHKNg==", "cpu": [ "arm64" ], @@ -831,8 +1146,159 @@ "node": ">= 10" } }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-darwin-x64": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-x64/-/napi-darwin-x64-0.25.7.tgz", + "integrity": "sha512-gq1Cf7US322ZJYPrVnAnn6eBLS6xi5catb5t99Wu6Rbm67XadEc81gtPTbPeNIu8FGgPjvKUc010rts2ZZbJeA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-linux-arm64-gnu": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-gnu/-/napi-linux-arm64-gnu-0.25.7.tgz", + "integrity": "sha512-q+BzEC7wB7pkK+pQKbn4TVJThrEtvxjObz0okscPtxTNYvSJGv9jr3Nde5SYjdkfk8Ab4NgDMshVjKWVz2TSbQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-linux-arm64-musl": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-musl/-/napi-linux-arm64-musl-0.25.7.tgz", + "integrity": "sha512-SEqZ6y0UhzmvZS938jIgR04kgHAW70hJ8yF4x9AkcqEhbeyqgElxIE7ve50ukDzs70fAKccdV8zYmebYN/7iPg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-linux-x64-gnu": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-gnu/-/napi-linux-x64-gnu-0.25.7.tgz", + "integrity": "sha512-8YuE/zTywTBb/iTm601JXTdWV2Redy9L9ab27aRD0hwX8FLmKUy8gK0fSo3xx+FyvSET49xkoR9tYdNaG2Wrkw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-linux-x64-musl": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-musl/-/napi-linux-x64-musl-0.25.7.tgz", + "integrity": "sha512-sT3eslR50IU6lHfqvq/c7vpxksJiB3h1NjEy1LpG+CYPuoLsQaB8j9OQlX8TqgVlDty/d/13cSls1Y3n/pm9xw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-win32-arm64-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-arm64-msvc/-/napi-win32-arm64-msvc-0.25.7.tgz", + "integrity": "sha512-pDi9vyXzUbpiRwFTif6+R7ZIIVB1ZKcRUJLKSIPyYb39DcSX7aOuxQcSZderWnBrwPGxZKzdgztdQ16TuAz2IQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-win32-ia32-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-ia32-msvc/-/napi-win32-ia32-msvc-0.25.7.tgz", + "integrity": "sha512-WFSNDMI5L9N9dK5zFQ6N900nhraOSYtKns/2p/EKZIKPBDXJSzzhT/jBakCSDix1GUs8K0XgkDoq2rXmuiBqXA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@codemod.com/workflow/node_modules/@ast-grep/napi-win32-x64-msvc": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-x64-msvc/-/napi-win32-x64-msvc-0.25.7.tgz", + "integrity": "sha512-HlsoVwQ9XrgNZ0JAmXgV5t8Ltx9tGyWZNS2UMY/2cvNU/SG9EpJLm1Bu9Mlk5seiJLbl28QTTbhZdfPKBzGTVQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@inquirer/external-editor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.2.tgz", + "integrity": "sha512-yy9cOoBnx58TlsPrIxauKIFQTiyH+0MK4e97y4sV9ERbI+zDxw7i2hxHLCIEGIE/8PPvDxGhgzIOTSOWcs6/MQ==", + "license": "MIT", + "dependencies": { + "chardet": "^2.1.0", + "iconv-lite": "^0.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, "node_modules/@inquirer/figures": { - "version": "1.0.13", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.14.tgz", + "integrity": "sha512-DbFgdt+9/OZYFM+19dbpXOSeAstPy884FPy1KjDu4anWwymZeOYhMY1mdFri172htv6mvc/uvIAAi7b7tvjJBQ==", "license": "MIT", "engines": { "node": ">=18" @@ -840,6 +1306,8 @@ }, "node_modules/@isaacs/cliui": { "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "license": "ISC", "dependencies": { "string-width": "^5.1.2", @@ -854,7 +1322,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "license": "MIT", "engines": { "node": ">=12" @@ -864,7 +1334,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", "engines": { "node": ">=12" @@ -875,10 +1347,14 @@ }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", @@ -893,7 +1369,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" @@ -907,6 +1385,8 @@ }, "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", @@ -922,14 +1402,28 @@ }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "license": "MIT", "engines": { "node": ">=6.0.0" @@ -937,10 +1431,14 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.30", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -949,6 +1447,8 @@ }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", "license": "MIT", "dependencies": { "debug": "^4.1.1" @@ -956,10 +1456,14 @@ }, "node_modules/@kwsites/promise-deferred": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", "license": "MIT" }, "node_modules/@nodejs-loaders/alias": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@nodejs-loaders/alias/-/alias-2.1.2.tgz", + "integrity": "sha512-thHaBXfGUbu7WpMqWt6Fw2xA6eN4faMl8kNFO8ufb2Ae4B9+9RhAg4vai1bFvzlBtnSTvUPU6qDz7sbpImFAbA==", "license": "ISC", "dependencies": { "json5": "^2.2.3" @@ -1058,6 +1562,8 @@ }, "node_modules/@octokit/auth-token": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-4.0.0.tgz", + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", "license": "MIT", "engines": { "node": ">= 18" @@ -1065,6 +1571,8 @@ }, "node_modules/@octokit/core": { "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.2.tgz", + "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", "license": "MIT", "peer": true, "dependencies": { @@ -1082,6 +1590,8 @@ }, "node_modules/@octokit/endpoint": { "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz", + "integrity": "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==", "license": "MIT", "dependencies": { "@octokit/types": "^13.1.0", @@ -1093,6 +1603,8 @@ }, "node_modules/@octokit/graphql": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", + "integrity": "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==", "license": "MIT", "dependencies": { "@octokit/request": "^8.4.1", @@ -1105,10 +1617,14 @@ }, "node_modules/@octokit/openapi-types": { "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-24.2.0.tgz", + "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==", "license": "MIT" }, "node_modules/@octokit/plugin-paginate-rest": { "version": "11.4.4-cjs.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-11.4.4-cjs.2.tgz", + "integrity": "sha512-2dK6z8fhs8lla5PaOTgqfCGBxgAv/le+EhPs27KklPhm1bKObpu6lXzwfUEQ16ajXzqNrKMujsFyo9K2eaoISw==", "license": "MIT", "dependencies": { "@octokit/types": "^13.7.0" @@ -1122,6 +1638,8 @@ }, "node_modules/@octokit/plugin-request-log": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-4.0.1.tgz", + "integrity": "sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==", "license": "MIT", "engines": { "node": ">= 18" @@ -1132,6 +1650,8 @@ }, "node_modules/@octokit/plugin-rest-endpoint-methods": { "version": "13.3.2-cjs.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-13.3.2-cjs.1.tgz", + "integrity": "sha512-VUjIjOOvF2oELQmiFpWA1aOPdawpyaCUqcEBc/UOUnj3Xp6DJGrJ1+bjUIIDzdHjnFNO6q57ODMfdEZnoBkCwQ==", "license": "MIT", "dependencies": { "@octokit/types": "^13.8.0" @@ -1145,6 +1665,8 @@ }, "node_modules/@octokit/request": { "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.4.1.tgz", + "integrity": "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==", "license": "MIT", "dependencies": { "@octokit/endpoint": "^9.0.6", @@ -1158,6 +1680,8 @@ }, "node_modules/@octokit/request-error": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.1.tgz", + "integrity": "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==", "license": "MIT", "dependencies": { "@octokit/types": "^13.1.0", @@ -1170,6 +1694,8 @@ }, "node_modules/@octokit/rest": { "version": "20.1.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-20.1.2.tgz", + "integrity": "sha512-GmYiltypkHHtihFwPRxlaorG5R9VAHuk/vbszVoRTGXnAsY60wYLkh/E2XiFmdZmqrisw+9FaazS1i5SbdWYgA==", "license": "MIT", "dependencies": { "@octokit/core": "^5.0.2", @@ -1183,6 +1709,8 @@ }, "node_modules/@octokit/types": { "version": "13.10.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.10.0.tgz", + "integrity": "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==", "license": "MIT", "dependencies": { "@octokit/openapi-types": "^24.2.0" @@ -1190,6 +1718,8 @@ }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "license": "MIT", "optional": true, "engines": { @@ -1198,6 +1728,8 @@ }, "node_modules/@sindresorhus/slugify": { "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-2.2.1.tgz", + "integrity": "sha512-MkngSCRZ8JdSOCHRaYd+D01XhvU3Hjy6MGl06zhOk614hp9EOAp5gIkBeQg7wtmxpitU6eAL4kdiRMcJa2dlrw==", "license": "MIT", "dependencies": { "@sindresorhus/transliterate": "^1.0.0", @@ -1212,6 +1744,8 @@ }, "node_modules/@sindresorhus/transliterate": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/transliterate/-/transliterate-1.6.0.tgz", + "integrity": "sha512-doH1gimEu3A46VX6aVxpHTeHrytJAG6HgdxntYnCFiIFHEM/ZGpG8KiZGBChchjQmG0XFIBL552kBTjVcMZXwQ==", "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0" @@ -1225,6 +1759,8 @@ }, "node_modules/@types/jscodeshift": { "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@types/jscodeshift/-/jscodeshift-0.11.11.tgz", + "integrity": "sha512-d7CAfFGOupj5qCDqMODXxNz2/NwCv/Lha78ZFbnr6qpk3K98iSB8I+ig9ERE2+EeYML352VMRsjPyOpeA+04eQ==", "license": "MIT", "dependencies": { "ast-types": "^0.14.1", @@ -1242,6 +1778,8 @@ }, "node_modules/@types/node-fetch": { "version": "2.6.13", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -1367,6 +1905,8 @@ }, "node_modules/abort-controller": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" @@ -1377,6 +1917,8 @@ }, "node_modules/agentkeepalive": { "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", "license": "MIT", "dependencies": { "humanize-ms": "^1.2.1" @@ -1387,6 +1929,8 @@ }, "node_modules/ansi-escapes": { "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "license": "MIT", "dependencies": { "type-fest": "^0.21.3" @@ -1400,6 +1944,8 @@ }, "node_modules/ansi-regex": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", "engines": { "node": ">=8" @@ -1407,6 +1953,8 @@ }, "node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -1420,6 +1968,8 @@ }, "node_modules/ast-types": { "version": "0.14.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.14.2.tgz", + "integrity": "sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==", "license": "MIT", "dependencies": { "tslib": "^2.0.1" @@ -1430,10 +1980,14 @@ }, "node_modules/asynckit": { "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "license": "MIT" }, "node_modules/babel-core": { "version": "7.0.0-bridge.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", + "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", "license": "MIT", "peerDependencies": { "@babel/core": "^7.0.0-0" @@ -1441,13 +1995,19 @@ }, "node_modules/balanced-match": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/base-64": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", + "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -1464,12 +2024,25 @@ ], "license": "MIT" }, + "node_modules/baseline-browser-mapping": { + "version": "2.8.25", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.25.tgz", + "integrity": "sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, "node_modules/before-after-hook": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz", + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", "license": "Apache-2.0" }, "node_modules/bl": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -1479,6 +2052,8 @@ }, "node_modules/brace-expansion": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -1486,6 +2061,8 @@ }, "node_modules/braces": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -1495,7 +2072,9 @@ } }, "node_modules/browserslist": { - "version": "4.25.2", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.27.0.tgz", + "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", "funding": [ { "type": "opencollective", @@ -1513,10 +2092,11 @@ "license": "MIT", "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001733", - "electron-to-chromium": "^1.5.199", - "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.3" + "baseline-browser-mapping": "^2.8.19", + "caniuse-lite": "^1.0.30001751", + "electron-to-chromium": "^1.5.238", + "node-releases": "^2.0.26", + "update-browserslist-db": "^1.1.4" }, "bin": { "browserslist": "cli.js" @@ -1527,6 +2107,8 @@ }, "node_modules/buffer": { "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "funding": [ { "type": "github", @@ -1549,10 +2131,14 @@ }, "node_modules/buffer-from": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT" }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -1563,7 +2149,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001734", + "version": "1.0.30001754", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001754.tgz", + "integrity": "sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==", "funding": [ { "type": "opencollective", @@ -1582,6 +2170,8 @@ }, "node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -1595,11 +2185,15 @@ } }, "node_modules/chardet": { - "version": "0.7.0", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", "license": "MIT" }, "node_modules/charenc": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", "license": "BSD-3-Clause", "engines": { "node": "*" @@ -1607,6 +2201,8 @@ }, "node_modules/cli-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" @@ -1617,6 +2213,8 @@ }, "node_modules/cli-spinners": { "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "license": "MIT", "engines": { "node": ">=6" @@ -1627,6 +2225,8 @@ }, "node_modules/cli-width": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", "license": "ISC", "engines": { "node": ">= 12" @@ -1634,6 +2234,8 @@ }, "node_modules/clone": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "license": "MIT", "engines": { "node": ">=0.8" @@ -1641,6 +2243,8 @@ }, "node_modules/clone-deep": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "license": "MIT", "dependencies": { "is-plain-object": "^2.0.4", @@ -1653,6 +2257,8 @@ }, "node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -1663,10 +2269,14 @@ }, "node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/colors-cli": { "version": "1.0.33", + "resolved": "https://registry.npmjs.org/colors-cli/-/colors-cli-1.0.33.tgz", + "integrity": "sha512-PWGsmoJFdOB0t+BeHgmtuoRZUQucOLl5ii81NBzOOGVxlgE04muFNHlR5j8i8MKbOPELBl3243AI6lGBTj5ICQ==", "license": "MIT", "bin": { "colors": "bin/colors" @@ -1677,6 +2287,8 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -1687,18 +2299,26 @@ }, "node_modules/commondir": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, "node_modules/convert-source-map": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -1711,13 +2331,17 @@ }, "node_modules/crypt": { "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", "license": "BSD-3-Clause", "engines": { "node": "*" } }, "node_modules/debug": { - "version": "4.4.1", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -1733,6 +2357,8 @@ }, "node_modules/dedent": { "version": "1.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.0.tgz", + "integrity": "sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1746,6 +2372,8 @@ }, "node_modules/defaults": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "license": "MIT", "dependencies": { "clone": "^1.0.2" @@ -1756,6 +2384,8 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -1763,17 +2393,26 @@ }, "node_modules/deprecation": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "license": "ISC" }, "node_modules/detect-indent": { - "version": "7.0.1", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.2.tgz", + "integrity": "sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==", "license": "MIT", "engines": { "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/detect-libc": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "license": "Apache-2.0", "engines": { "node": ">=8" @@ -1781,6 +2420,8 @@ }, "node_modules/detect-newline": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -1791,6 +2432,8 @@ }, "node_modules/diff": { "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -1798,6 +2441,8 @@ }, "node_modules/digest-fetch": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz", + "integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==", "license": "ISC", "dependencies": { "base-64": "^0.1.0", @@ -1806,6 +2451,8 @@ }, "node_modules/dunder-proto": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -1818,18 +2465,26 @@ }, "node_modules/eastasianwidth": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.200", + "version": "1.5.248", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.248.tgz", + "integrity": "sha512-zsur2yunphlyAO4gIubdJEXCK6KOVvtpiuDfCIqbM9FjcnMYiyn0ICa3hWfPr0nc41zcLWobgy1iL7VvoOyA2Q==", "license": "ISC" }, "node_modules/emoji-regex": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, "node_modules/es-define-property": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -1837,6 +2492,8 @@ }, "node_modules/es-errors": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -1844,6 +2501,8 @@ }, "node_modules/es-object-atoms": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -1854,6 +2513,8 @@ }, "node_modules/es-set-tostringtag": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -1867,6 +2528,8 @@ }, "node_modules/escalade": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "license": "MIT", "engines": { "node": ">=6" @@ -1874,6 +2537,8 @@ }, "node_modules/escape-string-regexp": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "license": "MIT", "engines": { "node": ">=12" @@ -1884,6 +2549,8 @@ }, "node_modules/esprima": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", @@ -1895,25 +2562,17 @@ }, "node_modules/event-target-shim": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "license": "MIT", - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/filename-reserved-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-3.0.0.tgz", + "integrity": "sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==", "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -1924,6 +2583,8 @@ }, "node_modules/filenamify": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-6.0.0.tgz", + "integrity": "sha512-vqIlNogKeyD3yzrm0yhRMQg8hOVwYcYRfjEoODd49iCprMn4HL85gK3HcykQE53EPIpX3HcAbGA5ELQv216dAQ==", "license": "MIT", "dependencies": { "filename-reserved-regex": "^3.0.0" @@ -1937,6 +2598,8 @@ }, "node_modules/fill-range": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -1947,6 +2610,8 @@ }, "node_modules/find-cache-dir": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "license": "MIT", "dependencies": { "commondir": "^1.0.1", @@ -1959,6 +2624,8 @@ }, "node_modules/find-up": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "license": "MIT", "dependencies": { "locate-path": "^3.0.0" @@ -1968,7 +2635,9 @@ } }, "node_modules/flow-parser": { - "version": "0.278.0", + "version": "0.290.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.290.0.tgz", + "integrity": "sha512-9qXeNyrHPIoRK23kX7HNp275RYMy2y1AWb37y86ZTH/2UvfrofBis18aBunzfTIXkRpeD0F/w/uAKFhLUpboqQ==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -1976,6 +2645,8 @@ }, "node_modules/foreground-child": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", @@ -1990,6 +2661,8 @@ }, "node_modules/form-data": { "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", @@ -2004,10 +2677,14 @@ }, "node_modules/form-data-encoder": { "version": "1.7.2", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", "license": "MIT" }, "node_modules/formdata-node": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", "license": "MIT", "dependencies": { "node-domexception": "1.0.0", @@ -2019,6 +2696,8 @@ }, "node_modules/formdata-node/node_modules/web-streams-polyfill": { "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", "license": "MIT", "engines": { "node": ">= 14" @@ -2026,10 +2705,14 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2037,6 +2720,8 @@ }, "node_modules/gensync": { "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -2044,6 +2729,8 @@ }, "node_modules/get-intrinsic": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -2066,6 +2753,8 @@ }, "node_modules/get-proto": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -2077,6 +2766,8 @@ }, "node_modules/git-up": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz", + "integrity": "sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==", "license": "MIT", "dependencies": { "is-ssh": "^1.4.0", @@ -2085,6 +2776,8 @@ }, "node_modules/git-url-parse": { "version": "14.1.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-14.1.0.tgz", + "integrity": "sha512-8xg65dTxGHST3+zGpycMMFZcoTzAdZ2dOtu4vmgIfkTFnVHBxHMzBC2L1k8To7EmrSiHesT8JgPLT91VKw1B5g==", "license": "MIT", "dependencies": { "git-up": "^7.0.0" @@ -2092,6 +2785,8 @@ }, "node_modules/glob": { "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", @@ -2110,6 +2805,8 @@ }, "node_modules/gopd": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2120,10 +2817,14 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -2131,6 +2832,8 @@ }, "node_modules/has-symbols": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2141,6 +2844,8 @@ }, "node_modules/has-tostringtag": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -2154,6 +2859,8 @@ }, "node_modules/hasown": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -2164,23 +2871,33 @@ }, "node_modules/humanize-ms": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "license": "MIT", "dependencies": { "ms": "^2.0.0" } }, "node_modules/iconv-lite": { - "version": "0.4.24", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -2199,6 +2916,8 @@ }, "node_modules/imurmurhash": { "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "license": "MIT", "engines": { "node": ">=0.8.19" @@ -2206,6 +2925,9 @@ }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -2214,16 +2936,20 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/inquirer": { - "version": "9.3.7", + "version": "9.3.8", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.3.8.tgz", + "integrity": "sha512-pFGGdaHrmRKMh4WoDDSowddgjT1Vkl90atobmTeSmcPGdYiwikch/m/Ef5wRaiamHejtw0cUUMMerzDUXCci2w==", "license": "MIT", "dependencies": { + "@inquirer/external-editor": "^1.0.2", "@inquirer/figures": "^1.0.3", "ansi-escapes": "^4.3.2", "cli-width": "^4.1.0", - "external-editor": "^3.1.0", "mute-stream": "1.0.0", "ora": "^5.4.1", "run-async": "^3.0.0", @@ -2239,10 +2965,14 @@ }, "node_modules/is-buffer": { "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "license": "MIT" }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { "node": ">=8" @@ -2250,6 +2980,8 @@ }, "node_modules/is-interactive": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", "license": "MIT", "engines": { "node": ">=8" @@ -2257,6 +2989,8 @@ }, "node_modules/is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", "engines": { "node": ">=0.12.0" @@ -2264,6 +2998,8 @@ }, "node_modules/is-plain-object": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "license": "MIT", "dependencies": { "isobject": "^3.0.1" @@ -2274,6 +3010,8 @@ }, "node_modules/is-ssh": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.1.tgz", + "integrity": "sha512-JNeu1wQsHjyHgn9NcWTaXq6zWSR6hqE0++zhfZlkFBbScNkyvxCdeV8sRkSBaeLKxmbpR21brail63ACNxJ0Tg==", "license": "MIT", "dependencies": { "protocols": "^2.0.1" @@ -2281,6 +3019,8 @@ }, "node_modules/is-unicode-supported": { "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "license": "MIT", "engines": { "node": ">=10" @@ -2291,10 +3031,14 @@ }, "node_modules/isexe": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, "node_modules/isobject": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -2302,6 +3046,8 @@ }, "node_modules/jackspeak": { "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -2315,10 +3061,14 @@ }, "node_modules/js-tokens": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, "node_modules/jscodeshift": { "version": "0.15.2", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.15.2.tgz", + "integrity": "sha512-FquR7Okgmc4Sd0aEDwqho3rEiKR3BdvuG9jfdHjLJ6JQoWSMpavug3AoIfnfWhxFlf+5pzQh8qjqz0DWFrNQzA==", "license": "MIT", "dependencies": { "@babel/core": "^7.23.0", @@ -2356,6 +3106,8 @@ }, "node_modules/jscodeshift/node_modules/ast-types": { "version": "0.16.1", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.1.tgz", + "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==", "license": "MIT", "dependencies": { "tslib": "^2.0.1" @@ -2366,6 +3118,8 @@ }, "node_modules/jscodeshift/node_modules/recast": { "version": "0.23.11", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.11.tgz", + "integrity": "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==", "license": "MIT", "dependencies": { "ast-types": "^0.16.1", @@ -2380,6 +3134,8 @@ }, "node_modules/jsesc": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "license": "MIT", "bin": { "jsesc": "bin/jsesc" @@ -2390,6 +3146,8 @@ }, "node_modules/json5": { "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "license": "MIT", "bin": { "json5": "lib/cli.js" @@ -2400,6 +3158,8 @@ }, "node_modules/kind-of": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -2407,6 +3167,8 @@ }, "node_modules/locate-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "license": "MIT", "dependencies": { "p-locate": "^3.0.0", @@ -2418,10 +3180,14 @@ }, "node_modules/lodash-es": { "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "license": "MIT", "dependencies": { "chalk": "^4.1.0", @@ -2436,20 +3202,26 @@ }, "node_modules/lru-cache": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/magic-string": { - "version": "0.30.17", + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, "node_modules/make-dir": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "license": "MIT", "dependencies": { "pify": "^4.0.1", @@ -2461,6 +3233,8 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "license": "ISC", "bin": { "semver": "bin/semver" @@ -2468,6 +3242,8 @@ }, "node_modules/math-intrinsics": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2475,6 +3251,8 @@ }, "node_modules/md5": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", "license": "BSD-3-Clause", "dependencies": { "charenc": "0.0.2", @@ -2484,6 +3262,8 @@ }, "node_modules/micromatch": { "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -2495,6 +3275,8 @@ }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2502,6 +3284,8 @@ }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -2512,6 +3296,8 @@ }, "node_modules/mimic-fn": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "license": "MIT", "engines": { "node": ">=6" @@ -2519,6 +3305,8 @@ }, "node_modules/minimatch": { "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -2532,6 +3320,8 @@ }, "node_modules/minipass": { "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" @@ -2539,10 +3329,14 @@ }, "node_modules/ms": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/mute-stream": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -2550,10 +3344,14 @@ }, "node_modules/neo-async": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "license": "MIT" }, "node_modules/node-dir": { "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", "license": "MIT", "dependencies": { "minimatch": "^3.0.2" @@ -2564,6 +3362,8 @@ }, "node_modules/node-dir/node_modules/brace-expansion": { "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -2572,6 +3372,8 @@ }, "node_modules/node-dir/node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -2582,6 +3384,9 @@ }, "node_modules/node-domexception": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", "funding": [ { "type": "github", @@ -2599,6 +3404,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -2616,11 +3423,15 @@ } }, "node_modules/node-releases": { - "version": "2.0.19", + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", "license": "MIT" }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -2628,6 +3439,8 @@ }, "node_modules/onetime": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" @@ -2641,6 +3454,8 @@ }, "node_modules/openai": { "version": "4.23.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.23.0.tgz", + "integrity": "sha512-ey2CXh1OTcTUa0AWZWuTpgA9t5GuAG3DVU1MofCRUI7fQJij8XJ3Sr0VtgxoAE69C9wbHBMCux8Z/IQZfSwHiA==", "license": "Apache-2.0", "dependencies": { "@types/node": "^18.11.18", @@ -2658,7 +3473,9 @@ } }, "node_modules/openai/node_modules/@types/node": { - "version": "18.19.122", + "version": "18.19.130", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", "license": "MIT", "dependencies": { "undici-types": "~5.26.4" @@ -2666,10 +3483,14 @@ }, "node_modules/openai/node_modules/undici-types": { "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "license": "MIT" }, "node_modules/ora": { "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "license": "MIT", "dependencies": { "bl": "^4.1.0", @@ -2689,15 +3510,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -2711,6 +3527,8 @@ }, "node_modules/p-locate": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "license": "MIT", "dependencies": { "p-limit": "^2.0.0" @@ -2721,6 +3539,8 @@ }, "node_modules/p-try": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "license": "MIT", "engines": { "node": ">=6" @@ -2728,10 +3548,14 @@ }, "node_modules/package-json-from-dist": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "license": "BlueOak-1.0.0" }, "node_modules/parse-path": { "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-7.1.0.tgz", + "integrity": "sha512-EuCycjZtfPcjWk7KTksnJ5xPMvWGA/6i4zrLYhRG0hGvC3GPU/jGUj3Cy+ZR0v30duV3e23R95T1lE2+lsndSw==", "license": "MIT", "dependencies": { "protocols": "^2.0.0" @@ -2739,6 +3563,8 @@ }, "node_modules/parse-url": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-8.1.0.tgz", + "integrity": "sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==", "license": "MIT", "dependencies": { "parse-path": "^7.0.0" @@ -2746,6 +3572,8 @@ }, "node_modules/path-exists": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "license": "MIT", "engines": { "node": ">=4" @@ -2753,6 +3581,8 @@ }, "node_modules/path-is-absolute": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -2760,6 +3590,8 @@ }, "node_modules/path-key": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "license": "MIT", "engines": { "node": ">=8" @@ -2767,6 +3599,8 @@ }, "node_modules/path-scurry": { "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^10.2.0", @@ -2781,14 +3615,20 @@ }, "node_modules/path-scurry/node_modules/lru-cache": { "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "license": "ISC" }, "node_modules/picocolors": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "license": "MIT", "engines": { "node": ">=8.6" @@ -2799,6 +3639,8 @@ }, "node_modules/pify": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "license": "MIT", "engines": { "node": ">=6" @@ -2806,6 +3648,8 @@ }, "node_modules/pirates": { "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "license": "MIT", "engines": { "node": ">= 6" @@ -2813,6 +3657,8 @@ }, "node_modules/pkg-dir": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "license": "MIT", "dependencies": { "find-up": "^3.0.0" @@ -2823,6 +3669,8 @@ }, "node_modules/prettier": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -2836,10 +3684,14 @@ }, "node_modules/protocols": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-2.0.2.tgz", + "integrity": "sha512-hHVTzba3wboROl0/aWRRG9dMytgH6ow//STBZh43l/wQgmMhYhOFi0EHWAPtoCz9IAUymsyP0TSBHkhgMEGNnQ==", "license": "MIT" }, "node_modules/readable-stream": { "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -2852,6 +3704,8 @@ }, "node_modules/recast": { "version": "0.20.5", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.20.5.tgz", + "integrity": "sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ==", "license": "MIT", "dependencies": { "ast-types": "0.14.2", @@ -2865,6 +3719,8 @@ }, "node_modules/restore-cursor": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "license": "MIT", "dependencies": { "onetime": "^5.1.0", @@ -2876,10 +3732,15 @@ }, "node_modules/restore-cursor/node_modules/signal-exit": { "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "license": "ISC" }, "node_modules/rimraf": { "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -2890,6 +3751,8 @@ }, "node_modules/rimraf/node_modules/brace-expansion": { "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -2898,6 +3761,9 @@ }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2916,6 +3782,8 @@ }, "node_modules/rimraf/node_modules/minimatch": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -2926,6 +3794,8 @@ }, "node_modules/run-async": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", "license": "MIT", "engines": { "node": ">=0.12.0" @@ -2933,6 +3803,8 @@ }, "node_modules/rxjs": { "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", "dependencies": { "tslib": "^2.1.0" @@ -2940,6 +3812,8 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -2958,10 +3832,14 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, "node_modules/semver": { "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -2969,6 +3847,8 @@ }, "node_modules/shallow-clone": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "license": "MIT", "dependencies": { "kind-of": "^6.0.2" @@ -2979,6 +3859,8 @@ }, "node_modules/shebang-command": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -2989,6 +3871,8 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "license": "MIT", "engines": { "node": ">=8" @@ -2996,6 +3880,8 @@ }, "node_modules/signal-exit": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "license": "ISC", "engines": { "node": ">=14" @@ -3005,7 +3891,9 @@ } }, "node_modules/simple-git": { - "version": "3.28.0", + "version": "3.30.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.30.0.tgz", + "integrity": "sha512-q6lxyDsCmEal/MEGhP1aVyQ3oxnagGlBDOVSIB4XUVLl1iZh0Pah6ebC9V4xBap/RfgP2WlI8EKs0WS0rMEJHg==", "license": "MIT", "dependencies": { "@kwsites/file-exists": "^1.1.1", @@ -3019,6 +3907,8 @@ }, "node_modules/source-map": { "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -3026,6 +3916,8 @@ }, "node_modules/source-map-support": { "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", @@ -3034,6 +3926,8 @@ }, "node_modules/string_decoder": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" @@ -3041,6 +3935,8 @@ }, "node_modules/string-width": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -3054,6 +3950,8 @@ "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -3066,6 +3964,8 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -3077,6 +3977,8 @@ "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -3087,6 +3989,8 @@ }, "node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -3097,6 +4001,8 @@ }, "node_modules/temp": { "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", "license": "MIT", "dependencies": { "rimraf": "~2.6.2" @@ -3107,20 +4013,14 @@ }, "node_modules/tiny-invariant": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", "license": "MIT" }, - "node_modules/tmp": { - "version": "0.0.33", - "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -3131,10 +4031,14 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "node_modules/tree-kill": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "license": "MIT", "bin": { "tree-kill": "cli.js" @@ -3142,6 +4046,8 @@ }, "node_modules/ts-invariant": { "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", "license": "MIT", "dependencies": { "tslib": "^2.1.0" @@ -3152,10 +4058,14 @@ }, "node_modules/tslib": { "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, "node_modules/type-fest": { "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" @@ -3166,14 +4076,20 @@ }, "node_modules/undici-types": { "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "license": "MIT" }, "node_modules/universal-user-agent": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.1.tgz", + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", "license": "ISC" }, "node_modules/update-browserslist-db": { - "version": "1.1.3", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", "funding": [ { "type": "opencollective", @@ -3202,10 +4118,14 @@ }, "node_modules/util-deprecate": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, "node_modules/wcwidth": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "license": "MIT", "dependencies": { "defaults": "^1.0.3" @@ -3213,6 +4133,8 @@ }, "node_modules/web-streams-polyfill": { "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", "license": "MIT", "engines": { "node": ">= 8" @@ -3220,10 +4142,14 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -3232,6 +4158,8 @@ }, "node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -3245,6 +4173,8 @@ }, "node_modules/wrap-ansi": { "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -3258,6 +4188,8 @@ "node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -3273,10 +4205,14 @@ }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/write-file-atomic": { "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "license": "ISC", "dependencies": { "graceful-fs": "^4.1.11", @@ -3286,14 +4222,20 @@ }, "node_modules/write-file-atomic/node_modules/signal-exit": { "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "license": "ISC" }, "node_modules/yallist": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "license": "ISC" }, "node_modules/yaml": { "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", "license": "ISC", "bin": { "yaml": "bin.mjs" @@ -3303,7 +4245,9 @@ } }, "node_modules/yoctocolors-cjs": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz", + "integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==", "license": "MIT", "engines": { "node": ">=18" From 7b347db525ef114498d0e648a041f757059eff03 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 8 Nov 2025 12:11:10 +0100 Subject: [PATCH 10/12] fix --- .../process-assert-to-assert/src/workflow.ts | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-assert/src/workflow.ts index bf266fd8..457da237 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-assert/src/workflow.ts @@ -72,13 +72,29 @@ export default function transform(root: SgRoot): string | null { const binding = resolveBindingPath(processImport, '$.assert'); if (binding) { + // Handle member expressions like nodeAssert.strictEqual replaceRules.push({ importNode: processImport, binding, rule: { kind: 'member_expression', has: { - kind: binding.includes('.') ? 'member_expression' : 'identifier', + kind: binding.includes('.') ? 'member_expression' : 'identifier', + pattern: binding, + }, + }, + replaceWith: 'assert', + }); + + // Handle standalone calls like nodeAssert(...) + replaceRules.push({ + importNode: processImport, + binding, + rule: { + kind: 'call_expression', + has: { + kind: 'identifier', + field: 'function', pattern: binding, }, }, @@ -101,13 +117,18 @@ export default function transform(root: SgRoot): string | null { } } + const processedImports = new Set>(); + for (const replaceRule of replaceRules) { const nodes = rootNode.findAll({ rule: replaceRule.rule, }); for (const node of nodes) { - if (replaceRule.importNode) { + if ( + replaceRule.importNode && + !processedImports.has(replaceRule.importNode) + ) { if (!processImportsToRemove.has(replaceRule.importNode)) { const removeBind = removeBinding( replaceRule.importNode, @@ -122,17 +143,29 @@ export default function transform(root: SgRoot): string | null { linesToRemove.push(removeBind.lineToRemove); } } + processedImports.add(replaceRule.importNode); } if ( replaceRule.rule.kind === 'member_expression' && replaceRule.binding ) { + // Replace the object part of member expressions (e.g., nodeAssert.strictEqual -> assert.strictEqual) const objectNode = node.field('object'); if (objectNode) { edits.push(objectNode.replace('assert')); } + } else if ( + replaceRule.rule.kind === 'call_expression' && + replaceRule.binding + ) { + // Replace the function identifier in call expressions (e.g., nodeAssert(...) -> assert(...)) + const functionNode = node.field('function'); + + if (functionNode) { + edits.push(functionNode.replace('assert')); + } } else { const replaceText = replaceRule.replaceWith || 'assert'; edits.push(node.replace(replaceText)); @@ -183,8 +216,6 @@ export default function transform(root: SgRoot): string | null { return `const assert = require("node:assert");${EOL}${sourceCode}`; } - // @todo(AugustinMauroy): after codemod response of capabilities on workflow step - // enable fs to read package.json to determine module type console.warn( `[process-assert-to-assert] Unable to determine module type for file: ${root.filename()}. No import added.`, ); From 19c7e1145ad9c0bfe8d46923dc3db352c9e691b2 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 8 Nov 2025 12:12:42 +0100 Subject: [PATCH 11/12] rename --- package-lock.json | 8 ++++---- .../README.md | 0 .../codemod.yaml | 2 +- .../package.json | 6 +++--- .../src/workflow.ts | 2 +- .../tests/expected/01-basic-global-process-assert.js | 0 .../tests/expected/02-basic-commonjs.cjs | 0 .../tests/expected/03-esm-import-process.mjs | 0 .../tests/expected/04-mixed-process-usage.js | 0 .../tests/expected/05-require-process.js | 0 .../tests/expected/06-destructured-assert-only.js | 0 .../tests/expected/07-destructured-mixed-bindings.js | 0 .../tests/expected/08-aliased-destructured-assert.js | 0 .../tests/expected/09-aliased-destructured-mixed.js | 0 .../tests/expected/10-require-destructured.js | 0 .../tests/expected/11-already-has-assert-import.js | 0 .../tests/expected/12-already-has-assert-require.js | 0 .../tests/expected/13-no-process-assert.js | 0 .../tests/expected/14-nested-in-function.js | 0 .../tests/expected/15-multiple-assert-methods.js | 0 .../tests/expected/16-mixed-require-and-assert.js | 0 .../tests/expected/17-complex-nested-class.js | 0 .../tests/input/01-basic-global-process-assert.js | 0 .../tests/input/02-basic-commonjs.cjs | 0 .../tests/input/03-esm-import-process.mjs | 0 .../tests/input/04-mixed-process-usage.js | 0 .../tests/input/05-require-process.js | 0 .../tests/input/06-destructured-assert-only.js | 0 .../tests/input/07-destructured-mixed-bindings.js | 0 .../tests/input/08-aliased-destructured-assert.js | 0 .../tests/input/09-aliased-destructured-mixed.js | 0 .../tests/input/10-require-destructured.js | 0 .../tests/input/11-already-has-assert-import.js | 0 .../tests/input/12-already-has-assert-require.js | 0 .../tests/input/13-no-process-assert.js | 0 .../tests/input/14-nested-in-function.js | 0 .../tests/input/15-multiple-assert-methods.js | 0 .../tests/input/16-mixed-require-and-assert.js | 0 .../tests/input/17-complex-nested-class.js | 0 .../workflow.yaml | 0 40 files changed, 9 insertions(+), 9 deletions(-) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/README.md (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/codemod.yaml (88%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/package.json (79%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/src/workflow.ts (98%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/01-basic-global-process-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/02-basic-commonjs.cjs (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/03-esm-import-process.mjs (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/04-mixed-process-usage.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/05-require-process.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/06-destructured-assert-only.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/07-destructured-mixed-bindings.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/08-aliased-destructured-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/09-aliased-destructured-mixed.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/10-require-destructured.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/11-already-has-assert-import.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/12-already-has-assert-require.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/13-no-process-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/14-nested-in-function.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/15-multiple-assert-methods.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/16-mixed-require-and-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/expected/17-complex-nested-class.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/01-basic-global-process-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/02-basic-commonjs.cjs (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/03-esm-import-process.mjs (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/04-mixed-process-usage.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/05-require-process.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/06-destructured-assert-only.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/07-destructured-mixed-bindings.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/08-aliased-destructured-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/09-aliased-destructured-mixed.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/10-require-destructured.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/11-already-has-assert-import.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/12-already-has-assert-require.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/13-no-process-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/14-nested-in-function.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/15-multiple-assert-methods.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/16-mixed-require-and-assert.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/tests/input/17-complex-nested-class.js (100%) rename recipes/{process-assert-to-assert => process-assert-to-node-assert}/workflow.yaml (100%) diff --git a/package-lock.json b/package-lock.json index 0e85efa9..a59425a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1520,8 +1520,8 @@ "resolved": "recipes/node-url-to-whatwg-url", "link": true }, - "node_modules/@nodejs/process-assert-to-assert": { - "resolved": "recipes/process-assert-to-assert", + "node_modules/@nodejs/process-assert-to-node-assert": { + "resolved": "recipes/process-assert-to-node-assert", "link": true }, "node_modules/@nodejs/process-main-module": { @@ -4381,8 +4381,8 @@ "@codemod.com/jssg-types": "^1.0.3" } }, - "recipes/process-assert-to-assert": { - "name": "@nodejs/process-assert-to-assert", + "recipes/process-assert-to-node-assert": { + "name": "@nodejs/process-assert-to-node-assert", "version": "1.0.0", "license": "MIT", "dependencies": { diff --git a/recipes/process-assert-to-assert/README.md b/recipes/process-assert-to-node-assert/README.md similarity index 100% rename from recipes/process-assert-to-assert/README.md rename to recipes/process-assert-to-node-assert/README.md diff --git a/recipes/process-assert-to-assert/codemod.yaml b/recipes/process-assert-to-node-assert/codemod.yaml similarity index 88% rename from recipes/process-assert-to-assert/codemod.yaml rename to recipes/process-assert-to-node-assert/codemod.yaml index abd4f604..e9e8b3ea 100644 --- a/recipes/process-assert-to-assert/codemod.yaml +++ b/recipes/process-assert-to-node-assert/codemod.yaml @@ -1,5 +1,5 @@ schema_version: "1.0" -name: "@nodejs/process-assert-to-assert" +name: "@nodejs/process-assert-to-node-assert" version: 1.0.0 description: Handle DEP0100 via transforming `process.assert` to `assert`. author: matheusmorett2 diff --git a/recipes/process-assert-to-assert/package.json b/recipes/process-assert-to-node-assert/package.json similarity index 79% rename from recipes/process-assert-to-assert/package.json rename to recipes/process-assert-to-node-assert/package.json index 4cd457c0..7d6999e0 100644 --- a/recipes/process-assert-to-assert/package.json +++ b/recipes/process-assert-to-node-assert/package.json @@ -1,5 +1,5 @@ { - "name": "@nodejs/process-assert-to-assert", + "name": "@nodejs/process-assert-to-node-assert", "version": "1.0.0", "description": "Handle DEP0100 via transforming `process.assert` to `node:assert`.", "type": "module", @@ -9,12 +9,12 @@ "repository": { "type": "git", "url": "git+https://github.com/nodejs/userland-migrations.git", - "directory": "recipes/process-assert-to-assert", + "directory": "recipes/process-assert-to-node-assert", "bugs": "https://github.com/nodejs/userland-migrations/issues" }, "author": "matheusmorett2", "license": "MIT", - "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/process-assert-to-assert/README.md", + "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/process-assert-to-node-assert/README.md", "devDependencies": { "@codemod.com/jssg-types": "^1.0.3" }, diff --git a/recipes/process-assert-to-assert/src/workflow.ts b/recipes/process-assert-to-node-assert/src/workflow.ts similarity index 98% rename from recipes/process-assert-to-assert/src/workflow.ts rename to recipes/process-assert-to-node-assert/src/workflow.ts index 457da237..82251e92 100644 --- a/recipes/process-assert-to-assert/src/workflow.ts +++ b/recipes/process-assert-to-node-assert/src/workflow.ts @@ -217,7 +217,7 @@ export default function transform(root: SgRoot): string | null { } console.warn( - `[process-assert-to-assert] Unable to determine module type for file: ${root.filename()}. No import added.`, + `[process-assert-to-node-assert] Unable to determine module type for file: ${root.filename()}. No import added.`, ); return `// Unable to determine module type; please add the appropriate import for 'assert'${EOL}${sourceCode}`; diff --git a/recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js b/recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/01-basic-global-process-assert.js rename to recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js diff --git a/recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs b/recipes/process-assert-to-node-assert/tests/expected/02-basic-commonjs.cjs similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/02-basic-commonjs.cjs rename to recipes/process-assert-to-node-assert/tests/expected/02-basic-commonjs.cjs diff --git a/recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs b/recipes/process-assert-to-node-assert/tests/expected/03-esm-import-process.mjs similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/03-esm-import-process.mjs rename to recipes/process-assert-to-node-assert/tests/expected/03-esm-import-process.mjs diff --git a/recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js b/recipes/process-assert-to-node-assert/tests/expected/04-mixed-process-usage.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/04-mixed-process-usage.js rename to recipes/process-assert-to-node-assert/tests/expected/04-mixed-process-usage.js diff --git a/recipes/process-assert-to-assert/tests/expected/05-require-process.js b/recipes/process-assert-to-node-assert/tests/expected/05-require-process.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/05-require-process.js rename to recipes/process-assert-to-node-assert/tests/expected/05-require-process.js diff --git a/recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js b/recipes/process-assert-to-node-assert/tests/expected/06-destructured-assert-only.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/06-destructured-assert-only.js rename to recipes/process-assert-to-node-assert/tests/expected/06-destructured-assert-only.js diff --git a/recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js b/recipes/process-assert-to-node-assert/tests/expected/07-destructured-mixed-bindings.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/07-destructured-mixed-bindings.js rename to recipes/process-assert-to-node-assert/tests/expected/07-destructured-mixed-bindings.js diff --git a/recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js b/recipes/process-assert-to-node-assert/tests/expected/08-aliased-destructured-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/08-aliased-destructured-assert.js rename to recipes/process-assert-to-node-assert/tests/expected/08-aliased-destructured-assert.js diff --git a/recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js b/recipes/process-assert-to-node-assert/tests/expected/09-aliased-destructured-mixed.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/09-aliased-destructured-mixed.js rename to recipes/process-assert-to-node-assert/tests/expected/09-aliased-destructured-mixed.js diff --git a/recipes/process-assert-to-assert/tests/expected/10-require-destructured.js b/recipes/process-assert-to-node-assert/tests/expected/10-require-destructured.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/10-require-destructured.js rename to recipes/process-assert-to-node-assert/tests/expected/10-require-destructured.js diff --git a/recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js b/recipes/process-assert-to-node-assert/tests/expected/11-already-has-assert-import.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/11-already-has-assert-import.js rename to recipes/process-assert-to-node-assert/tests/expected/11-already-has-assert-import.js diff --git a/recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js b/recipes/process-assert-to-node-assert/tests/expected/12-already-has-assert-require.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/12-already-has-assert-require.js rename to recipes/process-assert-to-node-assert/tests/expected/12-already-has-assert-require.js diff --git a/recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js b/recipes/process-assert-to-node-assert/tests/expected/13-no-process-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/13-no-process-assert.js rename to recipes/process-assert-to-node-assert/tests/expected/13-no-process-assert.js diff --git a/recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js b/recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/14-nested-in-function.js rename to recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js diff --git a/recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js b/recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/15-multiple-assert-methods.js rename to recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js diff --git a/recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js b/recipes/process-assert-to-node-assert/tests/expected/16-mixed-require-and-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/16-mixed-require-and-assert.js rename to recipes/process-assert-to-node-assert/tests/expected/16-mixed-require-and-assert.js diff --git a/recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js b/recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js similarity index 100% rename from recipes/process-assert-to-assert/tests/expected/17-complex-nested-class.js rename to recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js diff --git a/recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js b/recipes/process-assert-to-node-assert/tests/input/01-basic-global-process-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/01-basic-global-process-assert.js rename to recipes/process-assert-to-node-assert/tests/input/01-basic-global-process-assert.js diff --git a/recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs b/recipes/process-assert-to-node-assert/tests/input/02-basic-commonjs.cjs similarity index 100% rename from recipes/process-assert-to-assert/tests/input/02-basic-commonjs.cjs rename to recipes/process-assert-to-node-assert/tests/input/02-basic-commonjs.cjs diff --git a/recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs b/recipes/process-assert-to-node-assert/tests/input/03-esm-import-process.mjs similarity index 100% rename from recipes/process-assert-to-assert/tests/input/03-esm-import-process.mjs rename to recipes/process-assert-to-node-assert/tests/input/03-esm-import-process.mjs diff --git a/recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js b/recipes/process-assert-to-node-assert/tests/input/04-mixed-process-usage.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/04-mixed-process-usage.js rename to recipes/process-assert-to-node-assert/tests/input/04-mixed-process-usage.js diff --git a/recipes/process-assert-to-assert/tests/input/05-require-process.js b/recipes/process-assert-to-node-assert/tests/input/05-require-process.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/05-require-process.js rename to recipes/process-assert-to-node-assert/tests/input/05-require-process.js diff --git a/recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js b/recipes/process-assert-to-node-assert/tests/input/06-destructured-assert-only.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/06-destructured-assert-only.js rename to recipes/process-assert-to-node-assert/tests/input/06-destructured-assert-only.js diff --git a/recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js b/recipes/process-assert-to-node-assert/tests/input/07-destructured-mixed-bindings.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/07-destructured-mixed-bindings.js rename to recipes/process-assert-to-node-assert/tests/input/07-destructured-mixed-bindings.js diff --git a/recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js b/recipes/process-assert-to-node-assert/tests/input/08-aliased-destructured-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/08-aliased-destructured-assert.js rename to recipes/process-assert-to-node-assert/tests/input/08-aliased-destructured-assert.js diff --git a/recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js b/recipes/process-assert-to-node-assert/tests/input/09-aliased-destructured-mixed.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/09-aliased-destructured-mixed.js rename to recipes/process-assert-to-node-assert/tests/input/09-aliased-destructured-mixed.js diff --git a/recipes/process-assert-to-assert/tests/input/10-require-destructured.js b/recipes/process-assert-to-node-assert/tests/input/10-require-destructured.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/10-require-destructured.js rename to recipes/process-assert-to-node-assert/tests/input/10-require-destructured.js diff --git a/recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js b/recipes/process-assert-to-node-assert/tests/input/11-already-has-assert-import.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/11-already-has-assert-import.js rename to recipes/process-assert-to-node-assert/tests/input/11-already-has-assert-import.js diff --git a/recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js b/recipes/process-assert-to-node-assert/tests/input/12-already-has-assert-require.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/12-already-has-assert-require.js rename to recipes/process-assert-to-node-assert/tests/input/12-already-has-assert-require.js diff --git a/recipes/process-assert-to-assert/tests/input/13-no-process-assert.js b/recipes/process-assert-to-node-assert/tests/input/13-no-process-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/13-no-process-assert.js rename to recipes/process-assert-to-node-assert/tests/input/13-no-process-assert.js diff --git a/recipes/process-assert-to-assert/tests/input/14-nested-in-function.js b/recipes/process-assert-to-node-assert/tests/input/14-nested-in-function.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/14-nested-in-function.js rename to recipes/process-assert-to-node-assert/tests/input/14-nested-in-function.js diff --git a/recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js b/recipes/process-assert-to-node-assert/tests/input/15-multiple-assert-methods.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/15-multiple-assert-methods.js rename to recipes/process-assert-to-node-assert/tests/input/15-multiple-assert-methods.js diff --git a/recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js b/recipes/process-assert-to-node-assert/tests/input/16-mixed-require-and-assert.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/16-mixed-require-and-assert.js rename to recipes/process-assert-to-node-assert/tests/input/16-mixed-require-and-assert.js diff --git a/recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js b/recipes/process-assert-to-node-assert/tests/input/17-complex-nested-class.js similarity index 100% rename from recipes/process-assert-to-assert/tests/input/17-complex-nested-class.js rename to recipes/process-assert-to-node-assert/tests/input/17-complex-nested-class.js diff --git a/recipes/process-assert-to-assert/workflow.yaml b/recipes/process-assert-to-node-assert/workflow.yaml similarity index 100% rename from recipes/process-assert-to-assert/workflow.yaml rename to recipes/process-assert-to-node-assert/workflow.yaml From da74a79cc0331cf17dcdb8c53ecb7e63b1d2905c Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 8 Nov 2025 12:19:54 +0100 Subject: [PATCH 12/12] add import type detection --- recipes/process-assert-to-node-assert/README.md | 4 ++++ recipes/process-assert-to-node-assert/codemod.yaml | 6 +++++- .../process-assert-to-node-assert/src/workflow.ts | 14 ++++++++++---- .../expected/01-basic-global-process-assert.js | 2 +- .../tests/expected/14-nested-in-function.js | 2 +- .../tests/expected/15-multiple-assert-methods.js | 2 +- .../tests/expected/17-complex-nested-class.js | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/recipes/process-assert-to-node-assert/README.md b/recipes/process-assert-to-node-assert/README.md index 1540eddd..cae74613 100644 --- a/recipes/process-assert-to-node-assert/README.md +++ b/recipes/process-assert-to-node-assert/README.md @@ -18,3 +18,7 @@ process.assert(condition, "Assertion failed"); import assert from "node:assert"; assert(condition, "Assertion failed"); ``` + +## Additional Notes + +This codemod use [`fs` capability](https://docs.codemod.com/jssg/security) to read the `package.json` file and determine if the project is using ES modules or CommonJS. Based on this information, it adds the appropriate import statement for the `assert` module. diff --git a/recipes/process-assert-to-node-assert/codemod.yaml b/recipes/process-assert-to-node-assert/codemod.yaml index e9e8b3ea..ff21d993 100644 --- a/recipes/process-assert-to-node-assert/codemod.yaml +++ b/recipes/process-assert-to-node-assert/codemod.yaml @@ -1,7 +1,7 @@ schema_version: "1.0" name: "@nodejs/process-assert-to-node-assert" version: 1.0.0 -description: Handle DEP0100 via transforming `process.assert` to `assert`. +description: Handle DEP0100 via transforming `process.assert` to `node:assert`. author: matheusmorett2 license: MIT workflow: workflow.yaml @@ -19,3 +19,7 @@ keywords: registry: access: public visibility: public + +# https://docs.codemod.com/jssg/security#enabling-capabilities +capabilities: + - fs diff --git a/recipes/process-assert-to-node-assert/src/workflow.ts b/recipes/process-assert-to-node-assert/src/workflow.ts index 82251e92..14322159 100644 --- a/recipes/process-assert-to-node-assert/src/workflow.ts +++ b/recipes/process-assert-to-node-assert/src/workflow.ts @@ -1,4 +1,6 @@ import { EOL } from 'node:os'; +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; @@ -216,9 +218,13 @@ export default function transform(root: SgRoot): string | null { return `const assert = require("node:assert");${EOL}${sourceCode}`; } - console.warn( - `[process-assert-to-node-assert] Unable to determine module type for file: ${root.filename()}. No import added.`, - ); + const packageJsonPath = join(process.cwd(), 'package.json'); + const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')); + const isEsm = packageJson.type === 'module'; - return `// Unable to determine module type; please add the appropriate import for 'assert'${EOL}${sourceCode}`; + if (isEsm) { + return `import assert from "node:assert";${EOL}${sourceCode}`; + } + + return `const assert = require("node:assert");${EOL}${sourceCode}`; } diff --git a/recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js b/recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js index 83513e93..08f8977f 100644 --- a/recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js +++ b/recipes/process-assert-to-node-assert/tests/expected/01-basic-global-process-assert.js @@ -1,3 +1,3 @@ -// Unable to determine module type; please add the appropriate import for 'assert' +import assert from "node:assert"; assert(condition, "Basic assertion"); assert.strictEqual(a, b, "Values should be equal"); diff --git a/recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js b/recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js index f6e3df4f..92d74048 100644 --- a/recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js +++ b/recipes/process-assert-to-node-assert/tests/expected/14-nested-in-function.js @@ -1,4 +1,4 @@ -// Unable to determine module type; please add the appropriate import for 'assert' +import assert from "node:assert"; function testFunction() { assert(condition, "Assertion inside function"); diff --git a/recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js b/recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js index 32f5a659..5db73614 100644 --- a/recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js +++ b/recipes/process-assert-to-node-assert/tests/expected/15-multiple-assert-methods.js @@ -1,4 +1,4 @@ -// Unable to determine module type; please add the appropriate import for 'assert' +import assert from "node:assert"; assert(condition); assert.ok(value); assert.strictEqual(a, b); diff --git a/recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js b/recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js index 0a996d2a..1cd40c48 100644 --- a/recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js +++ b/recipes/process-assert-to-node-assert/tests/expected/17-complex-nested-class.js @@ -1,4 +1,4 @@ -// Unable to determine module type; please add the appropriate import for 'assert' +import assert from "node:assert"; class Validator { static validate(data) { assert(data, "Data is required");