-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
content(migrations): update
#8420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8420 +/- ##
==========================================
- Coverage 73.70% 73.68% -0.03%
==========================================
Files 107 107
Lines 9161 9161
Branches 311 311
==========================================
- Hits 6752 6750 -2
- Misses 2407 2409 +2
Partials 2 2 ☔ View full report in Codecov by Sentry. |
📦 Build Size ComparisonSummary
Changes➕ Added Assets (1)
➖ Removed Assets (1)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the Node.js v22 to v24 migration guide by adding new codemods (crypto-rsa-pss-update, dirent-path-to-parent-path, and process-assert-to-node-assert) and reorganizing all codemods in alphabetical order. It also updates the CODEOWNERS file to assign ownership of migration-related documentation to the userland-migrations team.
Key changes:
- Added three new codemod sections with examples and installation instructions
- Reordered codemods alphabetically (crypto → dirent → fs-access → fs-truncate → process-assert)
- Removed older codemods (
util-log-to-console-logandzlib-bytesRead-to-bytesWritten)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/site/pages/en/blog/migrations/v22-to-v24.mdx | Adds new codemods for EOL deprecations, reorganizes sections alphabetically, and updates migration guidance |
| .github/CODEOWNERS | Assigns ownership of migration-related documentation to @nodejs/userland-migrations team |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #### `dirent-path-to-parent-path` | ||
|
|
||
| This codemod transforms the usage of `dirent.path` to use `dirent.parentPath`. | ||
|
|
||
| See [DEP0178](https://nodejs.org/api/deprecations.html#DEP0178). | ||
|
|
||
| You can find this codemod in the [Codemod Registry](https://app.codemod.com/registry/@nodejs/dirent-path-to-parent-path). | ||
|
|
||
| ```bash | ||
| npx codemod run @nodejs/dirent-path-to-parent-path | ||
| ``` | ||
|
|
||
| #### Examples | ||
|
|
||
| ##### readdir | ||
|
|
||
| ```js displayName="Before" | ||
| const { readdir } = require('node:fs/promises'); | ||
| const entries = await readdir('/some/path', { withFileTypes: true }); | ||
| for (const dirent of entries) { | ||
| console.log(dirent.path); | ||
| } | ||
| ``` | ||
|
|
||
| ```js displayName="After" | ||
| const crypto = require('node:crypto'); | ||
| const { readdir } = require('node:fs/promises'); | ||
| const entries = await readdir('/some/path', { withFileTypes: true }); | ||
| for (const dirent of entries) { | ||
| console.log(dirent.parentPath); | ||
| } | ||
| ``` | ||
|
|
||
| crypto.generateKeyPair( | ||
| 'rsa-pss', | ||
| { | ||
| modulusLength: 2048, | ||
| hashAlgorithm: 'sha256', | ||
| mgf1HashAlgorithm: 'sha1', | ||
| saltLength: 32, | ||
| }, | ||
| (err, publicKey, privateKey) => { | ||
| // callback | ||
| } | ||
| ); | ||
| ##### opendir | ||
|
|
||
| ```js displayName="Before" | ||
| import { opendir } from 'node:fs/promises'; | ||
| const dir = await opendir('./'); | ||
| for await (const dirent of dir) { | ||
| console.log(`Found ${dirent.name} in ${dirent.path}`); | ||
| } | ||
| ``` | ||
|
|
||
| ```js displayName="After" | ||
| import { opendir } from 'node:fs/promises'; | ||
| const dir = await opendir('./'); | ||
| for await (const dirent of dir) { | ||
| console.log(`Found ${dirent.name} in ${dirent.parentPath}`); | ||
| } | ||
| ``` |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire section for dirent-path-to-parent-path is duplicated. The same content already appears at lines 120-168. Remove this duplicate section (lines 265-313) to avoid redundancy in the documentation.
| ``` | ||
|
|
||
| #### Example: | ||
| ## Example |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading level should be #### (level 4) instead of ## (level 2) to maintain consistency with other codemod sections. All other codemods use #### Example: for their example headings.
| ## Example | |
| #### Example: |
| assert(condition, 'Assertion failed'); | ||
| ``` | ||
|
|
||
| ## Additional Notes |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading level should be #### (level 4) instead of ## (level 2) to maintain consistency with the document hierarchy. This is a subsection under the process-assert-to-node-assert codemod.
| ## Additional Notes | |
| #### Additional Notes |
|
|
||
| ## Additional Notes | ||
|
|
||
| This codemod use [`fs` capability](https://docs.codemod.com/jssg/security) to read the `package.json` file and determine if the project is using ES modules or CommonJS. Based on this information, it adds the appropriate import statement for the `assert` module. |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar error: 'use' should be 'uses' for correct subject-verb agreement.
| This codemod use [`fs` capability](https://docs.codemod.com/jssg/security) to read the `package.json` file and determine if the project is using ES modules or CommonJS. Based on this information, it adds the appropriate import statement for the `assert` module. | |
| This codemod uses [`fs` capability](https://docs.codemod.com/jssg/security) to read the `package.json` file and determine if the project is using ES modules or CommonJS. Based on this information, it adds the appropriate import statement for the `assert` module. |
Description
Related Issues
No Related issue
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.