Skip to content

fix(cli): make env shims use the active vp executable#1631

Open
leohara wants to merge 8 commits into
voidzero-dev:mainfrom
leohara:fix/homebrew-env-shims
Open

fix(cli): make env shims use the active vp executable#1631
leohara wants to merge 8 commits into
voidzero-dev:mainfrom
leohara:fix/homebrew-env-shims

Conversation

@leohara
Copy link
Copy Markdown

@leohara leohara commented May 19, 2026

Summary

Fix Unix env shims created by vp env setup so they point to the active vp executable instead of always assuming the standalone VP_HOME/current/bin/vp layout.

This keeps the existing standalone behavior when the active executable is VP_HOME/current/bin/vp, while making Homebrew-style installs work when vp lives outside VP_HOME.

Fixes #1572 .

Details

  • Resolve the Unix shim target from the currently running vp
  • Preserve ../current/bin/vp for standalone installs
  • Recreate stale or broken Unix core shim symlinks without requiring --refresh.
  • Add a global snap test that simulates an external/Homebrew-style vp and verifies:
    • shims point to the external vp
    • command -v node resolves to the Vite+ shim
    • node -v uses the project Node version

Note

This PR intentionally keeps the scope focused on vp env setup core shims. I noticed that package binary shims created by vp install -g also use the ../current/bin/vp Unix target today, but I left that out to keep this PR focused on the reported Homebrew node shim issue. If you’d prefer fixing those package shims in the same PR, I’m happy to add that follow-up change here.

Verification

  • cargo test -p vite_global_cli shim -- --nocapture
  • pnpm bootstrap-cli
  • pnpm -C packages/cli snap-test-global command-env-setup-external-vp
  • vp check --fix
  • cargo clippy -p vite_global_cli --all-targets
  • cargo fmt --check
  • git diff --check

@netlify
Copy link
Copy Markdown

netlify Bot commented May 19, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 4fbe50f
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a0edfbc47e0db000818b7da

@fengmk2

This comment was marked as off-topic.

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented May 20, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Homebrew installation breaks vp env due to bundled Node.js dependency

3 participants