-
Notifications
You must be signed in to change notification settings - Fork 261
fix(env): isolate direct shims from package manager selection #2658
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fengmk2
merged 6 commits into
voidzero-dev:main
from
liangmiQwQ:liang/codex/pm-selection-shim-isolation
Sep 11, 2026
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0f99bfb
fix(env): isolate direct shims from package manager selection
liangmiQwQ 9ef8a3e
chore: merge main into package manager selection layer
liangmiQwQ 433aa8a
chore(test): remove trailing blank line in shim fixture
liangmiQwQ e646570
test: align npm path reset coverage with shim isolation
liangmiQwQ 5569acc
test: remove obsolete package manager selection assertions
liangmiQwQ eee2b43
chore: merge main into pm selection isolation
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
15 changes: 15 additions & 0 deletions
15
...i_snapshots/tests/cli_snapshots/fixtures/shim_package_manager_version_overrides/check.cjs
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,15 @@ | ||
| const assert = require('node:assert/strict'); | ||
| const { execFileSync } = require('node:child_process'); | ||
| const { delimiter } = require('node:path'); | ||
|
|
||
| // Start each child at the shim even though the parent Node process has injected tool paths. | ||
| const env = { | ||
| ...process.env, | ||
| PATH: [process.env.VP_HOME + '/bin', '/usr/bin', '/bin'].join(delimiter), | ||
| VP_PATH_INJECTED_TOOLS: '', | ||
| }; | ||
| const [tool, expected] = process.argv.slice(2); | ||
| const args = tool === 'vp' ? ['install', '--', '--version'] : ['--version']; | ||
| const actual = execFileSync(tool, args, { env, encoding: 'utf8' }).trim(); | ||
| assert.equal(actual, expected); | ||
| console.log(`${tool} uses the expected version`); |
5 changes: 5 additions & 0 deletions
5
...napshots/tests/cli_snapshots/fixtures/shim_package_manager_version_overrides/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,5 @@ | ||
| { | ||
| "name": "shim-package-manager-version-overrides", | ||
| "private": true, | ||
| "packageManager": "pnpm@10.18.0" | ||
| } |
11 changes: 11 additions & 0 deletions
11
...pshots/tests/cli_snapshots/fixtures/shim_package_manager_version_overrides/snapshots.toml
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,11 @@ | ||
| [[case]] | ||
| name = "selection_override_does_not_change_shims" | ||
| vp = "global" | ||
| skip-platforms = ["windows"] | ||
| env = { VP_PACKAGE_MANAGER = "pnpm@10.19.0", npm_config_manage_package_manager_versions = "false" } | ||
| steps = [ | ||
| { argv = ["node", "check.cjs", "pnpm", "10.18.0"], comment = "The matching shim still uses the project pin" }, | ||
| { argv = ["node", "check.cjs", "vp", "10.19.0"], comment = "vp install still uses VP_PACKAGE_MANAGER" }, | ||
| { argv = ["node", "check.cjs", "pnpm", "10.18.0"], envs = [["VP_PACKAGE_MANAGER", "invalid"]], comment = "An invalid selection does not affect direct shims" }, | ||
| ] | ||
|
|
25 changes: 25 additions & 0 deletions
25
...manager_version_overrides/snapshots/selection_override_does_not_change_shims.md
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,25 @@ | ||
| # selection_override_does_not_change_shims | ||
|
|
||
| ## `node check.cjs pnpm 10.18.0` | ||
|
|
||
| The matching shim still uses the project pin | ||
|
|
||
| ``` | ||
| pnpm uses the expected version | ||
| ``` | ||
|
|
||
| ## `node check.cjs vp 10.19.0` | ||
|
|
||
| vp install still uses VP_PACKAGE_MANAGER | ||
|
|
||
| ``` | ||
| vp uses the expected version | ||
| ``` | ||
|
|
||
| ## `VP_PACKAGE_MANAGER=invalid node check.cjs pnpm 10.18.0` | ||
|
|
||
| An invalid selection does not affect direct shims | ||
|
|
||
| ``` | ||
| pnpm uses the expected version | ||
| ``` |
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.
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.