Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .github/actions/clone/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ runs:
ref: ${{ steps.upstream-versions.outputs.ROLLDOWN_VITE_HASH }}
persist-credentials: false

# Match the manifests used by sync-remote when it generated the root lockfile.
# setup-node installs with --frozen-lockfile, so this must run before it.
- name: Align vendored Vitest dependencies
shell: bash
run: node packages/tools/src/vendored-vitest.mjs

# Disable autocrlf to preserve LF line endings on Windows
# This prevents prettier/eslint from failing with "Delete ␍" errors
- name: Configure git for LF line endings
Expand Down
6 changes: 6 additions & 0 deletions .github/scripts/__tests__/upgrade-deps-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ test('selects the highest stable version from the supported major', () => {
test('returns undefined when the supported major has no stable release', () => {
expect(findLatestStableVersionForMajor(['4.2.0-beta.1', '5.0.0'], 4)).toBeUndefined();
});

test('keeps Vitest upgrades on v5 after the migration', () => {
expect(
findLatestStableVersionForMajor(['4.1.11', '5.0.0', '5.1.0', '5.2.0-beta.1', '6.0.0'], 5),
).toBe('5.1.0');
});
7 changes: 2 additions & 5 deletions .github/scripts/upgrade-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type PnpmWorkspaceEntry = {
const STABLE_SEMVER_TAG_RE = /^v?\d+\.\d+\.\d+$/;
// Vitest major upgrades can change the bundled API, export shims, and CLI
// behavior. Advance this only after Vite+ has adapted to the new major.
const SUPPORTED_VITEST_MAJOR = 4;
const SUPPORTED_VITEST_MAJOR = 5;

const isFullSha = (s: string): boolean => /^[0-9a-f]{40}$/.test(s);

Expand Down Expand Up @@ -211,18 +211,15 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise<voi
let content = fs.readFileSync(filePath, 'utf8');

// oxlint's trailing \n in the pattern disambiguates from oxlint-tsgolint.
// All @vitest/* catalog entries (browser + core direct deps) must stay pinned
// Official @vitest/* catalog entries (browser + core direct deps) stay pinned
// to the same exact version as `vitest` itself, otherwise the catalog drifts
// from VITEST_VERSION.
const vitestExactVersionPackages = [
'@vitest/browser',
'@vitest/browser-playwright',
'@vitest/browser-preview',
'@vitest/browser-webdriverio',
'@vitest/expect',
'@vitest/mocker',
'@vitest/pretty-format',
'@vitest/runner',
'@vitest/snapshot',
'@vitest/spy',
'@vitest/utils',
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,13 @@ jobs:
include:
- os: namespace-profile-linux-x64-default
target: x86_64-unknown-linux-gnu
test-node: 22.18.0
- os: namespace-profile-mac-default
target: aarch64-apple-darwin
test-node: 24.11.0
- os: namespace-profile-windows-4c-8g
target: x86_64-pc-windows-msvc
test-node: 26.0.0
runs-on: ${{ matrix.os }}
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
Expand Down Expand Up @@ -467,10 +470,22 @@ jobs:
run: vp check

- name: Run unit tests
run: RUST_BACKTRACE=1 pnpm test:unit
run: vp env exec --node ${{ matrix.test-node }} node packages/cli/dist/bin.js test run
env:
RUST_BACKTRACE: '1'
RUST_MIN_STACK: 8388608

- name: Test vendored workspaces with Vitest v5
if: runner.os == 'Linux'
run: |
pnpm --filter vite build-bundle
pnpm --filter create-vite build
pnpm --filter @rolldown/test-dev-server build
pnpm exec playwright install --with-deps chromium
pnpm test:vendored
env:
PLAYWRIGHT_BROWSERS_PATH: '0'

- name: Test global package install (powershell)
if: ${{ matrix.os != 'namespace-profile-linux-x64-default' }}
shell: pwsh
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/upgrade-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ jobs:

### Background
- Upgrade script: `./.github/scripts/upgrade-deps.ts`
- Vitest is intentionally capped at the latest stable `4.x` release until
Vite+ adapts to a newer major. Do not remove or bypass that cap.
- Vitest is capped at the latest stable `5.x` release. Keep the exact
version selected by the upgrade script when merging upstream catalogs.
Official Vitest packages must use that version. Do not bypass the cap.
- Sync-remote tool: `pnpm tool sync-remote` (source in
`packages/tools/src/sync-remote-deps.ts`) — clones rolldown/vite into the
working tree, merges their pnpm-workspace catalogs into the root
Expand All @@ -119,7 +120,7 @@ jobs:
cross-major semver conflict in the merged catalog, e.g.
`Incompatible semver ranges for <pkg>: ^X vs ^Y`. The merger refuses to
auto-resolve cross-major conflicts for packages outside its synced list
(oxc-*, vitest deps). For passthrough deps that vp does NOT import
(oxc-* and tinybench). For passthrough deps that vp does NOT import
directly (e.g. `diff`, `acorn`, `astring`, anything only present in
`rolldown/scripts/package.json` or vite's internals), bump vp's
`pnpm-workspace.yaml` catalog entry to match the rolldown/vite version,
Expand Down
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[default]
# Vitest v4 used this misspelled directory; the migrator must recognize it.
extend-ignore-re = ['\.vitest-attachements\b']

[default.extend-words]
ratatui = "ratatui"
PUNICODE = "PUNICODE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ should add package as dev dependencies
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -80,7 +80,7 @@ warn: yarn does not support --allow-build.
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -113,7 +113,7 @@ VITE+ - The Unified Toolchain for the Web
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -149,7 +149,7 @@ should add package as optional dependencies
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -186,7 +186,7 @@ support pass through arguments
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ should add package to workspace root
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/utils/package.json`
Expand Down Expand Up @@ -54,7 +54,7 @@ warn: yarn does not support --workspace.
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/utils/package.json`
Expand Down Expand Up @@ -99,10 +99,10 @@ should add packages to packages/app
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: ┌ Link step
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: · Done in <duration> <duration>
[app]: Process exited (exit code 0), completed in <duration> <duration>
[app]: ➤ YN0000: · Done in <duration>
[app]: Process exited (exit code 0), completed in <duration>

Done in <duration> <duration>
Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/utils/package.json`
Expand Down Expand Up @@ -150,10 +150,10 @@ warn: yarn does not support --workspace.
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: ┌ Link step
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: · Done in <duration> <duration>
[app]: Process exited (exit code 0), completed in <duration> <duration>
[app]: ➤ YN0000: · Done in <duration>
[app]: Process exited (exit code 0), completed in <duration>

Done in <duration> <duration>
Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/utils/package.json`
Expand Down Expand Up @@ -201,8 +201,8 @@ should add testnpm2 test-vite-plus-install to all packages and workspace root
[command-add-yarn4-with-workspace]: ➤ YN0000: └ Completed
[command-add-yarn4-with-workspace]: ➤ YN0000: ┌ Link step
[command-add-yarn4-with-workspace]: ➤ YN0000: └ Completed
[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in <duration> <duration>
[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in <duration> <duration>
[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in <duration>
[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in <duration>

[admin]: Process started
[admin]: ➤ YN0000: · Yarn <version>
Expand All @@ -212,8 +212,8 @@ should add testnpm2 test-vite-plus-install to all packages and workspace root
[admin]: ➤ YN0000: └ Completed
[admin]: ➤ YN0000: ┌ Link step
[admin]: ➤ YN0000: └ Completed
[admin]: ➤ YN0000: · Done in <duration> <duration>
[admin]: Process exited (exit code 0), completed in <duration> <duration>
[admin]: ➤ YN0000: · Done in <duration>
[admin]: Process exited (exit code 0), completed in <duration>

[app]: Process started
[app]: ➤ YN0000: · Yarn <version>
Expand All @@ -223,8 +223,8 @@ should add testnpm2 test-vite-plus-install to all packages and workspace root
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: ┌ Link step
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: · Done in <duration> <duration>
[app]: Process exited (exit code 0), completed in <duration> <duration>
[app]: ➤ YN0000: · Done in <duration>
[app]: Process exited (exit code 0), completed in <duration>

[@vite-plus-test/utils]: Process started
[@vite-plus-test/utils]: ➤ YN0000: · Yarn <version>
Expand All @@ -234,10 +234,10 @@ should add testnpm2 test-vite-plus-install to all packages and workspace root
[@vite-plus-test/utils]: ➤ YN0000: └ Completed
[@vite-plus-test/utils]: ➤ YN0000: ┌ Link step
[@vite-plus-test/utils]: ➤ YN0000: └ Completed
[@vite-plus-test/utils]: ➤ YN0000: · Done in <duration> <duration>
[@vite-plus-test/utils]: Process exited (exit code 0), completed in <duration> <duration>
[@vite-plus-test/utils]: ➤ YN0000: · Done in <duration>
[@vite-plus-test/utils]: Process exited (exit code 0), completed in <duration>

Done in <duration> <duration>
Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json`
Expand Down Expand Up @@ -301,8 +301,8 @@ VITE+ - The Unified Toolchain for the Web
[command-add-yarn4-with-workspace]: ➤ YN0000: └ Completed
[command-add-yarn4-with-workspace]: ➤ YN0000: ┌ Link step
[command-add-yarn4-with-workspace]: ➤ YN0000: └ Completed
[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in <duration> <duration>
[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in <duration> <duration>
[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in <duration>
[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in <duration>

[admin]: Process started
[admin]: ➤ YN0000: · Yarn <version>
Expand All @@ -312,8 +312,8 @@ VITE+ - The Unified Toolchain for the Web
[admin]: ➤ YN0000: └ Completed
[admin]: ➤ YN0000: ┌ Link step
[admin]: ➤ YN0000: └ Completed
[admin]: ➤ YN0000: · Done in <duration> <duration>
[admin]: Process exited (exit code 0), completed in <duration> <duration>
[admin]: ➤ YN0000: · Done in <duration>
[admin]: Process exited (exit code 0), completed in <duration>

[app]: Process started
[app]: ➤ YN0000: · Yarn <version>
Expand All @@ -323,10 +323,10 @@ VITE+ - The Unified Toolchain for the Web
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: ┌ Link step
[app]: ➤ YN0000: └ Completed
[app]: ➤ YN0000: · Done in <duration> <duration>
[app]: Process exited (exit code 0), completed in <duration> <duration>
[app]: ➤ YN0000: · Done in <duration>
[app]: Process exited (exit code 0), completed in <duration>

Done in <duration> <duration>
Done in <duration>
```

## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ should dedupe dependencies
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ should link local directory
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -53,7 +53,7 @@ should work with ln alias
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down Expand Up @@ -81,7 +81,7 @@ cleanup temp states
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in <duration> <duration>
➤ YN0000: · Done in <duration>
```

## `vpt print-file package.json`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ should pack current package
```
➤ YN0000: package.json
➤ YN0000: Package archive generated in <workspace>/package.tgz
➤ YN0000: Done in <duration> <duration>
➤ YN0000: Done in <duration>
```

## `vp pm pack --out ./dist/package.tgz`
Expand All @@ -17,7 +17,7 @@ should pack with output file
```
➤ YN0000: package.json
➤ YN0000: Package archive generated in <workspace>/dist/package.tgz
➤ YN0000: Done in <duration> <duration>
➤ YN0000: Done in <duration>
```

## `vp pm pack --json`
Expand All @@ -38,5 +38,5 @@ should support pass through arguments
```
➤ YN0000: dist/package.tgz
➤ YN0000: package.json
➤ YN0000: Done in <duration> <duration>
➤ YN0000: Done in <duration>
```
Loading
Loading