Skip to content

Commit 79e1961

Browse files
Update introduction.md
1 parent a85ba97 commit 79e1961

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

apps/site/pages/en/learn/userland-migrations/introduction.md

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,32 @@ authors: JakobJingleheimer, AugustinMauroy
1010

1111
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.
1212

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.
1714

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
1916

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.
2518

2619
## How to use a Codemod
2720

2821
To use a codemod, you can run the following command in your terminal:
2922

30-
```bash displayName="npm"
23+
```bash
3124
npx codemod@next <codemod-name>
3225
```
3326

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-
4227
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:
4328

44-
```bash displayName="npm"
29+
```bash
4530
npx codemod@next @nodejs/import-assertions-to-attributes
4631
```
4732

48-
```bash displayName="yarn"
49-
yarn dlx codemod@next @nodejs/import-assertions-to-attributes
50-
```
51-
52-
```bash displayName="pnpm"
53-
pnpx codemod@next @nodejs/import-assertions-to-attributes
54-
```
55-
5633
## Good Practices
5734

5835
- **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.
5936
- **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.
6037
- **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.
6139

6240
## Feedback
6341

0 commit comments

Comments
 (0)