Repository navigation
fix(cli): preserve package commands in subdirectory Git hooks - #3451
Conversation
d885c61 to
af2e437
Compare
Preview binary sizes (
|
| Binary | Latest release | Preview | Change |
|---|---|---|---|
vp (macOS ARM64) |
5.46 MiB | 5.46 MiB | +16 B (+0.00%) |
| NAPI (macOS ARM64) | 43.61 MiB | 43.61 MiB | 0 B (0.00%) |
vp (macOS x64) |
6.93 MiB | 6.93 MiB | 0 B (0.00%) |
| NAPI (macOS x64) | 49.00 MiB | 49.01 MiB | +8.00 KiB (+0.02%) |
vp (Linux ARM64 GNU) |
6.91 MiB | 6.91 MiB | 0 B (0.00%) |
| NAPI (Linux ARM64 GNU) | 32.90 MiB | 32.92 MiB | +20.00 KiB (+0.06%) |
vp (Linux ARM64 musl) |
6.99 MiB | 6.99 MiB | 0 B (0.00%) |
| NAPI (Linux ARM64 musl) | 32.13 MiB | 32.13 MiB | +1.13 KiB (+0.00%) |
vp (Linux x64 GNU) |
8.35 MiB | 8.35 MiB | 0 B (0.00%) |
| NAPI (Linux x64 GNU) | 36.98 MiB | 36.98 MiB | +4.00 KiB (+0.01%) |
vp (Linux x64 musl) |
8.42 MiB | 8.42 MiB | 0 B (0.00%) |
| NAPI (Linux x64 musl) | 36.18 MiB | 36.18 MiB | +1.75 KiB (+0.00%) |
vp (Windows x64) |
6.19 MiB | 6.19 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | 32.67 MiB | 32.67 MiB | +2.00 KiB (+0.01%) |
| Trampoline (Windows x64) | 13.00 KiB | 13.00 KiB | 0 B (0.00%) |
| Installer (Windows x64) | 4.69 MiB | 4.69 MiB | 0 B (0.00%) |
vp (Windows ARM64) |
5.42 MiB | 5.42 MiB | +512 B (+0.01%) |
| NAPI (Windows ARM64) | 28.85 MiB | 28.85 MiB | +1.50 KiB (+0.01%) |
| Trampoline (Windows ARM64) | 13.00 KiB | 13.00 KiB | 0 B (0.00%) |
| Installer (Windows ARM64) | 3.86 MiB | 3.86 MiB | 0 B (0.00%) |
gzip -9 sizes
| Binary | Latest release | Preview | Change |
|---|---|---|---|
vp (macOS ARM64) |
3.25 MiB | 3.25 MiB | +140 B (+0.00%) |
| NAPI (macOS ARM64) | 18.93 MiB | 18.93 MiB | +1.10 KiB (+0.01%) |
vp (macOS x64) |
3.44 MiB | 3.44 MiB | +588 B (+0.02%) |
| NAPI (macOS x64) | 20.22 MiB | 20.22 MiB | +559 B (+0.00%) |
vp (Linux ARM64 GNU) |
3.75 MiB | 3.75 MiB | +256 B (+0.01%) |
| NAPI (Linux ARM64 GNU) | 14.02 MiB | 14.02 MiB | +2.13 KiB (+0.01%) |
vp (Linux ARM64 musl) |
3.77 MiB | 3.77 MiB | +514 B (+0.01%) |
| NAPI (Linux ARM64 musl) | 13.72 MiB | 13.72 MiB | +1.76 KiB (+0.01%) |
vp (Linux x64 GNU) |
3.82 MiB | 3.82 MiB | -45 B (-0.00%) |
| NAPI (Linux x64 GNU) | 14.75 MiB | 14.75 MiB | +483 B (+0.00%) |
vp (Linux x64 musl) |
3.84 MiB | 3.84 MiB | +617 B (+0.02%) |
| NAPI (Linux x64 musl) | 14.43 MiB | 14.43 MiB | +965 B (+0.01%) |
vp (Windows x64) |
2.86 MiB | 2.86 MiB | +400 B (+0.01%) |
| NAPI (Windows x64) | 13.39 MiB | 13.39 MiB | +1.86 KiB (+0.01%) |
| Trampoline (Windows x64) | 7.14 KiB | 7.14 KiB | 0 B (0.00%) |
| Installer (Windows x64) | 2.25 MiB | 2.25 MiB | +34 B (+0.00%) |
vp (Windows ARM64) |
2.73 MiB | 2.73 MiB | +51 B (+0.00%) |
| NAPI (Windows ARM64) | 12.70 MiB | 12.70 MiB | -842 B (-0.01%) |
| Trampoline (Windows ARM64) | 6.93 KiB | 6.92 KiB | -1 B (-0.01%) |
| Installer (Windows ARM64) | 2.14 MiB | 2.14 MiB | +63 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.57764a46c32aa6c379f1c8609c6007bed0b53e1e |
@voidzero-dev/vite-plus-core |
0.0.0-commit.57764a46c32aa6c379f1c8609c6007bed0b53e1e |
create-vite-plus |
0.0.0-commit.57764a46c32aa6c379f1c8609c6007bed0b53e1e |
Install the Vite+ CLI built from this commit, then migrate a project:
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/57764a46c32aa6c379f1c8609c6007bed0b53e1e/packages/cli/install.sh | VP_PR_VERSION=3451 VP_LEGACY_INSTALLER_URL=https://raw.githubusercontent.com/voidzero-dev/vite-plus/57764a46c32aa6c379f1c8609c6007bed0b53e1e/packages/cli/install-legacy.sh bash# Windows (PowerShell)
$env:VP_PR_VERSION="3451"; $env:VP_LEGACY_INSTALLER_URL="https://raw.githubusercontent.com/voidzero-dev/vite-plus/57764a46c32aa6c379f1c8609c6007bed0b53e1e/packages/cli/install-legacy.ps1"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/57764a46c32aa6c379f1c8609c6007bed0b53e1e/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=57764a46c32aa6c379f1c8609c6007bed0b53e1e
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.57764a46c32aa6c379f1c8609c6007bed0b53e1e" --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.57764a46c32aa6c379f1c8609c6007bed0b53e1e # or: npm create vite-plus@0.0.0-commit.57764a46c32aa6c379f1c8609c6007bed0b53e1e$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.57764a46c32aa6c379f1c8609c6007bed0b53e1e # or: npm create vite-plus@0.0.0-commit.57764a46c32aa6c379f1c8609c6007bed0b53e1epnpm 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.57764a46c32aa6c379f1c8609c6007bed0b53e1e",
"vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.57764a46c32aa6c379f1c8609c6007bed0b53e1e"
}
}
🐳 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-3451 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-3451Quick check: docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-3451 vp --versionSee docs/guide/docker.md for usage. |
9edd2a6 to
77fa5ad
Compare
5336027 to
7bc100e
Compare
7bc100e to
c71ba68
Compare
c71ba68 to
250d667
Compare
When a package in
pkginstalls Git hooks, the dispatcher addspkg/node_modules/.bintoPATH. Aftercd pkg, the shell searchespkg/pkg/node_modules/.binand cannot find the package commands.For a subdirectory installation, the dispatcher builds the absolute path from the hook shell’s initial
$PWD. If the path contains:, it uses the original relative entry because:separates entries inPATH.Root hooks use
./node_modules/.bin, socd packages/uiselects commands from that workspace. Each linked worktree resolves the relativecore.hooksPathin its own checkout.Closes #3450