You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node.js provides migrations for "userland" (what you write vs node's own) source-code to facilitate adoption of new features and upgrading source-code affected by breaking changes. These are done in collaboration with [`codemod`](https://docs.codemod.com/introduction), who also work with other major projects like Next.js, React, and Tailwind. Node.js's migrations live in the [`nodejs/userland-migrations`](https://github.com/nodejs/userland-migrations) repository and are overseen by the `@nodejs/userland-migrations` team.
12
12
13
-
<!--
14
-
maintainer node: https://codemod.link/nodejs-official is pointing to legacy codemod registry
15
-
it's will point to new new one once codemod change the redirection of the short link
16
-
-->
13
+
Official migrations are published under the `@nodejs` scope within the [codemod registry](https://codemod.link/nodejs-official). These have been reviewed and/or authored by Node.js members.
17
14
18
-
Official migrations are published under the `@nodejs` namespace within the [codemod registry](https://codemod.link/nodejs-official). These have been reviewed and/or authored by Node.js members. There are also unofficial migrations available which have not been reviewed by Node.js.
15
+
## Goal
19
16
20
-
## Our goal
21
-
22
-
First our goal is to help you to migrate your codebase to the latest Node.js version. We want to make it easier for you to adopt new features, deprecations, and breaking changes. In summary, we want to help you to migrate your codebase to the latest Node.js version.
23
-
24
-
Second, we want to help you to adopt native Node.js features that are already available in the ecosystem. For example, if you are using a library that provides a feature that is already available in Node.js, we want to help you to migrate to the native Node.js feature.
17
+
The Node.js Userland Migrations team seeks to help developers migrate their codebases to the latest Node.js versions, making it easier to handle deprecations, new features, and breaking changes.
25
18
26
19
## How to use a Codemod
27
20
28
21
To use a codemod, you can run the following command in your terminal:
29
22
30
-
```bash displayName="npm"
23
+
```bash
31
24
npx codemod@next <codemod-name>
32
25
```
33
26
34
-
```bash displayName="yarn"
35
-
yarn dlx codemod@next <codemod-name>
36
-
```
37
-
38
-
```bash displayName="pnpm"
39
-
pnpx codemod@next <codemod-name>
40
-
```
41
-
42
27
Replace `<codemod-name>` with the name of the codemod you want to run. For example, if you want to run the `@nodejs/import-assertions-to-attributes` codemod on your project, you would run:
-**Run migrations in a separate branch**: If you are using a version control system like Git, it is a good practice to run migrations in a separate branch. This allows you to review the changes before merging them into your main branch.
59
36
-**Review changes**: After running a migration, review the changes made to your codebase. Ensure that the migration has not introduced any unintended side effects or issues.
60
37
-**Test your code**: After running a migration, it is important to test your code to ensure that everything is working as expected. Run your test suite and check for any errors or failures
38
+
-**Format and or lint your code**: After running a migration, it is a good practice to format and lint your code. This ensures that your code follows the project's coding standards and is easier to read and maintain.
0 commit comments