-
Notifications
You must be signed in to change notification settings - Fork 220
docs: document pkg.pr.new preview builds #1965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fengmk2
wants to merge
3
commits into
main
Choose a base branch
from
codex/document-pkg-pr-new-preview-builds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+81
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,3 +77,84 @@ vp --version | |
| ``` | ||
|
|
||
| Then set the `vitest` override to that exact version, or rerun `vp migrate` to update the pin for you. | ||
|
|
||
| ## Preview Builds | ||
|
|
||
| Some Vite+ pull requests publish temporary packages through `pkg.pr.new`. Treat these as nightly or bleeding-edge builds: they are useful when you want to verify a specific fix, test a fresh upstream dependency bump, or confirm a change before the next npm release. For day-to-day work, prefer the published `latest` release. | ||
|
|
||
| You can find preview builds in pull requests that automatically update upstream dependencies. For examples, search the merged pull requests for [upstream dependency updates](https://github.com/voidzero-dev/vite-plus/pulls?q=is%3Apr+is%3Amerged+upgrade+upstream+dependencies). | ||
|
|
||
| Preview builds are addressed by pull request number or commit SHA. They are not a stable version range, and you should avoid leaving them in long-lived branches unless a maintainer asks you to. | ||
|
|
||
| ### Global `vp` Preview | ||
|
|
||
| Install a preview build of the global CLI by passing `VP_PR_VERSION` to the installer: | ||
|
|
||
| ```bash | ||
| curl -fsSL https://vite.plus | VP_PR_VERSION=<pr-or-sha> bash | ||
| ``` | ||
|
|
||
| On Windows: | ||
|
|
||
| ```powershell | ||
| $env:VP_PR_VERSION = "<pr-or-sha>" | ||
| irm https://vite.plus/ps1 | iex | ||
| Remove-Item Env:\VP_PR_VERSION | ||
| ``` | ||
|
|
||
| Run `vp --version` afterward to confirm which build and bundled tool versions are active. When you are done testing, return to the published release with `vp upgrade --force` or by running the installer again without `VP_PR_VERSION`. | ||
|
|
||
| ### Local `vite-plus` Preview | ||
|
|
||
| To test an unreleased local package in a project, update the project dependency and any Vite+ alias or override before installing. Use the same pull request number or commit SHA for every preview URL: | ||
|
|
||
| - `vite-plus` should point at `https://pkg.pr.new/voidzero-dev/vite-plus@<pr-or-sha>` | ||
| - any direct `vite` alias or direct `@voidzero-dev/vite-plus-core` dependency should point at `https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-core@<pr-or-sha>` | ||
| - any `vite` override or resolution should point at that same core preview URL | ||
|
|
||
| For npm and Bun projects, update the relevant `package.json` entries: | ||
|
|
||
| ```json | ||
| { | ||
| "devDependencies": { | ||
| "vite-plus": "https://pkg.pr.new/voidzero-dev/vite-plus@<pr-or-sha>", | ||
| "vite": "https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-core@<pr-or-sha>" | ||
| }, | ||
| "overrides": { | ||
| "vite": "https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-core@<pr-or-sha>" | ||
|
fengmk2 marked this conversation as resolved.
|
||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Only include the direct `vite` entry if your project already has one. If your project has `@voidzero-dev/vite-plus-core` directly instead, update that package spec to the same core preview URL. | ||
|
|
||
| For pnpm workspaces, make the same temporary override change in `pnpm-workspace.yaml` if that is where your Vite+ overrides live: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed when the preview package depends on other pkg.pr.new preview URLs.
|
||
|
|
||
| ```yaml | ||
| overrides: | ||
| vite: 'https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-core@<pr-or-sha>' | ||
| ``` | ||
|
|
||
| For Yarn projects, update `resolutions` instead: | ||
|
|
||
| ```json | ||
| { | ||
| "resolutions": { | ||
| "vite": "https://pkg.pr.new/voidzero-dev/vite-plus/@voidzero-dev/vite-plus-core@<pr-or-sha>" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Then install once: | ||
|
|
||
| ```bash | ||
| vp install | ||
|
fengmk2 marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| After installing a preview, check the bundled versions with `vp --version`. If the preview includes a newer bundled Vitest, update your `vitest` override to that exact version so `vp test` and project imports keep using the same Vitest copy. | ||
|
|
||
| When testing is complete, restore every preview spec first: set `vite-plus` back to `latest`, and set any direct `vite` / `@voidzero-dev/vite-plus-core` dependency plus any `vite` override or resolution back to `npm:@voidzero-dev/vite-plus-core@latest`. Then reinstall: | ||
|
|
||
| ```bash | ||
| vp install | ||
| ``` | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for #1891 merged, then use the registry bridge.
There is a compatibility issue when bun overrides the http url version. It will decompress and read the name field in the package.json inside to verify. If it finds that it is not vite, it will invalidate the overrides rule, causing vitest to install the peer version of vite that it declares.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably document this somehow. do you think this is worth raising this in bun?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheAlexLichter Yes, I will create a minimal reproduction repo before merging and then submit it to bun.