-
Notifications
You must be signed in to change notification settings - Fork 193
fix: use real package name for global local packages installation #1685
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
Open
liangmiQwQ
wants to merge
9
commits into
voidzero-dev:main
Choose a base branch
from
liangmiQwQ:fix/check-real-package-json-for-global-install
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7946969
implement
liangmiQwQ f017f86
tests
liangmiQwQ b71ca5a
as we have snap tests already
liangmiQwQ 41103da
adjust
liangmiQwQ 1ea2285
adjust
liangmiQwQ 04646f1
tarball
liangmiQwQ f1daa27
snapshots
liangmiQwQ f36ecc9
Merge branch 'main' into fix/check-real-package-json-for-global-install
liangmiQwQ 60adb2e
Merge branch 'main' into fix/check-real-package-json-for-global-install
liangmiQwQ 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
8 changes: 4 additions & 4 deletions
8
packages/cli/snap-tests-global/command-env-install-conflict/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
Binary file added
BIN
+246 Bytes
packages/cli/snap-tests-global/command-env-install-global-local/another-package.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions
1
packages/cli/snap-tests-global/command-env-install-global-local/bin.js
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 @@ | ||
| console.log('The package is installed successfully'); |
7 changes: 7 additions & 0 deletions
7
packages/cli/snap-tests-global/command-env-install-global-local/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,7 @@ | ||
| { | ||
| "name": "just-a-normal-package", | ||
| "version": "0.0.0", | ||
| "bin": { | ||
| "just-a-normal-package": "./bin.js" | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
packages/cli/snap-tests-global/command-env-install-global-local/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,19 @@ | ||
| > vp install -g . | ||
| info: Installing 1 global package with Node.js <semver> | ||
| ✓ Installed just-a-normal-package <semver> | ||
| Bins: just-a-normal-package | ||
|
|
||
| > vp install -g ./another-package.tgz | ||
| info: Installing 1 global package with Node.js <semver> | ||
| ✓ Installed another-normal-package <semver> | ||
| Bins: another-normal-package | ||
|
|
||
| > vp list -g just-a-normal-package | ||
| Package Node version Binaries | ||
| --- --- --- | ||
| just-a-normal-package@<semver> <semver> just-a-normal-package | ||
|
|
||
| > vp list -g another-normal-package | ||
| Package Node version Binaries | ||
| --- --- --- | ||
| another-normal-package@<semver> <semver> another-normal-package |
9 changes: 9 additions & 0 deletions
9
packages/cli/snap-tests-global/command-env-install-global-local/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,9 @@ | ||
| { | ||
| "commands": [ | ||
| "vp install -g .", | ||
| "vp install -g ./another-package.tgz", | ||
| "vp list -g just-a-normal-package", | ||
| "vp list -g another-normal-package" | ||
| ], | ||
| "after": ["vp remove -g just-a-normal-package another-normal-package"] | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This early return blocks
vp remove -g ./local-pathbefore any metadata/bin lookup, which breaks uninstall for packages installed by older versions that stored the local spec path as the managed package key (the behavior this commit is replacing). After upgrading, those existing installs can no longer be removed viavpby either path (now rejected here) or name (metadata/bin ownership still recorded under the old path), leaving orphaned shims and package state that can block subsequent installs.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will influence
vp install -g --force's uninstall logic, but won't influence normalvp uninstall -g <pkg_name>, as we do not use BinConfig there. I've tested locally and it can still remove a global package