-
Notifications
You must be signed in to change notification settings - Fork 161
feat(migrate): migrate .nvmrc to .node-version during vp migrate
#1159
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 all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
070e2e7
feat(config): add support for .nvmrc file detection
naokihaba 8cf6d89
feat(nvm): add support for detecting and migrating .nvmrc to .node-veβ¦
naokihaba 5b302a2
feat(report): add nodeVersionFileMigrated field to MigrationReport
naokihaba ff66ccf
feat(migration): add support for migrating node version manager filesβ¦
naokihaba d2e4dfd
feat(tests): add tests for parsing and migrating .nvmrc to .node-version
naokihaba 5a2b00f
style(bin): format conditional statement for better readability
naokihaba db3da18
feat(tests): add test for invalid version strings in parseNvmrcVersion
naokihaba b80bf48
feat(migration): enhance parseNvmrcVersion to handle additional unsupβ¦
naokihaba 759bcc9
feat(migration): add migration support for .nvmrc files to .node-version
naokihaba 93ae0f5
feat(migration): update parseNvmrcVersion to map 'node' and 'stable' β¦
naokihaba 7d64b46
feat(migration): update migration warning for 'node' alias and clarifβ¦
naokihaba 374677a
feat(migration): update migration message for 'node' alias and removeβ¦
naokihaba 4668548
feat(migration): improve logging for automatic mapping of .nvmrc aliaβ¦
naokihaba 5c0d45a
Merge branch 'main' into feat/migrate-nvmrc
naokihaba 065b321
feat(migration): update comments for nvmrc version handling and logging
naokihaba 61834d3
Merge branch 'feat/migrate-nvmrc' of github.com:naokihaba/vite-plus iβ¦
naokihaba fc533d4
Merge branch 'main' into feat/migrate-nvmrc
naokihaba d3997a3
refactor(migrator): simplify parseNvmrcVersion function and improve aβ¦
naokihaba 085b9df
refactor(migration): remove redundant auto-migration log message for β¦
naokihaba 215dd72
Merge branch 'main' into feat/migrate-nvmrc
naokihaba 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 @@ | ||
| lts/iron |
6 changes: 6 additions & 0 deletions
6
packages/cli/snap-tests-global/migration-nvmrc-lts/package.json
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,6 @@ | ||
| { | ||
| "name": "migration-nvmrc-lts", | ||
| "devDependencies": { | ||
| "vite": "^7.0.0" | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
packages/cli/snap-tests-global/migration-nvmrc-lts/snap.txt
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,12 @@ | ||
| > vp migrate --no-interactive # migration should detect .nvmrc with lts alias and auto-migrate | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| β Migrated . to Vite+<repeat> | ||
| β’ Node <semver> pnpm <semver> | ||
| β’ 2 config updates applied | ||
| β’ Node version manager file migrated to .node-version | ||
|
|
||
| > cat .node-version # check lts alias is preserved as-is | ||
| lts/iron | ||
|
|
||
| > test ! -f .nvmrc # check .nvmrc is removed |
7 changes: 7 additions & 0 deletions
7
packages/cli/snap-tests-global/migration-nvmrc-lts/steps.json
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,7 @@ | ||
| { | ||
| "commands": [ | ||
| "vp migrate --no-interactive # migration should detect .nvmrc with lts alias and auto-migrate", | ||
| "cat .node-version # check lts alias is preserved as-is", | ||
| "test ! -f .nvmrc # check .nvmrc is removed" | ||
| ] | ||
| } |
1 change: 1 addition & 0 deletions
1
packages/cli/snap-tests-global/migration-nvmrc-node-alias/.nvmrc
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 @@ | ||
| node |
6 changes: 6 additions & 0 deletions
6
packages/cli/snap-tests-global/migration-nvmrc-node-alias/package.json
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,6 @@ | ||
| { | ||
| "name": "migration-nvmrc-node-alias", | ||
| "devDependencies": { | ||
| "vite": "^7.0.0" | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
packages/cli/snap-tests-global/migration-nvmrc-node-alias/snap.txt
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,14 @@ | ||
| > vp migrate --no-interactive # 'node' alias should be mapped to lts/* with an info message | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
|
|
||
| "node" in .nvmrc is not a specific version; automatically mapping to "lts/*" | ||
| β Migrated . to Vite+<repeat> | ||
| β’ Node <semver> pnpm <semver> | ||
| β’ 2 config updates applied | ||
| β’ Node version manager file migrated to .node-version | ||
|
|
||
| > cat .node-version # check node alias is mapped to lts/* | ||
| lts/* | ||
|
|
||
| > test ! -f .nvmrc # check .nvmrc is removed |
7 changes: 7 additions & 0 deletions
7
packages/cli/snap-tests-global/migration-nvmrc-node-alias/steps.json
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,7 @@ | ||
| { | ||
| "commands": [ | ||
| "vp migrate --no-interactive # 'node' alias should be mapped to lts/* with an info message", | ||
| "cat .node-version # check node alias is mapped to lts/*", | ||
| "test ! -f .nvmrc # check .nvmrc is removed" | ||
| ] | ||
| } |
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 @@ | ||
| v25.8.2 |
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,6 @@ | ||
| { | ||
| "name": "migration-nvmrc", | ||
| "devDependencies": { | ||
| "vite": "^7.0.0" | ||
| } | ||
| } |
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,12 @@ | ||
| > vp migrate --no-interactive # migration should detect .nvmrc and auto-migrate to .node-version | ||
| VITE+ - The Unified Toolchain for the Web | ||
|
|
||
| β Migrated . to Vite+<repeat> | ||
| β’ Node <semver> pnpm <semver> | ||
| β’ 2 config updates applied | ||
| β’ Node version manager file migrated to .node-version | ||
|
|
||
| > cat .node-version # check .node-version is created with v prefix stripped | ||
| 25.8.2 | ||
|
|
||
| > test ! -f .nvmrc # check .nvmrc is removed |
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,7 @@ | ||
| { | ||
| "commands": [ | ||
| "vp migrate --no-interactive # migration should detect .nvmrc and auto-migrate to .node-version", | ||
| "cat .node-version # check .node-version is created with v prefix stripped", | ||
| "test ! -f .nvmrc # check .nvmrc is removed" | ||
| ] | ||
| } |
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
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
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
Oops, something went wrong.
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.