Repository navigation
Conversation
liangmiQwQ
reviewed
Oct 20, 2026
| pub const VP_BUN_VERSION: &str = "VP_BUN_VERSION"; | ||
|
|
||
| /// Node.js management preference (`yes` or `no`). | ||
| pub const VP_NODE_MANAGER: &str = "VP_NODE_MANAGER"; |
Collaborator
There was a problem hiding this comment.
vite-plus/crates/vp_installer/src/main.rs
Line 169 in 4134f8c
Cloud we reuse these variables in other modules as well?
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Preparatory refactor for #1899 (
system-onlymanagement mode for NixOS). No behavior change: existing tests and snapshots are unchanged.The follow-up PRs need two things that currently live inside the installer and the shim dispatcher. This PR moves them to shared places.
What's Changed
Manager preferences in
EnvConfigVP_NODE_MANAGER,VP_PM_MANAGER,VP_NPM_MANAGER,VP_PNPM_MANAGER,VP_YARN_MANAGER, andVP_BUN_MANAGERtovp_shared::env_vars.ManagerPreference { Yes, No }and sixOption<ManagerPreference>fields toEnvConfig. Only the exact valuesyesandnoare recognized, as before.self_setupnow converts these fields withshim_modeinstead of reading the variables inmanager_mode. The precedence (family variable >VP_PM_MANAGER> default) is unchanged.External tool lookup in
vp_commandfind_external_tool_infromshim/dispatch.rstovp_command::find_external_tool. The caller now passes PATH, the bypass directories, and the executable to exclude throughExternalToolQuery. In the NAPI binding,current_exe()is the Node.js executable, so a future local CLI caller can passself_exe: Noneinstead of excluding the system Node.js.dispatch.rskeepsfind_external_tool_in(tool, cwd)as a thin wrapper that reads the same process environment as before, so the existingtest_find_external_tool_*tests run unchanged.<DATA>/js_runtimeor<DATA>/package_manager) tovp_command::is_managed_install.Follow-ups
Next,
VP_*_MANAGER=system-onlywill make shims use only the system Node.js and package managers, without falling back to managed versions or downloading. Those changes and their tests come in separate PRs after this one merges.Testing
Run on top of the current
main:just checkjust lintjust testcargo fmt --all -- --checktyposjust snapshot-test-global shimandjust snapshot-test-global command_self_setup(CI)Fails locally on NixOS before and after this change (same cases); relying on CI.