diff --git a/package-lock.json b/package-lock.json index 137c4b7f..2e6a7810 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,120 +19,10 @@ "typescript": "^7.0.2" } }, - "../codemod/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript": { - "version": "5.5.4", - "extraneous": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "devDependencies": { - "@dprint/formatter": "^0.3.0", - "@dprint/typescript": "0.91.0", - "@esfx/canceltoken": "^1.0.0", - "@octokit/rest": "^20.1.1", - "@types/chai": "^4.3.16", - "@types/microsoft__typescript-etw": "^0.1.3", - "@types/minimist": "^1.2.5", - "@types/mocha": "^10.0.6", - "@types/ms": "^0.7.34", - "@types/node": "latest", - "@types/source-map-support": "^0.5.10", - "@types/which": "^3.0.3", - "@typescript-eslint/eslint-plugin": "^7.11.0", - "@typescript-eslint/parser": "^7.11.0", - "@typescript-eslint/utils": "^7.11.0", - "azure-devops-node-api": "^13.0.0", - "c8": "^9.1.0", - "chai": "^4.4.1", - "chalk": "^4.1.2", - "chokidar": "^3.6.0", - "diff": "^5.2.0", - "dprint": "^0.46.1", - "esbuild": "^0.21.4", - "eslint": "^8.57.0", - "eslint-formatter-autolinkable-stylish": "^1.3.0", - "eslint-plugin-local": "^4.2.2", - "fast-xml-parser": "^4.4.0", - "glob": "^10.4.1", - "hereby": "^1.8.9", - "jsonc-parser": "^3.2.1", - "minimist": "^1.2.8", - "mocha": "^10.4.0", - "mocha-fivemat-progress-reporter": "^0.1.0", - "ms": "^2.1.3", - "node-fetch": "^3.3.2", - "playwright": "^1.44.1", - "source-map-support": "^0.5.21", - "tslib": "^2.6.2", - "typescript": "^5.4.5", - "which": "^3.0.1" - }, - "engines": { - "node": ">=14.17" - } - }, - "../codemod/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript": { - "version": "5.9.3", - "extraneous": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "devDependencies": { - "@dprint/formatter": "^0.4.1", - "@dprint/typescript": "0.93.4", - "@esfx/canceltoken": "^1.0.0", - "@eslint/js": "^9.20.0", - "@octokit/rest": "^21.1.1", - "@types/chai": "^4.3.20", - "@types/diff": "^7.0.1", - "@types/minimist": "^1.2.5", - "@types/mocha": "^10.0.10", - "@types/ms": "^0.7.34", - "@types/node": "latest", - "@types/source-map-support": "^0.5.10", - "@types/which": "^3.0.4", - "@typescript-eslint/rule-tester": "^8.24.1", - "@typescript-eslint/type-utils": "^8.24.1", - "@typescript-eslint/utils": "^8.24.1", - "azure-devops-node-api": "^14.1.0", - "c8": "^10.1.3", - "chai": "^4.5.0", - "chokidar": "^4.0.3", - "diff": "^7.0.0", - "dprint": "^0.49.0", - "esbuild": "^0.25.0", - "eslint": "^9.20.1", - "eslint-formatter-autolinkable-stylish": "^1.4.0", - "eslint-plugin-regexp": "^2.7.0", - "fast-xml-parser": "^4.5.2", - "glob": "^10.4.5", - "globals": "^15.15.0", - "hereby": "^1.10.0", - "jsonc-parser": "^3.3.1", - "knip": "^5.44.4", - "minimist": "^1.2.8", - "mocha": "^10.8.2", - "mocha-fivemat-progress-reporter": "^0.1.0", - "monocart-coverage-reports": "^2.12.1", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "playwright": "^1.50.1", - "source-map-support": "^0.5.21", - "tslib": "^2.8.1", - "typescript": "^5.7.3", - "typescript-eslint": "^8.24.1", - "which": "^3.0.1" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/@ast-grep/lang-bash": { "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-bash/-/lang-bash-0.0.8.tgz", + "integrity": "sha512-qFykSsOdBv35I1rtt2PstJ4luzV9J1YCiFZBgySI8UPOh+TFnmpdlq9CrryNOj0Q7f6zZhc1OIau+/mUSs6HAg==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -150,6 +40,8 @@ }, "node_modules/@ast-grep/lang-json": { "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@ast-grep/lang-json/-/lang-json-0.0.7.tgz", + "integrity": "sha512-8wiH+B4Rih8/vHsUB4DOTXnQHMxfWhaBygUEZ036kfr1T9WFvx5E7QYd2WX2Wm1nFCzUmWbIfsoE+cR2G9SJlA==", "dev": true, "hasInstallScript": true, "license": "ISC", @@ -353,6 +245,8 @@ }, "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" }, @@ -674,6 +568,10 @@ "resolved": "recipes/util-print-to-console-log", "link": true }, + "node_modules/@nodejs/v22-to-v24": { + "resolved": "recipes/v22-to-v24", + "link": true + }, "node_modules/@nodejs/zlib-bytesread-to-byteswritten": { "resolved": "recipes/zlib-bytesread-to-byteswritten", "link": true @@ -1030,6 +928,8 @@ }, "node_modules/dedent": { "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", "license": "MIT", "peerDependencies": { "babel-plugin-macros": "^3.1.0" @@ -1441,6 +1341,11 @@ "@codemod.com/jssg-types": "^1.6.2" } }, + "recipes/v22-to-v24": { + "name": "@nodejs/v22-to-v24", + "version": "1.0.1", + "license": "MIT" + }, "recipes/zlib-bytesread-to-byteswritten": { "name": "@nodejs/zlib-bytesread-to-byteswritten", "version": "1.0.1", diff --git a/recipes/v22-to-v24/README.md b/recipes/v22-to-v24/README.md new file mode 100644 index 00000000..d1c66d3c --- /dev/null +++ b/recipes/v22-to-v24/README.md @@ -0,0 +1,12 @@ +# Node.js v22 → v24 Migration + +This codemod only wraps all migrations needed to upgrade a Node.js codebase from **v22 to v24**. + +> [!WARNING] +> This codemod is on `v0.0.X` because there are missing parts so be careful before pushing changes to production. If you find any missing migration, please open an issue or a PR. + +## More information + +You can find more information about the changes in Node.js v24 in the [official migration guide](https://nodejs.org/en/blog/migrations/v22-to-v24). + +To know missing part read this [issue](https://github.com/nodejs/userland-migrations/issues/239) diff --git a/recipes/v22-to-v24/codemod.yaml b/recipes/v22-to-v24/codemod.yaml new file mode 100644 index 00000000..276bc4d0 --- /dev/null +++ b/recipes/v22-to-v24/codemod.yaml @@ -0,0 +1,24 @@ +schema_version: "1.0" +name: "@nodejs/v22-to-v24" +version: "0.0.1" +description: Handle breaking changes in Node.js v24 by replacing deprecated APIs and updating code to be compatible with the new version. +author: Augustin Mauroy +license: MIT +workflow: workflow.yaml +category: migration +repository: https://github.com/nodejs/userland-migrations + +targets: + languages: + - javascript + - typescript + +keywords: + - transformation + - migration + - nodejs + - breaking-changes + +registry: + access: public + visibility: public diff --git a/recipes/v22-to-v24/package.json b/recipes/v22-to-v24/package.json new file mode 100644 index 00000000..1e719f1f --- /dev/null +++ b/recipes/v22-to-v24/package.json @@ -0,0 +1,18 @@ +{ + "name": "@nodejs/v22-to-v24", + "version": "1.0.1", + "description": "Handle breaking changes in Node.js v24 by replacing deprecated APIs and updating code to be compatible with the new version.", + "type": "module", + "scripts": { + "test": "echo \"no test necessary\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/nodejs/userland-migrations.git", + "directory": "recipes/v22-to-v24", + "bugs": "https://github.com/nodejs/userland-migrations/issues" + }, + "author": "Augustin Mauroy", + "license": "MIT", + "homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/v22-to-v24/README.md" +} diff --git a/recipes/v22-to-v24/workflow.yaml b/recipes/v22-to-v24/workflow.yaml new file mode 100644 index 00000000..2fa195b0 --- /dev/null +++ b/recipes/v22-to-v24/workflow.yaml @@ -0,0 +1,36 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/codemod-com/codemod/refs/heads/main/schemas/workflow.json + +version: "1" + +nodes: + - id: apply-transforms + name: Apply AST Transformations + type: automatic + steps: + - name: Run `@nodejs/dirent-path-to-parent-path` from Codemod Registry + codemod: + source: "@nodejs/dirent-path-to-parent-path" + - name: Run `@nodejs/fs-access-mode-constants` from Codemod Registry + codemod: + source: "@nodejs/fs-access-mode-constants" + - name: Run `@nodejs/fs-truncate-fd-deprecation` from Codemod Registry + codemod: + source: "@nodejs/fs-truncate-fd-deprecation" + - name: Run `@nodejs/http-outgoingmessage-headers` from Codemod Registry + codemod: + source: "@nodejs/http-outgoingmessage-headers" + - name: Run `@nodejs/http2-priority-signaling` from Codemod Registry + codemod: + source: "@nodejs/http2-priority-signaling" + - name: Run `@nodejs/timers-deprecations` from Codemod Registry + codemod: + source: "@nodejs/timers-deprecations" + - name: Run `@nodejs/tls-create-secure-pair-to-tls-socket` from Codemod Registry + codemod: + source: "@nodejs/tls-create-secure-pair-to-tls-socket" + - name: Run `@nodejs/util-is` from Codemod Registry + codemod: + source: "@nodejs/util-is" + - name: Run `util-log-to-console-log` from Codemod Registry + codemod: + source: "@nodejs/util-log-to-console-log"