Skip to content

feat(env): add per-manager shim versions and update env use - #2659

Draft
liangmiQwQ wants to merge 9 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/pm-shim-version-overrides
Draft

feat(env): add per-manager shim versions and update env use#2659
liangmiQwQ wants to merge 9 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/pm-shim-version-overrides

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Stack 2/2, depends on #2658. Merge #2658 first, then this PR. Both PRs target main because the branches are hosted in a fork. This PR currently includes the first layer; review only layer 2.

This PR adds VP_NPM_VERSION, VP_PNPM_VERSION, VP_YARN_VERSION, and VP_BUN_VERSION to override each package manager's direct shim version independently. Each variable covers the family's aliases and takes priority over its session file, project configuration, and default version in managed mode.

vp env use pnpm@10.20.0 now sets only VP_PNPM_VERSION, following the existing VP_NODE_VERSION model. Switching Yarn preserves the pnpm override. Scoped --unset pnpm clears only pnpm, while --unset pm clears all four package-manager overrides. These operations neither set nor clear VP_PACKAGE_MANAGER, which continues to select the manager and version for commands such as vp install.

vp env exec --npm and --package-manager also pass explicit versions through the corresponding family variable, so child shims retain the requested version after a PATH reset.

Without a shell wrapper, versions are stored in separate .session-<manager>-version files. The old .session-package-manager file is no longer read or migrated; rerunning vp env use creates the new session state. Concrete-family environment queries use the shim resolution and report its source, while vp env current pm reports the manager selected for vp commands. Integrity suffixes are preserved.

The existing vp-use.cmd wrapper executes the new set VP_*_VERSION=... output without template changes. Native Windows end-to-end execution has not been verified locally.

🤖 Generated with Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant