Repository navigation
fix(cli): run a selected app target with its own toolchain - #3509
Conversation
CLI artifact sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
packages/cli/dist |
Directory total | 2.40 MiB | 2.40 MiB | 0 B (0.00%) |
packages/core/dist |
Directory total | 4.11 MiB | 4.11 MiB | 0 B (0.00%) |
| Combined package dist | Directory total | 6.51 MiB | 6.51 MiB | 0 B (0.00%) |
vp (Linux x64) |
Binary | 8.57 MiB | 9.11 MiB | +556.03 KiB (+6.34%) |
vp (Linux x64) |
gzip -9 | 3.92 MiB | 4.18 MiB | +259.33 KiB (+6.46%) |
| NAPI (Linux x64) | Binary | 37.31 MiB | 37.34 MiB | +32.00 KiB (+0.08%) |
| NAPI (Linux x64) | gzip -9 | 14.91 MiB | 14.93 MiB | +21.47 KiB (+0.14%) |
vp (macOS ARM64) |
Binary | 5.61 MiB | 5.99 MiB | +390.06 KiB (+6.79%) |
vp (macOS ARM64) |
gzip -9 | 3.35 MiB | 3.57 MiB | +225.97 KiB (+6.59%) |
| NAPI (macOS ARM64) | Binary | 43.83 MiB | 43.86 MiB | +32.36 KiB (+0.07%) |
| NAPI (macOS ARM64) | gzip -9 | 19.04 MiB | 19.06 MiB | +21.19 KiB (+0.11%) |
vp (Windows x64) |
Binary | 6.65 MiB | 7.11 MiB | +464.00 KiB (+6.81%) |
vp (Windows x64) |
gzip -9 | 3.03 MiB | 3.26 MiB | +231.89 KiB (+7.47%) |
| NAPI (Windows x64) | Binary | 33.25 MiB | 33.28 MiB | +29.50 KiB (+0.09%) |
| NAPI (Windows x64) | gzip -9 | 13.64 MiB | 13.65 MiB | +15.01 KiB (+0.11%) |
| Trampoline (Windows x64) | Binary | 13.50 KiB | 13.50 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 7.09 KiB | 7.09 KiB | 0 B (0.00%) |
| Installer (Windows x64) | Binary | 4.69 MiB | 4.69 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.25 MiB | 2.25 MiB | +1 B (+0.00%) |
918707a to
5e969c6
Compare
a3848eb to
1be23dd
Compare
A bare `vp dev`, `vp build`, `vp preview`, or `vp pack` at a root can select another directory through `defaultPackage`, auto-selection, or the package picker. The global `vp` resolved the Node.js runtime and the local `vite-plus` installation for the invocation directory before the selection. The selected package then ran with the root's toolchain, while `vp -C <dir>` used the package's own toolchain. The global CLI now selects the target before it resolves the toolchain, and runs the command as `vp -C <dir>` would. The selection code moves from the NAPI binding into the shared `vp_app_target` crate, so the global CLI and the package's own `vp` bin use the same rules. The script note moves into `vp_cli_help` for the same reason. Fixes #2057 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only `vp_static_config` uses `oxc_parser` directly, and it reads plain config values. The global `vp` no longer links the regular expression parser. The `oxc` crate still enables it for the NAPI binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3ea9a51 to
7957897
Compare
Preview binary sizes (
|
| Binary | Latest release | Preview | Change |
|---|---|---|---|
vp (macOS ARM64) |
5.61 MiB | 5.99 MiB | +390.05 KiB (+6.79%) |
| NAPI (macOS ARM64) | 43.80 MiB | 43.83 MiB | +32.39 KiB (+0.07%) |
vp (macOS x64) |
7.12 MiB | 7.58 MiB | +474.12 KiB (+6.51%) |
| NAPI (macOS x64) | 49.23 MiB | 49.27 MiB | +36.20 KiB (+0.07%) |
vp (Linux ARM64 GNU) |
7.10 MiB | 7.58 MiB | +488.02 KiB (+6.71%) |
| NAPI (Linux ARM64 GNU) | 33.13 MiB | 33.18 MiB | +52.00 KiB (+0.15%) |
vp (Linux ARM64 musl) |
7.18 MiB | 7.66 MiB | +492.12 KiB (+6.70%) |
| NAPI (Linux ARM64 musl) | 32.34 MiB | 32.38 MiB | +36.88 KiB (+0.11%) |
vp (Linux x64 GNU) |
8.57 MiB | 9.11 MiB | +556.03 KiB (+6.34%) |
| NAPI (Linux x64 GNU) | 37.23 MiB | 37.26 MiB | +36.00 KiB (+0.09%) |
vp (Linux x64 musl) |
8.64 MiB | 9.19 MiB | +559.23 KiB (+6.32%) |
| NAPI (Linux x64 musl) | 36.42 MiB | 36.46 MiB | +38.63 KiB (+0.10%) |
vp (Windows x64) |
6.66 MiB | 7.12 MiB | +470.00 KiB (+6.89%) |
| NAPI (Windows x64) | 32.89 MiB | 32.92 MiB | +30.50 KiB (+0.09%) |
| Trampoline (Windows x64) | 13.00 KiB | 13.00 KiB | 0 B (0.00%) |
| Installer (Windows x64) | 4.70 MiB | 4.70 MiB | 0 B (0.00%) |
vp (Windows ARM64) |
5.87 MiB | 6.31 MiB | +446.50 KiB (+7.42%) |
| NAPI (Windows ARM64) | 29.02 MiB | 29.05 MiB | +27.50 KiB (+0.09%) |
| Trampoline (Windows ARM64) | 13.00 KiB | 13.00 KiB | 0 B (0.00%) |
| Installer (Windows ARM64) | 3.87 MiB | 3.87 MiB | 0 B (0.00%) |
gzip -9 sizes
| Binary | Latest release | Preview | Change |
|---|---|---|---|
vp (macOS ARM64) |
3.35 MiB | 3.57 MiB | +226.15 KiB (+6.60%) |
| NAPI (macOS ARM64) | 19.03 MiB | 19.05 MiB | +21.48 KiB (+0.11%) |
vp (macOS x64) |
3.53 MiB | 3.76 MiB | +238.42 KiB (+6.60%) |
| NAPI (macOS x64) | 20.33 MiB | 20.35 MiB | +19.04 KiB (+0.09%) |
vp (Linux ARM64 GNU) |
3.85 MiB | 4.11 MiB | +259.13 KiB (+6.57%) |
| NAPI (Linux ARM64 GNU) | 14.13 MiB | 14.15 MiB | +23.17 KiB (+0.16%) |
vp (Linux ARM64 musl) |
3.88 MiB | 4.13 MiB | +262.20 KiB (+6.60%) |
| NAPI (Linux ARM64 musl) | 13.82 MiB | 13.84 MiB | +22.15 KiB (+0.16%) |
vp (Linux x64 GNU) |
3.92 MiB | 4.18 MiB | +259.75 KiB (+6.47%) |
| NAPI (Linux x64 GNU) | 14.87 MiB | 14.89 MiB | +19.29 KiB (+0.13%) |
vp (Linux x64 musl) |
3.95 MiB | 4.20 MiB | +260.16 KiB (+6.43%) |
| NAPI (Linux x64 musl) | 14.54 MiB | 14.56 MiB | +20.23 KiB (+0.14%) |
vp (Windows x64) |
3.03 MiB | 3.26 MiB | +232.75 KiB (+7.49%) |
| NAPI (Windows x64) | 13.50 MiB | 13.52 MiB | +19.10 KiB (+0.14%) |
| Trampoline (Windows x64) | 7.14 KiB | 7.14 KiB | +1 B (+0.01%) |
| Installer (Windows x64) | 2.25 MiB | 2.25 MiB | +78 B (+0.00%) |
vp (Windows ARM64) |
2.90 MiB | 3.12 MiB | +222.48 KiB (+7.48%) |
| NAPI (Windows ARM64) | 12.79 MiB | 12.81 MiB | +17.70 KiB (+0.14%) |
| Trampoline (Windows ARM64) | 6.92 KiB | 6.92 KiB | 0 B (0.00%) |
| Installer (Windows ARM64) | 2.15 MiB | 2.15 MiB | +50 B (+0.00%) |
Raw sizes are uncompressed file sizes. gzip sizes recompress each binary at level 9; they are not package or download archive sizes.
The baseline uses published release files, including NAPI packages from npm at the same version. Build versions and toolchains can affect the difference.
Registry bridge build (
|
| Package | Version |
|---|---|
vite-plus |
0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4 |
@voidzero-dev/vite-plus-core |
0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4 |
create-vite-plus |
0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4 |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/7957897c0fac9ce5677c7b64c4431e88c266afb4/packages/cli/install.sh | VP_PR_VERSION=3509 VP_LEGACY_INSTALLER_URL=https://raw.githubusercontent.com/voidzero-dev/vite-plus/7957897c0fac9ce5677c7b64c4431e88c266afb4/packages/cli/install-legacy.sh bash# Windows (PowerShell)
$env:VP_PR_VERSION="3509"; $env:VP_LEGACY_INSTALLER_URL="https://raw.githubusercontent.com/voidzero-dev/vite-plus/7957897c0fac9ce5677c7b64c4431e88c266afb4/packages/cli/install-legacy.ps1"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/7957897c0fac9ce5677c7b64c4431e88c266afb4/packages/cli/install.ps1 | iexOr install with Homebrew (macOS / glibc Linux):
These commands use the formula and binary from this published commit. Replace brew install with brew reinstall if the tap package is already installed.
If Homebrew Core’s vite-plus is installed, run brew uninstall vite-plus first. This keeps your user data; do not run vp implode to switch installations.
(
set -eu
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_VP_PR_VERSION=7957897c0fac9ce5677c7b64c4431e88c266afb4
brew tap voidzero-dev/vite-plus https://github.com/voidzero-dev/vite-plus
preview_tap="$(brew --repository voidzero-dev/vite-plus)"
git -C "$preview_tap" fetch --depth=1 https://github.com/voidzero-dev/vite-plus.git "$HOMEBREW_VP_PR_VERSION"
git -C "$preview_tap" switch --detach "$HOMEBREW_VP_PR_VERSION"
brew install voidzero-dev/vite-plus/vp
brew test voidzero-dev/vite-plus/vp
"$(brew --prefix)/bin/vp"
)The tap stays at the tested commit. Return it to main after testing:
git -C "$(brew --repository voidzero-dev/vite-plus)" switch mainOr download the standalone Windows installer built from this commit:
| Architecture | Installer |
|---|---|
| x64 | vp-setup-x86_64-pc-windows-msvc.exe |
| Arm64 | vp-setup-aarch64-pc-windows-msvc.exe |
GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:
.\vp-setup.exe --version "0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4" --registry "https://registry-bridge.viteplus.dev/"After installing, upgrade the current project's vite-plus to this test build with:
vp migrateOr create a new project from this commit without installing the CLI:
export npm_config_registry=https://registry-bridge.viteplus.dev/ pnpm_config_registry=https://registry-bridge.viteplus.dev/
pnpm create vite-plus@0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4 # or: npm create vite-plus@0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4$env:npm_config_registry="https://registry-bridge.viteplus.dev/"; $env:pnpm_config_registry="https://registry-bridge.viteplus.dev/"
pnpm create vite-plus@0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4 # or: npm create vite-plus@0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4pnpm 11+ reads pnpm_config_registry, npm and older pnpm read npm_config_registry. The new project pins this build, so keep the registry set for later installs, or configure it as below.
Or point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:
| Package manager | Registry config |
|---|---|
| npm / pnpm / Bun | .npmrc: registry=https://registry-bridge.viteplus.dev/ |
| Yarn (v2+) | .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/" |
Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):
{
"devDependencies": {
"vite-plus": "0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.7957897c0fac9ce5677c7b64c4431e88c266afb4"
}
}
🐳 Docker preview imageBuilt from this PR's registry bridge build:
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-3509 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-3509Quick check: docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-3509 vp --versionSee docs/guide/docker.md for usage. |
The global CLI and the binding now share `is_bare_app_command`: no arguments, or a lone `--`. The binding restores a leading `--` before target selection, so both entry points check the same arguments. `resolve_app_target` returns the workspace root inside `AppTarget::CurrentDir`, the classification enum loses the nested wrapper that the move left behind, and the selected package message uses `output::print_stdout_line`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bare
vp dev,vp build,vp preview, orvp packat a root can select another directory throughdefaultPackage, auto-selection, or the package picker. The globalvpresolved the Node.js runtime and the localvite-plusinstallation for the invocation directory before the selection. The selected package then ran with the root's toolchain, whilevp -C <dir>used the package's own toolchain.The global CLI now selects the target before it resolves the toolchain, and runs the command as
vp -C <dir>would. The selection code moves from the NAPI binding into a sharedvp_app_targetcrate, so the global CLI and the package's ownvpbin use the same rules. The note about apackage.jsonscript with the same name moves intovp_cli_helpfor the same reason.Before and after
A workspace root pins Node.js 24.22.1, and its
appmember pins 22.23.4. The root config setsdefaultPackage: './app'.vp buildat the rootappwith Node.js 24.22.1 and the root's Vite+appwith Node.js 22.23.4 and the Vite+ thatappresolvesvp -C app buildAuto-selection and the package picker change in the same way.
Behavior
vpwithout-Cchanges. Commands with arguments,vp -C, other commands, and the package's ownvpbin (pnpm exec vp,package.jsonscripts,vp runtasks) behave as before.VP_EXPLICIT_CHDIR=1, so the local CLI does not select again.defaultPackagenote, and the non-interactive package listing now come from the global CLI. Their text does not change.Cost
The global binary now links the static config reader and the package picker. It skips the oxc regular expression parser, which reading config values does not need.
vpbinaryThe NAPI binding grows by about 30 KiB (+0.1%) on each platform. The JavaScript packages do not change.
Fixes #2057
🤖 Generated with Claude Code