feat(env): make vp env off disable Node.js management for all vp commands#1255
Draft
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.
|
Member
Author
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
2 tasks
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.

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