feat(install): support VP_PR_VERSION for pkg.pr.new testing#1578
Merged
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
87d4894 to
6bc2227
Compare
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.
6bc2227 to
247c17e
Compare
Member
Author
|
@cursor review |
There was a problem hiding this comment.
✅ 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.
cpojer
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
VP_PR_VERSIONenv var to bothinstall.shandinstall.ps1so users can install an unreleased PR build (or any commit) via pkg.pr.new for temporary testing. Since npm releases only ship frommain, pkg.pr.new is the only available testing channel for in-flight changes.When
VP_PR_VERSIONis set, the installer:https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-cli-{platform}@{PR_or_SHA}vite-plusin the wrapperpackage.jsonashttps://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.~/.vite-plus/pkg-pr-new-{PR_or_SHA}/— a non-semver dir name socleanup_old_versionswon't auto-delete it.VP_LOCAL_TGZ.Usage
VP_PR_VERSIONaccepts either a PR number (e.g.1569) or a commit SHA.Test plan
End-to-end verified against #1569 in a sandboxed
HOME:vp --versionreportsv0.0.0-pkg-pr-new.c178e90(matches PR feat(deps): upgrade upstream dependencies #1569 commit)node_modules/vite-plus/package.jsonversion matches the PR build@voidzero-dev/vite-plus-coreresolves via pkg.pr.new URL with the same commit SHApnpm-lock.yamlrecordsvite-plus.specifier: https://pkg.pr.new/voidzero-dev/vite-plus@1569VP_PR_VERSION) flow unchanged — still hits npm registryVP_PR_VERSION+VP_LOCAL_TGZerrors early as expectedbash -npasses oninstall.shNote
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.ps1and guarded by an opt-in env var.Overview
Adds
VP_PR_VERSIONtoinstall.shandinstall.ps1to install unreleased PR/commit builds viapkg.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 frompkg.pr.new, (3) install into a synthetic non-semver version directory (pkg-pr-new-...) to avoid old-version cleanup, and (4) write the wrapperpackage.jsondependency as apkg.pr.newURL sopnpmpulls a coherent PR build ofvite-plusand its workspace deps.Reviewed by Cursor Bugbot for commit 247c17e. Configure here.