-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(learn/userland-migrations): add intro #7764
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
33058e8
feat(learn/userland-migrations): add intro
JakobJingleheimer 741952c
fixup!: prettier
JakobJingleheimer 5b5329b
fixup!: english → american
JakobJingleheimer eca9072
fixup!: add nav & labels
JakobJingleheimer d969edd
Update introduction.md
JakobJingleheimer 55b37f7
fixup!: clarify wording
JakobJingleheimer a432607
fixup!: remove CLI prompt from code block
JakobJingleheimer 3655407
fixup!: add `@nodejs/userland-migrations` to CODEOWNERS
JakobJingleheimer 9cd0b7b
Revert "fixup!: add `@nodejs/userland-migrations` to CODEOWNERS"
JakobJingleheimer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Userland Migrations | ||
layout: learn | ||
authors: JakobJingleheimer | ||
--- | ||
|
||
# Userland Migrations | ||
|
||
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. | ||
|
||
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. | ||
JakobJingleheimer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
A migration alters a project's source-code to apply a new design pattern, like: | ||
|
||
```console | ||
$ cd path/to/your/project | ||
$ npx codemod@latest @nodejs/correct-ts-specifiers | ||
JakobJingleheimer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
The cited migration transforms legacy typescript imports to standards-compliant specifiers like: | ||
|
||
```ts displayName="before" | ||
import Foo from './foo'; | ||
``` | ||
```ts displayName="after" | ||
import type Foo from './foo/index.ts'; | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.