diff --git a/.github/actions/build-upstream/action.yml b/.github/actions/build-upstream/action.yml index 12b84bbb5b..d992565e60 100644 --- a/.github/actions/build-upstream/action.yml +++ b/.github/actions/build-upstream/action.yml @@ -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 diff --git a/.github/actions/clone/action.yml b/.github/actions/clone/action.yml index 2fda687c88..8c98b3147f 100644 --- a/.github/actions/clone/action.yml +++ b/.github/actions/clone/action.yml @@ -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 @@ -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 diff --git a/.github/renovate.json b/.github/renovate.json index 86b7694bf1..3d180b124d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -7,7 +7,7 @@ "packages/cli/snap-tests-todo/**", "bench/fixtures/**", "rolldown/**", - "rolldown-vite/**" + "vite/**" ], "packageRules": [ { diff --git a/.github/scripts/upgrade-deps.mjs b/.github/scripts/upgrade-deps.mjs index 1b09af5228..fac13b86df 100644 --- a/.github/scripts/upgrade-deps.mjs +++ b/.github/scripts/upgrade-deps.mjs @@ -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'); diff --git a/.github/workflows/upgrade-deps.yml b/.github/workflows/upgrade-deps.yml index 6317a07a1c..0b6821a69a 100644 --- a/.github/workflows/upgrade-deps.yml +++ b/.github/workflows/upgrade-deps.yml @@ -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) diff --git a/.gitignore b/.gitignore index af889bcf5f..7821398421 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ dist .DS_Store rolldown rolldown-vite +vite /crates/vite_global_cli/vp diff --git a/packages/cli/BUNDLING.md b/packages/cli/BUNDLING.md index 746728dbda..85d033b304 100644 --- a/packages/cli/BUNDLING.md +++ b/packages/cli/BUNDLING.md @@ -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) diff --git a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/package.json b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/package.json index 1cfd5fd11f..b27370addb 100644 --- a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/package.json +++ b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/package.json @@ -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" } } diff --git a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/pnpm-workspace.yaml b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/pnpm-workspace.yaml index 79284bd068..68f9270483 100644 --- a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/pnpm-workspace.yaml +++ b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/pnpm-workspace.yaml @@ -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' diff --git a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/snap.txt b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/snap.txt index 861689a48a..0e18946ce1 100644 --- a/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/snap.txt +++ b/packages/cli/snap-tests-global/migration-monorepo-pnpm-overrides-dependency-selector/snap.txt @@ -48,7 +48,7 @@ catalog: vite-plus: latest overrides: - '@vitejs/plugin-react>vite': 'npm:rolldown-vite@' + '@vitejs/plugin-react>vite': 'npm:vite@' 'supertest>superagent': '9.0.2' vite: 'catalog:' vitest: 'catalog:' diff --git a/packages/cli/src/migration/migrator.ts b/packages/cli/src/migration/migrator.ts index a083700309..9a26d910db 100644 --- a/packages/cli/src/migration/migrator.ts +++ b/packages/cli/src/migration/migrator.ts @@ -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>; for (const item of overrides.items) { if (item.key.value.includes('>')) { @@ -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('>'); diff --git a/packages/cli/src/resolve-vite.ts b/packages/cli/src/resolve-vite.ts index a2e3ac360b..150e3c941d 100644 --- a/packages/cli/src/resolve-vite.ts +++ b/packages/cli/src/resolve-vite.ts @@ -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<{ diff --git a/packages/core/BUNDLING.md b/packages/core/BUNDLING.md index dbb6251113..ba07700030 100644 --- a/packages/core/BUNDLING.md +++ b/packages/core/BUNDLING.md @@ -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 | @@ -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`) @@ -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 --- @@ -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 @@ -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 | @@ -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` @@ -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 diff --git a/packages/core/build.ts b/packages/core/build.ts index d375eafd03..3c32cc9641 100644 --- a/packages/core/build.ts +++ b/packages/core/build.ts @@ -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'); @@ -62,7 +62,7 @@ generateLicenseFile({ projectDir, join(projectDir, '..', '..'), join(projectDir, '..', '..', 'rolldown'), - join(projectDir, '..', '..', 'rolldown-vite'), + join(projectDir, '..', '..', 'vite'), ], extraPackages: [ { @@ -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, diff --git a/packages/core/rollupLicensePlugin.ts b/packages/core/rollupLicensePlugin.ts index 2897738409..8d86c68561 120000 --- a/packages/core/rollupLicensePlugin.ts +++ b/packages/core/rollupLicensePlugin.ts @@ -1 +1 @@ -../../rolldown-vite/packages/vite/rollupLicensePlugin.ts \ No newline at end of file +../../vite/packages/vite/rollupLicensePlugin.ts \ No newline at end of file diff --git a/packages/core/vite-rolldown.config.ts b/packages/core/vite-rolldown.config.ts index 7b6acd9fbf..30b06ff591 120000 --- a/packages/core/vite-rolldown.config.ts +++ b/packages/core/vite-rolldown.config.ts @@ -1 +1 @@ -../../rolldown-vite/packages/vite/rolldown.config.ts \ No newline at end of file +../../vite/packages/vite/rolldown.config.ts \ No newline at end of file diff --git a/packages/test/BUNDLING.md b/packages/test/BUNDLING.md index ba12fd917a..2ab49f9541 100644 --- a/packages/test/BUNDLING.md +++ b/packages/test/BUNDLING.md @@ -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: diff --git a/packages/tools/.upstream-versions.json b/packages/tools/.upstream-versions.json index f5cdde165b..4e79d626e2 100644 --- a/packages/tools/.upstream-versions.json +++ b/packages/tools/.upstream-versions.json @@ -4,7 +4,7 @@ "branch": "main", "hash": "00f9fa1d47335aacbb9becc527fd920169bdf0cf" }, - "rolldown-vite": { + "vite": { "repo": "https://github.com/vitejs/vite.git", "branch": "main", "hash": "b565af6f1123a62b3058253b2147574b8515e89f" diff --git a/packages/tools/src/brand-rolldown-vite.ts b/packages/tools/src/brand-vite.ts similarity index 92% rename from packages/tools/src/brand-rolldown-vite.ts rename to packages/tools/src/brand-vite.ts index eb52a6e035..759974135f 100644 --- a/packages/tools/src/brand-rolldown-vite.ts +++ b/packages/tools/src/brand-vite.ts @@ -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. * @@ -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}`); } /** @@ -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.`, ); } @@ -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); diff --git a/packages/tools/src/index.ts b/packages/tools/src/index.ts index 258d9a1353..5a6fa9b58e 100644 --- a/packages/tools/src/index.ts +++ b/packages/tools/src/index.ts @@ -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); } diff --git a/packages/tools/src/merge-peer-deps.ts b/packages/tools/src/merge-peer-deps.ts index cb88ce9e84..1e5a6df955 100644 --- a/packages/tools/src/merge-peer-deps.ts +++ b/packages/tools/src/merge-peer-deps.ts @@ -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[] = []; diff --git a/packages/tools/src/sync-remote-deps.ts b/packages/tools/src/sync-remote-deps.ts index 611a51a204..edf8e6bb29 100755 --- a/packages/tools/src/sync-remote-deps.ts +++ b/packages/tools/src/sync-remote-deps.ts @@ -31,7 +31,7 @@ interface PackageJson { type ExportValue = string | { [condition: string]: string | ExportValue } | null; const ROLLDOWN_DIR = 'rolldown'; -const ROLLDOWN_VITE_DIR = 'rolldown-vite'; +const VITE_DIR = 'vite'; const CORE_PACKAGE_PATH = 'packages/core'; function log(message: string) { @@ -529,9 +529,9 @@ function mergePnpmWorkspaces( // Add rolldown packages packagesSet.add(ROLLDOWN_DIR); packagesSet.add(`${ROLLDOWN_DIR}/packages/*`); - // Add rolldown-vite packages - packagesSet.add(ROLLDOWN_VITE_DIR); - packagesSet.add(`${ROLLDOWN_VITE_DIR}/packages/*`); + // Add vite packages + packagesSet.add(VITE_DIR); + packagesSet.add(`${VITE_DIR}/packages/*`); result.packages = Array.from(packagesSet); // Merge catalog @@ -547,7 +547,7 @@ function mergePnpmWorkspaces( } } - // Add all entries from rolldown-vite catalog (if it has one) + // Add all entries from vite catalog (if it has one) for (const [pkg, version] of Object.entries(rolldownVite.catalog || {})) { if (catalog[pkg]) { // Merge versions @@ -578,14 +578,14 @@ function mergePnpmWorkspaces( (rolldownVite.minimumReleaseAgeExclude || []).forEach((item) => excludeSet.add(item)); result.minimumReleaseAgeExclude = Array.from(excludeSet); - // Copy patchedDependencies from rolldown-vite (with path prefix) + // Copy patchedDependencies from vite (with path prefix) if (rolldownVite.patchedDependencies) { result.patchedDependencies = {}; for (const [dep, patchPath] of Object.entries(rolldownVite.patchedDependencies)) { - // Prepend rolldown-vite directory to patch paths + // Prepend vite directory to patch paths result.patchedDependencies[dep] = patchPath.startsWith('./') - ? `./${ROLLDOWN_VITE_DIR}/${patchPath.slice(2)}` - : `${ROLLDOWN_VITE_DIR}/${patchPath}`; + ? `./${VITE_DIR}/${patchPath.slice(2)}` + : `${VITE_DIR}/${patchPath}`; } } @@ -604,7 +604,7 @@ function mergePnpmWorkspaces( } } - // Copy packageExtensions from rolldown-vite + // Copy packageExtensions from vite if (rolldownVite.packageExtensions) { result.packageExtensions = { ...main.packageExtensions, @@ -631,7 +631,7 @@ export async function syncRemote() { args: process.argv.slice(3), }); - log('Starting rolldown/rolldown-vite sync...'); + log('Starting rolldown/vite sync...'); // Get the root directory (assuming script is run from root) const rootDir = process.cwd(); @@ -642,12 +642,18 @@ export async function syncRemote() { rmSync(join(rootDir, ROLLDOWN_DIR), { recursive: true, force: true }); log(`Removed ${ROLLDOWN_DIR}`); } - if (existsSync(join(rootDir, ROLLDOWN_VITE_DIR))) { - rmSync(join(rootDir, ROLLDOWN_VITE_DIR), { + if (existsSync(join(rootDir, VITE_DIR))) { + rmSync(join(rootDir, VITE_DIR), { recursive: true, force: true, }); - log(`Removed ${ROLLDOWN_VITE_DIR}`); + log(`Removed ${VITE_DIR}`); + } + // Clean up legacy 'rolldown-vite' directory (renamed to 'vite') + const legacyViteDir = join(rootDir, 'rolldown-vite'); + if (existsSync(legacyViteDir)) { + rmSync(legacyViteDir, { recursive: true, force: true }); + log('Removed legacy rolldown-vite directory'); } } @@ -659,10 +665,10 @@ export async function syncRemote() { upstreamVersions.rolldown.hash, ); cloneOrResetRepo( - upstreamVersions['rolldown-vite'].repo, - join(rootDir, ROLLDOWN_VITE_DIR), - upstreamVersions['rolldown-vite'].branch, - upstreamVersions['rolldown-vite'].hash, + upstreamVersions['vite'].repo, + join(rootDir, VITE_DIR), + upstreamVersions['vite'].branch, + upstreamVersions['vite'].hash, ); // Dynamically import dependencies after git clone @@ -697,8 +703,8 @@ export async function syncRemote() { readFileSync(rolldownWorkspacePath, 'utf-8'), ) as PnpmWorkspace; - // Read rolldown-vite pnpm-workspace.yaml - const rolldownViteWorkspacePath = join(rootDir, ROLLDOWN_VITE_DIR, 'pnpm-workspace.yaml'); + // Read vite pnpm-workspace.yaml + const rolldownViteWorkspacePath = join(rootDir, VITE_DIR, 'pnpm-workspace.yaml'); const rolldownViteWorkspace = parseYaml( readFileSync(rolldownViteWorkspacePath, 'utf-8'), ) as PnpmWorkspace; @@ -728,13 +734,7 @@ export async function syncRemote() { const corePackagePath = join(rootDir, CORE_PACKAGE_PATH, 'package.json'); const rolldownPackagePath = join(rootDir, ROLLDOWN_DIR, 'packages', 'rolldown', 'package.json'); - const rolldownVitePackagePath = join( - rootDir, - ROLLDOWN_VITE_DIR, - 'packages', - 'vite', - 'package.json', - ); + const rolldownVitePackagePath = join(rootDir, VITE_DIR, 'packages', 'vite', 'package.json'); const pluginutilsPackagePath = join( rootDir, ROLLDOWN_DIR, @@ -772,9 +772,9 @@ export async function syncRemote() { log('✓ package.json exports updated successfully!'); - // Apply Vite+ branding patches to rolldown-vite source - const { brandRolldownVite } = await import('./brand-rolldown-vite.ts'); - brandRolldownVite(rootDir); + // Apply Vite+ branding patches to vite source + const { brandVite } = await import('./brand-vite.ts'); + brandVite(rootDir); log('✓ Done!'); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 24bb7e91e4..bb9199011a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -259,13 +259,13 @@ packageExtensionsChecksum: sha256-Tldxs3DhJEw/FFBonUidqhCBqApA0zxQnop3Y+BTO3U= patchedDependencies: chokidar@3.6.0: hash: 8a4f9e2b397e6034b91a0508faae3cecb97f222313faa129d7cb0eb71e9d0e84 - path: rolldown-vite/patches/chokidar@3.6.0.patch + path: vite/patches/chokidar@3.6.0.patch dotenv-expand@12.0.3: hash: 49330a663821151418e003e822a82a6a61d2f0f8a6e3cab00c1c94815a112889 - path: rolldown-vite/patches/dotenv-expand@12.0.3.patch + path: vite/patches/dotenv-expand@12.0.3.patch sirv@3.0.2: hash: c07c56eb72faea34341d465cde2314e89db472106ed378181e3447893af6bf95 - path: rolldown-vite/patches/sirv@3.0.2.patch + path: vite/patches/sirv@3.0.2.patch importers: @@ -812,7 +812,7 @@ importers: specifier: 'catalog:' version: 5.9.3 - rolldown-vite: + vite: devDependencies: '@eslint/js': specifier: ^9.39.4 @@ -908,7 +908,7 @@ importers: specifier: workspace:@voidzero-dev/vite-plus-test@* version: link:../packages/test - rolldown-vite/packages/create-vite: + vite/packages/create-vite: devDependencies: '@clack/prompts': specifier: ^1.1.0 @@ -929,7 +929,7 @@ importers: specifier: ^0.20.3 version: 0.20.3(@arethetypeswrong/core@0.18.2)(@typescript/native-preview@7.0.0-dev.20260122.2)(@vitejs/devtools@0.1.2(@pnpm/logger@1001.0.1)(typescript@5.9.3)(vite@packages+core)(vue@3.5.27(typescript@5.9.3)))(publint@0.3.18)(typescript@5.9.3)(unplugin-lightningcss@0.4.3)(unplugin-unused@0.5.6) - rolldown-vite/packages/plugin-legacy: + vite/packages/plugin-legacy: dependencies: '@babel/core': specifier: ^7.29.0 @@ -984,7 +984,7 @@ importers: specifier: workspace:@voidzero-dev/vite-plus-core@* version: link:../../../packages/core - rolldown-vite/packages/vite: + vite/packages/vite: dependencies: '@oxc-project/runtime': specifier: 0.115.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6bbf4342f3..38fa0f9563 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,8 +2,8 @@ packages: - packages/* - rolldown - rolldown/packages/* - - rolldown-vite - - rolldown-vite/packages/* + - vite + - vite/packages/* catalog: '@babel/core': ^7.24.7 '@babel/preset-env': ^7.24.7 @@ -92,7 +92,6 @@ catalog: remark-parse: ^11.0.0 remeda: ^2.10.0 rolldown-plugin-dts: ^0.22.0 - rolldown-vite: ^7.1.19 rollup: ^4.18.0 semver: ^7.7.3 serve-static: ^2.0.0 @@ -151,7 +150,6 @@ minimumReleaseAgeExclude: - lightningcss-* - rolldown - rolldown-plugin-dts - - rolldown-vite - tsdown - unrun - vite @@ -175,9 +173,9 @@ packageExtensions: dependencies: '@types/estree': ^1.0.0 patchedDependencies: - sirv@3.0.2: rolldown-vite/patches/sirv@3.0.2.patch - chokidar@3.6.0: rolldown-vite/patches/chokidar@3.6.0.patch - dotenv-expand@12.0.3: rolldown-vite/patches/dotenv-expand@12.0.3.patch + sirv@3.0.2: vite/patches/sirv@3.0.2.patch + chokidar@3.6.0: vite/patches/chokidar@3.6.0.patch + dotenv-expand@12.0.3: vite/patches/dotenv-expand@12.0.3.patch peerDependencyRules: allowAny: - vite diff --git a/rfcs/cli-output-polish.md b/rfcs/cli-output-polish.md index 0614e1c96c..c3f4010d8b 100644 --- a/rfcs/cli-output-polish.md +++ b/rfcs/cli-output-polish.md @@ -6,7 +6,7 @@ Draft ## Executive Summary -Vite+ wraps several sub-tools (rolldown-vite, vitest, oxlint, oxfmt) and has native Rust commands (upgrade, env, vpx, package manager commands). Each sub-tool currently shows its own branding and uses inconsistent formatting for messages, prefixes, and status indicators. This RFC proposes unifying all CLI output under the "Vite+" brand identity with consistent message formatting, starting with rolldown-vite (whose source is cloned locally and directly modifiable) and extending to Rust commands and other sub-tools. +Vite+ wraps several sub-tools (vite, vitest, oxlint, oxfmt) and has native Rust commands (upgrade, env, vpx, package manager commands). Each sub-tool currently shows its own branding and uses inconsistent formatting for messages, prefixes, and status indicators. This RFC proposes unifying all CLI output under the "Vite+" brand identity with consistent message formatting, starting with vite (whose source is cloned locally and directly modifiable) and extending to Rust commands and other sub-tools. ## Motivation @@ -56,11 +56,11 @@ Neither identifies the experience as "Vite+". Users who installed `vite-plus` se | ------------------ | ----------------------- | | Rust (global CLI) | `owo_colors` | | JS (vite-plus CLI) | `node:util styleText()` | -| rolldown-vite | `picocolors` | +| vite | `picocolors` | -**5. The `[vite]` logger prefix in rolldown-vite** +**5. The `[vite]` logger prefix in vite** -The logger in `rolldown-vite/packages/vite/src/node/logger.ts` defaults to `prefix = '[vite]'` for timestamped messages. This shows up during dev server operation as colored `[vite]` tags. +The logger in `vite/packages/vite/src/node/logger.ts` defaults to `prefix = '[vite]'` for timestamped messages. This shows up during dev server operation as colored `[vite]` tags. ### What Users See Today @@ -89,7 +89,7 @@ $ vpx 1. Establish a unified branding format where "VITE+" is the primary identity shown to users 2. Standardize message prefix formatting across all commands to a single convention 3. Standardize status indicator symbols to a single set -4. Apply branding changes to rolldown-vite output (dev banner, build banner, logger prefix) +4. Apply branding changes to vite output (dev banner, build banner, logger prefix) 5. Define a repeatable approach: modify sub-tool source directly to achieve consistent output ## Non-Goals @@ -104,15 +104,15 @@ $ vpx ### Overview: Direct Source Modification -Since vite-plus clones sub-tool source repositories (rolldown-vite at `rolldown-vite/`, rolldown at `rolldown/`), we modify the source directly. This is simple, transparent, and easy to audit via `git diff`. When syncing upstream, branding patches are rebased or re-applied — a small, well-defined set of changes. +Since vite-plus clones sub-tool source repositories (vite at `vite/`, rolldown at `rolldown/`), we modify the source directly. This is simple, transparent, and easy to audit via `git diff`. When syncing upstream, branding patches are rebased or re-applied — a small, well-defined set of changes. Other sub-tools (vitest, oxlint, oxfmt) can follow the same pattern once their source is cloned or forked. -### Phase 1: Rebrand rolldown-vite Output +### Phase 1: Rebrand vite Output #### 1.1 Dev server banner -**File:** `rolldown-vite/packages/vite/src/node/cli.ts` (line 256) +**File:** `vite/packages/vite/src/node/cli.ts` (line 256) **Current:** @@ -142,20 +142,20 @@ info( Where `VITE_PLUS_VERSION` is the vite-plus package version, injected via: -- A new constant in `rolldown-vite/packages/vite/src/node/constants.ts`, or +- A new constant in `vite/packages/vite/src/node/constants.ts`, or - Read from an environment variable set by the Rust CLI before spawning vite (e.g., `VITE_PLUS_VERSION`) -**Recommended approach:** Environment variable injection. The Rust NAPI binding in `packages/cli/binding/src/cli.rs` already merges environment variables when spawning sub-tools via `merge_resolved_envs()`. We add `VITE_PLUS_VERSION` to the env map, and read it in rolldown-vite: +**Recommended approach:** Environment variable injection. The Rust NAPI binding in `packages/cli/binding/src/cli.rs` already merges environment variables when spawning sub-tools via `merge_resolved_envs()`. We add `VITE_PLUS_VERSION` to the env map, and read it in vite: ```javascript const VITE_PLUS_VERSION = process.env.VITE_PLUS_VERSION || VERSION; ``` -This is clean: the rolldown-vite source change is minimal (reads an env var with fallback), and the version injection happens in the Rust layer that already owns this responsibility. +This is clean: the vite source change is minimal (reads an env var with fallback), and the version injection happens in the Rust layer that already owns this responsibility. #### 1.2 Build banner -**File:** `rolldown-vite/packages/vite/src/node/build.ts` (line 789) +**File:** `vite/packages/vite/src/node/build.ts` (line 789) **Current:** @@ -187,7 +187,7 @@ logger.info( #### 1.3 Logger prefix -**File:** `rolldown-vite/packages/vite/src/node/logger.ts` (line 78) +**File:** `vite/packages/vite/src/node/logger.ts` (line 78) **Current:** @@ -203,7 +203,7 @@ prefix = '[vite+]', #### 1.4 Other user-visible strings to audit -A full audit of rolldown-vite source for user-visible "vite" strings: +A full audit of vite source for user-visible "vite" strings: | Location | String | Action | | ----------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------- | @@ -309,7 +309,7 @@ After `bundleVitest()` copies vitest files to `dist/`, a `brandVitest()` step pa 3. `/^vitest\/\d+\.\d+\.\d+$/` regex → `/^vp test\/[\d.]+$/` — so the help callback can still find the banner line 4. `$ vitest --help --expand-help` → `$ vp test --help --expand-help` — hardcoded help text -The Rust NAPI binding injects `VITE_PLUS_VERSION` env var (same mechanism used for rolldown-vite build/dev/preview commands), so `vp test -h` shows `vp test/`. +The Rust NAPI binding injects `VITE_PLUS_VERSION` env var (same mechanism used for vite build/dev/preview commands), so `vp test -h` shows `vp test/`. #### 3.3 Remaining `vite` → `vp` branding in CLI output @@ -365,9 +365,9 @@ Migrate JS-side code (`migration/bin.ts`, `create/bin.ts`) to use these shared f ### D1: Direct source modification over build-time transforms -**Decision:** Modify rolldown-vite source files directly. +**Decision:** Modify vite source files directly. -**Rationale:** The user has the source cloned locally. Direct modification is transparent — anyone can `git diff rolldown-vite/` to see exactly what changed. The set of branding changes is small and well-defined (3-5 files), making rebasing during upstream sync manageable. Build-time transforms (Rolldown plugins in `packages/core/build.ts`) are an alternative that avoids merge conflicts, but they are less visible and can break silently when upstream changes the strings being matched. +**Rationale:** The user has the source cloned locally. Direct modification is transparent — anyone can `git diff vite/` to see exactly what changed. The set of branding changes is small and well-defined (3-5 files), making rebasing during upstream sync manageable. Build-time transforms (Rolldown plugins in `packages/core/build.ts`) are an alternative that avoids merge conflicts, but they are less visible and can break silently when upstream changes the strings being matched. ### D2: Only show vite-plus version, not underlying vite version @@ -377,9 +377,9 @@ Migrate JS-side code (`migration/bin.ts`, `create/bin.ts`) to use these shared f ### D3: Inject version via environment variable -**Decision:** The Rust CLI sets `VITE_PLUS_VERSION` env var before spawning rolldown-vite. The modified rolldown-vite source reads it with a fallback. +**Decision:** The Rust CLI sets `VITE_PLUS_VERSION` env var before spawning vite. The modified vite source reads it with a fallback. -**Rationale:** This avoids hardcoding the version in rolldown-vite source (which would require updating on every release). The Rust CLI already manages environment variables for sub-tool spawning via `merge_resolved_envs()`. The env var approach is the minimal-touch change to rolldown-vite. +**Rationale:** This avoids hardcoding the version in vite source (which would require updating on every release). The Rust CLI already manages environment variables for sub-tool spawning via `merge_resolved_envs()`. The env var approach is the minimal-touch change to vite. ### D4: Lowercase prefixes (`info:` not `Info:`) @@ -395,11 +395,11 @@ Migrate JS-side code (`migration/bin.ts`, `create/bin.ts`) to use these shared f ### D6: Keep each layer's color library -**Decision:** Rust keeps `owo_colors`, JS keeps `node:util styleText()`, rolldown-vite keeps `picocolors`. +**Decision:** Rust keeps `owo_colors`, JS keeps `node:util styleText()`, vite keeps `picocolors`. **Rationale:** Changing color libraries is high-risk, low-reward. The shared formatting module abstracts the library choice so the output convention is consistent regardless of the underlying library. -## Scope of rolldown-vite Changes +## Scope of vite Changes ### Strings to Change @@ -425,13 +425,13 @@ These are internal identifiers, API references, or project name references: ## Implementation Plan -### Phase 1: rolldown-vite Rebranding +### Phase 1: vite Rebranding 1. Add `VITE_PLUS_VERSION` env var injection in `packages/cli/binding/src/cli.rs` for vite commands (build, dev, preview) -2. Modify `rolldown-vite/packages/vite/src/node/cli.ts` — read env var, change banner text -3. Modify `rolldown-vite/packages/vite/src/node/build.ts` — change build banner text -4. Modify `rolldown-vite/packages/vite/src/node/logger.ts` — change default prefix -5. Modify `rolldown-vite/packages/vite/src/node/build.ts:1079` — change error prefix +2. Modify `vite/packages/vite/src/node/cli.ts` — read env var, change banner text +3. Modify `vite/packages/vite/src/node/build.ts` — change build banner text +4. Modify `vite/packages/vite/src/node/logger.ts` — change default prefix +5. Modify `vite/packages/vite/src/node/build.ts:1079` — change error prefix 6. Rebuild with `pnpm bootstrap-cli` and verify output 7. Update affected snap tests @@ -493,7 +493,7 @@ Many existing snap tests will need updates due to prefix and branding changes: ### CI - All existing `cargo test` and snap tests pass with updated expectations -- No regressions in rolldown-vite's own test suite +- No regressions in vite's own test suite ## Future Enhancements diff --git a/tsconfig.json b/tsconfig.json index 1a9a171807..61c9698a71 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ "ecosystem-ci", "packages/cli/snap-tests", "packages/cli/snap-tests-global", - "rolldown-vite", + "vite", "rolldown", "target" ] diff --git a/vite.config.ts b/vite.config.ts index df3ef55db6..913492fa9a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,7 +55,7 @@ export default defineConfig({ test: { exclude: [ './ecosystem-ci/**', - './rolldown-vite/**', + './vite/**', './rolldown/**', '**/node_modules/**', '**/snap-tests/**', @@ -77,7 +77,7 @@ export default defineConfig({ 'packages/test/**.d.ts', 'packages/test/**.mjs', 'packages/test/browser/', - 'rolldown-vite', + 'vite', 'rolldown', ], singleQuote: true,