Skip to content

Commit 39e3ae1

Browse files
JakobJingleheimerCopilotavivkellerAugustinMauroy
authored
feat(learn/userland-migrations): add intro (#7764)
* feat(learn/userland-migrations): add intro * fixup!: prettier * fixup!: english → american Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> * fixup!: add nav & labels * Update introduction.md Co-authored-by: Aviv Keller <me@aviv.sh> Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> * fixup!: clarify wording * fixup!: remove CLI prompt from code block Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com> Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> * fixup!: add `@nodejs/userland-migrations` to CODEOWNERS * Revert "fixup!: add `@nodejs/userland-migrations` to CODEOWNERS" This reverts commit 3655407. --------- Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Aviv Keller <me@aviv.sh> Co-authored-by: Augustin Mauroy <97875033+AugustinMauroy@users.noreply.github.com>
1 parent d27573c commit 39e3ae1

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

apps/site/navigation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,15 @@
332332
}
333333
}
334334
},
335+
"migrations": {
336+
"label": "components.navigation.learn.migrations.links.migrations",
337+
"items": {
338+
"introduction": {
339+
"link": "/learn/migrations/introduction",
340+
"label": "components.navigation.learn.migrations.links.introduction"
341+
}
342+
}
343+
},
335344
"modules": {
336345
"label": "components.navigation.learn.modules.links.modules",
337346
"items": {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Userland Migrations
3+
layout: learn
4+
authors: JakobJingleheimer
5+
---
6+
7+
# Userland Migrations
8+
9+
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://www.codemod.com), 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`](https://github.com/orgs/nodejs/teams/userland-migrations) team.
10+
11+
Official migrations are published under the `@nodejs` namespace within the [codemod registry](https://codemod.com/registry?framework=node.js). 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.
12+
13+
A migration alters a project's source-code to apply a new design pattern, like:
14+
15+
```console
16+
cd path/to/your/project
17+
npx codemod@latest @nodejs/correct-ts-specifiers
18+
```
19+
20+
The cited migration transforms legacy typescript imports to standards-compliant specifiers like:
21+
22+
```ts displayName="before"
23+
import Foo from './foo';
24+
```
25+
26+
```ts displayName="after"
27+
import type Foo from './foo/index.ts';
28+
```

packages/i18n/locales/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@
9494
"acceptInputFromTheCommandLineInNodejs": "Accept input from the command line in Node.js"
9595
}
9696
},
97+
"migrations": {
98+
"links": {
99+
"migrations": "Userland Migrations",
100+
"introduction": "Introduction to Userland Migrations"
101+
}
102+
},
97103
"modules": {
98104
"links": {
99105
"modules": "Modules",

0 commit comments

Comments
 (0)