feat(env): make vp env off disable Node.js management for all vp commands#1255
feat(env): make vp env off disable Node.js management for all vp commands#1255
vp env off disable Node.js management for all vp commands#1255Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
…mmands Previously, `vp env off` only affected shim dispatch (node/npm/npx invoked directly). All vp commands (create, build, install, etc.) still downloaded managed Node.js via JsExecutor, ignoring the system-first mode setting. Now when `vp env off` is active, JsExecutor checks ShimMode before downloading and uses the system-installed Node.js found in PATH. This fixes NixOS/Guix (where downloaded binaries fail), air-gapped environments, and users managing Node.js via other tools (mise, nvm). - Add JsRuntime::from_system() constructor for system binary paths - Add system-first checks to ensure_cli_runtime/ensure_project_runtime - Expose find_system_tool as pub(crate) and deduplicate doctor.rs copy - Update vp env off/on messaging to reflect broader scope - Add CI E2E tests for system-first mode on all platforms Closes #977
Verifies the full system-first mode lifecycle: - `vp run` uses project's engines.node in managed mode - `vp env off` switches to system-first mode - `vp run` uses system Node.js instead of project version - `vp env on` restores managed mode
Verifies the full system-first mode lifecycle with assertions: - `assert-managed` passes in managed mode (uses engines.node 20.18.0) - `vp env off` switches to system-first mode - `assert-not-managed` passes (version is NOT 20.18.0) - `vp env on` restores managed mode - `assert-managed` passes again (back to 20.18.0)
The snap test command-env-off-on now covers system-first mode switching with runtime assertions, making the CI E2E steps redundant.
…s active Previously, `vp env doctor` always showed managed version resolution (from .node-version, engines.node, etc.) even in system-first mode. Now the Version Resolution section shows: - Source: "system PATH" - Version: actual system node version (from `node --version`) - Node binary: system node path (e.g., /usr/local/bin/node)
…ands - Rename "Shim Mode" to "Node.js Mode" throughout - Update config.json comments to describe broader scope - Update all doctor output examples (managed/system-first/unhealthy) - Update vp env on/off command output examples - Add NixOS, air-gapped, container, and multi-tool use cases - Show Version Resolution section for system-first mode in doctor
Thread the system node path from check_shim_mode() into check_current_resolution() instead of scanning PATH twice. Also add debug_assert in JsRuntime::from_system() to catch empty binary filenames from malformed paths.
9ce4b34 to
0d4e245
Compare
|
Question regarding I imagine that there might be use-cases for three things:
Can you walk me through what our plan is exactly? |
|
Before this PR change: After this PR change: I think after the change there are only 2 modes: either intercept everything or fall back everything, without the current intermediate state. As for falling back to vp management mode when system Node.js is not found, I think this is reasonable because we assume some new users will only install vp without installing Node.js first. |

Previously,
vp env offonly affected shim dispatch (node/npm/npxinvoked directly). All vp commands (create, build, install, etc.)
still downloaded managed Node.js via JsExecutor, ignoring the
system-first mode setting.
Now when
vp env offis active, JsExecutor checks ShimMode beforedownloading and uses the system-installed Node.js found in PATH.
This fixes NixOS/Guix (where downloaded binaries fail), air-gapped
environments, and users managing Node.js via other tools (mise, nvm).
Closes #977