Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';

const project = createRequire(import.meta.url);
const vite = createRequire(project.resolve('vite/package.json'));
assert.equal(vite('./package.json').name, '@voidzero-dev/vite-plus-core');
assert.equal(vite('postcss/package.json').version, '8.5.32');
assert.equal(project('postcss/package.json').version, '8.5.33');
console.log('The installed Vite alias uses its own PostCSS pin.');
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"name": "migration-standalone-bun-install",
"private": true,
"devDependencies": {
"postcss": "8.5.33",
"vite": "npm:@voidzero-dev/[email protected]",
"vite-plus": "0.1.24"
},
"overrides": {
"vite": "npm:@voidzero-dev/[email protected]"
"vite": {
".": "npm:@voidzero-dev/[email protected]",
"postcss": "8.5.32"
}
},
"devEngines": {
"packageManager": {
"name": "bun",
"version": "1.3.11",
"version": "1.4.5",
"onFail": "download"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ unset-env = ["VP_SKIP_INSTALL", "CI"]
local-registry = true
steps = [
{ argv = ["vp", "migrate", "--no-interactive", "--no-hooks"], comment = "standalone (non-workspace) bun upgrade must keep concrete specs so `bun install` resolves instead of failing with `vite@catalog: failed to resolve`", continue-on-failure = true },
["node", "check-postcss.mjs"],
{ argv = ["vpt", "print-file", "package.json"], comment = "vite/vite-plus stay concrete (vite via the @voidzero-dev/vite-plus-core alias); NO top-level catalog field is written", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ VITE+ - The Unified Toolchain for the Web
• Package manager settings configured
```

## `node check-postcss.mjs`

```
The installed Vite alias uses its own PostCSS pin.
```

## `vpt print-file package.json`

vite/vite-plus stay concrete (vite via the @voidzero-dev/vite-plus-core alias); NO top-level catalog field is written
Expand All @@ -27,11 +33,18 @@ vite/vite-plus stay concrete (vite via the @voidzero-dev/vite-plus-core alias);
"name": "migration-standalone-bun-install",
"private": true,
"devDependencies": {
"postcss": "8.5.33",
"vite": "npm:@voidzero-dev/vite-plus-core@<version>",
"vite-plus": "<version>"
},
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@<version>"
"@voidzero-dev/vite-plus-core": {
"postcss": "8.5.32"
},
"vite": {
".": "npm:@voidzero-dev/vite-plus-core@<version>",
"postcss": "8.5.32"
}
},
"devEngines": {
"packageManager": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
"vitest": "catalog:"
},
"overrides": {
"vite": "catalog:",
"vite": {
".": "catalog:",
"postcss": "8.5.32"
},
"vitest": "catalog:"
},
"devEngines": {
"packageManager": {
"name": "bun",
"version": "1.3.11",
"version": "1.4.5",
"onFail": "download"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ name = "migration_upgrade_bun_catalog"
vp = "global"
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "existing bun Vite+ catalog WORKSPACE gains a direct vite edge for bun#8406 (bun resolves catalog: only inside a workspace)", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "the direct vite edge is catalog: (resolving through the bun catalog), not a concrete alias", continue-on-failure = true },
{ argv = ["vp", "migrate", "--no-interactive"], comment = "the second migration finds the workspace up to date", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "the direct Vite dependency and its override use the catalog, and the PostCSS pin survives both runs", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ VITE+ - The Unified Toolchain for the Web
• Package manager settings configured
```

## `vp migrate --no-interactive`

the second migration finds the workspace up to date

```
VITE+ - The Unified Toolchain for the Web

This project is already using Vite+! Happy coding!
```

## `vpt print-file package.json`

the direct vite edge is catalog: (resolving through the bun catalog), not a concrete alias
the direct Vite dependency and its override use the catalog, and the PostCSS pin survives both runs

```
{
Expand All @@ -30,7 +40,13 @@ the direct vite edge is catalog: (resolving through the bun catalog), not a conc
"vite-plus": "catalog:"
},
"overrides": {
"vite": "catalog:"
"vite": {
".": "catalog:",
"postcss": "8.5.32"
},
"@voidzero-dev/vite-plus-core": {
"postcss": "8.5.32"
}
},
"devEngines": {
"packageManager": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"vite-plus": "latest"
},
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vite": {
"rollup": "^4.0.0"
},
"vitest": {
"@vitest/runner": "4.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "migration_upgrade_nested_vitest_override_npm"
vp = "global"
steps = [
{ argv = ["vp", "migrate", "--no-interactive"], comment = "nested Vitest override is user-owned and not pending removal", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "object-valued override is preserved", continue-on-failure = true },
{ argv = ["vp", "migrate", "--no-interactive"], comment = "add the Vite alias to the nested override", continue-on-failure = true },
{ argv = ["vpt", "print-file", "package.json"], comment = "preserve the Rollup and Vitest runner overrides", continue-on-failure = true },
{ argv = ["vp", "migrate", "--no-interactive"], comment = "nested override must not make migration permanently pending", continue-on-failure = true },
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## `vp migrate --no-interactive`

nested Vitest override is user-owned and not pending removal
add the Vite alias to the nested override

```
VITE+ - The Unified Toolchain for the Web
Expand All @@ -17,7 +17,7 @@ VITE+ - The Unified Toolchain for the Web

## `vpt print-file package.json`

object-valued override is preserved
preserve the Rollup and Vitest runner overrides

```
{
Expand All @@ -26,7 +26,10 @@ object-valued override is preserved
"vite-plus": "<version>"
},
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@<version>",
"vite": {
"rollup": "^4.0.0",
".": "npm:@voidzero-dev/vite-plus-core@<version>"
},
"vitest": {
"@vitest/runner": "<version>"
}
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/migrate-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Migration detects Playwright usage before it rewrites imports, including legacy

`vp migrate` restores removed Vite+ WebDriverIO aliases to `@vitest/browser-webdriverio` and adds `^5.0.0` if the provider is missing. It upgrades older versions, narrows ranges that allow versions below `5.0.0`, updates referenced catalog entries, and removes overrides that force an older provider. Versions and ranges that meet the minimum stay unchanged. Migration ensures the required `webdriverio` peer and adds an `@vitest/browser` override matching bundled Vitest (`resolutions` for Yarn). You manage later community provider upgrades. See [Community WebDriverIO provider](./vitest-v5.md#community-webdriverio-provider).

Object-valued nested npm and Bun overrides are preserved: they are user-defined scopes rather than scalar version pins.
For npm and Bun, migration reads or updates the `"."` entry of a nested override for a managed package. It preserves child entries in `package.json`, including pins such as `overrides.vite.postcss`.

## Source Rewrite Rules

Expand Down Expand Up @@ -426,6 +426,7 @@ Migration converts the Volta `volta.node` pin to `.node-version`, because Vite+
- Bun before 1.2.21 reads only catalogs under `workspaces`. On those versions, migration uses catalogs only when the project already has one under `workspaces`, and keeps concrete specs otherwise.
- When an existing named catalog already owns `vite-plus`, `vite`, or `vitest`, migration adds missing toolchain entries to that catalog instead of creating a default catalog beside it.
- The core alias is mirrored as a direct `vite` dependency so Bun sees the peer provider before applying overrides.
- Bun 1.4 and later match child overrides by the installed package name. When migration aliases `vite` to `@voidzero-dev/vite-plus-core`, it also copies child pins such as `overrides.vite.postcss` to the core package's overrides. Existing overrides for the core package take precedence. To change the pin for the aliased Vite after migration, edit the core package's override.

## After the Migration

Expand Down
Loading
Loading