You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#1929
Rewrites the "Upgrading Vite+" guide to match the current tooling:
- Preview builds now install through the registry bridge as ordinary
`0.0.0-commit.<sha>` npm versions instead of mutable `pkg.pr.new` URLs.
- Recommends `vp migrate` for upgrading a project's local `vite-plus`,
and for moving it onto a preview build.
Copy file name to clipboardExpand all lines: docs/guide/upgrade.md
+43-21Lines changed: 43 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,48 +32,70 @@ Older versions are pruned automatically after each upgrade. The active version a
32
32
33
33
## Local `vite-plus`
34
34
35
-
Update the project dependency with the package manager commands in Vite+:
35
+
The recommended way to upgrade an existing Vite+ project is `vp migrate`:
36
36
37
37
```bash
38
-
vp update vite-plus
38
+
vp migrate
39
39
```
40
40
41
-
You can also use `vp add vite-plus@latest` if you want to move the dependency explicitly to the latest version.
41
+
On a project that is already on Vite+, migrate does a toolchain version upgrade only: it re-pins `vite-plus`, the `vite` -> `@voidzero-dev/vite-plus-core` alias, and the `vitest` pin to the versions the global `vp` now bundles, across every workspace package. It skips the first-time setup steps (git hooks, editor and agent files, lint migration), so a version bump does not re-touch things you already configured. Pass `--full` to also run that setup.
42
42
43
-
### Updating Aliased Packages
43
+
### Updating the Vitest Pin
44
+
45
+
If you migrated with `vp migrate`, your project pins `vitest` to an exact version so the whole project shares a single Vitest copy with the bundled `vp test` runner. The pin lives in your package manager's override block:
44
46
45
-
Vite+ sets up an npm alias for its core package during installation:
47
+
-**npm / Bun:** a `vitest` entry under `overrides` in `package.json`
48
+
-**Yarn:** a `vitest` entry under `resolutions` in `package.json`
49
+
-**pnpm:** a `vitest` entry under `overrides` in `pnpm-workspace.yaml` — unless your `package.json` already had a `pnpm` field, in which case it lives under `pnpm.overrides` in `package.json` instead (pnpm ignores `pnpm-workspace.yaml` overrides when `package.json` defines `pnpm.overrides`)
46
50
47
-
-`vite` is aliased to `npm:@voidzero-dev/vite-plus-core@latest`
51
+
A Vite+ release can bump the bundled Vitest. Because that pin also applies to `vite-plus`'s own `vitest` dependency, an out-of-date pin keeps installing the previous runner even after you upgrade `vite-plus` — splitting Vitest's internals (mocks, `expect`, runner state) between the pinned copy and the one `vp test` loads.
48
52
49
-
`vp update vite-plus` does not re-resolve this alias in the lockfile. To fully upgrade, update it separately:
53
+
After upgrading `vite-plus`, re-pin `vitest` to the version Vite+ now bundles. Check that version with:
50
54
51
55
```bash
52
-
vp update @voidzero-dev/vite-plus-core
56
+
vp --version
53
57
```
54
58
55
-
Or update everything at once:
59
+
Then set the `vitest` override to that exact version, or rerun `vp migrate` to update the pin for you.
60
+
61
+
## Preview Builds
62
+
63
+
Some Vite+ pull requests publish temporary packages for testing before an npm release. 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 release. For day-to-day work, prefer the published `latest` release.
64
+
65
+
Each commit on an eligible pull request is published to [pkg.pr.new](https://pkg.pr.new) and registered with the [registry bridge](https://registry-bridge.viteplus.dev/). The bridge serves these builds as ordinary npm versions of the form `0.0.0-commit.<sha>` and proxies every other package to the npm registry. That means you install a preview with normal version specs instead of mutable URLs, and the same versions resolve in CI.
66
+
67
+
Both `vite-plus` and `@voidzero-dev/vite-plus-core` publish under the same `0.0.0-commit.<sha>` version. Each pull request carries a comment listing the exact version for its latest commit, along with ready-to-copy install steps.
68
+
69
+
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).
70
+
71
+
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.
72
+
73
+
### Global `vp` Preview
74
+
75
+
Install a preview build of the global CLI by passing `VP_PR_VERSION` to the installer. Pass a pull request number or a commit SHA:
You can verify with `vp outdated` that no Vite+ packages remain outdated.
81
+
On Windows:
62
82
63
-
### Updating the Vitest Pin
83
+
```powershell
84
+
$env:VP_PR_VERSION = "<pr-or-sha>"
85
+
irm https://vite.plus/ps1 | iex
86
+
Remove-Item Env:\VP_PR_VERSION
87
+
```
64
88
65
-
If you migrated with `vp migrate`, your project pins `vitest`to an exact version so the whole project shares a single Vitest copy with the bundled `vp test` runner. The pin lives in your package manager's override block:
89
+
The installer resolves the ref to its `0.0.0-commit.<sha>` build through the registry bridge and installs it like any other 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`.
66
90
67
-
-**npm / Bun:** a `vitest` entry under `overrides` in `package.json`
68
-
-**Yarn:** a `vitest` entry under `resolutions` in `package.json`
69
-
-**pnpm:** a `vitest` entry under `overrides` in `pnpm-workspace.yaml` — unless your `package.json` already had a `pnpm` field, in which case it lives under `pnpm.overrides` in `package.json` instead (pnpm ignores `pnpm-workspace.yaml` overrides when `package.json` defines `pnpm.overrides`)
70
-
71
-
A Vite+ release can bump the bundled Vitest. Because that pin also applies to `vite-plus`'s own `vitest` dependency, an out-of-date pin keeps installing the previous runner even after you upgrade `vite-plus` — splitting Vitest's internals (mocks, `expect`, runner state) between the pinned copy and the one `vp test` loads.
91
+
### Local `vite-plus` Preview
72
92
73
-
After upgrading `vite-plus`, re-pin `vitest` to the version Vite+ now bundles. Check that version with:
93
+
After installing the preview global CLI above, run migrate in the project to move its local `vite-plus` onto the same build:
74
94
75
95
```bash
76
-
vp --version
96
+
vp migrate
77
97
```
78
98
79
-
Then set the `vitest` override to that exact version, or rerun `vp migrate` to update the pin for you.
99
+
Migrate points the project at the bridge registry (writing it to `.npmrc`, or `.yarnrc.yml` for Yarn Berry) and pins `vite-plus` and the `vite` -> `@voidzero-dev/vite-plus-core` alias to the matching `0.0.0-commit.<sha>` version. That registry line is what lets the same versions resolve in the project's own CI, so commit it if you want CI to test the preview too.
100
+
101
+
After installing, check the bundled versions with `vp --version`. When testing is complete, restore the published release: set `vite-plus` back to `latest`, remove the bridge `registry` line from `.npmrc` (or `.yarnrc.yml`), and reinstall with `vp install`.
0 commit comments