From d81e531091be7a910d7216691c0c950b6c65d218 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Wed, 29 Oct 2025 22:43:59 +0100 Subject: [PATCH 01/11] feat(`timers-deprecations`): scaffould --- package-lock.json | 15 +++ recipes/timers-deprecations/README.md | 60 ++++++++++++ recipes/timers-deprecations/codemod.yaml | 21 +++++ recipes/timers-deprecations/package.json | 29 ++++++ .../src/active-to-standard-timer.ts | 11 +++ .../src/cleanup-imports.ts | 11 +++ .../src/enroll-to-set-timeout.ts | 11 +++ .../src/unenroll-to-clear-timer.ts | 11 +++ .../src/unref-active-to-unref.ts | 11 +++ .../tests/active/expected/basic.js | 19 ++++ .../tests/active/expected/destructured.js | 19 ++++ .../tests/active/input/basic.js | 11 +++ .../tests/active/input/destructured.js | 11 +++ .../tests/enroll/expected/basic.js | 14 +++ .../tests/enroll/expected/destructured.js | 14 +++ .../tests/enroll/input/basic.js | 9 ++ .../tests/enroll/input/destructured.js | 9 ++ .../tests/imports/expected/basic.js | 17 ++++ .../tests/imports/expected/named.js | 6 ++ .../tests/imports/input/basic.js | 19 ++++ .../tests/imports/input/named.js | 8 ++ .../tests/unenroll/expected/basic.js | 8 ++ .../tests/unenroll/expected/destructured.js | 8 ++ .../tests/unenroll/input/basic.js | 7 ++ .../tests/unenroll/input/destructured.js | 7 ++ .../tests/unref/expected/basic.js | 20 ++++ .../tests/unref/expected/destructured.js | 20 ++++ .../tests/unref/input/basic.js | 11 +++ .../tests/unref/input/destructured.js | 11 +++ recipes/timers-deprecations/workflow.yaml | 91 +++++++++++++++++++ 30 files changed, 519 insertions(+) create mode 100644 recipes/timers-deprecations/README.md create mode 100644 recipes/timers-deprecations/codemod.yaml create mode 100644 recipes/timers-deprecations/package.json create mode 100644 recipes/timers-deprecations/src/active-to-standard-timer.ts create mode 100644 recipes/timers-deprecations/src/cleanup-imports.ts create mode 100644 recipes/timers-deprecations/src/enroll-to-set-timeout.ts create mode 100644 recipes/timers-deprecations/src/unenroll-to-clear-timer.ts create mode 100644 recipes/timers-deprecations/src/unref-active-to-unref.ts create mode 100644 recipes/timers-deprecations/tests/active/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/active/expected/destructured.js create mode 100644 recipes/timers-deprecations/tests/active/input/basic.js create mode 100644 recipes/timers-deprecations/tests/active/input/destructured.js create mode 100644 recipes/timers-deprecations/tests/enroll/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/enroll/expected/destructured.js create mode 100644 recipes/timers-deprecations/tests/enroll/input/basic.js create mode 100644 recipes/timers-deprecations/tests/enroll/input/destructured.js create mode 100644 recipes/timers-deprecations/tests/imports/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/imports/expected/named.js create mode 100644 recipes/timers-deprecations/tests/imports/input/basic.js create mode 100644 recipes/timers-deprecations/tests/imports/input/named.js create mode 100644 recipes/timers-deprecations/tests/unenroll/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/unenroll/expected/destructured.js create mode 100644 recipes/timers-deprecations/tests/unenroll/input/basic.js create mode 100644 recipes/timers-deprecations/tests/unenroll/input/destructured.js create mode 100644 recipes/timers-deprecations/tests/unref/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/unref/expected/destructured.js create mode 100644 recipes/timers-deprecations/tests/unref/input/basic.js create mode 100644 recipes/timers-deprecations/tests/unref/input/destructured.js create mode 100644 recipes/timers-deprecations/workflow.yaml diff --git a/package-lock.json b/package-lock.json index 3084e4d7..57ac73ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1509,6 +1509,10 @@ "resolved": "recipes/rmdir", "link": true }, + "node_modules/@nodejs/timers-deprecations": { + "resolved": "recipes/timers-deprecations", + "link": true + }, "node_modules/@nodejs/tmpdir-to-tmpdir": { "resolved": "recipes/tmpdir-to-tmpdir", "link": true @@ -4399,6 +4403,17 @@ "@codemod.com/jssg-types": "^1.0.9" } }, + "recipes/timers-deprecations": { + "name": "@nodejs/timers-deprecations", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@nodejs/codemod-utils": "*" + }, + "devDependencies": { + "@codemod.com/jssg-types": "^1.0.9" + } + }, "recipes/tmpdir-to-tmpdir": { "name": "@nodejs/tmpdir-to-tmpdir", "version": "1.0.0", diff --git a/recipes/timers-deprecations/README.md b/recipes/timers-deprecations/README.md new file mode 100644 index 00000000..425b65ff --- /dev/null +++ b/recipes/timers-deprecations/README.md @@ -0,0 +1,60 @@ +# Node.js Timers Deprecations + +This recipe migrates deprecated internals from `node:timers` to the supported public timers API. It replaces usages of `timers.enroll()`, `timers.unenroll()`, `timers.active()`, and `timers._unrefActive()` with standard constructs built on top of `setTimeout()`, `clearTimeout()`, and `Timer#unref()`. + +See the upstream notices: [DEP0095](https://nodejs.org/api/deprecations.html#DEP0095), [DEP0096](https://nodejs.org/api/deprecations.html#DEP0096), [DEP0126](https://nodejs.org/api/deprecations.html#DEP0126), and [DEP0127](https://nodejs.org/api/deprecations.html#DEP0127). + +## Example + +### Replace `timers.enroll()` + +**Before:** + +```js +const timers = require('node:timers'); +const resource = { _idleTimeout: 1500 }; +timers.enroll(resource, 1500); +``` + +**After:** + +```js +const resource = { timeout: setTimeout(() => { + // timeout handler +}, 1500) }; +``` + +### Replace `timers.unenroll()` + +**Before:** + +```js +timers.unenroll(resource); +``` + +**After:** + +```js +clearTimeout(resource.timeout); +``` + +### Replace `timers.active()` and `timers._unrefActive()` + +**Before:** + +```js +const timers = require('node:timers'); +timers.active(resource); +timers._unrefActive(resource); +``` + +**After:** + +```js +const handle = setTimeout(onTimeout, delay); +handle.unref(); +``` + +## Caveats + +The legacy APIs exposed internal timer bookkeeping fields such as `_idleStart` or `_idleTimeout`. Those internals have no public equivalent. The codemod focuses on migrating the control flow to modern timers and leaves application specific bookkeeping to the developer. Carefully review the transformed code to ensure that any custom metadata is still updated as expected. diff --git a/recipes/timers-deprecations/codemod.yaml b/recipes/timers-deprecations/codemod.yaml new file mode 100644 index 00000000..434e593e --- /dev/null +++ b/recipes/timers-deprecations/codemod.yaml @@ -0,0 +1,21 @@ +schema_version: "1.0" +name: "@nodejs/timers-deprecations" +version: 1.0.0 +description: Migrate deprecated node:timers APIs to public timer functions. +author: Augustin Mauroy +license: MIT +workflow: workflow.yaml +category: migration + +targets: + languages: + - javascript + - typescript + +keywords: + - migration + - timers + +registry: + access: public + visibility: public diff --git a/recipes/timers-deprecations/package.json b/recipes/timers-deprecations/package.json new file mode 100644 index 00000000..92784b03 --- /dev/null +++ b/recipes/timers-deprecations/package.json @@ -0,0 +1,29 @@ +{ + "name": "@nodejs/timers-deprecations", + "version": "1.0.0", + "description": "Migrate deprecated node:timers APIs to public timer functions.", + "type": "module", + "scripts": { + "test": "node --run test:enroll && node --run test:unenroll && node --run test:active && node --run test:unref && node --run test:imports", + "test:enroll": "npx codemod jssg test -l typescript ./src/enroll-to-set-timeout.ts ./tests/ --filter enroll", + "test:unenroll": "npx codemod jssg test -l typescript ./src/unenroll-to-clear-timer.ts ./tests/ --filter unenroll", + "test:active": "npx codemod jssg test -l typescript ./src/active-to-standard-timer.ts ./tests/ --filter active", + "test:unref": "npx codemod jssg test -l typescript ./src/unref-active-to-unref.ts ./tests/ --filter unref", + "test:imports": "npx codemod jssg test -l typescript ./src/cleanup-imports.ts ./tests/ --filter imports" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/userland-migrations.git", + "directory": "recipes/timers-deprecations", + "bugs": "https://github.com/nodejs/userland-migrations/issues" + }, + "author": "Augustin Mauroy", + "license": "MIT", + "homepage": "https://github.com/nodejs/userland-migrations/tree/main/recipes/timers-deprecations#readme", + "devDependencies": { + "@codemod.com/jssg-types": "^1.0.9" + }, + "dependencies": { + "@nodejs/codemod-utils": "*" + } +} diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts new file mode 100644 index 00000000..56f8ce87 --- /dev/null +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -0,0 +1,11 @@ +import type { SgRoot } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +/* + * todo: Remove usages of `timers.active()` in favor of public timer rescheduling helpers. + */ +export default function transform(root: SgRoot): string | null { + root.root(); + + return null; +} diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts new file mode 100644 index 00000000..16ab45d0 --- /dev/null +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -0,0 +1,11 @@ +import type { SgRoot } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +/* + * todo: Remove unused `node:timers` imports once the deprecated APIs are migrated. + */ +export default function transform(root: SgRoot): string | null { + root.root(); + + return null; +} diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts new file mode 100644 index 00000000..ad27da57 --- /dev/null +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -0,0 +1,11 @@ +import type { SgRoot } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +/* + * todo: Replace `timers.enroll()` with a `setTimeout()` handle stored on the resource. + */ +export default function transform(root: SgRoot): string | null { + root.root(); + + return null; +} diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts new file mode 100644 index 00000000..e165ae1e --- /dev/null +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -0,0 +1,11 @@ +import type { SgRoot } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +/* + * todo: Swap calls to `timers.unenroll()` with the appropriate `clearTimeout` / `clearInterval` usage. + */ +export default function transform(root: SgRoot): string | null { + root.root(); + + return null; +} diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts new file mode 100644 index 00000000..e8d5ffe0 --- /dev/null +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -0,0 +1,11 @@ +import type { SgRoot } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +/* + * todo: Replace `timers._unrefActive()` with an unref'ed `setTimeout()` handle. + */ +export default function transform(root: SgRoot): string | null { + root.root(); + + return null; +} diff --git a/recipes/timers-deprecations/tests/active/expected/basic.js b/recipes/timers-deprecations/tests/active/expected/basic.js new file mode 100644 index 00000000..dbfce297 --- /dev/null +++ b/recipes/timers-deprecations/tests/active/expected/basic.js @@ -0,0 +1,19 @@ +const timers = require("node:timers"); + +const resource = { + _idleTimeout: 500, + timeout: setTimeout(() => { }, 500), + _onTimeout() { + console.log("again"); + }, +}; + +if (resource.timeout != null) { + clearTimeout(resource.timeout); +} + +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, resource._idleTimeout); diff --git a/recipes/timers-deprecations/tests/active/expected/destructured.js b/recipes/timers-deprecations/tests/active/expected/destructured.js new file mode 100644 index 00000000..fd1991a5 --- /dev/null +++ b/recipes/timers-deprecations/tests/active/expected/destructured.js @@ -0,0 +1,19 @@ +const { active } = require("node:timers"); + +const handle = { + _idleTimeout: 750, + timeout: setTimeout(() => { }, 750), + _onTimeout() { + console.log("tick"); + }, +}; + +if (handle.timeout != null) { + clearTimeout(handle.timeout); +} + +handle.timeout = setTimeout(() => { + if (typeof handle._onTimeout === "function") { + handle._onTimeout(); + } +}, handle._idleTimeout); diff --git a/recipes/timers-deprecations/tests/active/input/basic.js b/recipes/timers-deprecations/tests/active/input/basic.js new file mode 100644 index 00000000..04d5897c --- /dev/null +++ b/recipes/timers-deprecations/tests/active/input/basic.js @@ -0,0 +1,11 @@ +const timers = require("node:timers"); + +const resource = { + _idleTimeout: 500, + timeout: setTimeout(() => { }, 500), + _onTimeout() { + console.log("again"); + }, +}; + +timers.active(resource); diff --git a/recipes/timers-deprecations/tests/active/input/destructured.js b/recipes/timers-deprecations/tests/active/input/destructured.js new file mode 100644 index 00000000..d6a51681 --- /dev/null +++ b/recipes/timers-deprecations/tests/active/input/destructured.js @@ -0,0 +1,11 @@ +const { active } = require("node:timers"); + +const handle = { + _idleTimeout: 750, + timeout: setTimeout(() => { }, 750), + _onTimeout() { + console.log("tick"); + }, +}; + +active(handle); diff --git a/recipes/timers-deprecations/tests/enroll/expected/basic.js b/recipes/timers-deprecations/tests/enroll/expected/basic.js new file mode 100644 index 00000000..7510abdc --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/expected/basic.js @@ -0,0 +1,14 @@ +const timers = require("node:timers"); + +const resource = { + _onTimeout() { + console.log("done"); + }, +}; + +resource._idleTimeout = 1000; +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/expected/destructured.js b/recipes/timers-deprecations/tests/enroll/expected/destructured.js new file mode 100644 index 00000000..2ff3d415 --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/expected/destructured.js @@ -0,0 +1,14 @@ +const { enroll } = require("node:timers"); + +const scope = { + _onTimeout() { + console.log("refresh"); + }, +}; + +scope._idleTimeout = 250; +scope.timeout = setTimeout(() => { + if (typeof scope._onTimeout === "function") { + scope._onTimeout(); + } +}, 250); diff --git a/recipes/timers-deprecations/tests/enroll/input/basic.js b/recipes/timers-deprecations/tests/enroll/input/basic.js new file mode 100644 index 00000000..05508c87 --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/input/basic.js @@ -0,0 +1,9 @@ +const timers = require("node:timers"); + +const resource = { + _onTimeout() { + console.log("done"); + }, +}; + +timers.enroll(resource, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/input/destructured.js b/recipes/timers-deprecations/tests/enroll/input/destructured.js new file mode 100644 index 00000000..62b134c3 --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/input/destructured.js @@ -0,0 +1,9 @@ +const { enroll } = require("node:timers"); + +const scope = { + _onTimeout() { + console.log("refresh"); + }, +}; + +enroll(scope, 250); diff --git a/recipes/timers-deprecations/tests/imports/expected/basic.js b/recipes/timers-deprecations/tests/imports/expected/basic.js new file mode 100644 index 00000000..dbf3e5f4 --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/expected/basic.js @@ -0,0 +1,17 @@ +const resource = { + _idleTimeout: 100, + timeout: setTimeout(() => { }, 100), + _onTimeout() { + console.log("cleanup"); + }, +}; + +if (resource.timeout != null) { + clearTimeout(resource.timeout); +} + +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, resource._idleTimeout); diff --git a/recipes/timers-deprecations/tests/imports/expected/named.js b/recipes/timers-deprecations/tests/imports/expected/named.js new file mode 100644 index 00000000..674b9638 --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/expected/named.js @@ -0,0 +1,6 @@ +function setup(resource) { + resource._idleTimeout = 42; + resource.timeout = setTimeout(() => { }, 42); +} + +setup({}); diff --git a/recipes/timers-deprecations/tests/imports/input/basic.js b/recipes/timers-deprecations/tests/imports/input/basic.js new file mode 100644 index 00000000..3387e713 --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/input/basic.js @@ -0,0 +1,19 @@ +import timers from "node:timers"; + +const resource = { + _idleTimeout: 100, + timeout: setTimeout(() => { }, 100), + _onTimeout() { + console.log("cleanup"); + }, +}; + +if (resource.timeout != null) { + clearTimeout(resource.timeout); +} + +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, resource._idleTimeout); diff --git a/recipes/timers-deprecations/tests/imports/input/named.js b/recipes/timers-deprecations/tests/imports/input/named.js new file mode 100644 index 00000000..8c0c76e1 --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/input/named.js @@ -0,0 +1,8 @@ +const { enroll, active } = require("node:timers"); + +function setup(resource) { + resource._idleTimeout = 42; + resource.timeout = setTimeout(() => { }, 42); +} + +setup({}); diff --git a/recipes/timers-deprecations/tests/unenroll/expected/basic.js b/recipes/timers-deprecations/tests/unenroll/expected/basic.js new file mode 100644 index 00000000..5cf62448 --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/expected/basic.js @@ -0,0 +1,8 @@ +const timers = require("node:timers"); + +const resource = { + timeout: setTimeout(() => { }, 1000), +}; + +clearTimeout(resource.timeout); +delete resource.timeout; diff --git a/recipes/timers-deprecations/tests/unenroll/expected/destructured.js b/recipes/timers-deprecations/tests/unenroll/expected/destructured.js new file mode 100644 index 00000000..a1f13e15 --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/expected/destructured.js @@ -0,0 +1,8 @@ +const { unenroll } = require("node:timers"); + +const queue = { + timeout: setTimeout(() => { }, 200), +}; + +clearTimeout(queue.timeout); +delete queue.timeout; diff --git a/recipes/timers-deprecations/tests/unenroll/input/basic.js b/recipes/timers-deprecations/tests/unenroll/input/basic.js new file mode 100644 index 00000000..e51a0d2e --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/input/basic.js @@ -0,0 +1,7 @@ +const timers = require("node:timers"); + +const resource = { + timeout: setTimeout(() => { }, 1000), +}; + +timers.unenroll(resource); diff --git a/recipes/timers-deprecations/tests/unenroll/input/destructured.js b/recipes/timers-deprecations/tests/unenroll/input/destructured.js new file mode 100644 index 00000000..01eda84d --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/input/destructured.js @@ -0,0 +1,7 @@ +const { unenroll } = require("node:timers"); + +const queue = { + timeout: setTimeout(() => { }, 200), +}; + +unenroll(queue); diff --git a/recipes/timers-deprecations/tests/unref/expected/basic.js b/recipes/timers-deprecations/tests/unref/expected/basic.js new file mode 100644 index 00000000..188d52b7 --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/expected/basic.js @@ -0,0 +1,20 @@ +const timers = require("node:timers"); + +const resource = { + _idleTimeout: 60, + timeout: setTimeout(() => { }, 60), + _onTimeout() { + console.log("cleanup"); + }, +}; + +if (resource.timeout != null) { + clearTimeout(resource.timeout); +} + +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, resource._idleTimeout); +resource.timeout.unref?.(); diff --git a/recipes/timers-deprecations/tests/unref/expected/destructured.js b/recipes/timers-deprecations/tests/unref/expected/destructured.js new file mode 100644 index 00000000..85a8cc76 --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/expected/destructured.js @@ -0,0 +1,20 @@ +const { _unrefActive } = require("node:timers"); + +const task = { + _idleTimeout: 90, + timeout: setTimeout(() => { }, 90), + _onTimeout() { + console.log("idle"); + }, +}; + +if (task.timeout != null) { + clearTimeout(task.timeout); +} + +task.timeout = setTimeout(() => { + if (typeof task._onTimeout === "function") { + task._onTimeout(); + } +}, task._idleTimeout); +task.timeout.unref?.(); diff --git a/recipes/timers-deprecations/tests/unref/input/basic.js b/recipes/timers-deprecations/tests/unref/input/basic.js new file mode 100644 index 00000000..1c48ca25 --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/input/basic.js @@ -0,0 +1,11 @@ +const timers = require("node:timers"); + +const resource = { + _idleTimeout: 60, + timeout: setTimeout(() => { }, 60), + _onTimeout() { + console.log("cleanup"); + }, +}; + +timers._unrefActive(resource); diff --git a/recipes/timers-deprecations/tests/unref/input/destructured.js b/recipes/timers-deprecations/tests/unref/input/destructured.js new file mode 100644 index 00000000..b1ec9493 --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/input/destructured.js @@ -0,0 +1,11 @@ +const { _unrefActive } = require("node:timers"); + +const task = { + _idleTimeout: 90, + timeout: setTimeout(() => { }, 90), + _onTimeout() { + console.log("idle"); + }, +}; + +_unrefActive(task); diff --git a/recipes/timers-deprecations/workflow.yaml b/recipes/timers-deprecations/workflow.yaml new file mode 100644 index 00000000..6c55e026 --- /dev/null +++ b/recipes/timers-deprecations/workflow.yaml @@ -0,0 +1,91 @@ +# 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 + runtime: + type: direct + steps: + - name: Replace `timers.enroll()` with `setTimeout()` + js-ast-grep: + js_file: src/enroll-to-set-timeout.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.cts" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript + - name: Replace `timers.unenroll()` with standard clear APIs + js-ast-grep: + js_file: src/unenroll-to-clear-timer.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.cts" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript + - name: Remove usages of `timers.active()` + js-ast-grep: + js_file: src/active-to-standard-timer.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.cts" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript + - name: Replace `timers._unrefActive()` with `setTimeout().unref()` + js-ast-grep: + js_file: src/unref-active-to-unref.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.cts" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript + - name: Clean up `node:timers` imports and requires + js-ast-grep: + js_file: src/cleanup-imports.ts + base_path: . + include: + - "**/*.cjs" + - "**/*.cts" + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript From 7409e1b2888c4b2b6c76b84b240a8080923f597f Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:46:12 +0100 Subject: [PATCH 02/11] update --- recipes/timers-deprecations/package.json | 4 +- .../src/active-to-standard-timer.ts | 75 +++++++- .../src/cleanup-imports.ts | 179 +++++++++++++++++- .../src/enroll-to-set-timeout.ts | 70 ++++++- recipes/timers-deprecations/src/shared.ts | 73 +++++++ .../src/unenroll-to-clear-timer.ts | 65 ++++++- .../src/unref-active-to-unref.ts | 76 +++++++- .../tests/enroll/expected/basic.js | 14 -- .../tests/enroll/expected/dep0095-basic.js | 14 ++ ...estructured.js => dep0095-destructured.js} | 0 .../input/{basic.js => dep0095-basic.js} | 6 +- ...estructured.js => dep0095-destructured.js} | 0 .../expected/{basic.js => dep0096-basic.js} | 0 ...estructured.js => dep0096-destructured.js} | 2 +- .../input/{basic.js => dep0096-basic.js} | 0 ...estructured.js => dep0096-destructured.js} | 2 +- 16 files changed, 529 insertions(+), 51 deletions(-) create mode 100644 recipes/timers-deprecations/src/shared.ts delete mode 100644 recipes/timers-deprecations/tests/enroll/expected/basic.js create mode 100644 recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js rename recipes/timers-deprecations/tests/enroll/expected/{destructured.js => dep0095-destructured.js} (100%) rename recipes/timers-deprecations/tests/enroll/input/{basic.js => dep0095-basic.js} (63%) rename recipes/timers-deprecations/tests/enroll/input/{destructured.js => dep0095-destructured.js} (100%) rename recipes/timers-deprecations/tests/unenroll/expected/{basic.js => dep0096-basic.js} (100%) rename recipes/timers-deprecations/tests/unenroll/expected/{destructured.js => dep0096-destructured.js} (74%) rename recipes/timers-deprecations/tests/unenroll/input/{basic.js => dep0096-basic.js} (100%) rename recipes/timers-deprecations/tests/unenroll/input/{destructured.js => dep0096-destructured.js} (66%) diff --git a/recipes/timers-deprecations/package.json b/recipes/timers-deprecations/package.json index 92784b03..19e2fd84 100644 --- a/recipes/timers-deprecations/package.json +++ b/recipes/timers-deprecations/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "test": "node --run test:enroll && node --run test:unenroll && node --run test:active && node --run test:unref && node --run test:imports", - "test:enroll": "npx codemod jssg test -l typescript ./src/enroll-to-set-timeout.ts ./tests/ --filter enroll", - "test:unenroll": "npx codemod jssg test -l typescript ./src/unenroll-to-clear-timer.ts ./tests/ --filter unenroll", + "test:enroll": "npx codemod jssg test -l typescript ./src/enroll-to-set-timeout.ts ./tests/ --filter dep0095", + "test:unenroll": "npx codemod jssg test -l typescript ./src/unenroll-to-clear-timer.ts ./tests/ --filter dep0096", "test:active": "npx codemod jssg test -l typescript ./src/active-to-standard-timer.ts ./tests/ --filter active", "test:unref": "npx codemod jssg test -l typescript ./src/unref-active-to-unref.ts ./tests/ --filter unref", "test:imports": "npx codemod jssg test -l typescript ./src/cleanup-imports.ts ./tests/ --filter imports" diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index 56f8ce87..3a37127d 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -1,11 +1,74 @@ -import type { SgRoot } from '@codemod.com/jssg-types/main'; +import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import { + detectIndentUnit, + findParentStatement, + getLineIndent, + isSafeResourceTarget, +} from './shared.ts'; +import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -/* - * todo: Remove usages of `timers.active()` in favor of public timer rescheduling helpers. - */ +const TARGET_METHOD = 'active'; + export default function transform(root: SgRoot): string | null { - root.root(); + const rootNode = root.root(); + const sourceCode = rootNode.text(); + const indentUnit = detectIndentUnit(sourceCode); + const edits: Edit[] = []; + const handledStatements = new Set(); + + const importNodes = [ + ...getNodeRequireCalls(root, 'timers'), + ...getNodeImportStatements(root, 'timers'), + ]; + + for (const importNode of importNodes) { + const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); + if (!bindingPath) continue; + + const matches = rootNode.findAll({ + rule: { + any: [ + { pattern: `${bindingPath}($RESOURCE)` }, + { pattern: `${bindingPath}($RESOURCE, $$$REST)` }, + ], + }, + }); + + for (const match of matches) { + const resourceNode = match.getMatch('RESOURCE'); + if (!resourceNode) continue; + + if (!isSafeResourceTarget(resourceNode)) continue; + + const statement = findParentStatement(match); + if (!statement) continue; + + if (handledStatements.has(statement.id())) continue; + handledStatements.add(statement.id()); + + const indent = getLineIndent(sourceCode, statement.range().start.index); + const resourceText = resourceNode.text(); + const childIndent = indent + indentUnit; + const innerIndent = childIndent + indentUnit; + + const replacement = + `${indent}if (${resourceText}.timeout != null) {\n` + + `${childIndent}clearTimeout(${resourceText}.timeout);\n` + + `${indent}}\n\n` + + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + + `${innerIndent}${resourceText}._onTimeout();\n` + + `${childIndent}}\n` + + `${indent}}, ${resourceText}._idleTimeout);`; + + edits.push(statement.replace(replacement)); + } + } + + if (!edits.length) return null; - return null; + return rootNode.commitEdits(edits); } diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts index 16ab45d0..54b8ed42 100644 --- a/recipes/timers-deprecations/src/cleanup-imports.ts +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -1,11 +1,178 @@ -import type { SgRoot } from '@codemod.com/jssg-types/main'; +import { + getNodeImportStatements, + getDefaultImportIdentifier, +} from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { + getNodeRequireCalls, + getRequireNamespaceIdentifier, +} from '@nodejs/codemod-utils/ast-grep/require-call'; +import { removeBinding } from '@nodejs/codemod-utils/ast-grep/remove-binding'; +import { removeLines } from '@nodejs/codemod-utils/ast-grep/remove-lines'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import type { Edit, Range, SgNode, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -/* - * todo: Remove unused `node:timers` imports once the deprecated APIs are migrated. - */ +const DEPRECATED_METHODS = [ + 'enroll', + 'unenroll', + 'active', + '_unrefActive', +] as const; +const DEPRECATED_SET = new Set(DEPRECATED_METHODS); + export default function transform(root: SgRoot): string | null { - root.root(); + const rootNode = root.root(); + const edits: Edit[] = []; + const linesToRemove: Range[] = []; + + const statements = [ + ...getNodeRequireCalls(root, 'timers'), + ...getNodeImportStatements(root, 'timers'), + ]; + + for (const statement of statements) { + if (shouldRemoveEntireStatement(statement)) { + linesToRemove.push(statement.range()); + continue; + } + + let statementMarkedForRemoval = false; + const removedBindings = new Set(); + + for (const method of DEPRECATED_METHODS) { + const bindingPath = resolveBindingPath(statement, `$.${method}`); + if (!bindingPath) continue; + + const localBinding = bindingPath.split('.').at(-1); + if (!localBinding || removedBindings.has(localBinding)) continue; + + if (isBindingStillUsed(rootNode, statement, localBinding)) continue; + + const removal = removeBinding(statement, localBinding); + if (!removal) continue; + + if (removal.edit) edits.push(removal.edit); + if (removal.lineToRemove) { + linesToRemove.push(removal.lineToRemove); + removedBindings.add(localBinding); + statementMarkedForRemoval = true; + break; + } + + removedBindings.add(localBinding); + } + + if (statementMarkedForRemoval) { + continue; + } + + const namespaceIdentifier = getNamespaceIdentifier(statement); + if (!namespaceIdentifier) continue; + + const nsName = namespaceIdentifier.text(); + if (removedBindings.has(nsName)) continue; + if (isBindingStillUsed(rootNode, statement, nsName)) continue; + + const removal = removeBinding(statement, nsName); + if (!removal) continue; + + if (removal.edit) edits.push(removal.edit); + if (removal.lineToRemove) linesToRemove.push(removal.lineToRemove); + } + + if (!edits.length && !linesToRemove.length) { + return null; + } + + let source = edits.length ? rootNode.commitEdits(edits) : rootNode.text(); + + if (linesToRemove.length) { + source = removeLines(source, linesToRemove); + } + + return source.replace(/^\s*\n/, ''); +} + +function isBindingStillUsed( + rootNode: SgNode, + statement: SgNode, + binding: string, +): boolean { + const occurrences = rootNode.findAll({ rule: { pattern: binding } }); + for (const occurrence of occurrences) { + if (isInsideNode(occurrence, statement)) continue; + return true; + } + return false; +} + +function isInsideNode(node: SgNode, container: SgNode): boolean { + for (const ancestor of node.ancestors()) { + if (ancestor.id() === container.id()) return true; + } + return false; +} + +function getNamespaceIdentifier(statement: SgNode): SgNode | null { + const requireIdent = getRequireNamespaceIdentifier(statement); + if (requireIdent) return requireIdent; + + const namespaceImport = statement.find({ + rule: { + kind: 'identifier', + inside: { kind: 'namespace_import' }, + }, + }); + if (namespaceImport) return namespaceImport; + + return getDefaultImportIdentifier(statement); +} + +function shouldRemoveEntireStatement(statement: SgNode): boolean { + const objectPattern = statement.find({ rule: { kind: 'object_pattern' } }); + if (objectPattern) { + const propertyNames = new Set(); + for (const shorthand of objectPattern.findAll({ + rule: { kind: 'shorthand_property_identifier_pattern' }, + })) { + propertyNames.add(shorthand.text()); + } + for (const pair of objectPattern.findAll({ rule: { kind: 'pair_pattern' } })) { + const property = pair.find({ rule: { kind: 'property_identifier' } }); + if (!property) return false; + propertyNames.add(property.text()); + } + if (!propertyNames.size) return false; + for (const name of propertyNames) { + if (!DEPRECATED_SET.has(name)) return false; + } + return true; + } + + const namedImports = statement.find({ rule: { kind: 'named_imports' } }); + if (!namedImports) return false; + + const importClause = statement.find({ rule: { kind: 'import_clause' } }); + if (!importClause) return false; + + if (importClause.find({ rule: { kind: 'namespace_import' } })) return false; + + const defaultImport = importClause.find({ + rule: { + kind: 'identifier', + not: { inside: { kind: 'named_imports' } }, + }, + }); + if (defaultImport) return false; + + let hasSpecifier = false; + for (const specifier of namedImports.findAll({ rule: { kind: 'import_specifier' } })) { + hasSpecifier = true; + const identifiers = specifier.findAll({ rule: { kind: 'identifier' } }); + if (!identifiers.length) return false; + const importedName = identifiers[0]?.text(); + if (!importedName || !DEPRECATED_SET.has(importedName)) return false; + } - return null; + return hasSpecifier; } diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index ad27da57..c1041558 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -1,11 +1,69 @@ -import type { SgRoot } from '@codemod.com/jssg-types/main'; +import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import { + detectIndentUnit, + findParentStatement, + getLineIndent, + isSafeResourceTarget, +} from './shared.ts'; +import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -/* - * todo: Replace `timers.enroll()` with a `setTimeout()` handle stored on the resource. - */ +const TARGET_METHOD = 'enroll'; + export default function transform(root: SgRoot): string | null { - root.root(); + const rootNode = root.root(); + const sourceCode = rootNode.text(); + const indentUnit = detectIndentUnit(sourceCode); + const edits: Edit[] = []; + const handledStatements = new Set(); + + const importNodes = [ + ...getNodeRequireCalls(root, 'timers'), + ...getNodeImportStatements(root, 'timers'), + ]; + + for (const importNode of importNodes) { + const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); + if (!bindingPath) continue; + + const matches = rootNode.findAll({ + rule: { pattern: `${bindingPath}($RESOURCE, $TIMEOUT)` }, + }); + + for (const match of matches) { + const resourceNode = match.getMatch('RESOURCE'); + const timeoutNode = match.getMatch('TIMEOUT'); + if (!resourceNode || !timeoutNode) continue; + + if (!isSafeResourceTarget(resourceNode)) continue; + + const statement = findParentStatement(match); + if (!statement) continue; + + if (handledStatements.has(statement.id())) continue; + handledStatements.add(statement.id()); + + const indent = getLineIndent(sourceCode, statement.range().start.index); + const resourceText = resourceNode.text(); + const timeoutText = timeoutNode.text(); + const childIndent = indent + indentUnit; + const innerIndent = childIndent + indentUnit; + + const replacement = + `${indent}${resourceText}._idleTimeout = ${timeoutText};\n` + + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + + `${innerIndent}${resourceText}._onTimeout();\n` + + `${childIndent}}\n` + + `${indent}}, ${timeoutText});`; + + edits.push(statement.replace(replacement)); + } + } + + if (!edits.length) return null; - return null; + return rootNode.commitEdits(edits); } diff --git a/recipes/timers-deprecations/src/shared.ts b/recipes/timers-deprecations/src/shared.ts new file mode 100644 index 00000000..d9476fe2 --- /dev/null +++ b/recipes/timers-deprecations/src/shared.ts @@ -0,0 +1,73 @@ +import type { SgNode } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +export function detectIndentUnit(source: string): string { + let tabIndent = ''; + const spaceIndents: number[] = []; + const lines = source.split(/\r?\n/); + + for (const line of lines) { + const match = line.match(/^(\s+)/); + if (!match) continue; + const leading = match[1]; + if (leading.includes('\t')) { + tabIndent = '\t'; + break; + } + spaceIndents.push(leading.length); + } + + if (tabIndent) return tabIndent; + if (!spaceIndents.length) return '\t'; + + const unit = spaceIndents.reduce((acc, len) => gcd(acc, len)); + return ' '.repeat(unit || spaceIndents[0]); +} + +export function getLineIndent(source: string, index: number): string { + let cursor = index; + while ( + cursor > 0 && + source[cursor - 1] !== '\n' && + source[cursor - 1] !== '\r' + ) { + cursor--; + } + + let indent = ''; + while (cursor < source.length) { + const char = source[cursor]; + if (char === ' ' || char === '\t') { + indent += char; + cursor++; + continue; + } + break; + } + + return indent; +} + +export function findParentStatement(node: SgNode): SgNode | null { + for (const ancestor of node.ancestors()) { + if (ancestor.kind() === 'expression_statement') { + return ancestor; + } + } + return null; +} + +export function isSafeResourceTarget(node: SgNode): boolean { + return node.is('identifier') || node.is('member_expression'); +} + +function gcd(a: number, b: number): number { + let x = Math.abs(a); + let y = Math.abs(b); + while (y !== 0) { + const temp = y; + y = x % y; + x = temp; + } + return x; +} diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index e165ae1e..23e56aec 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -1,11 +1,64 @@ -import type { SgRoot } from '@codemod.com/jssg-types/main'; +import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import { + findParentStatement, + getLineIndent, + isSafeResourceTarget, +} from './shared.ts'; +import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -/* - * todo: Swap calls to `timers.unenroll()` with the appropriate `clearTimeout` / `clearInterval` usage. - */ +const TARGET_METHOD = 'unenroll'; + export default function transform(root: SgRoot): string | null { - root.root(); + const rootNode = root.root(); + const sourceCode = rootNode.text(); + const edits: Edit[] = []; + const handledStatements = new Set(); + + const importNodes = [ + ...getNodeRequireCalls(root, 'timers'), + ...getNodeImportStatements(root, 'timers'), + ]; + + for (const importNode of importNodes) { + const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); + if (!bindingPath) continue; + + const matches = rootNode.findAll({ + rule: { + any: [ + { pattern: `${bindingPath}($RESOURCE)` }, + { pattern: `${bindingPath}($RESOURCE, $$$REST)` }, + ], + }, + }); + + for (const match of matches) { + const resourceNode = match.getMatch('RESOURCE'); + if (!resourceNode) continue; + + if (!isSafeResourceTarget(resourceNode)) continue; + + const statement = findParentStatement(match); + if (!statement) continue; + + if (handledStatements.has(statement.id())) continue; + handledStatements.add(statement.id()); + + const indent = getLineIndent(sourceCode, statement.range().start.index); + const resourceText = resourceNode.text(); + + const replacement = + `${indent}clearTimeout(${resourceText}.timeout);\n` + + `${indent}delete ${resourceText}.timeout;`; + + edits.push(statement.replace(replacement)); + } + } + + if (!edits.length) return null; - return null; + return rootNode.commitEdits(edits); } diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index e8d5ffe0..e4f5d660 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -1,11 +1,75 @@ -import type { SgRoot } from '@codemod.com/jssg-types/main'; +import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; +import { + detectIndentUnit, + findParentStatement, + getLineIndent, + isSafeResourceTarget, +} from './shared.ts'; +import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -/* - * todo: Replace `timers._unrefActive()` with an unref'ed `setTimeout()` handle. - */ +const TARGET_METHOD = '_unrefActive'; + export default function transform(root: SgRoot): string | null { - root.root(); + const rootNode = root.root(); + const sourceCode = rootNode.text(); + const indentUnit = detectIndentUnit(sourceCode); + const edits: Edit[] = []; + const handledStatements = new Set(); + + const importNodes = [ + ...getNodeRequireCalls(root, 'timers'), + ...getNodeImportStatements(root, 'timers'), + ]; + + for (const importNode of importNodes) { + const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); + if (!bindingPath) continue; + + const matches = rootNode.findAll({ + rule: { + any: [ + { pattern: `${bindingPath}($RESOURCE)` }, + { pattern: `${bindingPath}($RESOURCE, $$$REST)` }, + ], + }, + }); + + for (const match of matches) { + const resourceNode = match.getMatch('RESOURCE'); + if (!resourceNode) continue; + + if (!isSafeResourceTarget(resourceNode)) continue; + + const statement = findParentStatement(match); + if (!statement) continue; + + if (handledStatements.has(statement.id())) continue; + handledStatements.add(statement.id()); + + const indent = getLineIndent(sourceCode, statement.range().start.index); + const resourceText = resourceNode.text(); + const childIndent = indent + indentUnit; + const innerIndent = childIndent + indentUnit; + + const replacement = + `${indent}if (${resourceText}.timeout != null) {\n` + + `${childIndent}clearTimeout(${resourceText}.timeout);\n` + + `${indent}}\n\n` + + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + + `${innerIndent}${resourceText}._onTimeout();\n` + + `${childIndent}}\n` + + `${indent}}, ${resourceText}._idleTimeout);\n` + + `${indent}${resourceText}.timeout.unref?.();`; + + edits.push(statement.replace(replacement)); + } + } + + if (!edits.length) return null; - return null; + return rootNode.commitEdits(edits); } diff --git a/recipes/timers-deprecations/tests/enroll/expected/basic.js b/recipes/timers-deprecations/tests/enroll/expected/basic.js deleted file mode 100644 index 7510abdc..00000000 --- a/recipes/timers-deprecations/tests/enroll/expected/basic.js +++ /dev/null @@ -1,14 +0,0 @@ -const timers = require("node:timers"); - -const resource = { - _onTimeout() { - console.log("done"); - }, -}; - -resource._idleTimeout = 1000; -resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } -}, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js b/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js new file mode 100644 index 00000000..ba2f6769 --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js @@ -0,0 +1,14 @@ +const timers = require("node:timers"); + +const resource = { + _onTimeout() { + console.log("done"); + }, +}; + +resource._idleTimeout = 1000; +resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } +}, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/expected/destructured.js b/recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js similarity index 100% rename from recipes/timers-deprecations/tests/enroll/expected/destructured.js rename to recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js diff --git a/recipes/timers-deprecations/tests/enroll/input/basic.js b/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js similarity index 63% rename from recipes/timers-deprecations/tests/enroll/input/basic.js rename to recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js index 05508c87..ce38c43b 100644 --- a/recipes/timers-deprecations/tests/enroll/input/basic.js +++ b/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js @@ -1,9 +1,9 @@ const timers = require("node:timers"); const resource = { - _onTimeout() { - console.log("done"); - }, + _onTimeout() { + console.log("done"); + }, }; timers.enroll(resource, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/input/destructured.js b/recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js similarity index 100% rename from recipes/timers-deprecations/tests/enroll/input/destructured.js rename to recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js diff --git a/recipes/timers-deprecations/tests/unenroll/expected/basic.js b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-basic.js similarity index 100% rename from recipes/timers-deprecations/tests/unenroll/expected/basic.js rename to recipes/timers-deprecations/tests/unenroll/expected/dep0096-basic.js diff --git a/recipes/timers-deprecations/tests/unenroll/expected/destructured.js b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-destructured.js similarity index 74% rename from recipes/timers-deprecations/tests/unenroll/expected/destructured.js rename to recipes/timers-deprecations/tests/unenroll/expected/dep0096-destructured.js index a1f13e15..edbefa3f 100644 --- a/recipes/timers-deprecations/tests/unenroll/expected/destructured.js +++ b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-destructured.js @@ -1,7 +1,7 @@ const { unenroll } = require("node:timers"); const queue = { - timeout: setTimeout(() => { }, 200), + timeout: setTimeout(() => { }, 200), }; clearTimeout(queue.timeout); diff --git a/recipes/timers-deprecations/tests/unenroll/input/basic.js b/recipes/timers-deprecations/tests/unenroll/input/dep0096-basic.js similarity index 100% rename from recipes/timers-deprecations/tests/unenroll/input/basic.js rename to recipes/timers-deprecations/tests/unenroll/input/dep0096-basic.js diff --git a/recipes/timers-deprecations/tests/unenroll/input/destructured.js b/recipes/timers-deprecations/tests/unenroll/input/dep0096-destructured.js similarity index 66% rename from recipes/timers-deprecations/tests/unenroll/input/destructured.js rename to recipes/timers-deprecations/tests/unenroll/input/dep0096-destructured.js index 01eda84d..52652231 100644 --- a/recipes/timers-deprecations/tests/unenroll/input/destructured.js +++ b/recipes/timers-deprecations/tests/unenroll/input/dep0096-destructured.js @@ -1,7 +1,7 @@ const { unenroll } = require("node:timers"); const queue = { - timeout: setTimeout(() => { }, 200), + timeout: setTimeout(() => { }, 200), }; unenroll(queue); From b679ff58917fb44c2e20a242971e8cb7c576e25f Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Wed, 29 Oct 2025 23:46:45 +0100 Subject: [PATCH 03/11] Update cleanup-imports.ts --- recipes/timers-deprecations/src/cleanup-imports.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts index 54b8ed42..6327bb28 100644 --- a/recipes/timers-deprecations/src/cleanup-imports.ts +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -137,7 +137,9 @@ function shouldRemoveEntireStatement(statement: SgNode): boolean { })) { propertyNames.add(shorthand.text()); } - for (const pair of objectPattern.findAll({ rule: { kind: 'pair_pattern' } })) { + for (const pair of objectPattern.findAll({ + rule: { kind: 'pair_pattern' }, + })) { const property = pair.find({ rule: { kind: 'property_identifier' } }); if (!property) return false; propertyNames.add(property.text()); @@ -166,7 +168,9 @@ function shouldRemoveEntireStatement(statement: SgNode): boolean { if (defaultImport) return false; let hasSpecifier = false; - for (const specifier of namedImports.findAll({ rule: { kind: 'import_specifier' } })) { + for (const specifier of namedImports.findAll({ + rule: { kind: 'import_specifier' }, + })) { hasSpecifier = true; const identifiers = specifier.findAll({ rule: { kind: 'identifier' } }); if (!identifiers.length) return false; From a88c1c4330dd6bf1deb29727bf1a8f2148ca3704 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:38:17 +0100 Subject: [PATCH 04/11] update and add more case --- .../src/active-to-standard-timer.ts | 9 +- .../src/cleanup-imports.ts | 14 +++ .../src/enroll-to-set-timeout.ts | 9 +- .../src/unenroll-to-clear-timer.ts | 9 +- .../src/unref-active-to-unref.ts | 9 +- .../active/expected/active_import-variants.js | 92 +++++++++++++++++ .../active/input/active_import-variants.js | 36 +++++++ .../tests/enroll/expected/dep0095-basic.js | 12 +-- .../enroll/expected/dep0095-destructured.js | 12 +-- .../expected/dep0095-import-variants.js | 75 ++++++++++++++ .../tests/enroll/input/dep0095-basic.js | 6 +- .../enroll/input/dep0095-destructured.js | 6 +- .../enroll/input/dep0095-import-variants.js | 40 ++++++++ .../tests/imports/expected/imports_dynamic.js | 39 ++++++++ .../tests/imports/input/imports_dynamic.js | 41 ++++++++ .../expected/dep0096-import-variants.js | 43 ++++++++ .../unenroll/input/dep0096-import-variants.js | 36 +++++++ .../unref/expected/unref_import-variants.js | 99 +++++++++++++++++++ .../unref/input/unref_import-variants.js | 36 +++++++ 19 files changed, 597 insertions(+), 26 deletions(-) create mode 100644 recipes/timers-deprecations/tests/active/expected/active_import-variants.js create mode 100644 recipes/timers-deprecations/tests/active/input/active_import-variants.js create mode 100644 recipes/timers-deprecations/tests/enroll/expected/dep0095-import-variants.js create mode 100644 recipes/timers-deprecations/tests/enroll/input/dep0095-import-variants.js create mode 100644 recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js create mode 100644 recipes/timers-deprecations/tests/imports/input/imports_dynamic.js create mode 100644 recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js create mode 100644 recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js create mode 100644 recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js create mode 100644 recipes/timers-deprecations/tests/unref/input/unref_import-variants.js diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index 3a37127d..a10f6b62 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -1,4 +1,7 @@ -import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { + getNodeImportStatements, + getNodeImportCalls, +} from '@nodejs/codemod-utils/ast-grep/import-statement'; import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { @@ -22,9 +25,11 @@ export default function transform(root: SgRoot): string | null { const importNodes = [ ...getNodeRequireCalls(root, 'timers'), ...getNodeImportStatements(root, 'timers'), + ...getNodeImportCalls(root, 'timers'), ]; for (const importNode of importNodes) { + if (importNode.kind() === 'expression_statement') continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -55,7 +60,7 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `${indent}if (${resourceText}.timeout != null) {\n` + + `if (${resourceText}.timeout != null) {\n` + `${childIndent}clearTimeout(${resourceText}.timeout);\n` + `${indent}}\n\n` + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts index 6327bb28..ab5563e1 100644 --- a/recipes/timers-deprecations/src/cleanup-imports.ts +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -1,6 +1,7 @@ import { getNodeImportStatements, getDefaultImportIdentifier, + getNodeImportCalls, } from '@nodejs/codemod-utils/ast-grep/import-statement'; import { getNodeRequireCalls, @@ -28,9 +29,13 @@ export default function transform(root: SgRoot): string | null { const statements = [ ...getNodeRequireCalls(root, 'timers'), ...getNodeImportStatements(root, 'timers'), + ...getNodeImportCalls(root, 'timers'), ]; for (const statement of statements) { + if (statement.kind() === 'expression_statement') { + continue; + } if (shouldRemoveEntireStatement(statement)) { linesToRemove.push(statement.range()); continue; @@ -125,6 +130,15 @@ function getNamespaceIdentifier(statement: SgNode): SgNode | null { }); if (namespaceImport) return namespaceImport; + const dynamicImportIdentifier = statement.find({ + rule: { + kind: 'identifier', + inside: { kind: 'variable_declarator' }, + not: { inside: { kind: 'object_pattern' } }, + }, + }); + if (dynamicImportIdentifier) return dynamicImportIdentifier; + return getDefaultImportIdentifier(statement); } diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index c1041558..d46ee63b 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -1,4 +1,7 @@ -import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { + getNodeImportStatements, + getNodeImportCalls, +} from '@nodejs/codemod-utils/ast-grep/import-statement'; import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { @@ -22,9 +25,11 @@ export default function transform(root: SgRoot): string | null { const importNodes = [ ...getNodeRequireCalls(root, 'timers'), ...getNodeImportStatements(root, 'timers'), + ...getNodeImportCalls(root, 'timers'), ]; for (const importNode of importNodes) { + if (importNode.kind() === 'expression_statement') continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -52,7 +57,7 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `${indent}${resourceText}._idleTimeout = ${timeoutText};\n` + + `${resourceText}._idleTimeout = ${timeoutText};\n` + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + `${innerIndent}${resourceText}._onTimeout();\n` + diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index 23e56aec..69104b80 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -1,4 +1,7 @@ -import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { + getNodeImportStatements, + getNodeImportCalls, +} from '@nodejs/codemod-utils/ast-grep/import-statement'; import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { @@ -20,9 +23,11 @@ export default function transform(root: SgRoot): string | null { const importNodes = [ ...getNodeRequireCalls(root, 'timers'), ...getNodeImportStatements(root, 'timers'), + ...getNodeImportCalls(root, 'timers'), ]; for (const importNode of importNodes) { + if (importNode.kind() === 'expression_statement') continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -51,7 +56,7 @@ export default function transform(root: SgRoot): string | null { const resourceText = resourceNode.text(); const replacement = - `${indent}clearTimeout(${resourceText}.timeout);\n` + + `clearTimeout(${resourceText}.timeout);\n` + `${indent}delete ${resourceText}.timeout;`; edits.push(statement.replace(replacement)); diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index e4f5d660..456b5aca 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -1,4 +1,7 @@ -import { getNodeImportStatements } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { + getNodeImportStatements, + getNodeImportCalls, +} from '@nodejs/codemod-utils/ast-grep/import-statement'; import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { @@ -22,9 +25,11 @@ export default function transform(root: SgRoot): string | null { const importNodes = [ ...getNodeRequireCalls(root, 'timers'), ...getNodeImportStatements(root, 'timers'), + ...getNodeImportCalls(root, 'timers'), ]; for (const importNode of importNodes) { + if (importNode.kind() === 'expression_statement') continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -55,7 +60,7 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `${indent}if (${resourceText}.timeout != null) {\n` + + `if (${resourceText}.timeout != null) {\n` + `${childIndent}clearTimeout(${resourceText}.timeout);\n` + `${indent}}\n\n` + `${indent}${resourceText}.timeout = setTimeout(() => {\n` + diff --git a/recipes/timers-deprecations/tests/active/expected/active_import-variants.js b/recipes/timers-deprecations/tests/active/expected/active_import-variants.js new file mode 100644 index 00000000..8e69f9ac --- /dev/null +++ b/recipes/timers-deprecations/tests/active/expected/active_import-variants.js @@ -0,0 +1,92 @@ +const timersNamespace = require("node:timers"); +const { active: activeAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { active as markActive } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } + + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); +} + +function fromCjsAlias(resource) { + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } + + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); +} + +function fromEsmDefault(resource) { + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } + + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); +} + +function fromEsmNamed(resource) { + if (resource.item.timeout != null) { + clearTimeout(resource.item.timeout); + } + + resource.item.timeout = setTimeout(() => { + if (typeof resource.item._onTimeout === "function") { + resource.item._onTimeout(); + } + }, resource.item._idleTimeout); +} + +function fromEsmNamespace(resource) { + if (resource.node.timeout != null) { + clearTimeout(resource.node.timeout); + } + + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, resource.node._idleTimeout); +} + +async function fromDynamic(resource) { + const { active } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } + + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); +} + +async function fromDynamicAlias(resource) { + const { active: activateDynamic } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } + + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); +} diff --git a/recipes/timers-deprecations/tests/active/input/active_import-variants.js b/recipes/timers-deprecations/tests/active/input/active_import-variants.js new file mode 100644 index 00000000..3c179a3a --- /dev/null +++ b/recipes/timers-deprecations/tests/active/input/active_import-variants.js @@ -0,0 +1,36 @@ +const timersNamespace = require("node:timers"); +const { active: activeAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { active as markActive } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + timersNamespace.active(resource.target); +} + +function fromCjsAlias(resource) { + activeAlias(resource.target); +} + +function fromEsmDefault(resource) { + timersDefault.active(resource); +} + +function fromEsmNamed(resource) { + markActive(resource.item); +} + +function fromEsmNamespace(resource) { + timersESMNamespace.active(resource.node); +} + +async function fromDynamic(resource) { + const { active } = await import("node:timers"); + active(resource.session); +} + +async function fromDynamicAlias(resource) { + const { active: activateDynamic } = await import("node:timers"); + activateDynamic(resource.session); +} diff --git a/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js b/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js index ba2f6769..7510abdc 100644 --- a/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js +++ b/recipes/timers-deprecations/tests/enroll/expected/dep0095-basic.js @@ -1,14 +1,14 @@ const timers = require("node:timers"); const resource = { - _onTimeout() { - console.log("done"); - }, + _onTimeout() { + console.log("done"); + }, }; resource._idleTimeout = 1000; resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } }, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js b/recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js index 2ff3d415..39cc0a20 100644 --- a/recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js +++ b/recipes/timers-deprecations/tests/enroll/expected/dep0095-destructured.js @@ -1,14 +1,14 @@ const { enroll } = require("node:timers"); const scope = { - _onTimeout() { - console.log("refresh"); - }, + _onTimeout() { + console.log("refresh"); + }, }; scope._idleTimeout = 250; scope.timeout = setTimeout(() => { - if (typeof scope._onTimeout === "function") { - scope._onTimeout(); - } + if (typeof scope._onTimeout === "function") { + scope._onTimeout(); + } }, 250); diff --git a/recipes/timers-deprecations/tests/enroll/expected/dep0095-import-variants.js b/recipes/timers-deprecations/tests/enroll/expected/dep0095-import-variants.js new file mode 100644 index 00000000..f94fc98e --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/expected/dep0095-import-variants.js @@ -0,0 +1,75 @@ +const timersNamespace = require("node:timers"); +const { enroll: enrollAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { enroll as enrollRenamed } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + resource.target._idleTimeout = resource.delay; + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.delay); +} + +function fromCjsAlias(resource) { + resource.target._idleTimeout = resource.delay + 5; + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.delay + 5); +} + +function fromEsmDefault(resource) { + resource._idleTimeout = 100; + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, 100); +} + +function fromEsmNamed(resource) { + resource._idleTimeout = getDelay(); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, getDelay()); +} + +function fromEsmNamespace(resource) { + resource.item._idleTimeout = resource.timeout; + resource.item.timeout = setTimeout(() => { + if (typeof resource.item._onTimeout === "function") { + resource.item._onTimeout(); + } + }, resource.timeout); +} + +async function fromDynamic(resource) { + const { enroll } = await import("node:timers"); + resource.node._idleTimeout = resource.delay; + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, resource.delay); +} + +async function fromDynamicAlias(resource) { + const { enroll: load } = await import("node:timers"); + resource.node._idleTimeout = 50; + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, 50); +} + +function getDelay() { + return 300; +} diff --git a/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js b/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js index ce38c43b..05508c87 100644 --- a/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js +++ b/recipes/timers-deprecations/tests/enroll/input/dep0095-basic.js @@ -1,9 +1,9 @@ const timers = require("node:timers"); const resource = { - _onTimeout() { - console.log("done"); - }, + _onTimeout() { + console.log("done"); + }, }; timers.enroll(resource, 1000); diff --git a/recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js b/recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js index 62b134c3..e4ae6657 100644 --- a/recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js +++ b/recipes/timers-deprecations/tests/enroll/input/dep0095-destructured.js @@ -1,9 +1,9 @@ const { enroll } = require("node:timers"); const scope = { - _onTimeout() { - console.log("refresh"); - }, + _onTimeout() { + console.log("refresh"); + }, }; enroll(scope, 250); diff --git a/recipes/timers-deprecations/tests/enroll/input/dep0095-import-variants.js b/recipes/timers-deprecations/tests/enroll/input/dep0095-import-variants.js new file mode 100644 index 00000000..7894f561 --- /dev/null +++ b/recipes/timers-deprecations/tests/enroll/input/dep0095-import-variants.js @@ -0,0 +1,40 @@ +const timersNamespace = require("node:timers"); +const { enroll: enrollAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { enroll as enrollRenamed } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + timersNamespace.enroll(resource.target, resource.delay); +} + +function fromCjsAlias(resource) { + enrollAlias(resource.target, resource.delay + 5); +} + +function fromEsmDefault(resource) { + timersDefault.enroll(resource, 100); +} + +function fromEsmNamed(resource) { + enrollRenamed(resource, getDelay()); +} + +function fromEsmNamespace(resource) { + timersESMNamespace.enroll(resource.item, resource.timeout); +} + +async function fromDynamic(resource) { + const { enroll } = await import("node:timers"); + enroll(resource.node, resource.delay); +} + +async function fromDynamicAlias(resource) { + const { enroll: load } = await import("node:timers"); + load(resource.node, 50); +} + +function getDelay() { + return 300; +} diff --git a/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js b/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js new file mode 100644 index 00000000..8abc284f --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js @@ -0,0 +1,39 @@ +async function cleanupEnroll(resource) { + resource._idleTimeout = resource.delay; + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource.delay); +} + +async function cleanupAlias(resource) { + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } + + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); +} + +async function cleanupDefault(resource) { + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); +} + +async function preserveNamespace(resource) { + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + return timersModule; +} diff --git a/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js b/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js new file mode 100644 index 00000000..c078a18d --- /dev/null +++ b/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js @@ -0,0 +1,41 @@ +async function cleanupEnroll(resource) { + const { enroll } = await import("node:timers"); + resource._idleTimeout = resource.delay; + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource.delay); +} + +async function cleanupAlias(resource) { + const { active: activate } = await import("node:timers"); + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } + + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); +} + +async function cleanupDefault(resource) { + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); +} + +async function preserveNamespace(resource) { + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + return timersModule; +} diff --git a/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js new file mode 100644 index 00000000..8406a392 --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js @@ -0,0 +1,43 @@ +const timersNamespace = require("node:timers"); +const { unenroll: cancelAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { unenroll as release } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + clearTimeout(resource.target.timeout); + delete resource.target.timeout; +} + +function fromCjsAlias(resource) { + clearTimeout(resource.target.timeout); + delete resource.target.timeout; +} + +function fromEsmDefault(resource) { + clearTimeout(resource.timeout); + delete resource.timeout; +} + +function fromEsmNamed(resource) { + clearTimeout(resource.item.timeout); + delete resource.item.timeout; +} + +function fromEsmNamespace(resource) { + clearTimeout(resource.node.timeout); + delete resource.node.timeout; +} + +async function fromDynamic(resource) { + const { unenroll } = await import("node:timers"); + clearTimeout(resource.session.timeout); + delete resource.session.timeout; +} + +async function fromDynamicAlias(resource) { + const { unenroll: cancel } = await import("node:timers"); + clearTimeout(resource.session.timeout); + delete resource.session.timeout; +} diff --git a/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js b/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js new file mode 100644 index 00000000..44c55a43 --- /dev/null +++ b/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js @@ -0,0 +1,36 @@ +const timersNamespace = require("node:timers"); +const { unenroll: cancelAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { unenroll as release } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + timersNamespace.unenroll(resource.target); +} + +function fromCjsAlias(resource) { + cancelAlias(resource.target); +} + +function fromEsmDefault(resource) { + timersDefault.unenroll(resource); +} + +function fromEsmNamed(resource) { + release(resource.item); +} + +function fromEsmNamespace(resource) { + timersESMNamespace.unenroll(resource.node); +} + +async function fromDynamic(resource) { + const { unenroll } = await import("node:timers"); + unenroll(resource.session); +} + +async function fromDynamicAlias(resource) { + const { unenroll: cancel } = await import("node:timers"); + cancel(resource.session); +} diff --git a/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js b/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js new file mode 100644 index 00000000..b8c0c4fd --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js @@ -0,0 +1,99 @@ +const timersNamespace = require("node:timers"); +const { _unrefActive: unrefAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { _unrefActive as unref } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } + + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); + resource.target.timeout.unref?.(); +} + +function fromCjsAlias(resource) { + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } + + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); + resource.target.timeout.unref?.(); +} + +function fromEsmDefault(resource) { + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } + + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + resource.timeout.unref?.(); +} + +function fromEsmNamed(resource) { + if (resource.item.timeout != null) { + clearTimeout(resource.item.timeout); + } + + resource.item.timeout = setTimeout(() => { + if (typeof resource.item._onTimeout === "function") { + resource.item._onTimeout(); + } + }, resource.item._idleTimeout); + resource.item.timeout.unref?.(); +} + +function fromEsmNamespace(resource) { + if (resource.node.timeout != null) { + clearTimeout(resource.node.timeout); + } + + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, resource.node._idleTimeout); + resource.node.timeout.unref?.(); +} + +async function fromDynamic(resource) { + const { _unrefActive } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } + + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); + resource.session.timeout.unref?.(); +} + +async function fromDynamicAlias(resource) { + const { _unrefActive: unrefDynamic } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } + + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); + resource.session.timeout.unref?.(); +} diff --git a/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js b/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js new file mode 100644 index 00000000..d9f4aad8 --- /dev/null +++ b/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js @@ -0,0 +1,36 @@ +const timersNamespace = require("node:timers"); +const { _unrefActive: unrefAlias } = require("node:timers"); + +import timersDefault from "node:timers"; +import { _unrefActive as unref } from "node:timers"; +import * as timersESMNamespace from "node:timers"; + +async function fromNamespace(resource) { + timersNamespace._unrefActive(resource.target); +} + +function fromCjsAlias(resource) { + unrefAlias(resource.target); +} + +function fromEsmDefault(resource) { + timersDefault._unrefActive(resource); +} + +function fromEsmNamed(resource) { + unref(resource.item); +} + +function fromEsmNamespace(resource) { + timersESMNamespace._unrefActive(resource.node); +} + +async function fromDynamic(resource) { + const { _unrefActive } = await import("node:timers"); + _unrefActive(resource.session); +} + +async function fromDynamicAlias(resource) { + const { _unrefActive: unrefDynamic } = await import("node:timers"); + unrefDynamic(resource.session); +} From b5635b5193bb7c91934582e107dcc593f7aec6d9 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Fri, 31 Oct 2025 14:35:21 +0100 Subject: [PATCH 05/11] fix: support of windows --- .../src/active-to-standard-timer.ts | 15 ++++++++------- .../src/enroll-to-set-timeout.ts | 11 ++++++----- .../src/unenroll-to-clear-timer.ts | 3 ++- .../src/unref-active-to-unref.ts | 17 +++++++++-------- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index a10f6b62..6e7235c9 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -1,3 +1,4 @@ +import { EOL } from 'node:os'; import { getNodeImportStatements, getNodeImportCalls, @@ -60,13 +61,13 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `if (${resourceText}.timeout != null) {\n` + - `${childIndent}clearTimeout(${resourceText}.timeout);\n` + - `${indent}}\n\n` + - `${indent}${resourceText}.timeout = setTimeout(() => {\n` + - `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + - `${innerIndent}${resourceText}._onTimeout();\n` + - `${childIndent}}\n` + + `if (${resourceText}.timeout != null) {${EOL}` + + `${childIndent}clearTimeout(${resourceText}.timeout);${EOL}` + + `${indent}}${EOL}${EOL}` + + `${indent}${resourceText}.timeout = setTimeout(() => {${EOL}` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {${EOL}` + + `${innerIndent}${resourceText}._onTimeout();${EOL}` + + `${childIndent}}${EOL}` + `${indent}}, ${resourceText}._idleTimeout);`; edits.push(statement.replace(replacement)); diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index d46ee63b..8fa1462a 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -1,3 +1,4 @@ +import { EOL } from 'node:os'; import { getNodeImportStatements, getNodeImportCalls, @@ -57,11 +58,11 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `${resourceText}._idleTimeout = ${timeoutText};\n` + - `${indent}${resourceText}.timeout = setTimeout(() => {\n` + - `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + - `${innerIndent}${resourceText}._onTimeout();\n` + - `${childIndent}}\n` + + `${resourceText}._idleTimeout = ${timeoutText};${EOL}` + + `${indent}${resourceText}.timeout = setTimeout(() => {${EOL}` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {${EOL}` + + `${innerIndent}${resourceText}._onTimeout();${EOL}` + + `${childIndent}}${EOL}` + `${indent}}, ${timeoutText});`; edits.push(statement.replace(replacement)); diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index 69104b80..f40090b3 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -1,3 +1,4 @@ +import { EOL } from 'node:os'; import { getNodeImportStatements, getNodeImportCalls, @@ -56,7 +57,7 @@ export default function transform(root: SgRoot): string | null { const resourceText = resourceNode.text(); const replacement = - `clearTimeout(${resourceText}.timeout);\n` + + `clearTimeout(${resourceText}.timeout);${EOL}` + `${indent}delete ${resourceText}.timeout;`; edits.push(statement.replace(replacement)); diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index 456b5aca..7de55f2c 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -1,3 +1,4 @@ +import { EOL } from 'node:os'; import { getNodeImportStatements, getNodeImportCalls, @@ -60,14 +61,14 @@ export default function transform(root: SgRoot): string | null { const innerIndent = childIndent + indentUnit; const replacement = - `if (${resourceText}.timeout != null) {\n` + - `${childIndent}clearTimeout(${resourceText}.timeout);\n` + - `${indent}}\n\n` + - `${indent}${resourceText}.timeout = setTimeout(() => {\n` + - `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {\n` + - `${innerIndent}${resourceText}._onTimeout();\n` + - `${childIndent}}\n` + - `${indent}}, ${resourceText}._idleTimeout);\n` + + `if (${resourceText}.timeout != null) {${EOL}` + + `${childIndent}clearTimeout(${resourceText}.timeout);${EOL}` + + `${indent}}${EOL}${EOL}` + + `${indent}${resourceText}.timeout = setTimeout(() => {${EOL}` + + `${childIndent}if (typeof ${resourceText}._onTimeout === "function") {${EOL}` + + `${innerIndent}${resourceText}._onTimeout();${EOL}` + + `${childIndent}}${EOL}` + + `${indent}}, ${resourceText}._idleTimeout);${EOL}` + `${indent}${resourceText}.timeout.unref?.();`; edits.push(statement.replace(replacement)); From bfc9b187c056ab9ec0e661ed40acb601e31a12c2 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:08:45 +0100 Subject: [PATCH 06/11] split utility --- .../src/active-to-standard-timer.ts | 8 +- .../src/enroll-to-set-timeout.ts | 8 +- .../src/unenroll-to-clear-timer.ts | 4 +- .../src/unref-active-to-unref.ts | 8 +- utils/src/ast-grep/general.test.ts | 61 +++++++++++++ utils/src/ast-grep/general.ts | 15 ++++ utils/src/ast-grep/indent.test.ts | 89 +++++++++++++++++++ .../shared.ts => utils/src/ast-grep/indent.ts | 27 +----- utils/src/math.test.ts | 32 +++++++ utils/src/math.ts | 14 +++ 10 files changed, 229 insertions(+), 37 deletions(-) create mode 100644 utils/src/ast-grep/general.test.ts create mode 100644 utils/src/ast-grep/general.ts create mode 100644 utils/src/ast-grep/indent.test.ts rename recipes/timers-deprecations/src/shared.ts => utils/src/ast-grep/indent.ts (60%) create mode 100644 utils/src/math.test.ts create mode 100644 utils/src/math.ts diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index 6e7235c9..70434da5 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -6,11 +6,13 @@ import { import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { - detectIndentUnit, findParentStatement, - getLineIndent, isSafeResourceTarget, -} from './shared.ts'; +} from '@nodejs/codemod-utils/ast-grep/general'; +import { + detectIndentUnit, + getLineIndent, +} from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index 8fa1462a..3676f18b 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -6,11 +6,13 @@ import { import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { - detectIndentUnit, findParentStatement, - getLineIndent, isSafeResourceTarget, -} from './shared.ts'; +} from '@nodejs/codemod-utils/ast-grep/general'; +import { + detectIndentUnit, + getLineIndent, +} from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index f40090b3..071c9a61 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -7,9 +7,9 @@ import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { findParentStatement, - getLineIndent, isSafeResourceTarget, -} from './shared.ts'; +} from '@nodejs/codemod-utils/ast-grep/general'; +import { getLineIndent } from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index 7de55f2c..cdd71fbb 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -6,11 +6,13 @@ import { import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; import { - detectIndentUnit, findParentStatement, - getLineIndent, isSafeResourceTarget, -} from './shared.ts'; +} from '@nodejs/codemod-utils/ast-grep/general'; +import { + detectIndentUnit, + getLineIndent, +} from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; diff --git a/utils/src/ast-grep/general.test.ts b/utils/src/ast-grep/general.test.ts new file mode 100644 index 00000000..fa09f195 --- /dev/null +++ b/utils/src/ast-grep/general.test.ts @@ -0,0 +1,61 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import astGrep from '@ast-grep/napi'; +import { findParentStatement, isSafeResourceTarget } from './general.ts'; // ts ext is needed + +describe('findParentStatement', () => { + it('should find the parent expression_statement', () => { + const code = 'function test() { x + 1; }'; + const root = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = root.root().find({ + rule: { kind: 'binary_expression' }, + }); + + const parentStatement = findParentStatement(node); + assert.ok(parentStatement); + assert.strictEqual(parentStatement?.kind(), 'expression_statement'); + }); + + it('should return null if no parent statement is found', () => { + const code = 'const x = 5;'; + const root = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = root.root().find({ + rule: { kind: 'identifier' }, + }); + + const parentStatement = findParentStatement(node); + assert.strictEqual(parentStatement, null); + }); +}); + +describe('isSafeResourceTarget', () => { + it('should return true for an identifier', () => { + const code = 'function test() { const x = 5; }'; + const root = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = root.root().find({ + rule: { kind: 'identifier' }, + }); + + assert.strictEqual(isSafeResourceTarget(node), true); + }); + + it('should return true for a member_expression', () => { + const code = 'function test() { obj.prop = 5; }'; + const root = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = root.root().find({ + rule: { kind: 'member_expression' }, + }); + + assert.strictEqual(isSafeResourceTarget(node), true); + }); + + it('should return false for other node types', () => { + const code = 'function test() { 5 + 3; }'; + const root = astGrep.parse(astGrep.Lang.JavaScript, code); + const node = root.root().find({ + rule: { kind: 'binary_expression' }, + }); + + assert.strictEqual(isSafeResourceTarget(node), false); + }); +}); diff --git a/utils/src/ast-grep/general.ts b/utils/src/ast-grep/general.ts new file mode 100644 index 00000000..9f183b2f --- /dev/null +++ b/utils/src/ast-grep/general.ts @@ -0,0 +1,15 @@ +import type { SgNode } from '@codemod.com/jssg-types/main'; +import type Js from '@codemod.com/jssg-types/langs/javascript'; + +export function findParentStatement(node: SgNode): SgNode | null { + for (const ancestor of node.ancestors()) { + if (ancestor.kind() === 'expression_statement') { + return ancestor; + } + } + return null; +} + +export function isSafeResourceTarget(node: SgNode): boolean { + return node.is('identifier') || node.is('member_expression'); +} diff --git a/utils/src/ast-grep/indent.test.ts b/utils/src/ast-grep/indent.test.ts new file mode 100644 index 00000000..b5ecc41f --- /dev/null +++ b/utils/src/ast-grep/indent.test.ts @@ -0,0 +1,89 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { detectIndentUnit, getLineIndent } from './indent.ts'; + +describe('detectIndentUnit', () => { + it('should detect tab indentation', () => { + const source = '\tfunction test() {\n\t\tconsole.log("Hello");\n\t}'; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should detect space indentation', () => { + const source = + ' function test() {\n console.log("Hello");\n }'; + assert.equal(detectIndentUnit(source), ' '); + }); + + it('should detect mixed indentation and return the most common one', () => { + const source = + ' function test() {\n console.log("Hello");\n\tconsole.log("World");\n }'; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should return empty string if no indentation is found', () => { + const source = 'function test() {\nconsole.log("Hello");\n}'; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should handle empty source', () => { + const source = ''; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should handle lines with only whitespace', () => { + const source = ' \n\t\t\n '; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should handle inconsistent indentation', () => { + const source = ' \t \t\n \t\n\t'; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should handle no indentation at all', () => { + const source = 'function test() {\nconsole.log("Hello");\n}'; + assert.equal(detectIndentUnit(source), '\t'); + }); + + it('should handle a single line of code', () => { + const source = 'console.log("Hello");'; + assert.equal(detectIndentUnit(source), '\t'); + }); +}); + +describe('getLineIndent', () => { + it('should return the correct indentation for a given line index', () => { + const source = + 'function test() {\n console.log("Hello");\n\tconsole.log("World");\n}'; + assert.equal(getLineIndent(source, 25), ' '); + assert.equal(getLineIndent(source, 50), '\t'); + assert.equal(getLineIndent(source, 0), ''); + }); + + it('should handle lines with no indentation', () => { + const source = 'function test() {\nconsole.log("Hello");\n}'; + assert.equal(getLineIndent(source, 20), ''); + }); + + it('should handle empty source', () => { + const source = ''; + assert.equal(getLineIndent(source, 0), ''); + }); +}); + +describe('getLineIndent - additional tests', () => { + it('should handle index out of bounds', () => { + const source = 'function test() {\n console.log("Hello");\n}'; + assert.equal(getLineIndent(source, 100), ''); + }); + + it('should handle lines with only whitespace', () => { + const source = ' \n\t\t\n '; + assert.equal(getLineIndent(source, 1), ' '); + }); + + it('should handle an empty string', () => { + const source = ''; + assert.equal(getLineIndent(source, 0), ''); + }); +}); diff --git a/recipes/timers-deprecations/src/shared.ts b/utils/src/ast-grep/indent.ts similarity index 60% rename from recipes/timers-deprecations/src/shared.ts rename to utils/src/ast-grep/indent.ts index d9476fe2..205a37e8 100644 --- a/recipes/timers-deprecations/src/shared.ts +++ b/utils/src/ast-grep/indent.ts @@ -1,5 +1,4 @@ -import type { SgNode } from '@codemod.com/jssg-types/main'; -import type Js from '@codemod.com/jssg-types/langs/javascript'; +import { gcd } from '../math.ts'; export function detectIndentUnit(source: string): string { let tabIndent = ''; @@ -47,27 +46,3 @@ export function getLineIndent(source: string, index: number): string { return indent; } - -export function findParentStatement(node: SgNode): SgNode | null { - for (const ancestor of node.ancestors()) { - if (ancestor.kind() === 'expression_statement') { - return ancestor; - } - } - return null; -} - -export function isSafeResourceTarget(node: SgNode): boolean { - return node.is('identifier') || node.is('member_expression'); -} - -function gcd(a: number, b: number): number { - let x = Math.abs(a); - let y = Math.abs(b); - while (y !== 0) { - const temp = y; - y = x % y; - x = temp; - } - return x; -} diff --git a/utils/src/math.test.ts b/utils/src/math.test.ts new file mode 100644 index 00000000..74682588 --- /dev/null +++ b/utils/src/math.test.ts @@ -0,0 +1,32 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { gcd } from './math.ts'; + +describe('gcd', () => { + it('should return the greatest common divisor of two numbers', () => { + assert.equal(gcd(48, 18), 6); + assert.equal(gcd(56, 98), 14); + assert.equal(gcd(101, 10), 1); + assert.equal(gcd(-48, 18), 6); + assert.equal(gcd(48, -18), 6); + assert.equal(gcd(-48, -18), 6); + assert.equal(gcd(0, 5), 5); + assert.equal(gcd(5, 0), 5); + assert.equal(gcd(0, 0), 0); + }); + + it('should throw TypeError if arguments are not numbers', () => { + assert.throws(() => gcd('48' as unknown as number, 18), { + name: 'TypeError', + message: 'Both arguments must be numbers.', + }); + assert.throws(() => gcd(48, null as unknown as number), { + name: 'TypeError', + message: 'Both arguments must be numbers.', + }); + assert.throws(() => gcd(undefined as unknown as number, 18), { + name: 'TypeError', + message: 'Both arguments must be numbers.', + }); + }); +}); diff --git a/utils/src/math.ts b/utils/src/math.ts new file mode 100644 index 00000000..9957a9a1 --- /dev/null +++ b/utils/src/math.ts @@ -0,0 +1,14 @@ +export function gcd(a: number, b: number): number { + if (typeof a !== 'number' || typeof b !== 'number') { + throw new TypeError('Both arguments must be numbers.'); + } + + let x = Math.abs(a); + let y = Math.abs(b); + while (y !== 0) { + const temp = y; + y = x % y; + x = temp; + } + return x; +} From 3292eac33c21012dda1244a4b136ac9961cab1e1 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Tue, 2 Dec 2025 09:28:00 +0100 Subject: [PATCH 07/11] doc: use diff --- recipes/timers-deprecations/README.md | 53 ++++++++------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/recipes/timers-deprecations/README.md b/recipes/timers-deprecations/README.md index 425b65ff..6c10ce04 100644 --- a/recipes/timers-deprecations/README.md +++ b/recipes/timers-deprecations/README.md @@ -8,51 +8,30 @@ See the upstream notices: [DEP0095](https://nodejs.org/api/deprecations.html#DEP ### Replace `timers.enroll()` -**Before:** - -```js -const timers = require('node:timers'); -const resource = { _idleTimeout: 1500 }; -timers.enroll(resource, 1500); -``` - -**After:** - -```js -const resource = { timeout: setTimeout(() => { - // timeout handler -}, 1500) }; +```diff +- const timers = require('node:timers'); +- const resource = { _idleTimeout: 1500 }; +- timers.enroll(resource, 1500); ++ const resource = { timeout: setTimeout(() => { ++ // timeout handler ++ }, 1500) }; ``` ### Replace `timers.unenroll()` -**Before:** - -```js -timers.unenroll(resource); -``` - -**After:** - -```js -clearTimeout(resource.timeout); +```diff +- timers.unenroll(resource); ++ clearTimeout(resource.timeout); ``` ### Replace `timers.active()` and `timers._unrefActive()` -**Before:** - -```js -const timers = require('node:timers'); -timers.active(resource); -timers._unrefActive(resource); -``` - -**After:** - -```js -const handle = setTimeout(onTimeout, delay); -handle.unref(); +```diff +- const timers = require('node:timers'); +- timers.active(resource); +- timers._unrefActive(resource); ++ const handle = setTimeout(onTimeout, delay); ++ handle.unref(); ``` ## Caveats From d4b29f83b82b736502b545d595933c5ac0ff92b6 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 17 Jan 2026 17:08:36 +0100 Subject: [PATCH 08/11] update Co-Authored-By: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> --- .../src/active-to-standard-timer.ts | 2 +- .../src/cleanup-imports.ts | 38 ++--- .../src/enroll-to-set-timeout.ts | 2 +- .../src/unenroll-to-clear-timer.ts | 2 +- .../src/unref-active-to-unref.ts | 2 +- .../active/expected/active_import-variants.js | 116 ++++++++-------- .../tests/active/expected/destructured.js | 18 +-- .../active/input/active_import-variants.js | 18 +-- .../tests/active/input/destructured.js | 10 +- .../tests/imports/expected/basic.js | 1 + .../tests/imports/expected/imports_dynamic.js | 54 ++++---- .../tests/imports/expected/named.js | 5 +- .../tests/imports/input/imports_dynamic.js | 58 ++++---- .../tests/imports/input/named.js | 4 +- .../expected/dep0096-import-variants.js | 32 ++--- .../unenroll/input/dep0096-import-variants.js | 18 +-- .../tests/unref/expected/destructured.js | 18 +-- .../unref/expected/unref_import-variants.js | 130 +++++++++--------- .../tests/unref/input/destructured.js | 10 +- .../unref/input/unref_import-variants.js | 18 +-- 20 files changed, 279 insertions(+), 277 deletions(-) diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index 70434da5..6cd364c1 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -55,7 +55,6 @@ export default function transform(root: SgRoot): string | null { if (!statement) continue; if (handledStatements.has(statement.id())) continue; - handledStatements.add(statement.id()); const indent = getLineIndent(sourceCode, statement.range().start.index); const resourceText = resourceNode.text(); @@ -72,6 +71,7 @@ export default function transform(root: SgRoot): string | null { `${childIndent}}${EOL}` + `${indent}}, ${resourceText}._idleTimeout);`; + handledStatements.add(statement.id()); edits.push(statement.replace(replacement)); } } diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts index ab5563e1..d875aa62 100644 --- a/recipes/timers-deprecations/src/cleanup-imports.ts +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -13,13 +13,8 @@ import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-bindi import type { Edit, Range, SgNode, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; -const DEPRECATED_METHODS = [ - 'enroll', - 'unenroll', - 'active', - '_unrefActive', -] as const; -const DEPRECATED_SET = new Set(DEPRECATED_METHODS); +const DEPRECATED_METHODS = ['enroll', 'unenroll', 'active', '_unrefActive']; +const DEPRECATED_SET = new Set(DEPRECATED_METHODS); export default function transform(root: SgRoot): string | null { const rootNode = root.root(); @@ -33,9 +28,7 @@ export default function transform(root: SgRoot): string | null { ]; for (const statement of statements) { - if (statement.kind() === 'expression_statement') { - continue; - } + if (statement.kind() === 'expression_statement') continue; if (shouldRemoveEntireStatement(statement)) { linesToRemove.push(statement.range()); continue; @@ -67,9 +60,7 @@ export default function transform(root: SgRoot): string | null { removedBindings.add(localBinding); } - if (statementMarkedForRemoval) { - continue; - } + if (statementMarkedForRemoval) continue; const namespaceIdentifier = getNamespaceIdentifier(statement); if (!namespaceIdentifier) continue; @@ -95,7 +86,7 @@ export default function transform(root: SgRoot): string | null { source = removeLines(source, linesToRemove); } - return source.replace(/^\s*\n/, ''); + return source; } function isBindingStillUsed( @@ -144,24 +135,33 @@ function getNamespaceIdentifier(statement: SgNode): SgNode | null { function shouldRemoveEntireStatement(statement: SgNode): boolean { const objectPattern = statement.find({ rule: { kind: 'object_pattern' } }); + if (objectPattern) { const propertyNames = new Set(); - for (const shorthand of objectPattern.findAll({ + const shorthands = objectPattern.findAll({ rule: { kind: 'shorthand_property_identifier_pattern' }, - })) { + }); + const pairs = objectPattern.findAll({ + rule: { kind: 'pair_pattern' }, + }); + + for (const shorthand of shorthands) { propertyNames.add(shorthand.text()); } - for (const pair of objectPattern.findAll({ - rule: { kind: 'pair_pattern' }, - })) { + + for (const pair of pairs) { const property = pair.find({ rule: { kind: 'property_identifier' } }); + if (!property) return false; propertyNames.add(property.text()); } + if (!propertyNames.size) return false; + for (const name of propertyNames) { if (!DEPRECATED_SET.has(name)) return false; } + return true; } diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index 3676f18b..84dfd820 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -51,7 +51,6 @@ export default function transform(root: SgRoot): string | null { if (!statement) continue; if (handledStatements.has(statement.id())) continue; - handledStatements.add(statement.id()); const indent = getLineIndent(sourceCode, statement.range().start.index); const resourceText = resourceNode.text(); @@ -67,6 +66,7 @@ export default function transform(root: SgRoot): string | null { `${childIndent}}${EOL}` + `${indent}}, ${timeoutText});`; + handledStatements.add(statement.id()); edits.push(statement.replace(replacement)); } } diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index 071c9a61..6f312265 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -51,7 +51,6 @@ export default function transform(root: SgRoot): string | null { if (!statement) continue; if (handledStatements.has(statement.id())) continue; - handledStatements.add(statement.id()); const indent = getLineIndent(sourceCode, statement.range().start.index); const resourceText = resourceNode.text(); @@ -60,6 +59,7 @@ export default function transform(root: SgRoot): string | null { `clearTimeout(${resourceText}.timeout);${EOL}` + `${indent}delete ${resourceText}.timeout;`; + handledStatements.add(statement.id()); edits.push(statement.replace(replacement)); } } diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index cdd71fbb..6872c5f0 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -55,7 +55,6 @@ export default function transform(root: SgRoot): string | null { if (!statement) continue; if (handledStatements.has(statement.id())) continue; - handledStatements.add(statement.id()); const indent = getLineIndent(sourceCode, statement.range().start.index); const resourceText = resourceNode.text(); @@ -73,6 +72,7 @@ export default function transform(root: SgRoot): string | null { `${indent}}, ${resourceText}._idleTimeout);${EOL}` + `${indent}${resourceText}.timeout.unref?.();`; + handledStatements.add(statement.id()); edits.push(statement.replace(replacement)); } } diff --git a/recipes/timers-deprecations/tests/active/expected/active_import-variants.js b/recipes/timers-deprecations/tests/active/expected/active_import-variants.js index 8e69f9ac..67e98626 100644 --- a/recipes/timers-deprecations/tests/active/expected/active_import-variants.js +++ b/recipes/timers-deprecations/tests/active/expected/active_import-variants.js @@ -6,87 +6,87 @@ import { active as markActive } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - if (resource.target.timeout != null) { - clearTimeout(resource.target.timeout); - } + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } - resource.target.timeout = setTimeout(() => { - if (typeof resource.target._onTimeout === "function") { - resource.target._onTimeout(); - } - }, resource.target._idleTimeout); + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); } function fromCjsAlias(resource) { - if (resource.target.timeout != null) { - clearTimeout(resource.target.timeout); - } + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } - resource.target.timeout = setTimeout(() => { - if (typeof resource.target._onTimeout === "function") { - resource.target._onTimeout(); - } - }, resource.target._idleTimeout); + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); } function fromEsmDefault(resource) { - if (resource.timeout != null) { - clearTimeout(resource.timeout); - } + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); } function fromEsmNamed(resource) { - if (resource.item.timeout != null) { - clearTimeout(resource.item.timeout); - } + if (resource.item.timeout != null) { + clearTimeout(resource.item.timeout); + } - resource.item.timeout = setTimeout(() => { - if (typeof resource.item._onTimeout === "function") { - resource.item._onTimeout(); - } - }, resource.item._idleTimeout); + resource.item.timeout = setTimeout(() => { + if (typeof resource.item._onTimeout === "function") { + resource.item._onTimeout(); + } + }, resource.item._idleTimeout); } function fromEsmNamespace(resource) { - if (resource.node.timeout != null) { - clearTimeout(resource.node.timeout); - } + if (resource.node.timeout != null) { + clearTimeout(resource.node.timeout); + } - resource.node.timeout = setTimeout(() => { - if (typeof resource.node._onTimeout === "function") { - resource.node._onTimeout(); - } - }, resource.node._idleTimeout); + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, resource.node._idleTimeout); } async function fromDynamic(resource) { - const { active } = await import("node:timers"); - if (resource.session.timeout != null) { - clearTimeout(resource.session.timeout); - } + const { active } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } - resource.session.timeout = setTimeout(() => { - if (typeof resource.session._onTimeout === "function") { - resource.session._onTimeout(); - } - }, resource.session._idleTimeout); + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); } async function fromDynamicAlias(resource) { - const { active: activateDynamic } = await import("node:timers"); - if (resource.session.timeout != null) { - clearTimeout(resource.session.timeout); - } + const { active: activateDynamic } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } - resource.session.timeout = setTimeout(() => { - if (typeof resource.session._onTimeout === "function") { - resource.session._onTimeout(); - } - }, resource.session._idleTimeout); + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); } diff --git a/recipes/timers-deprecations/tests/active/expected/destructured.js b/recipes/timers-deprecations/tests/active/expected/destructured.js index fd1991a5..32ff1f3b 100644 --- a/recipes/timers-deprecations/tests/active/expected/destructured.js +++ b/recipes/timers-deprecations/tests/active/expected/destructured.js @@ -1,19 +1,19 @@ const { active } = require("node:timers"); const handle = { - _idleTimeout: 750, - timeout: setTimeout(() => { }, 750), - _onTimeout() { - console.log("tick"); - }, + _idleTimeout: 750, + timeout: setTimeout(() => { }, 750), + _onTimeout() { + console.log("tick"); + }, }; if (handle.timeout != null) { - clearTimeout(handle.timeout); + clearTimeout(handle.timeout); } handle.timeout = setTimeout(() => { - if (typeof handle._onTimeout === "function") { - handle._onTimeout(); - } + if (typeof handle._onTimeout === "function") { + handle._onTimeout(); + } }, handle._idleTimeout); diff --git a/recipes/timers-deprecations/tests/active/input/active_import-variants.js b/recipes/timers-deprecations/tests/active/input/active_import-variants.js index 3c179a3a..c3ae05e9 100644 --- a/recipes/timers-deprecations/tests/active/input/active_import-variants.js +++ b/recipes/timers-deprecations/tests/active/input/active_import-variants.js @@ -6,31 +6,31 @@ import { active as markActive } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - timersNamespace.active(resource.target); + timersNamespace.active(resource.target); } function fromCjsAlias(resource) { - activeAlias(resource.target); + activeAlias(resource.target); } function fromEsmDefault(resource) { - timersDefault.active(resource); + timersDefault.active(resource); } function fromEsmNamed(resource) { - markActive(resource.item); + markActive(resource.item); } function fromEsmNamespace(resource) { - timersESMNamespace.active(resource.node); + timersESMNamespace.active(resource.node); } async function fromDynamic(resource) { - const { active } = await import("node:timers"); - active(resource.session); + const { active } = await import("node:timers"); + active(resource.session); } async function fromDynamicAlias(resource) { - const { active: activateDynamic } = await import("node:timers"); - activateDynamic(resource.session); + const { active: activateDynamic } = await import("node:timers"); + activateDynamic(resource.session); } diff --git a/recipes/timers-deprecations/tests/active/input/destructured.js b/recipes/timers-deprecations/tests/active/input/destructured.js index d6a51681..4eeb85df 100644 --- a/recipes/timers-deprecations/tests/active/input/destructured.js +++ b/recipes/timers-deprecations/tests/active/input/destructured.js @@ -1,11 +1,11 @@ const { active } = require("node:timers"); const handle = { - _idleTimeout: 750, - timeout: setTimeout(() => { }, 750), - _onTimeout() { - console.log("tick"); - }, + _idleTimeout: 750, + timeout: setTimeout(() => { }, 750), + _onTimeout() { + console.log("tick"); + }, }; active(handle); diff --git a/recipes/timers-deprecations/tests/imports/expected/basic.js b/recipes/timers-deprecations/tests/imports/expected/basic.js index dbf3e5f4..5fc114c2 100644 --- a/recipes/timers-deprecations/tests/imports/expected/basic.js +++ b/recipes/timers-deprecations/tests/imports/expected/basic.js @@ -1,3 +1,4 @@ + const resource = { _idleTimeout: 100, timeout: setTimeout(() => { }, 100), diff --git a/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js b/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js index 8abc284f..6cd327c5 100644 --- a/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js +++ b/recipes/timers-deprecations/tests/imports/expected/imports_dynamic.js @@ -1,39 +1,39 @@ async function cleanupEnroll(resource) { - resource._idleTimeout = resource.delay; - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource.delay); + resource._idleTimeout = resource.delay; + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource.delay); } async function cleanupAlias(resource) { - if (resource.timeout != null) { - clearTimeout(resource.timeout); - } + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); } async function cleanupDefault(resource) { - const timersModule = await import("node:timers"); - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); } async function preserveNamespace(resource) { - const timersModule = await import("node:timers"); - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); - return timersModule; + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + return timersModule; } diff --git a/recipes/timers-deprecations/tests/imports/expected/named.js b/recipes/timers-deprecations/tests/imports/expected/named.js index 674b9638..d425d2fa 100644 --- a/recipes/timers-deprecations/tests/imports/expected/named.js +++ b/recipes/timers-deprecations/tests/imports/expected/named.js @@ -1,6 +1,7 @@ + function setup(resource) { - resource._idleTimeout = 42; - resource.timeout = setTimeout(() => { }, 42); + resource._idleTimeout = 42; + resource.timeout = setTimeout(() => { }, 42); } setup({}); diff --git a/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js b/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js index c078a18d..ec331f30 100644 --- a/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js +++ b/recipes/timers-deprecations/tests/imports/input/imports_dynamic.js @@ -1,41 +1,41 @@ async function cleanupEnroll(resource) { - const { enroll } = await import("node:timers"); - resource._idleTimeout = resource.delay; - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource.delay); + const { enroll } = await import("node:timers"); + resource._idleTimeout = resource.delay; + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource.delay); } async function cleanupAlias(resource) { - const { active: activate } = await import("node:timers"); - if (resource.timeout != null) { - clearTimeout(resource.timeout); - } + const { active: activate } = await import("node:timers"); + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); } async function cleanupDefault(resource) { - const timersModule = await import("node:timers"); - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); } async function preserveNamespace(resource) { - const timersModule = await import("node:timers"); - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); - return timersModule; + const timersModule = await import("node:timers"); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + return timersModule; } diff --git a/recipes/timers-deprecations/tests/imports/input/named.js b/recipes/timers-deprecations/tests/imports/input/named.js index 8c0c76e1..a03231d3 100644 --- a/recipes/timers-deprecations/tests/imports/input/named.js +++ b/recipes/timers-deprecations/tests/imports/input/named.js @@ -1,8 +1,8 @@ const { enroll, active } = require("node:timers"); function setup(resource) { - resource._idleTimeout = 42; - resource.timeout = setTimeout(() => { }, 42); + resource._idleTimeout = 42; + resource.timeout = setTimeout(() => { }, 42); } setup({}); diff --git a/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js index 8406a392..03689e18 100644 --- a/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js +++ b/recipes/timers-deprecations/tests/unenroll/expected/dep0096-import-variants.js @@ -6,38 +6,38 @@ import { unenroll as release } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - clearTimeout(resource.target.timeout); - delete resource.target.timeout; + clearTimeout(resource.target.timeout); + delete resource.target.timeout; } function fromCjsAlias(resource) { - clearTimeout(resource.target.timeout); - delete resource.target.timeout; + clearTimeout(resource.target.timeout); + delete resource.target.timeout; } function fromEsmDefault(resource) { - clearTimeout(resource.timeout); - delete resource.timeout; + clearTimeout(resource.timeout); + delete resource.timeout; } function fromEsmNamed(resource) { - clearTimeout(resource.item.timeout); - delete resource.item.timeout; + clearTimeout(resource.item.timeout); + delete resource.item.timeout; } function fromEsmNamespace(resource) { - clearTimeout(resource.node.timeout); - delete resource.node.timeout; + clearTimeout(resource.node.timeout); + delete resource.node.timeout; } async function fromDynamic(resource) { - const { unenroll } = await import("node:timers"); - clearTimeout(resource.session.timeout); - delete resource.session.timeout; + const { unenroll } = await import("node:timers"); + clearTimeout(resource.session.timeout); + delete resource.session.timeout; } async function fromDynamicAlias(resource) { - const { unenroll: cancel } = await import("node:timers"); - clearTimeout(resource.session.timeout); - delete resource.session.timeout; + const { unenroll: cancel } = await import("node:timers"); + clearTimeout(resource.session.timeout); + delete resource.session.timeout; } diff --git a/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js b/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js index 44c55a43..9f7e0c2b 100644 --- a/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js +++ b/recipes/timers-deprecations/tests/unenroll/input/dep0096-import-variants.js @@ -6,31 +6,31 @@ import { unenroll as release } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - timersNamespace.unenroll(resource.target); + timersNamespace.unenroll(resource.target); } function fromCjsAlias(resource) { - cancelAlias(resource.target); + cancelAlias(resource.target); } function fromEsmDefault(resource) { - timersDefault.unenroll(resource); + timersDefault.unenroll(resource); } function fromEsmNamed(resource) { - release(resource.item); + release(resource.item); } function fromEsmNamespace(resource) { - timersESMNamespace.unenroll(resource.node); + timersESMNamespace.unenroll(resource.node); } async function fromDynamic(resource) { - const { unenroll } = await import("node:timers"); - unenroll(resource.session); + const { unenroll } = await import("node:timers"); + unenroll(resource.session); } async function fromDynamicAlias(resource) { - const { unenroll: cancel } = await import("node:timers"); - cancel(resource.session); + const { unenroll: cancel } = await import("node:timers"); + cancel(resource.session); } diff --git a/recipes/timers-deprecations/tests/unref/expected/destructured.js b/recipes/timers-deprecations/tests/unref/expected/destructured.js index 85a8cc76..cd885246 100644 --- a/recipes/timers-deprecations/tests/unref/expected/destructured.js +++ b/recipes/timers-deprecations/tests/unref/expected/destructured.js @@ -1,20 +1,20 @@ const { _unrefActive } = require("node:timers"); const task = { - _idleTimeout: 90, - timeout: setTimeout(() => { }, 90), - _onTimeout() { - console.log("idle"); - }, + _idleTimeout: 90, + timeout: setTimeout(() => { }, 90), + _onTimeout() { + console.log("idle"); + }, }; if (task.timeout != null) { - clearTimeout(task.timeout); + clearTimeout(task.timeout); } task.timeout = setTimeout(() => { - if (typeof task._onTimeout === "function") { - task._onTimeout(); - } + if (typeof task._onTimeout === "function") { + task._onTimeout(); + } }, task._idleTimeout); task.timeout.unref?.(); diff --git a/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js b/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js index b8c0c4fd..9ba7efd9 100644 --- a/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js +++ b/recipes/timers-deprecations/tests/unref/expected/unref_import-variants.js @@ -6,94 +6,94 @@ import { _unrefActive as unref } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - if (resource.target.timeout != null) { - clearTimeout(resource.target.timeout); - } + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } - resource.target.timeout = setTimeout(() => { - if (typeof resource.target._onTimeout === "function") { - resource.target._onTimeout(); - } - }, resource.target._idleTimeout); - resource.target.timeout.unref?.(); + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); + resource.target.timeout.unref?.(); } function fromCjsAlias(resource) { - if (resource.target.timeout != null) { - clearTimeout(resource.target.timeout); - } + if (resource.target.timeout != null) { + clearTimeout(resource.target.timeout); + } - resource.target.timeout = setTimeout(() => { - if (typeof resource.target._onTimeout === "function") { - resource.target._onTimeout(); - } - }, resource.target._idleTimeout); - resource.target.timeout.unref?.(); + resource.target.timeout = setTimeout(() => { + if (typeof resource.target._onTimeout === "function") { + resource.target._onTimeout(); + } + }, resource.target._idleTimeout); + resource.target.timeout.unref?.(); } function fromEsmDefault(resource) { - if (resource.timeout != null) { - clearTimeout(resource.timeout); - } + if (resource.timeout != null) { + clearTimeout(resource.timeout); + } - resource.timeout = setTimeout(() => { - if (typeof resource._onTimeout === "function") { - resource._onTimeout(); - } - }, resource._idleTimeout); - resource.timeout.unref?.(); + resource.timeout = setTimeout(() => { + if (typeof resource._onTimeout === "function") { + resource._onTimeout(); + } + }, resource._idleTimeout); + resource.timeout.unref?.(); } function fromEsmNamed(resource) { - if (resource.item.timeout != null) { - clearTimeout(resource.item.timeout); - } + if (resource.item.timeout != null) { + clearTimeout(resource.item.timeout); + } - resource.item.timeout = setTimeout(() => { - if (typeof resource.item._onTimeout === "function") { - resource.item._onTimeout(); - } - }, resource.item._idleTimeout); - resource.item.timeout.unref?.(); + resource.item.timeout = setTimeout(() => { + if (typeof resource.item._onTimeout === "function") { + resource.item._onTimeout(); + } + }, resource.item._idleTimeout); + resource.item.timeout.unref?.(); } function fromEsmNamespace(resource) { - if (resource.node.timeout != null) { - clearTimeout(resource.node.timeout); - } + if (resource.node.timeout != null) { + clearTimeout(resource.node.timeout); + } - resource.node.timeout = setTimeout(() => { - if (typeof resource.node._onTimeout === "function") { - resource.node._onTimeout(); - } - }, resource.node._idleTimeout); - resource.node.timeout.unref?.(); + resource.node.timeout = setTimeout(() => { + if (typeof resource.node._onTimeout === "function") { + resource.node._onTimeout(); + } + }, resource.node._idleTimeout); + resource.node.timeout.unref?.(); } async function fromDynamic(resource) { - const { _unrefActive } = await import("node:timers"); - if (resource.session.timeout != null) { - clearTimeout(resource.session.timeout); - } + const { _unrefActive } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } - resource.session.timeout = setTimeout(() => { - if (typeof resource.session._onTimeout === "function") { - resource.session._onTimeout(); - } - }, resource.session._idleTimeout); - resource.session.timeout.unref?.(); + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); + resource.session.timeout.unref?.(); } async function fromDynamicAlias(resource) { - const { _unrefActive: unrefDynamic } = await import("node:timers"); - if (resource.session.timeout != null) { - clearTimeout(resource.session.timeout); - } + const { _unrefActive: unrefDynamic } = await import("node:timers"); + if (resource.session.timeout != null) { + clearTimeout(resource.session.timeout); + } - resource.session.timeout = setTimeout(() => { - if (typeof resource.session._onTimeout === "function") { - resource.session._onTimeout(); - } - }, resource.session._idleTimeout); - resource.session.timeout.unref?.(); + resource.session.timeout = setTimeout(() => { + if (typeof resource.session._onTimeout === "function") { + resource.session._onTimeout(); + } + }, resource.session._idleTimeout); + resource.session.timeout.unref?.(); } diff --git a/recipes/timers-deprecations/tests/unref/input/destructured.js b/recipes/timers-deprecations/tests/unref/input/destructured.js index b1ec9493..26b9d36a 100644 --- a/recipes/timers-deprecations/tests/unref/input/destructured.js +++ b/recipes/timers-deprecations/tests/unref/input/destructured.js @@ -1,11 +1,11 @@ const { _unrefActive } = require("node:timers"); const task = { - _idleTimeout: 90, - timeout: setTimeout(() => { }, 90), - _onTimeout() { - console.log("idle"); - }, + _idleTimeout: 90, + timeout: setTimeout(() => { }, 90), + _onTimeout() { + console.log("idle"); + }, }; _unrefActive(task); diff --git a/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js b/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js index d9f4aad8..77cea61f 100644 --- a/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js +++ b/recipes/timers-deprecations/tests/unref/input/unref_import-variants.js @@ -6,31 +6,31 @@ import { _unrefActive as unref } from "node:timers"; import * as timersESMNamespace from "node:timers"; async function fromNamespace(resource) { - timersNamespace._unrefActive(resource.target); + timersNamespace._unrefActive(resource.target); } function fromCjsAlias(resource) { - unrefAlias(resource.target); + unrefAlias(resource.target); } function fromEsmDefault(resource) { - timersDefault._unrefActive(resource); + timersDefault._unrefActive(resource); } function fromEsmNamed(resource) { - unref(resource.item); + unref(resource.item); } function fromEsmNamespace(resource) { - timersESMNamespace._unrefActive(resource.node); + timersESMNamespace._unrefActive(resource.node); } async function fromDynamic(resource) { - const { _unrefActive } = await import("node:timers"); - _unrefActive(resource.session); + const { _unrefActive } = await import("node:timers"); + _unrefActive(resource.session); } async function fromDynamicAlias(resource) { - const { _unrefActive: unrefDynamic } = await import("node:timers"); - unrefDynamic(resource.session); + const { _unrefActive: unrefDynamic } = await import("node:timers"); + unrefDynamic(resource.session); } From d148c73118a2a814c9c46b239527559ecfe3d742 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 17 Jan 2026 17:11:53 +0100 Subject: [PATCH 09/11] Update package-lock.json --- package-lock.json | 1024 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 974 insertions(+), 50 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8208c722..40220450 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,8 @@ }, "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" @@ -43,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" ], @@ -55,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.7", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-bash/-/lang-bash-0.0.7.tgz", + "integrity": "sha512-tbPrTkmUv3YVKZZg8q51nAE5ItVVq6WzGPrJtiDKLZ3AdfRzZCOC2VgRwJBWD+VbFELqSVARKwXoQB6E8k+xug==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -74,6 +176,8 @@ }, "node_modules/@ast-grep/lang-json": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-json/-/lang-json-0.0.6.tgz", + "integrity": "sha512-xb4OXtyuyY9RqUs5Af4Jb5hAJcBD0hGD1rJSQm1chJqdWOjhM6G7V2vHLx6B8M9uXuTBnaNs4U4OccMp+e95JQ==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -91,6 +195,8 @@ }, "node_modules/@ast-grep/napi": { "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi/-/napi-0.40.5.tgz", + "integrity": "sha512-hJA62OeBKUQT68DD2gDyhOqJxZxycqg8wLxbqjgqSzYttCMSDL9tiAQ9abgekBYNHudbJosm9sWOEbmCDfpX2A==", "dev": true, "license": "MIT", "engines": { @@ -110,6 +216,8 @@ }, "node_modules/@ast-grep/napi-darwin-arm64": { "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-arm64/-/napi-darwin-arm64-0.40.5.tgz", + "integrity": "sha512-2F072fGN0WTq7KI3okuEnkGJVEHLbi56Bw1H6NAMf7j2mJJeQWsRyGOMcyNnUXZDeNdvoMH0OB2a5wwUegY/nQ==", "cpu": [ "arm64" ], @@ -123,13 +231,153 @@ "node": ">= 10" } }, + "node_modules/@ast-grep/napi-darwin-x64": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-x64/-/napi-darwin-x64-0.40.5.tgz", + "integrity": "sha512-dJMidHZhhxuLBYNi6/FKI812jQ7wcFPSKkVPwviez2D+KvYagapUMAV/4dJ7FCORfguVk8Y0jpPAlYmWRT5nvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-gnu": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-gnu/-/napi-linux-arm64-gnu-0.40.5.tgz", + "integrity": "sha512-nBRCbyoS87uqkaw4Oyfe5VO+SRm2B+0g0T8ME69Qry9ShMf41a2bTdpcQx9e8scZPogq+CTwDHo3THyBV71l9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-musl": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-musl/-/napi-linux-arm64-musl-0.40.5.tgz", + "integrity": "sha512-/qKsmds5FMoaEj6FdNzepbmLMtlFuBLdrAn9GIWCqOIcVcYvM1Nka8+mncfeXB/MFZKOrzQsQdPTWqrrQzXLrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-gnu": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-gnu/-/napi-linux-x64-gnu-0.40.5.tgz", + "integrity": "sha512-DP4oDbq7f/1A2hRTFLhJfDFR6aI5mRWdEfKfHzRItmlKsR9WlcEl1qDJs/zX9R2EEtIDsSKRzuJNfJllY3/W8Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-musl": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-musl/-/napi-linux-x64-musl-0.40.5.tgz", + "integrity": "sha512-BRZUvVBPUNpWPo6Ns8chXVzxHPY+k9gpsubGTHy92Q26ecZULd/dTkWWdnvfhRqttsSQ9Pe/XQdi5+hDQ6RYcg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-arm64-msvc": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-arm64-msvc/-/napi-win32-arm64-msvc-0.40.5.tgz", + "integrity": "sha512-y95zSEwc7vhxmcrcH0GnK4ZHEBQrmrszRBNQovzaciF9GUqEcCACNLoBesn4V47IaOp4fYgD2/EhGRTIBFb2Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-ia32-msvc": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-ia32-msvc/-/napi-win32-ia32-msvc-0.40.5.tgz", + "integrity": "sha512-K/u8De62iUnFCzVUs7FBdTZ2Jrgc5/DLHqjpup66KxZ7GIM9/HGME/O8aSoPkpcAeCD4TiTZ11C1i5p5H98hTg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-x64-msvc": { + "version": "0.40.5", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-x64-msvc/-/napi-win32-x64-msvc-0.40.5.tgz", + "integrity": "sha512-dqm5zg/o4Nh4VOQPEpMS23ot8HVd22gG0eg01t4CFcZeuzyuSgBlOL3N7xLbz3iH2sVkk7keuBwAzOIpTqziNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@ast-grep/setup-lang": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@ast-grep/setup-lang/-/setup-lang-0.0.6.tgz", + "integrity": "sha512-aSYZNF5nGQMxnwiA3Lcc8zi0AtpGlug47ADgqCgP/2n7p922FbnW7vo1rbW4kKjW72B/3mDdN7uvYidv8JnPnw==", "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", @@ -142,6 +390,8 @@ }, "node_modules/@babel/compat-data": { "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" @@ -149,8 +399,9 @@ }, "node_modules/@babel/core": { "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": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -178,6 +429,8 @@ }, "node_modules/@babel/generator": { "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.5", @@ -192,6 +445,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" @@ -202,6 +457,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", @@ -216,6 +473,8 @@ }, "node_modules/@babel/helper-create-class-features-plugin": { "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.3", @@ -235,6 +494,8 @@ }, "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" @@ -242,6 +503,8 @@ }, "node_modules/@babel/helper-member-expression-to-functions": { "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.28.5", @@ -253,6 +516,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", @@ -264,6 +529,8 @@ }, "node_modules/@babel/helper-module-transforms": { "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", @@ -279,6 +546,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" @@ -289,6 +558,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" @@ -296,6 +567,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", @@ -311,6 +584,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", @@ -322,6 +597,8 @@ }, "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" @@ -329,6 +606,8 @@ }, "node_modules/@babel/helper-validator-identifier": { "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" @@ -336,6 +615,8 @@ }, "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" @@ -343,6 +624,8 @@ }, "node_modules/@babel/helpers": { "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", @@ -354,6 +637,8 @@ }, "node_modules/@babel/parser": { "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.5" @@ -367,6 +652,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" @@ -380,6 +667,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" @@ -393,6 +682,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" @@ -406,6 +697,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", @@ -420,6 +713,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", @@ -434,6 +729,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", @@ -448,6 +745,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" @@ -461,6 +760,8 @@ }, "node_modules/@babel/plugin-transform-optional-chaining": { "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", @@ -475,6 +776,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", @@ -489,6 +792,8 @@ }, "node_modules/@babel/plugin-transform-typescript": { "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", @@ -506,6 +811,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", @@ -521,6 +828,8 @@ }, "node_modules/@babel/preset-typescript": { "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", @@ -538,6 +847,8 @@ }, "node_modules/@babel/register": { "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", @@ -555,6 +866,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", @@ -567,6 +880,8 @@ }, "node_modules/@babel/traverse": { "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", @@ -583,6 +898,8 @@ }, "node_modules/@babel/types": { "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", @@ -757,11 +1074,15 @@ }, "node_modules/@codemod.com/jssg-types": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@codemod.com/jssg-types/-/jssg-types-1.3.1.tgz", + "integrity": "sha512-poYNa8mfr8+4+kBPc3bAKBTaUtOQdg5z3voeGGAAr0tiTBvC4cmmoY/dyHXEWT8F+p8A1tWUnhmJZ4WQXV3HVA==", "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", @@ -790,6 +1111,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" @@ -808,6 +1131,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" ], @@ -820,8 +1145,138 @@ "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", @@ -841,6 +1296,8 @@ }, "node_modules/@inquirer/figures": { "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" @@ -848,6 +1305,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", @@ -863,6 +1322,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { "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" @@ -873,6 +1334,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { "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" @@ -883,10 +1346,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", @@ -902,6 +1369,8 @@ }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { "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" @@ -915,6 +1384,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", @@ -930,6 +1401,8 @@ }, "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", @@ -938,6 +1411,8 @@ }, "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", @@ -946,6 +1421,8 @@ }, "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" @@ -953,10 +1430,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.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", @@ -965,6 +1446,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" @@ -972,10 +1455,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" @@ -1064,10 +1551,6 @@ "resolved": "recipes/slow-buffer-to-buffer-alloc-unsafe-slow", "link": true }, - "node_modules/@nodejs/timers-deprecations": { - "resolved": "recipes/timers-deprecations", - "link": true - }, "node_modules/@nodejs/tmpdir-to-tmpdir": { "resolved": "recipes/tmpdir-to-tmpdir", "link": true @@ -1098,6 +1581,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" @@ -1105,8 +1590,9 @@ }, "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": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -1122,6 +1608,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", @@ -1133,6 +1621,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", @@ -1145,10 +1635,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" @@ -1162,6 +1656,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" @@ -1172,6 +1668,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" @@ -1185,6 +1683,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", @@ -1198,6 +1698,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", @@ -1210,6 +1712,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", @@ -1223,6 +1727,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" @@ -1230,6 +1736,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": { @@ -1238,6 +1746,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", @@ -1252,6 +1762,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" @@ -1265,6 +1777,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", @@ -1282,6 +1796,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": "*", @@ -1289,28 +1805,28 @@ } }, "node_modules/@typescript/native-preview": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-5peFvGyf+TOlU6KYMLzfPiPJdxYwG0O/oQN4Z+EzDOzrN8tbY/H58+QOQww4Lo8m4b7+4o/0r+zopD/sYR6uMw==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview/-/native-preview-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-DvUmkkJ5BePLmZbQ9OecQr6wRVUlWbNz/bNEYmTcl7+0qwF8KtgPGriWiyuIzs+TiIhjf3HM1tt5OC/uBHNJsw==", "dev": true, "license": "Apache-2.0", "bin": { "tsgo": "bin/tsgo.js" }, "optionalDependencies": { - "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260117.1", - "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260117.1", - "@typescript/native-preview-linux-arm": "7.0.0-dev.20260117.1", - "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260117.1", - "@typescript/native-preview-linux-x64": "7.0.0-dev.20260117.1", - "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260117.1", - "@typescript/native-preview-win32-x64": "7.0.0-dev.20260117.1" + "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260112.1", + "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260112.1", + "@typescript/native-preview-linux-arm": "7.0.0-dev.20260112.1", + "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260112.1", + "@typescript/native-preview-linux-x64": "7.0.0-dev.20260112.1", + "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260112.1", + "@typescript/native-preview-win32-x64": "7.0.0-dev.20260112.1" } }, "node_modules/@typescript/native-preview-darwin-arm64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-sf8/7keXq1auS7XI0vyAs3t/vgss4/EwACZmzSYtO75dug8TRmuSQDPHxx4R16VURijO/GQ3Bz6rA8VivREzsA==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-arm64/-/native-preview-darwin-arm64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-FUOOGN0/9LF+AOX07SOqfX1hBQfP3rezMFCwDlwAVW52leJ2Fur8efrQR5oUNL8hDt/NMGJwsg3wreZGdYSqJg==", "cpu": [ "arm64" ], @@ -1322,9 +1838,9 @@ ] }, "node_modules/@typescript/native-preview-darwin-x64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-3DhQdRUbDq7YduIaRYJtH5MXqCzOry+GT4DjkLPJ08vOGOFypZjgd6G+moEQHgitnefisC1PkNcL1baF4B7+og==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-darwin-x64/-/native-preview-darwin-x64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-SgiY7DcvhcyCCdrFRcgq5zPK1jdp7hxhnvo8YEEGvBsvyI+Y/q6phoR79nqMnz5W7a2HTPuaxLjCf7tR17cw4w==", "cpu": [ "x64" ], @@ -1336,9 +1852,9 @@ ] }, "node_modules/@typescript/native-preview-linux-arm": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-RKSKINs23agj0MJJ2Tzkhe/MuwhcPqRNRRfLmpVRjrNWI43Ta6a5+5Lah+7GYjt00wHUOhay94ZT3iHJkeHATg==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm/-/native-preview-linux-arm-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-7mtAOEKaNOqKFIIVUsFK2IYB09bd/i8oIkzPi1EcEN3V7dzuKtSieNak30pY+k6z/f6QpUheHXVFM4wXBGbGrQ==", "cpu": [ "arm" ], @@ -1350,9 +1866,9 @@ ] }, "node_modules/@typescript/native-preview-linux-arm64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-R9h8cX5C0yBtE8xnpAxZBSHWPiVW3d5o3mup0ei1n/8w98lwtMFLWURnPD8N4kRgql9L40IbRXW6jqWdjDUe4Q==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-arm64/-/native-preview-linux-arm64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-N9Ukn5NUjO063F3YICBl/dSLEpJayTIMTAJbvbuLjEdlHmp9xn7ty3MCkE4FqP6x/CWLDiZttnu9jYppJ//Q5g==", "cpu": [ "arm64" ], @@ -1364,9 +1880,9 @@ ] }, "node_modules/@typescript/native-preview-linux-x64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-KI5UprUMIVT4wehBcbGZQm0I3z1uls8fsOmCUzdEpmaLpVu8NbTahgJPVtMyS/nDUiN3At4Uj8ciL36kgbqRmQ==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-linux-x64/-/native-preview-linux-x64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-K4/6TRu2MAwObOxZyUmUvAxi1B5fpwi/8OYb8xyf9VsLbkDCsBMbZxgwEMf9RBYhW74I187IIGEfw/g0oHDKEA==", "cpu": [ "x64" ], @@ -1378,9 +1894,9 @@ ] }, "node_modules/@typescript/native-preview-win32-arm64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-dUJTLMD24TQ4XiyYAxxqKs6hPrq8wS9BiFt+ucjCuWXBGQLbnfiT4bgYz2a4yfbtyxVkG7mxV8udo+gRXtaWRQ==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-arm64/-/native-preview-win32-arm64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-ivjcYuqlCD91x6QOO+/xpjGUiWBLzBCgz0aAITkEfDTBHEwf3keTEQH2GsaVnMC8GKUFdoEF6QtSR+jZ75BhWA==", "cpu": [ "arm64" ], @@ -1392,9 +1908,9 @@ ] }, "node_modules/@typescript/native-preview-win32-x64": { - "version": "7.0.0-dev.20260117.1", - "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260117.1.tgz", - "integrity": "sha512-SdKCAtNZee2TMdZ/bGjfKWX43qIAZhBwLlkPU1G0uxKqmDG1mVRbg/krxm5MnKOjFL00X/gozth6d3LmimonnA==", + "version": "7.0.0-dev.20260112.1", + "resolved": "https://registry.npmjs.org/@typescript/native-preview-win32-x64/-/native-preview-win32-x64-7.0.0-dev.20260112.1.tgz", + "integrity": "sha512-gZ+72BdVDA4VUFKw9ZvEkEger/2SrXw62gstz25TriOHROvjxEgXLVHqiVKhE/XkWqYT0GJ7aM7WKoM/RG2XTw==", "cpu": [ "x64" ], @@ -1407,6 +1923,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" @@ -1417,6 +1935,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" @@ -1427,6 +1947,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" @@ -1440,6 +1962,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" @@ -1447,6 +1971,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" @@ -1460,6 +1986,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" @@ -1470,10 +1998,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" @@ -1481,13 +2013,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", @@ -1506,6 +2044,8 @@ }, "node_modules/baseline-browser-mapping": { "version": "2.8.24", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.24.tgz", + "integrity": "sha512-uUhTRDPXamakPyghwrUcjaGvvBqGrWvBHReoiULMIpOJVM9IYzQh83Xk2Onx5HlGI2o10NNCzcs9TG/S3TkwrQ==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.js" @@ -1513,10 +2053,14 @@ }, "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", @@ -1526,6 +2070,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" @@ -1533,6 +2079,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" @@ -1543,6 +2091,8 @@ }, "node_modules/browserslist": { "version": "4.27.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.27.0.tgz", + "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", "funding": [ { "type": "opencollective", @@ -1558,7 +2108,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -1575,6 +2124,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", @@ -1597,10 +2148,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", @@ -1612,6 +2167,8 @@ }, "node_modules/caniuse-lite": { "version": "1.0.30001753", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001753.tgz", + "integrity": "sha512-Bj5H35MD/ebaOV4iDLqPEtiliTN29qkGtEHCwawWn4cYm+bPJM2NsaP30vtZcnERClMzp52J4+aw2UNbK4o+zw==", "funding": [ { "type": "opencollective", @@ -1630,6 +2187,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", @@ -1644,10 +2203,14 @@ }, "node_modules/chardet": { "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": "*" @@ -1655,6 +2218,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" @@ -1665,6 +2230,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" @@ -1675,6 +2242,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" @@ -1682,6 +2251,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" @@ -1689,6 +2260,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", @@ -1701,6 +2274,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" @@ -1711,10 +2286,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" @@ -1725,6 +2304,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" @@ -1735,18 +2316,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", @@ -1759,6 +2348,8 @@ }, "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": "*" @@ -1766,6 +2357,8 @@ }, "node_modules/debug": { "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" @@ -1781,6 +2374,8 @@ }, "node_modules/dedent": { "version": "1.7.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz", + "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1794,6 +2389,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" @@ -1804,6 +2401,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" @@ -1811,10 +2410,14 @@ }, "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.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" @@ -1825,6 +2428,8 @@ }, "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" @@ -1832,6 +2437,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" @@ -1842,6 +2449,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" @@ -1849,6 +2458,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", @@ -1857,6 +2468,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", @@ -1869,18 +2482,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.244", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.244.tgz", + "integrity": "sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw==", "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" @@ -1888,6 +2509,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" @@ -1895,6 +2518,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" @@ -1905,6 +2530,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", @@ -1918,6 +2545,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" @@ -1925,6 +2554,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" @@ -1935,6 +2566,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", @@ -1946,6 +2579,8 @@ }, "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" @@ -1953,6 +2588,8 @@ }, "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" @@ -1963,6 +2600,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" @@ -1976,6 +2615,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" @@ -1986,6 +2627,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", @@ -1998,6 +2641,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" @@ -2008,6 +2653,8 @@ }, "node_modules/flow-parser": { "version": "0.289.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.289.0.tgz", + "integrity": "sha512-w4sVnH6ddNAIxokoz0mGyiIIdzvqncFhAYW+RmkPbPSSTYozG6yhqAixzaWeBCQf2qqXJTlHkoKPnf/BAj8Ofw==", "license": "MIT", "engines": { "node": ">=0.4.0" @@ -2015,6 +2662,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", @@ -2029,6 +2678,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", @@ -2043,10 +2694,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", @@ -2058,6 +2713,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" @@ -2065,10 +2722,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" @@ -2076,6 +2737,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" @@ -2083,6 +2746,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", @@ -2105,6 +2770,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", @@ -2116,6 +2783,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", @@ -2124,6 +2793,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" @@ -2131,6 +2802,8 @@ }, "node_modules/glob": { "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", @@ -2149,6 +2822,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" @@ -2159,10 +2834,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" @@ -2170,6 +2849,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" @@ -2180,6 +2861,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" @@ -2193,6 +2876,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" @@ -2203,6 +2888,8 @@ }, "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" @@ -2210,6 +2897,8 @@ }, "node_modules/iconv-lite": { "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.0.0" @@ -2224,6 +2913,8 @@ }, "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", @@ -2242,6 +2933,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" @@ -2249,6 +2942,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", @@ -2257,10 +2953,14 @@ }, "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.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", @@ -2282,10 +2982,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" @@ -2293,6 +2997,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" @@ -2300,6 +3006,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" @@ -2307,6 +3015,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" @@ -2317,6 +3027,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" @@ -2324,6 +3036,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" @@ -2334,10 +3048,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" @@ -2345,6 +3063,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" @@ -2358,10 +3078,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", @@ -2399,6 +3123,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" @@ -2409,6 +3135,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", @@ -2423,6 +3151,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" @@ -2433,6 +3163,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" @@ -2443,6 +3175,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" @@ -2450,6 +3184,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", @@ -2461,10 +3197,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", @@ -2479,6 +3219,8 @@ }, "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" @@ -2486,6 +3228,8 @@ }, "node_modules/magic-string": { "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.5" @@ -2493,6 +3237,8 @@ }, "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", @@ -2504,6 +3250,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" @@ -2511,6 +3259,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" @@ -2518,6 +3268,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", @@ -2527,6 +3279,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", @@ -2538,6 +3292,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" @@ -2545,6 +3301,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" @@ -2555,6 +3313,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" @@ -2562,6 +3322,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" @@ -2575,6 +3337,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" @@ -2582,10 +3346,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" @@ -2593,10 +3361,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" @@ -2607,6 +3379,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", @@ -2615,6 +3389,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" @@ -2625,6 +3401,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", @@ -2642,6 +3421,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" @@ -2660,10 +3441,14 @@ }, "node_modules/node-releases": { "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" @@ -2671,6 +3456,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" @@ -2684,6 +3471,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", @@ -2702,6 +3491,8 @@ }, "node_modules/openai/node_modules/@types/node": { "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" @@ -2709,10 +3500,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", @@ -2734,6 +3529,8 @@ }, "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" @@ -2747,6 +3544,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" @@ -2757,6 +3556,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" @@ -2764,10 +3565,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" @@ -2775,6 +3580,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" @@ -2782,6 +3589,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" @@ -2789,6 +3598,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" @@ -2796,6 +3607,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" @@ -2803,6 +3616,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", @@ -2817,14 +3632,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" @@ -2835,6 +3656,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" @@ -2842,6 +3665,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" @@ -2849,6 +3674,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" @@ -2859,6 +3686,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" @@ -2872,10 +3701,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", @@ -2888,6 +3721,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", @@ -2901,6 +3736,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", @@ -2912,10 +3749,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" @@ -2926,6 +3768,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", @@ -2934,6 +3778,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", @@ -2952,6 +3799,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" @@ -2962,6 +3811,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" @@ -2969,6 +3820,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" @@ -2976,6 +3829,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", @@ -2994,10 +3849,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" @@ -3005,6 +3864,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" @@ -3015,6 +3876,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" @@ -3025,6 +3888,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" @@ -3032,6 +3897,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" @@ -3042,6 +3909,8 @@ }, "node_modules/simple-git": { "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", @@ -3055,6 +3924,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" @@ -3062,6 +3933,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", @@ -3070,6 +3943,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" @@ -3077,6 +3952,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", @@ -3090,6 +3967,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", @@ -3102,6 +3981,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" @@ -3113,6 +3994,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" @@ -3123,6 +4006,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" @@ -3133,6 +4018,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" @@ -3143,10 +4030,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/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" @@ -3157,10 +4048,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" @@ -3168,6 +4063,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" @@ -3178,10 +4075,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" @@ -3192,14 +4093,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.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", "funding": [ { "type": "opencollective", @@ -3228,10 +4135,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" @@ -3239,6 +4150,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" @@ -3246,10 +4159,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", @@ -3258,6 +4175,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" @@ -3271,6 +4190,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", @@ -3284,6 +4205,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", @@ -3299,10 +4222,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", @@ -3312,14 +4239,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" @@ -3330,6 +4263,8 @@ }, "node_modules/yoctocolors-cjs": { "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" @@ -3546,17 +4481,6 @@ "@codemod.com/jssg-types": "^1.3.1" } }, - "recipes/timers-deprecations": { - "name": "@nodejs/timers-deprecations", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "@nodejs/codemod-utils": "*" - }, - "devDependencies": { - "@codemod.com/jssg-types": "^1.0.9" - } - }, "recipes/tmpdir-to-tmpdir": { "name": "@nodejs/tmpdir-to-tmpdir", "version": "1.0.1", From 7d3e420b762164444b862cf0799397c86860457a Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Sat, 17 Jan 2026 17:12:05 +0100 Subject: [PATCH 10/11] Update package-lock.json --- package-lock.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package-lock.json b/package-lock.json index 40220450..3778f0d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,6 +402,7 @@ "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": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.5", @@ -1551,6 +1552,10 @@ "resolved": "recipes/slow-buffer-to-buffer-alloc-unsafe-slow", "link": true }, + "node_modules/@nodejs/timers-deprecations": { + "resolved": "recipes/timers-deprecations", + "link": true + }, "node_modules/@nodejs/tmpdir-to-tmpdir": { "resolved": "recipes/tmpdir-to-tmpdir", "link": true @@ -1593,6 +1598,7 @@ "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": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -1790,6 +1796,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.9.tgz", "integrity": "sha512-/rpCXHlCWeqClNBwUhDcusJxXYDjZTyE8v5oTO7WbL8eij2nKhUeU89/6xgjU7N4/Vh3He0BtyhJdQbDyhiXAw==", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -2108,6 +2115,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -4481,6 +4489,17 @@ "@codemod.com/jssg-types": "^1.3.1" } }, + "recipes/timers-deprecations": { + "name": "@nodejs/timers-deprecations", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "@nodejs/codemod-utils": "*" + }, + "devDependencies": { + "@codemod.com/jssg-types": "^1.0.9" + } + }, "recipes/tmpdir-to-tmpdir": { "name": "@nodejs/tmpdir-to-tmpdir", "version": "1.0.1", From 9321583517621e3cdca18b31c24f655208afeec8 Mon Sep 17 00:00:00 2001 From: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Date: Thu, 22 Jan 2026 22:33:32 +0100 Subject: [PATCH 11/11] Update Co-Authored-By: Bruno Rodrigues --- .../src/active-to-standard-timer.ts | 32 +++-- .../src/cleanup-imports.ts | 115 +++++++----------- .../src/enroll-to-set-timeout.ts | 31 +++-- .../src/unenroll-to-clear-timer.ts | 31 +++-- .../src/unref-active-to-unref.ts | 31 +++-- utils/src/ast-grep/general.test.ts | 61 ---------- utils/src/ast-grep/general.ts | 15 --- 7 files changed, 99 insertions(+), 217 deletions(-) delete mode 100644 utils/src/ast-grep/general.test.ts delete mode 100644 utils/src/ast-grep/general.ts diff --git a/recipes/timers-deprecations/src/active-to-standard-timer.ts b/recipes/timers-deprecations/src/active-to-standard-timer.ts index 6cd364c1..a25e39db 100644 --- a/recipes/timers-deprecations/src/active-to-standard-timer.ts +++ b/recipes/timers-deprecations/src/active-to-standard-timer.ts @@ -1,18 +1,10 @@ import { EOL } from 'node:os'; -import { - getNodeImportStatements, - getNodeImportCalls, -} from '@nodejs/codemod-utils/ast-grep/import-statement'; -import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; -import { - findParentStatement, - isSafeResourceTarget, -} from '@nodejs/codemod-utils/ast-grep/general'; import { detectIndentUnit, getLineIndent, } from '@nodejs/codemod-utils/ast-grep/indent'; +import { getModuleDependencies } from '@nodejs/codemod-utils/ast-grep/module-dependencies'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; @@ -25,14 +17,10 @@ export default function transform(root: SgRoot): string | null { const edits: Edit[] = []; const handledStatements = new Set(); - const importNodes = [ - ...getNodeRequireCalls(root, 'timers'), - ...getNodeImportStatements(root, 'timers'), - ...getNodeImportCalls(root, 'timers'), - ]; + const importNodes = getModuleDependencies(root, 'timers'); for (const importNode of importNodes) { - if (importNode.kind() === 'expression_statement') continue; + if (importNode.is('expression_statement')) continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -49,9 +37,19 @@ export default function transform(root: SgRoot): string | null { const resourceNode = match.getMatch('RESOURCE'); if (!resourceNode) continue; - if (!isSafeResourceTarget(resourceNode)) continue; + const isSafeResourceTarget = + resourceNode.is('identifier') || resourceNode.is('member_expression'); + if (!isSafeResourceTarget) continue; + + const statement = match.find({ + rule: { + inside: { + kind: 'expression_statement', + stopBy: 'end', + }, + }, + }); - const statement = findParentStatement(match); if (!statement) continue; if (handledStatements.has(statement.id())) continue; diff --git a/recipes/timers-deprecations/src/cleanup-imports.ts b/recipes/timers-deprecations/src/cleanup-imports.ts index d875aa62..7b50ac54 100644 --- a/recipes/timers-deprecations/src/cleanup-imports.ts +++ b/recipes/timers-deprecations/src/cleanup-imports.ts @@ -1,12 +1,6 @@ -import { - getNodeImportStatements, - getDefaultImportIdentifier, - getNodeImportCalls, -} from '@nodejs/codemod-utils/ast-grep/import-statement'; -import { - getNodeRequireCalls, - getRequireNamespaceIdentifier, -} from '@nodejs/codemod-utils/ast-grep/require-call'; +import { getDefaultImportIdentifier } from '@nodejs/codemod-utils/ast-grep/import-statement'; +import { getRequireNamespaceIdentifier } from '@nodejs/codemod-utils/ast-grep/require-call'; +import { getModuleDependencies } from '@nodejs/codemod-utils/ast-grep/module-dependencies'; import { removeBinding } from '@nodejs/codemod-utils/ast-grep/remove-binding'; import { removeLines } from '@nodejs/codemod-utils/ast-grep/remove-lines'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; @@ -14,21 +8,16 @@ import type { Edit, Range, SgNode, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; const DEPRECATED_METHODS = ['enroll', 'unenroll', 'active', '_unrefActive']; -const DEPRECATED_SET = new Set(DEPRECATED_METHODS); export default function transform(root: SgRoot): string | null { const rootNode = root.root(); const edits: Edit[] = []; const linesToRemove: Range[] = []; - const statements = [ - ...getNodeRequireCalls(root, 'timers'), - ...getNodeImportStatements(root, 'timers'), - ...getNodeImportCalls(root, 'timers'), - ]; + const importNodes = getModuleDependencies(root, 'timers'); - for (const statement of statements) { - if (statement.kind() === 'expression_statement') continue; + for (const statement of importNodes) { + if (statement.is('expression_statement')) continue; if (shouldRemoveEntireStatement(statement)) { linesToRemove.push(statement.range()); continue; @@ -134,63 +123,43 @@ function getNamespaceIdentifier(statement: SgNode): SgNode | null { } function shouldRemoveEntireStatement(statement: SgNode): boolean { - const objectPattern = statement.find({ rule: { kind: 'object_pattern' } }); - - if (objectPattern) { - const propertyNames = new Set(); - const shorthands = objectPattern.findAll({ - rule: { kind: 'shorthand_property_identifier_pattern' }, - }); - const pairs = objectPattern.findAll({ - rule: { kind: 'pair_pattern' }, - }); - - for (const shorthand of shorthands) { - propertyNames.add(shorthand.text()); - } - - for (const pair of pairs) { - const property = pair.find({ rule: { kind: 'property_identifier' } }); - - if (!property) return false; - propertyNames.add(property.text()); - } - - if (!propertyNames.size) return false; - - for (const name of propertyNames) { - if (!DEPRECATED_SET.has(name)) return false; - } - - return true; - } - - const namedImports = statement.find({ rule: { kind: 'named_imports' } }); - if (!namedImports) return false; - - const importClause = statement.find({ rule: { kind: 'import_clause' } }); - if (!importClause) return false; - - if (importClause.find({ rule: { kind: 'namespace_import' } })) return false; - - const defaultImport = importClause.find({ + const supportedMethods = statement.findAll({ + constraints: { + METHOD: { + regex: `^(${DEPRECATED_METHODS.join('|')})$`, + }, + }, rule: { - kind: 'identifier', - not: { inside: { kind: 'named_imports' } }, + any: [ + { + inside: { + kind: 'object_pattern', + }, + kind: 'shorthand_property_identifier_pattern', + pattern: '$METHOD', + }, + { + inside: { + kind: 'pair_pattern', + inside: { + kind: 'object_pattern', + }, + }, + kind: 'property_identifier', + pattern: '$METHOD', + }, + { + inside: { + kind: 'import_specifier', + inside: { + kind: 'named_imports', + }, + }, + kind: 'identifier', + pattern: '$METHOD', + }, + ], }, }); - if (defaultImport) return false; - - let hasSpecifier = false; - for (const specifier of namedImports.findAll({ - rule: { kind: 'import_specifier' }, - })) { - hasSpecifier = true; - const identifiers = specifier.findAll({ rule: { kind: 'identifier' } }); - if (!identifiers.length) return false; - const importedName = identifiers[0]?.text(); - if (!importedName || !DEPRECATED_SET.has(importedName)) return false; - } - - return hasSpecifier; + return Boolean(supportedMethods.length); } diff --git a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts index 84dfd820..25d1f4bd 100644 --- a/recipes/timers-deprecations/src/enroll-to-set-timeout.ts +++ b/recipes/timers-deprecations/src/enroll-to-set-timeout.ts @@ -1,20 +1,12 @@ import { EOL } from 'node:os'; -import { - getNodeImportStatements, - getNodeImportCalls, -} from '@nodejs/codemod-utils/ast-grep/import-statement'; -import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; -import { - findParentStatement, - isSafeResourceTarget, -} from '@nodejs/codemod-utils/ast-grep/general'; import { detectIndentUnit, getLineIndent, } from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; +import { getModuleDependencies } from '@nodejs/codemod-utils/ast-grep/module-dependencies'; const TARGET_METHOD = 'enroll'; @@ -25,14 +17,10 @@ export default function transform(root: SgRoot): string | null { const edits: Edit[] = []; const handledStatements = new Set(); - const importNodes = [ - ...getNodeRequireCalls(root, 'timers'), - ...getNodeImportStatements(root, 'timers'), - ...getNodeImportCalls(root, 'timers'), - ]; + const importNodes = getModuleDependencies(root, 'timers'); for (const importNode of importNodes) { - if (importNode.kind() === 'expression_statement') continue; + if (importNode.is('expression_statement')) continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -45,9 +33,18 @@ export default function transform(root: SgRoot): string | null { const timeoutNode = match.getMatch('TIMEOUT'); if (!resourceNode || !timeoutNode) continue; - if (!isSafeResourceTarget(resourceNode)) continue; + const isSafeResourceTarget = + resourceNode.is('identifier') || resourceNode.is('member_expression'); + if (!isSafeResourceTarget) continue; - const statement = findParentStatement(match); + const statement = match.find({ + rule: { + inside: { + kind: 'expression_statement', + stopBy: 'end', + }, + }, + }); if (!statement) continue; if (handledStatements.has(statement.id())) continue; diff --git a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts index 6f312265..39beabc4 100644 --- a/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts +++ b/recipes/timers-deprecations/src/unenroll-to-clear-timer.ts @@ -1,17 +1,9 @@ import { EOL } from 'node:os'; -import { - getNodeImportStatements, - getNodeImportCalls, -} from '@nodejs/codemod-utils/ast-grep/import-statement'; -import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; -import { - findParentStatement, - isSafeResourceTarget, -} from '@nodejs/codemod-utils/ast-grep/general'; import { getLineIndent } from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; +import { getModuleDependencies } from '@nodejs/codemod-utils/ast-grep/module-dependencies'; const TARGET_METHOD = 'unenroll'; @@ -21,14 +13,10 @@ export default function transform(root: SgRoot): string | null { const edits: Edit[] = []; const handledStatements = new Set(); - const importNodes = [ - ...getNodeRequireCalls(root, 'timers'), - ...getNodeImportStatements(root, 'timers'), - ...getNodeImportCalls(root, 'timers'), - ]; + const importNodes = getModuleDependencies(root, 'timers'); for (const importNode of importNodes) { - if (importNode.kind() === 'expression_statement') continue; + if (importNode.is('expression_statement')) continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -45,9 +33,18 @@ export default function transform(root: SgRoot): string | null { const resourceNode = match.getMatch('RESOURCE'); if (!resourceNode) continue; - if (!isSafeResourceTarget(resourceNode)) continue; + const isSafeResourceTarget = + resourceNode.is('identifier') || resourceNode.is('member_expression'); + if (!isSafeResourceTarget) continue; - const statement = findParentStatement(match); + const statement = match.find({ + rule: { + inside: { + kind: 'expression_statement', + stopBy: 'end', + }, + }, + }); if (!statement) continue; if (handledStatements.has(statement.id())) continue; diff --git a/recipes/timers-deprecations/src/unref-active-to-unref.ts b/recipes/timers-deprecations/src/unref-active-to-unref.ts index 6872c5f0..d943cf18 100644 --- a/recipes/timers-deprecations/src/unref-active-to-unref.ts +++ b/recipes/timers-deprecations/src/unref-active-to-unref.ts @@ -1,20 +1,12 @@ import { EOL } from 'node:os'; -import { - getNodeImportStatements, - getNodeImportCalls, -} from '@nodejs/codemod-utils/ast-grep/import-statement'; -import { getNodeRequireCalls } from '@nodejs/codemod-utils/ast-grep/require-call'; import { resolveBindingPath } from '@nodejs/codemod-utils/ast-grep/resolve-binding-path'; -import { - findParentStatement, - isSafeResourceTarget, -} from '@nodejs/codemod-utils/ast-grep/general'; import { detectIndentUnit, getLineIndent, } from '@nodejs/codemod-utils/ast-grep/indent'; import type { Edit, SgRoot } from '@codemod.com/jssg-types/main'; import type Js from '@codemod.com/jssg-types/langs/javascript'; +import { getModuleDependencies } from '@nodejs/codemod-utils/ast-grep/module-dependencies'; const TARGET_METHOD = '_unrefActive'; @@ -25,14 +17,10 @@ export default function transform(root: SgRoot): string | null { const edits: Edit[] = []; const handledStatements = new Set(); - const importNodes = [ - ...getNodeRequireCalls(root, 'timers'), - ...getNodeImportStatements(root, 'timers'), - ...getNodeImportCalls(root, 'timers'), - ]; + const importNodes = getModuleDependencies(root, 'timers'); for (const importNode of importNodes) { - if (importNode.kind() === 'expression_statement') continue; + if (importNode.is('expression_statement')) continue; const bindingPath = resolveBindingPath(importNode, `$.${TARGET_METHOD}`); if (!bindingPath) continue; @@ -49,9 +37,18 @@ export default function transform(root: SgRoot): string | null { const resourceNode = match.getMatch('RESOURCE'); if (!resourceNode) continue; - if (!isSafeResourceTarget(resourceNode)) continue; + const isSafeResourceTarget = + resourceNode.is('identifier') || resourceNode.is('member_expression'); + if (!isSafeResourceTarget) continue; - const statement = findParentStatement(match); + const statement = match.find({ + rule: { + inside: { + kind: 'expression_statement', + stopBy: 'end', + }, + }, + }); if (!statement) continue; if (handledStatements.has(statement.id())) continue; diff --git a/utils/src/ast-grep/general.test.ts b/utils/src/ast-grep/general.test.ts deleted file mode 100644 index fa09f195..00000000 --- a/utils/src/ast-grep/general.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -import assert from 'node:assert/strict'; -import { describe, it } from 'node:test'; -import astGrep from '@ast-grep/napi'; -import { findParentStatement, isSafeResourceTarget } from './general.ts'; // ts ext is needed - -describe('findParentStatement', () => { - it('should find the parent expression_statement', () => { - const code = 'function test() { x + 1; }'; - const root = astGrep.parse(astGrep.Lang.JavaScript, code); - const node = root.root().find({ - rule: { kind: 'binary_expression' }, - }); - - const parentStatement = findParentStatement(node); - assert.ok(parentStatement); - assert.strictEqual(parentStatement?.kind(), 'expression_statement'); - }); - - it('should return null if no parent statement is found', () => { - const code = 'const x = 5;'; - const root = astGrep.parse(astGrep.Lang.JavaScript, code); - const node = root.root().find({ - rule: { kind: 'identifier' }, - }); - - const parentStatement = findParentStatement(node); - assert.strictEqual(parentStatement, null); - }); -}); - -describe('isSafeResourceTarget', () => { - it('should return true for an identifier', () => { - const code = 'function test() { const x = 5; }'; - const root = astGrep.parse(astGrep.Lang.JavaScript, code); - const node = root.root().find({ - rule: { kind: 'identifier' }, - }); - - assert.strictEqual(isSafeResourceTarget(node), true); - }); - - it('should return true for a member_expression', () => { - const code = 'function test() { obj.prop = 5; }'; - const root = astGrep.parse(astGrep.Lang.JavaScript, code); - const node = root.root().find({ - rule: { kind: 'member_expression' }, - }); - - assert.strictEqual(isSafeResourceTarget(node), true); - }); - - it('should return false for other node types', () => { - const code = 'function test() { 5 + 3; }'; - const root = astGrep.parse(astGrep.Lang.JavaScript, code); - const node = root.root().find({ - rule: { kind: 'binary_expression' }, - }); - - assert.strictEqual(isSafeResourceTarget(node), false); - }); -}); diff --git a/utils/src/ast-grep/general.ts b/utils/src/ast-grep/general.ts deleted file mode 100644 index 9f183b2f..00000000 --- a/utils/src/ast-grep/general.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { SgNode } from '@codemod.com/jssg-types/main'; -import type Js from '@codemod.com/jssg-types/langs/javascript'; - -export function findParentStatement(node: SgNode): SgNode | null { - for (const ancestor of node.ancestors()) { - if (ancestor.kind() === 'expression_statement') { - return ancestor; - } - } - return null; -} - -export function isSafeResourceTarget(node: SgNode): boolean { - return node.is('identifier') || node.is('member_expression'); -}