Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/actions/build-upstream/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ runs:
target/${{ inputs.target }}/release/vp-shim.exe
key: ${{ steps.cache-key.outputs.key }}

# Apply Vite+ branding patches to rolldown-vite source (CI checks out
# upstream rolldown-vite which doesn't have branding patches)
- name: Brand rolldown-vite
# Apply Vite+ branding patches to vite source (CI checks out
# upstream vite which doesn't have branding patches)
- name: Brand vite
shell: bash
run: pnpm exec tool brand-rolldown-vite
run: pnpm exec tool brand-vite

# Build upstream TypeScript packages first (don't depend on native bindings)
- name: Build upstream TypeScript packages
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/clone/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ outputs:
runs:
using: 'composite'
steps:
- name: Output rolldown and rolldown-vite hash
- name: Output rolldown and vite hash
shell: bash
id: upstream-versions
run: |
node -e "console.log('ROLLDOWN_HASH=' + require('./packages/tools/.upstream-versions.json').rolldown.hash)" >> $GITHUB_OUTPUT
node -e "console.log('ROLLDOWN_VITE_HASH=' + require('./packages/tools/.upstream-versions.json')['rolldown-vite'].hash)" >> $GITHUB_OUTPUT
node -e "console.log('ROLLDOWN_VITE_HASH=' + require('./packages/tools/.upstream-versions.json')['vite'].hash)" >> $GITHUB_OUTPUT

- name: Output ecosystem ci project hash
shell: bash
Expand All @@ -40,7 +40,7 @@ runs:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: vitejs/vite
path: rolldown-vite
path: vite
ref: ${{ steps.upstream-versions.outputs.ROLLDOWN_VITE_HASH }}

# Disable autocrlf to preserve LF line endings on Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"packages/cli/snap-tests-todo/**",
"bench/fixtures/**",
"rolldown/**",
"rolldown-vite/**"
"vite/**"
],
"packageRules": [
{
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/upgrade-deps.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ async function updateUpstreamVersions() {
// rolldown -> rolldown/rolldown
data.rolldown.hash = await getLatestTagCommit('rolldown', 'rolldown');

// rolldown-vite -> vitejs/vite
data['rolldown-vite'].hash = await getLatestTagCommit('vitejs', 'vite');
// vite -> vitejs/vite
data['vite'].hash = await getLatestTagCommit('vitejs', 'vite');

fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
console.log('Updated .upstream-versions.json');
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
body: |
Automated daily upgrade of upstream dependencies:
- rolldown (latest tag)
- rolldown-vite (latest tag)
- vite (latest tag)
- vitest (latest npm version)
- tsdown (latest npm version)

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist
.DS_Store
rolldown
rolldown-vite
vite
/crates/vite_global_cli/vp
2 changes: 1 addition & 1 deletion packages/cli/BUNDLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ The CLI package creates thin shim files that re-export from `@voidzero-dev/vite-
3. **Reduces duplication** - No file copying, just re-exports
4. **Preserves module resolution** - Node.js resolves to the actual core package

**Note**: The `@voidzero-dev/vite-plus-core` package itself bundles multiple upstream projects (rolldown-vite, rolldown, tsdown, vitepress). See [Core Package Bundling](../core/BUNDLING.md) for details.
**Note**: The `@voidzero-dev/vite-plus-core` package itself bundles multiple upstream projects (vite, rolldown, tsdown, vitepress). See [Core Package Bundling](../core/BUNDLING.md) for details.

### Export Mapping (Core)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"pnpm": {
"overrides": {
"react-click-away-listener>react": "0.0.0-experimental-7dc903cd-20251203",
"vite": "npm:rolldown-vite@7.0.12",
"vite-plugin-inspect>vite": "npm:rolldown-vite@7.0.12",
"vite-plugin-svgr>foo>vite": "npm:rolldown-vite@7.0.12",
"@vitejs/plugin-react>vite": "npm:rolldown-vite@7.0.12",
"@vitejs/plugin-react-swc>vite": "npm:rolldown-vite@7.0.12",
"vite": "npm:vite@7.0.12",
"vite-plugin-inspect>vite": "npm:vite@7.0.12",
"vite-plugin-svgr>foo>vite": "npm:vite@7.0.12",
"@vitejs/plugin-react>vite": "npm:vite@7.0.12",
"@vitejs/plugin-react-swc>vite": "npm:vite@7.0.12",
"supertest>superagent": "9.0.2"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ packages:
- packages/*

catalog:
vite: 'npm:rolldown-vite@7.0.12'
vite: 'npm:vite@7.0.12'

overrides:
'vite-plugin-svgr>vite': 'npm:rolldown-vite@7.0.12'
'@vitejs/plugin-react>vite': 'npm:rolldown-vite@7.0.12'
'vite-plugin-svgr>foo>vite': 'npm:rolldown-vite@7.0.12'
'vite-plugin-svgr>vite': 'npm:vite@7.0.12'
'@vitejs/plugin-react>vite': 'npm:vite@7.0.12'
'vite-plugin-svgr>foo>vite': 'npm:vite@7.0.12'
'supertest>superagent': '9.0.2'
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ catalog:
vite-plus: latest

overrides:
'@vitejs/plugin-react>vite': 'npm:rolldown-vite@<semver>'
'@vitejs/plugin-react>vite': 'npm:vite@<semver>'
'supertest>superagent': '9.0.2'
vite: 'catalog:'
vitest: 'catalog:'
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/migration/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ function rewritePnpmWorkspaceYaml(projectPath: string): void {
}
doc.setIn(['overrides', scalarString(key)], scalarString(version));
}
// remove dependency selector from vite, e.g. "vite-plugin-svgr>vite": "npm:rolldown-vite@7.0.12"
// remove dependency selector from vite, e.g. "vite-plugin-svgr>vite": "npm:vite@7.0.12"
const overrides = doc.getIn(['overrides']) as YAMLMap<Scalar<string>, Scalar<string>>;
for (const item of overrides.items) {
if (item.key.value.includes('>')) {
Expand Down Expand Up @@ -994,7 +994,7 @@ function rewriteRootWorkspacePackageJson(
delete pkg.resolutions[key];
}
}
// remove dependency selector from vite, e.g. "vite-plugin-svgr>vite": "npm:rolldown-vite@7.0.12"
// remove dependency selector from vite, e.g. "vite-plugin-svgr>vite": "npm:vite@7.0.12"
for (const key in pkg.pnpm?.overrides) {
if (key.includes('>')) {
const splits = key.split('>');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/resolve-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { DEFAULT_ENVS, resolve } from './utils/constants.js';
* - envs: Environment variables to set when executing Vite
*
* The function first tries to resolve vite package, then falls back
* to rolldown-vite package (for direct rolldown-vite installations).
* to vite package (for direct vite installations).
* It constructs the path to the CLI binary within the resolved package.
*/
export async function vite(): Promise<{
Expand Down
18 changes: 9 additions & 9 deletions packages/core/BUNDLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The core package uses a **multi-project bundling strategy** that combines 5 upst
| ----------------------- | ------------------------------- | ------------------------- |
| `@rolldown/pluginutils` | `rolldown/packages/pluginutils` | Rolldown plugin utilities |
| `rolldown` | `rolldown/packages/rolldown` | Rolldown bundler |
| `vite` (rolldown-vite) | `rolldown-vite/packages/vite` | Vite v8 beta |
| `vite` | `vite/packages/vite` | Vite v8 beta |
| `tsdown` | `node_modules/tsdown` | TypeScript build tool |
| `vitepress` | `node_modules/vitepress` | Documentation tool |

Expand Down Expand Up @@ -59,7 +59,7 @@ This is the most complex step, using the upstream `vite-rolldown.config` with mo
3. **Rewrite static paths** - Fixes `VITE_PACKAGE_DIR`, `CLIENT_ENTRY`, `ENV_ENTRY` constants
4. **Copy additional files** - `misc/`, `.d.ts` files, `types/`, `client.d.ts`

**Input**: `rolldown-vite/packages/vite/`
**Input**: `vite/packages/vite/`
**Output**: `dist/vite/`

### Step 4: Bundle Tsdown (`bundleTsdown`)
Expand Down Expand Up @@ -93,8 +93,8 @@ This is the most complex step, using the upstream `vite-rolldown.config` with mo

**Updates**:

- `peerDependencies` - Merged from tsdown and rolldown-vite
- `peerDependenciesMeta` - Merged from tsdown and rolldown-vite
- `peerDependencies` - Merged from tsdown and vite
- `peerDependenciesMeta` - Merged from tsdown and vite
- `bundledVersions` - Records vite, rolldown, and tsdown versions

---
Expand Down Expand Up @@ -234,7 +234,7 @@ dist/
│ ├── parse-ast-index.mjs
│ ├── plugins-index.mjs
│ └── ...
├── vite/ # Vite (from rolldown-vite)
├── vite/ # Vite
│ ├── node/
│ │ ├── index.js
│ │ ├── index.d.ts
Expand Down Expand Up @@ -291,7 +291,7 @@ dist/
| ----------------------- | ------------------------------------- | -------------- |
| `@rolldown/pluginutils` | `../../rolldown/packages/pluginutils` | Git submodule |
| `rolldown` | `../../rolldown/packages/rolldown` | Git submodule |
| `vite` (rolldown-vite) | `../../rolldown-vite/packages/vite` | Git submodule |
| `vite` | `../../vite/packages/vite` | Git submodule |
| `tsdown` | `node_modules/tsdown` | npm dependency |
| `vitepress` | `node_modules/vitepress` | npm dependency |

Expand All @@ -312,9 +312,9 @@ dist/

## Maintenance: Updating Bundled Versions

### Updating Vite (rolldown-vite)
### Updating Vite

1. Update the `rolldown-vite` git submodule to the new version
1. Update the `vite` git submodule to the new version
2. Run `pnpm -C packages/core build`
3. Verify `bundledVersions.vite` in `package.json` is updated
4. Test with `pnpm test`
Expand Down Expand Up @@ -389,7 +389,7 @@ const rolldownPluginUtilsDir = resolve(
'pluginutils',
);
const rolldownSourceDir = resolve(projectDir, '..', '..', 'rolldown', 'packages', 'rolldown');
const rolldownViteSourceDir = resolve(projectDir, '..', '..', 'rolldown-vite', 'packages', 'vite');
const rolldownViteSourceDir = resolve(projectDir, '..', '..', 'vite', 'packages', 'vite');
const tsdownSourceDir = resolve(projectDir, 'node_modules/tsdown');

// Package name used for rewrites
Expand Down
8 changes: 4 additions & 4 deletions packages/core/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const rolldownPluginUtilsDir = resolve(

const rolldownSourceDir = resolve(projectDir, '..', '..', 'rolldown', 'packages', 'rolldown');

const rolldownViteSourceDir = resolve(projectDir, '..', '..', 'rolldown-vite', 'packages', 'vite');
const rolldownViteSourceDir = resolve(projectDir, '..', '..', 'vite', 'packages', 'vite');

const tsdownSourceDir = resolve(projectDir, 'node_modules/tsdown');

Expand All @@ -62,7 +62,7 @@ generateLicenseFile({
projectDir,
join(projectDir, '..', '..'),
join(projectDir, '..', '..', 'rolldown'),
join(projectDir, '..', '..', 'rolldown-vite'),
join(projectDir, '..', '..', 'vite'),
],
extraPackages: [
{
Expand Down Expand Up @@ -640,13 +640,13 @@ async function mergePackageJson() {
const vitePkg = JSON.parse(await readFile(vitePkgPath, 'utf-8'));
const destPkg = JSON.parse(await readFile(destPkgPath, 'utf-8'));

// Merge peerDependencies from tsdown and rolldown-vite
// Merge peerDependencies from tsdown and vite
destPkg.peerDependencies = {
...tsdownPkg.peerDependencies,
...vitePkg.peerDependencies,
};

// Merge peerDependenciesMeta from tsdown and rolldown-vite
// Merge peerDependenciesMeta from tsdown and vite
destPkg.peerDependenciesMeta = {
...tsdownPkg.peerDependenciesMeta,
...vitePkg.peerDependenciesMeta,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rollupLicensePlugin.ts
2 changes: 1 addition & 1 deletion packages/core/vite-rolldown.config.ts
2 changes: 1 addition & 1 deletion packages/test/BUNDLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ For maintainers developing the vitest/vite migration feature, here are the trans
| `from "vite"` | `from "@voidzero-dev/vite-plus-core"` |
| `from "vite/module-runner"` | `from "@voidzero-dev/vite-plus-core/module-runner"` |

**Note**: `@voidzero-dev/vite-plus-core` is the bundled version of upstream rolldown-vite (Vite v8 beta). See [Core Package Bundling](../core/BUNDLING.md) for details on what it contains.
**Note**: `@voidzero-dev/vite-plus-core` is the bundled version of upstream vite (Vite v8 beta). See [Core Package Bundling](../core/BUNDLING.md) for details on what it contains.

**Note:** When using pnpm overrides, you have three options for browser provider imports:

Expand Down
2 changes: 1 addition & 1 deletion packages/tools/.upstream-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"branch": "main",
"hash": "00f9fa1d47335aacbb9becc527fd920169bdf0cf"
},
"rolldown-vite": {
"vite": {
"repo": "https://github.com/vitejs/vite.git",
"branch": "main",
"hash": "b565af6f1123a62b3058253b2147574b8515e89f"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Apply Vite+ branding patches to rolldown-vite source after sync.
* Apply Vite+ branding patches to vite source after sync.
*
* This script modifies user-visible branding strings in the rolldown-vite
* This script modifies user-visible branding strings in the vite
* source to show "VITE+" instead of "VITE". It is called automatically
* at the end of `sync-remote-deps.ts` and can also be run independently.
*
Expand All @@ -16,11 +16,11 @@
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';

const ROLLDOWN_VITE_DIR = 'rolldown-vite';
const VITE_NODE_DIR = join(ROLLDOWN_VITE_DIR, 'packages', 'vite', 'src', 'node');
const VITE_DIR = 'vite';
const VITE_NODE_DIR = join(VITE_DIR, 'packages', 'vite', 'src', 'node');

function log(message: string) {
console.log(`[brand-rolldown-vite] ${message}`);
console.log(`[brand-vite] ${message}`);
}

/**
Expand All @@ -46,9 +46,9 @@ function replaceInFile(
return 'patched';
}
throw new Error(
`[brand-rolldown-vite] Patch failed in ${filePath}:\n` +
`[brand-vite] Patch failed in ${filePath}:\n` +
` Could not find search string: ${JSON.stringify(search)}\n` +
` The upstream code may have changed. Please update the search string in brand-rolldown-vite.ts.`,
` The upstream code may have changed. Please update the search string in brand-vite.ts.`,
);
}

Expand Down Expand Up @@ -84,7 +84,7 @@ function logPatch(file: string, desc: string, result: 'patched' | 'already') {
}
}

export function brandRolldownVite(rootDir: string = process.cwd()) {
export function brandVite(rootDir: string = process.cwd()) {
log('Applying Vite+ branding patches...');

const nodeDir = join(rootDir, VITE_NODE_DIR);
Expand Down
8 changes: 4 additions & 4 deletions packages/tools/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ switch (subcommand) {
const { installGlobalCli } = await import('./install-global-cli.ts');
installGlobalCli();
break;
case 'brand-rolldown-vite':
const { brandRolldownVite } = await import('./brand-rolldown-vite.ts');
brandRolldownVite();
case 'brand-vite':
const { brandVite } = await import('./brand-vite.ts');
brandVite();
break;
default:
console.error(`Unknown subcommand: ${subcommand}`);
console.error(
'Available subcommands: snap-test, replace-file-content, sync-remote, json-sort, merge-peer-deps, install-global-cli, brand-rolldown-vite',
'Available subcommands: snap-test, replace-file-content, sync-remote, json-sort, merge-peer-deps, install-global-cli, brand-vite',
);
process.exit(1);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/merge-peer-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ export function mergePeerDeps() {
const vitepressPackagePath = join(rootDir, 'packages/cli/node_modules/vitepress/package.json');
const tsdownPackagePath = join(rootDir, 'packages/cli/node_modules/tsdown/package.json');
const vitestPackagePath = join(rootDir, 'packages/cli/node_modules/vitest-dev/package.json');
const rolldownVitePackagePath = join(rootDir, 'rolldown-vite/packages/vite/package.json');
const rolldownVitePackagePath = join(rootDir, 'vite/packages/vite/package.json');

// Check if all files exist
const packagePaths = [
{ path: vitepressPackagePath, name: 'vitepress' },
{ path: tsdownPackagePath, name: 'tsdown' },
{ path: vitestPackagePath, name: 'vitest' },
{ path: rolldownVitePackagePath, name: 'rolldown-vite' },
{ path: rolldownVitePackagePath, name: 'vite' },
];

const packages: PackageJson[] = [];
Expand Down
Loading
Loading