Skip to content

feat(env): make vp env off disable Node.js management for all vp commands#1255

Draft
fengmk2 wants to merge 7 commits intomainfrom
real-node-off-mode
Draft

feat(env): make vp env off disable Node.js management for all vp commands#1255
fengmk2 wants to merge 7 commits intomainfrom
real-node-off-mode

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Apr 1, 2026

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

…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
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 1, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 9ce4b34
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69cd0d64194c660007e6b82c

@fengmk2 fengmk2 self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Member Author

fengmk2 commented Apr 1, 2026


How to use the Graphite Merge Queue

Add 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.

fengmk2 added 6 commits April 1, 2026 19:57
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.
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.

Support system Node.js for vp commands (not just shims)

1 participant