Skip to content

feat(install): support VP_PR_VERSION for pkg.pr.new testing#1578

Merged
fengmk2 merged 2 commits into
mainfrom
install-script-pr-version
May 15, 2026
Merged

feat(install): support VP_PR_VERSION for pkg.pr.new testing#1578
fengmk2 merged 2 commits into
mainfrom
install-script-pr-version

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented May 14, 2026

Summary

Add VP_PR_VERSION env var to both install.sh and install.ps1 so users can install an unreleased PR build (or any commit) via pkg.pr.new for temporary testing. Since npm releases only ship from main, pkg.pr.new is the only available testing channel for in-flight changes.

When VP_PR_VERSION is set, the installer:

  • Bypasses the npm registry (no metadata fetch)
  • Downloads the CLI platform tarball from https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-cli-{platform}@{PR_or_SHA}
  • Writes vite-plus in the wrapper package.json as https://pkg.pr.new/voidzero-dev/vite-plus@{PR_or_SHA} — the published pkg.pr.new tarball already rewrites scoped workspace deps to matching pkg.pr.new URLs by commit SHA, so pnpm pulls in a coherent PR build.
  • Installs into ~/.vite-plus/pkg-pr-new-{PR_or_SHA}/ — a non-semver dir name so cleanup_old_versions won't auto-delete it.
  • Errors early if combined with VP_LOCAL_TGZ.

Usage

# bash / macOS / Linux
curl -fsSL https://vite.plus | VP_PR_VERSION=1569 bash
# Windows
$env:VP_PR_VERSION = "1569"; irm https://vite.plus/ps1 | iex

VP_PR_VERSION accepts either a PR number (e.g. 1569) or a commit SHA.

Test plan

End-to-end verified against #1569 in a sandboxed HOME:

  • vp --version reports v0.0.0-pkg-pr-new.c178e90 (matches PR feat(deps): upgrade upstream dependencies #1569 commit)
  • node_modules/vite-plus/package.json version matches the PR build
  • Transitive @voidzero-dev/vite-plus-core resolves via pkg.pr.new URL with the same commit SHA
  • pnpm-lock.yaml records vite-plus.specifier: https://pkg.pr.new/voidzero-dev/vite-plus@1569
  • Normal (no VP_PR_VERSION) flow unchanged — still hits npm registry
  • VP_PR_VERSION + VP_LOCAL_TGZ errors early as expected
  • bash -n passes on install.sh

Note

Medium Risk
Changes the installation path and download sources in the cross-platform installers, which could break installs or pull unintended artifacts if the new URL construction/branching logic is wrong. Scope is limited to install.sh/install.ps1 and guarded by an opt-in env var.

Overview
Adds VP_PR_VERSION to install.sh and install.ps1 to install unreleased PR/commit builds via pkg.pr.new, bypassing npm metadata/version resolution.

When set, the installers (1) refuse to run alongside VP_LOCAL_TGZ, (2) download the platform CLI tarball from pkg.pr.new, (3) install into a synthetic non-semver version directory (pkg-pr-new-...) to avoid old-version cleanup, and (4) write the wrapper package.json dependency as a pkg.pr.new URL so pnpm pulls a coherent PR build of vite-plus and its workspace deps.

Reviewed by Cursor Bugbot for commit 247c17e. Configure here.

@fengmk2 fengmk2 self-assigned this May 14, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 247c17e
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a05be3fb729d4000829b2a7

@fengmk2 fengmk2 force-pushed the install-script-pr-version branch from 87d4894 to 6bc2227 Compare May 14, 2026 08:52
fengmk2 added 2 commits May 14, 2026 20:20
Add VP_PR_VERSION env var to both install.sh and install.ps1 so users
can install an unreleased PR build (or any commit) via pkg.pr.new for
temporary testing. Since npm releases only ship from main, pkg.pr.new
is the only available testing channel for in-flight changes.

When VP_PR_VERSION is set, the installer bypasses the npm registry,
downloads the CLI platform tarball from pkg.pr.new, and writes the
wrapper package.json with the vite-plus dependency pointing at the
matching pkg.pr.new URL (the published tarball already rewrites its
scoped workspace deps to pkg.pr.new URLs by commit SHA, so pnpm pulls
in a coherent PR build).

Usage:
  curl -fsSL https://vite.plus | VP_PR_VERSION=1569 bash
  $env:VP_PR_VERSION = "1569"; irm https://vite.plus/ps1 | iex
…ict check

Move the VP_PR_VERSION/VP_LOCAL_TGZ conflict check into main()/Main so
it can use the existing error() / Write-Error-Exit helpers, matching
the style of the surrounding validations and producing the same red
"error:" prefix. Drop a comment that restated the branch the reader
was about to see; keep the non-obvious WHY about pre-rewritten
transitive deps.
@fengmk2 fengmk2 force-pushed the install-script-pr-version branch from 6bc2227 to 247c17e Compare May 14, 2026 12:21
@fengmk2
Copy link
Copy Markdown
Member Author

fengmk2 commented May 14, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 247c17e. Configure here.

@fengmk2 fengmk2 marked this pull request as ready for review May 15, 2026 01:29
@fengmk2 fengmk2 requested review from Boshen, branchseer and cpojer May 15, 2026 01:29
@fengmk2 fengmk2 merged commit 23d7e68 into main May 15, 2026
52 checks passed
@fengmk2 fengmk2 deleted the install-script-pr-version branch May 15, 2026 02:16
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.

2 participants