Skip to content

Commit 33058e8

Browse files
feat(learn/userland-migrations): add intro
1 parent 232e7f1 commit 33058e8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Userland Migrations
3+
layout: learn
4+
authors: JakobJingleheimer
5+
---
6+
7+
# Userland Migrations
8+
9+
Node.js provide migrations for "userland" 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 [`github://nodejs/userland-migrations`](https://github.com/nodejs/userland-migrations) repository and are overseen by the [`@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 collaborators. 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+
```ts displayName="after"
26+
import type Foo from './foo/index.ts';
27+
```

0 commit comments

Comments
 (0)