diff --git a/.claude/skills/release-manager/SKILL.md b/.claude/skills/release-manager/SKILL.md index 56adb95b50..80898a016f 100644 --- a/.claude/skills/release-manager/SKILL.md +++ b/.claude/skills/release-manager/SKILL.md @@ -19,6 +19,7 @@ Run a standard vite-plus release from version bump to published announcement. An When given a release PR (URL or number), do not start from step 1. First audit the release's current state, then continue from the earliest unfinished step: - Is the binding version synced? (step 2: `grep -c "''" packages/cli/binding/index.cjs` on the release branch) +- Do the release version examples in `docs/guide/migrate.md`, including its Copy Prompt, match `packages/cli/package.json`? (step 2) - Is the PR description still the `prepare_release` boilerplate, or already a categorized changelog? (step 3) - Is a preview build present and for the current head? (step 4) - Does `main` have commits the release branch lacks? (`git log origin/release/vX.Y.Z..origin/main`, step 5) @@ -32,7 +33,7 @@ Before post-release work, fetch `origin/main` and read its copy of this skill (` ## Pipeline overview 1. `Prepare Release` workflow bumps versions and opens the release PR (`release/vX.Y.Z` -> `main`). -2. Release manager: sync `binding/index.cjs`, write the changelog PR description, offer the preview-build smoke test (recommend it when the release has more than 10 commits since the previous tag), get CI green. +2. Release manager: sync `binding/index.cjs` and the migration guide's release version, write the changelog PR description, offer the preview-build smoke test (recommend it when the release has more than 10 commits since the previous tag), get CI green. 3. Merging the PR pushes a `packages/cli/package.json` change to `main`, which triggers `release.yml`: build, manual approval gate, npm publish, GitHub release, Docker image, Discord notification. 4. Release manager: polish the GitHub release notes, verify installs, announce. @@ -46,7 +47,9 @@ gh workflow run prepare_release.yml --repo voidzero-dev/vite-plus -f version=X.Y The workflow bumps `packages/cli/package.json`, `packages/core/package.json`, `packages/cli/binding/Cargo.toml`, and `crates/vp_global_cli/Cargo.toml`, refreshes `Cargo.lock`, and opens a PR titled `release: vX.Y.Z` from branch `release/vX.Y.Z`. The PR body ends with `Merging this PR will trigger the release workflow.` and that line must survive every later edit. -## 2. Sync the NAPI binding version (required every release) +## 2. Sync release versions (required every release) + +### NAPI binding NAPI bakes the package version into version checks in `packages/cli/binding/index.cjs` (26+ sites). `prepare_release` bumps `package.json` but does not regenerate this file, so CI's `Ensure no unexpected file changes after build` step in the `CLI E2E test` job fails until it is synced. Do this immediately; do not wait for CI to fail. @@ -79,7 +82,15 @@ regenerate this file, so the CI build's regeneration step produces a diff that the post-build no-unexpected-changes guard rejects. ``` -This is the only kind of commit that goes directly on the release branch. Everything else goes through `main` (see step 5). +### Migration guide + +Use the version in the release branch's `packages/cli/package.json` as the target release version in `docs/guide/migrate.md`. Update the `--package=vite-plus@` pins in the pnpm and npm command examples, the `upgradePrompt` text used by Copy Prompt, and the surrounding prose that names that exact release. Keep an exact version; do not replace it with a major range or `latest`. + +Preserve historical versions such as the migration's source version and the release that introduced a breaking change. Leave Node.js requirements, bundled tool versions, and preview-registry instructions unchanged unless their requirements change. + +Commit the guide update on the release branch with the binding sync or in a separate release-version sync commit. Recheck both files after a target-version change or a merge from `main`. Before merging, confirm that the guide and Copy Prompt use the target release in both package-manager commands and their matching prose, then run `git diff --check`. + +Only these release-version sync commits go directly on the release branch. Everything else goes through `main` (see step 5). ## 3. Write the release PR description @@ -326,7 +337,7 @@ Two fork-CI blockers are worth fixing rather than reporting, both on the **test Match checks to the current PR head and the latest applicable workflow runs. Superseded canceled runs can leave failed aggregate checks in the PR rollup. Check required statuses with `gh pr checks --required`, and report required reviewer approval separately from technical CI readiness. -Fixes for CI failures go through a **separate PR to `main`**, never as commits on the release branch (the binding sync in step 2 is the sole exception). After the fix PR merges: +Fixes for CI failures go through a **separate PR to `main`**, never as commits on the release branch (the release-version syncs in step 2 are the exceptions). After the fix PR merges: ```bash git checkout release/vX.Y.Z && git merge origin/main --no-edit && git push origin release/vX.Y.Z @@ -341,7 +352,7 @@ Known release-branch-only failure modes: ## 6. Merge -Merging the release PR is the release trigger. Before merging confirm: CI green, changelog validated, binding synced, and (if used) the preview build verified. +Merging the release PR is the release trigger. Before merging confirm: CI green, changelog validated, binding and migration guide versions synced, and (if used) the preview build verified. Auto-merge being enabled is not a completed merge. Confirm `mergedAt` and the merge commit, then follow the Release run for that commit; older successful runs can have skipped publishing because the version did not change. @@ -492,6 +503,7 @@ After the release ships and announcements are approved or confirmed complete, re - [ ] `prepare_release` run for the target version; release PR open - [ ] `binding/index.cjs` synced on the release branch (step 2 commit message shape) +- [ ] `docs/guide/migrate.md` command examples, Copy Prompt, and matching release prose use the exact target version from `packages/cli/package.json` - [ ] PR description written from the head branch data; every PR exactly once except documented omissions; breaking changes in their own section above Highlights; no em/en dashes; closing boilerplate intact - [ ] Dependency-upgrade PRs consolidated; vite-task bump expanded with upstream credits; security advisories linked - [ ] Smoke test offered to the release manager at both levels (local sweep and fork-PR CI), with the commit count stated and a recommendation to run it when that count is above 10; if accepted, forks synced to upstream first, preview build published, and the full ecosystem-ci catalog verified via `test-pkg-pr-new-migrate` (following TESTING.md), with every failure triaged and regressions ruled out against the previous release diff --git a/.github/actions/build-upstream/action.yml b/.github/actions/build-upstream/action.yml index a491fc36f4..007bb85300 100644 --- a/.github/actions/build-upstream/action.yml +++ b/.github/actions/build-upstream/action.yml @@ -31,12 +31,13 @@ runs: - uses: ./.github/actions/compute-native-cache-input-hash id: native-cache-inputs - # Include env vars (RELEASE_BUILD, DEBUG, VERSION) to ensure cache miss on release builds. + # Include the documentation origin so preview binaries cannot reuse release links. - name: Compute NAPI binding cache key id: cache-key shell: bash run: | - echo "key=napi-binding-v3-${INPUTS_TARGET}-${RELEASE_BUILD}-${DEBUG}-${VERSION}-${NPM_TAG}-${{ steps.native-cache-inputs.outputs.hash }}" >> "$GITHUB_OUTPUT" + DOCS_ORIGIN_HASH=$(node -e 'process.stdout.write(require("node:crypto").createHash("sha256").update(process.env.VITE_PLUS_DOCS_ORIGIN || "https://viteplus.dev").digest("hex").slice(0, 16))') + echo "key=napi-binding-v3-${INPUTS_TARGET}-${RELEASE_BUILD}-${DEBUG}-${VERSION}-${NPM_TAG}-${DOCS_ORIGIN_HASH}-${{ steps.native-cache-inputs.outputs.hash }}" >> "$GITHUB_OUTPUT" env: INPUTS_TARGET: ${{ inputs.target }} diff --git a/.github/actions/clone/action.yml b/.github/actions/clone/action.yml index ac291fc82a..6db8238f68 100644 --- a/.github/actions/clone/action.yml +++ b/.github/actions/clone/action.yml @@ -47,6 +47,13 @@ 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. + # The runner's preinstalled Node may not support direct TypeScript execution. + - name: Align vendored Vite's Vitest dependencies + shell: bash + run: npx tsx packages/tools/src/vendored-vitest.ts + # 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 diff --git a/.github/scripts/__tests__/docs-fork-preview.mjs b/.github/scripts/__tests__/docs-fork-preview.mjs index 51711c6d86..59b2263b84 100644 --- a/.github/scripts/__tests__/docs-fork-preview.mjs +++ b/.github/scripts/__tests__/docs-fork-preview.mjs @@ -6,6 +6,7 @@ import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { test } from 'node:test'; +import { resolveDocsSiteOrigin } from '../../../docs/.vitepress/site-origin.ts'; import { authorizePreview, commentPreview, @@ -241,12 +242,75 @@ await test('reuses the PR origin across commits, builds, and reruns while pinnin assert.match(deploy, /--preview-alias "\$PREVIEW_ALIAS"/); }); -await test('uses each PR origin for shell and PowerShell installer links', async (t) => { +await test('resolves Workers branch origins without an explicit docs origin', () => { + for (const branch of ['rfc/vitest-v5-upgrade', '--RFC//Vitest_V5-Upgrade--']) { + assert.equal( + resolveDocsSiteOrigin({ WORKERS_CI: '1', WORKERS_CI_BRANCH: branch }), + 'https://rfc-vitest-v5-upgrade-viteplus-dev.voidzero-docs.workers.dev', + ); + } +}); + +await test('preserves explicit origins and production defaults', () => { + assert.equal( + resolveDocsSiteOrigin({ + DOCS_SITE_ORIGIN: 'https://viteplus-staging.void.app/', + WORKERS_CI: '1', + WORKERS_CI_BRANCH: 'rfc/vitest-v5-upgrade', + }), + 'https://viteplus-staging.void.app', + ); + for (const env of [ + {}, + { DOCS_SITE_ORIGIN: '' }, + { WORKERS_CI_BRANCH: 'rfc/vitest-v5-upgrade' }, + { WORKERS_CI: '1' }, + { WORKERS_CI: '1', WORKERS_CI_BRANCH: 'main' }, + ]) { + assert.equal(resolveDocsSiteOrigin(env), undefined); + } +}); + +await test('matches Wrangler long-branch aliases without collisions after truncation', () => { + for (const [branch, hash] of [ + [`feature/${'a'.repeat(80)}`, '288d'], + [`feature/${'a'.repeat(79)}b`, 'ee30'], + ]) { + const origin = resolveDocsSiteOrigin({ WORKERS_CI: '1', WORKERS_CI_BRANCH: branch }); + assert.equal( + origin, + `https://feature-${'a'.repeat(37)}-${hash}-viteplus-dev.voidzero-docs.workers.dev`, + ); + assert.equal(new URL(origin).hostname.split('.')[0].length, 63); + } +}); + +await test('requires an explicit origin when Wrangler cannot create a branch alias', () => { + for (const branch of ['123-fix', '___']) { + const env = { WORKERS_CI: '1', WORKERS_CI_BRANCH: branch }; + assert.throws(() => resolveDocsSiteOrigin(env), /Set DOCS_SITE_ORIGIN/); + assert.equal( + resolveDocsSiteOrigin({ ...env, DOCS_SITE_ORIGIN: previewUrl(2684) }), + previewUrl(2684), + ); + } +}); + +await test('uses each deploy origin for shell and PowerShell installer links', async (t) => { const directory = await mkdtemp(join(tmpdir(), 'docs-preview-installers-')); t.after(() => rm(directory, { recursive: true, force: true })); const snapshots = []; - for (const number of [2684, 2685]) { - const root = join(directory, String(number)); + const cases = [ + { env: { DOCS_SITE_ORIGIN: previewUrl(2684) }, origin: previewUrl(2684) }, + { env: { DOCS_SITE_ORIGIN: previewUrl(2685) }, origin: previewUrl(2685) }, + { + env: { WORKERS_CI: '1', WORKERS_CI_BRANCH: 'rfc/vitest-v5-upgrade' }, + origin: 'https://rfc-vitest-v5-upgrade-viteplus-dev.voidzero-docs.workers.dev', + }, + { env: {}, origin: 'https://viteplus.dev' }, + ]; + for (const [index, { env, origin }] of cases.entries()) { + const root = join(directory, String(index)); const scripts = join(root, 'docs', '.vitepress', 'scripts'); const output = join(root, 'docs', 'public'); const installers = join(root, 'packages', 'cli'); @@ -258,21 +322,32 @@ await test('uses each PR origin for shell and PowerShell installer links', async new URL('../../../docs/.vitepress/scripts/copy-installers.mjs', import.meta.url), script, ); + await copyFile( + new URL('../../../docs/.vitepress/site-origin.ts', import.meta.url), + join(scripts, '..', 'site-origin.ts'), + ); for (const name of ['install.sh', 'install.ps1', 'install-legacy.sh', 'install-legacy.ps1']) { await copyFile( new URL(`../../../packages/cli/${name}`, import.meta.url), join(installers, name), ); } - const origin = previewUrl(number); - execFileSync(process.execPath, [script], { env: { ...process.env, DOCS_SITE_ORIGIN: origin } }); + execFileSync(process.execPath, [script], { + env: { + ...process.env, + DOCS_SITE_ORIGIN: '', + WORKERS_CI: '', + WORKERS_CI_BRANCH: '', + ...env, + }, + }); const shell = await readFile(join(output, 'install.sh'), 'utf8'); const powershell = await readFile(join(output, 'install.ps1'), 'utf8'); assert.ok(shell.includes(`${origin}/install-legacy.sh`)); assert.ok(powershell.includes(`${origin}/install-legacy.ps1`)); snapshots.push({ origin, shell, powershell }); } - assert.equal(new Set(snapshots.map((snapshot) => snapshot.origin)).size, 2); + assert.equal(new Set(snapshots.map((snapshot) => snapshot.origin)).size, cases.length); for (const snapshot of snapshots) { for (const other of snapshots) { if (other.origin !== snapshot.origin) { diff --git a/.github/scripts/__tests__/preview-docs-origin.mjs b/.github/scripts/__tests__/preview-docs-origin.mjs new file mode 100644 index 0000000000..7f21bcdafa --- /dev/null +++ b/.github/scripts/__tests__/preview-docs-origin.mjs @@ -0,0 +1,51 @@ +import assert from 'node:assert/strict'; +import { readFileSync } from 'node:fs'; +import { test } from 'node:test'; + +import { resolveDocsSiteOrigin } from '../../../docs/.vitepress/site-origin.ts'; +import { previewUrl } from '../docs-fork-preview.mjs'; +import { previewDocsOrigin } from '../preview-docs-origin.ts'; + +const pr = { + number: 2551, + head: { ref: 'rfc/vitest-v5-upgrade', repo: { full_name: 'voidzero-dev/vite-plus' } }, + base: { repo: { full_name: 'voidzero-dev/vite-plus' } }, +}; + +const read = (file) => readFileSync(new URL(file, import.meta.url), 'utf8'); + +await test('uses the head branch docs for same-repo and stacked PRs', () => { + assert.equal( + previewDocsOrigin(pr), + 'https://rfc-vitest-v5-upgrade-viteplus-dev.voidzero-docs.workers.dev', + ); + for (const branch of ['--RFC//Vitest_V5-Upgrade--', `feature/${'a'.repeat(80)}`]) { + assert.equal( + previewDocsOrigin({ ...pr, head: { ...pr.head, ref: branch } }), + resolveDocsSiteOrigin({ WORKERS_CI: '1', WORKERS_CI_BRANCH: branch }), + ); + } +}); + +await test('uses the PR alias for forks, never a same-named repository branch', () => { + assert.equal( + previewDocsOrigin({ + ...pr, + head: { ...pr.head, repo: { full_name: 'contributor/vite-plus' } }, + }), + previewUrl(pr.number), + ); +}); + +await test('passes the origin to native builds and includes it in the native cache key', () => { + const preview = read('../../workflows/publish-preview.yml'); + const release = read('../../workflows/reusable-release-build.yml'); + const build = read('../../actions/build-upstream/action.yml'); + assert.match(preview, /previewDocsOrigin\(context\.payload\.pull_request\)/); + assert.match(preview, /docs-origin: \$\{\{ steps\.docs\.outputs\.origin \}\}/); + assert.match(preview, /docs-origin: \$\{\{ needs\.prepare\.outputs\.docs-origin \}\}/); + assert.match(release, /default: 'https:\/\/viteplus\.dev'/); + assert.match(release, /VITE_PLUS_DOCS_ORIGIN: \$\{\{ inputs\.docs-origin \}\}/); + assert.match(build, /process\.env\.VITE_PLUS_DOCS_ORIGIN/); + assert.match(build, /napi-binding-v3-.*\$\{DOCS_ORIGIN_HASH\}/); +}); diff --git a/.github/scripts/__tests__/upgrade-deps-utils.spec.ts b/.github/scripts/__tests__/upgrade-deps-utils.spec.ts index b8b6b1f4a8..671ff1d069 100644 --- a/.github/scripts/__tests__/upgrade-deps-utils.spec.ts +++ b/.github/scripts/__tests__/upgrade-deps-utils.spec.ts @@ -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'); +}); diff --git a/.github/scripts/preview-docs-origin.ts b/.github/scripts/preview-docs-origin.ts new file mode 100644 index 0000000000..2f5a4fc140 --- /dev/null +++ b/.github/scripts/preview-docs-origin.ts @@ -0,0 +1,17 @@ +import { resolveDocsSiteOrigin } from '../../docs/.vitepress/site-origin.ts'; +import { previewUrl } from './docs-fork-preview.mjs'; + +/** Use the same URLs as Workers Builds (same-repo) and the fork docs workflow. */ +export function previewDocsOrigin(pr: { + number: number; + head: { ref: string; repo: { full_name: string } }; + base: { repo: { full_name: string } }; +}): string { + if (pr.head.repo.full_name !== pr.base.repo.full_name) { + return previewUrl(pr.number); + } + return ( + resolveDocsSiteOrigin({ WORKERS_CI: '1', WORKERS_CI_BRANCH: pr.head.ref }) ?? + 'https://viteplus.dev' + ); +} diff --git a/.github/scripts/upgrade-deps.ts b/.github/scripts/upgrade-deps.ts index feeded4c71..75a18f0eef 100644 --- a/.github/scripts/upgrade-deps.ts +++ b/.github/scripts/upgrade-deps.ts @@ -73,7 +73,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); @@ -212,18 +212,15 @@ async function updatePnpmWorkspace(versions: PnpmWorkspaceVersions): Promise- github.repository == 'voidzero-dev/vite-plus' && github.event.label.name == 'preview-build' - name: Compute snapshot version + name: Compute preview metadata runs-on: ubuntu-latest permissions: contents: read outputs: version: ${{ steps.version.outputs.version }} + docs-origin: ${{ steps.docs.outputs.origin }} steps: + - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version-file: .node-version + package-manager-cache: false + - name: Test preview documentation origin + run: node --test .github/scripts/__tests__/preview-docs-origin.mjs + - name: Resolve preview documentation origin + id: docs + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 + with: + script: | + const { previewDocsOrigin } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/preview-docs-origin.ts`); + core.setOutput('origin', previewDocsOrigin(context.payload.pull_request)); # Use the exact version the registry bridge serves (0.0.0-commit., # the same head SHA publish-preview-register.yml registers), so the built # Rust binary and JS @@ -64,6 +79,7 @@ jobs: uses: ./.github/workflows/reusable-release-build.yml with: version: ${{ needs.prepare.outputs.version }} + docs-origin: ${{ needs.prepare.outputs.docs-origin }} cache-key: pkg-pr-new publish: diff --git a/.github/workflows/reusable-release-build.yml b/.github/workflows/reusable-release-build.yml index 6f0b2eeda6..1b6520acfb 100644 --- a/.github/workflows/reusable-release-build.yml +++ b/.github/workflows/reusable-release-build.yml @@ -14,6 +14,11 @@ on: type: string required: false default: 'release' + docs-origin: + description: 'Documentation origin compiled into the native CLI, NAPI binding, and installer.' + type: string + required: false + default: 'https://viteplus.dev' jobs: build-rust: @@ -25,6 +30,7 @@ jobs: RELEASE_BUILD: 'true' DEBUG: 'napi:*' VERSION: ${{ inputs.version }} + VITE_PLUS_DOCS_ORIGIN: ${{ inputs.docs-origin }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/upgrade-deps.yml b/.github/workflows/upgrade-deps.yml index 627f1a3041..75511939c6 100644 --- a/.github/workflows/upgrade-deps.yml +++ b/.github/workflows/upgrade-deps.yml @@ -113,8 +113,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 @@ -135,7 +136,7 @@ jobs: cross-major semver conflict in the merged catalog, e.g. `Incompatible semver ranges for : ^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, diff --git a/.typos.toml b/.typos.toml index 0c6c885186..ae1189d497 100644 --- a/.typos.toml +++ b/.typos.toml @@ -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" diff --git a/Cargo.lock b/Cargo.lock index 3d27eef528..3968455536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8872,6 +8872,7 @@ dependencies = [ "ast-grep-language", "brush-parser 0.3.0", "ignore", + "oxc", "rayon", "regex", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 6393db2b7c..1f1923d486 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -256,7 +256,7 @@ reqwest = { version = "0.13", default-features = false } rolldown-notify = "10.2.0" rolldown-notify-debouncer-full = "0.7.5" rustc-hash = "2.1.1" -rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] } +rustls = { version = "0.23.45", default-features = false, features = ["ring", "std", "tls12"] } same-file = "1.0.6" schemars = "1.0.0" self_cell = "1.2.0" diff --git a/README.md b/README.md index c18ccaa745..139fdf4d08 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ Add package-manager overrides so that other packages use the Vite+ versions. Ali ```json "overrides": { "vite": "npm:@voidzero-dev/vite-plus-core@latest", - "vitest": "4.1.11" + "vitest": "5.0.1" } ``` @@ -216,7 +216,7 @@ If you are using `pnpm`, add this to your `pnpm-workspace.yaml`: ```yaml overrides: vite: npm:@voidzero-dev/vite-plus-core@latest - vitest: 4.1.11 + vitest: 5.0.1 ``` Or, if you are using Yarn: @@ -224,7 +224,7 @@ Or, if you are using Yarn: ```json "resolutions": { "vite": "npm:@voidzero-dev/vite-plus-core@latest", - "vitest": "4.1.11" + "vitest": "5.0.1" } ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4/snapshots/command_add_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4/snapshots/command_add_yarn4.md index 5a6b3afdcf..fd5c4245e0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4/snapshots/command_add_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4/snapshots/command_add_yarn4.md @@ -50,7 +50,7 @@ should add package as dev dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -81,7 +81,7 @@ warn: yarn does not support --allow-build. ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -114,7 +114,7 @@ VITE+ - The Unified Toolchain for the Web ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -150,7 +150,7 @@ should add package as optional dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -187,7 +187,7 @@ support pass through arguments ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4_with_workspace/snapshots/command_add_yarn4_with_workspace.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4_with_workspace/snapshots/command_add_yarn4_with_workspace.md index c2fb74cbb6..5a5b3fc5ff 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4_with_workspace/snapshots/command_add_yarn4_with_workspace.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_yarn4_with_workspace/snapshots/command_add_yarn4_with_workspace.md @@ -15,7 +15,7 @@ warn: yarn >=2 does not support --workspace-root. ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json packages/utils/package.json` @@ -56,7 +56,7 @@ warn: yarn does not support --workspace. ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json packages/utils/package.json` @@ -101,10 +101,10 @@ should add packages to packages/app [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/utils/package.json` @@ -152,10 +152,10 @@ warn: yarn does not support --workspace. [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/utils/package.json` @@ -203,8 +203,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 -[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in +[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in +[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in [admin]: Process started [admin]: ➤ YN0000: · Yarn @@ -214,8 +214,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 -[admin]: Process exited (exit code 0), completed in +[admin]: ➤ YN0000: · Done in +[admin]: Process exited (exit code 0), completed in [app]: Process started [app]: ➤ YN0000: · Yarn @@ -225,8 +225,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 -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in [@vite-plus-test/utils]: Process started [@vite-plus-test/utils]: ➤ YN0000: · Yarn @@ -236,10 +236,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 -[@vite-plus-test/utils]: Process exited (exit code 0), completed in +[@vite-plus-test/utils]: ➤ YN0000: · Done in +[@vite-plus-test/utils]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` @@ -303,8 +303,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 -[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in +[command-add-yarn4-with-workspace]: ➤ YN0000: · Done in +[command-add-yarn4-with-workspace]: Process exited (exit code 0), completed in [admin]: Process started [admin]: ➤ YN0000: · Yarn @@ -314,8 +314,8 @@ VITE+ - The Unified Toolchain for the Web [admin]: ➤ YN0000: └ Completed [admin]: ➤ YN0000: ┌ Link step [admin]: ➤ YN0000: └ Completed -[admin]: ➤ YN0000: · Done in -[admin]: Process exited (exit code 0), completed in +[admin]: ➤ YN0000: · Done in +[admin]: Process exited (exit code 0), completed in [app]: Process started [app]: ➤ YN0000: · Yarn @@ -325,10 +325,10 @@ VITE+ - The Unified Toolchain for the Web [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_yarn4/snapshots/command_dedupe_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_yarn4/snapshots/command_dedupe_yarn4.md index 24cc7616fc..217c332fed 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_yarn4/snapshots/command_dedupe_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_yarn4/snapshots/command_dedupe_yarn4.md @@ -17,7 +17,7 @@ should dedupe dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_yarn4/snapshots/command_link_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_yarn4/snapshots/command_link_yarn4.md index b80751d968..1ab706215b 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_yarn4/snapshots/command_link_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_yarn4/snapshots/command_link_yarn4.md @@ -25,7 +25,7 @@ should link local directory ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -53,7 +53,7 @@ should work with ln alias ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -81,7 +81,7 @@ cleanup temp states ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4/snapshots/command_pack_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4/snapshots/command_pack_yarn4.md index 0f03fe7b74..6eaa9537aa 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4/snapshots/command_pack_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4/snapshots/command_pack_yarn4.md @@ -7,7 +7,7 @@ should pack current package ``` ➤ YN0000: package.json ➤ YN0000: Package archive generated in /package.tgz -➤ YN0000: Done in +➤ YN0000: Done in ``` ## `vp pm pack --out ./dist/package.tgz` @@ -17,7 +17,7 @@ should pack with output file ``` ➤ YN0000: package.json ➤ YN0000: Package archive generated in /dist/package.tgz -➤ YN0000: Done in +➤ YN0000: Done in ``` ## `vp pm pack --json` @@ -38,5 +38,5 @@ should support pass through arguments ``` ➤ YN0000: dist/package.tgz ➤ YN0000: package.json -➤ YN0000: Done in +➤ YN0000: Done in ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4_with_workspace/snapshots/command_pack_yarn4_with_workspace.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4_with_workspace/snapshots/command_pack_yarn4_with_workspace.md index 9f43a23b24..fc748b3431 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4_with_workspace/snapshots/command_pack_yarn4_with_workspace.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_yarn4_with_workspace/snapshots/command_pack_yarn4_with_workspace.md @@ -15,7 +15,7 @@ VITE+ - The Unified Toolchain for the Web ➤ YN0000: ┌ Link step ➤ YN0073: │ Skipped due to mode=update-lockfile ➤ YN0000: └ Completed -➤ YN0000: · Done with warnings in +➤ YN0000: · Done with warnings in ``` ## `vp pm pack` @@ -25,7 +25,7 @@ should pack current workspace root ``` ➤ YN0000: package.json ➤ YN0000: Package archive generated in /package.tgz -➤ YN0000: Done in +➤ YN0000: Done in ``` ## `vp pm pack --recursive` @@ -36,22 +36,22 @@ should pack all packages in workspace (uses workspaces foreach --all pack) [command-pack-yarn4-with-workspace]: Process started [command-pack-yarn4-with-workspace]: ➤ YN0000: package.json [command-pack-yarn4-with-workspace]: ➤ YN0000: Package archive generated in /package.tgz -[command-pack-yarn4-with-workspace]: ➤ YN0000: Done in -[command-pack-yarn4-with-workspace]: Process exited (exit code 0), completed in +[command-pack-yarn4-with-workspace]: ➤ YN0000: Done in +[command-pack-yarn4-with-workspace]: Process exited (exit code 0), completed in [app]: Process started [app]: ➤ YN0000: package.json [app]: ➤ YN0000: Package archive generated in /packages/app/package.tgz -[app]: ➤ YN0000: Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: Done in +[app]: Process exited (exit code 0), completed in [@vite-plus-test/utils]: Process started [@vite-plus-test/utils]: ➤ YN0000: package.json [@vite-plus-test/utils]: ➤ YN0000: Package archive generated in /packages/utils/package.tgz -[@vite-plus-test/utils]: ➤ YN0000: Done in -[@vite-plus-test/utils]: Process exited (exit code 0), completed in +[@vite-plus-test/utils]: ➤ YN0000: Done in +[@vite-plus-test/utils]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vp pm pack --filter app` @@ -62,10 +62,10 @@ should pack specific package (uses workspaces foreach --all --include app pack) [app]: Process started [app]: ➤ YN0000: package.json [app]: ➤ YN0000: Package archive generated in /packages/app/package.tgz -[app]: ➤ YN0000: Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vp pm pack --filter app --filter @vite-plus-test/utils` @@ -76,16 +76,16 @@ should pack multiple packages [app]: Process started [app]: ➤ YN0000: package.json [app]: ➤ YN0000: Package archive generated in /packages/app/package.tgz -[app]: ➤ YN0000: Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: Done in +[app]: Process exited (exit code 0), completed in [@vite-plus-test/utils]: Process started [@vite-plus-test/utils]: ➤ YN0000: package.json [@vite-plus-test/utils]: ➤ YN0000: Package archive generated in /packages/utils/package.tgz -[@vite-plus-test/utils]: ➤ YN0000: Done in -[@vite-plus-test/utils]: Process exited (exit code 0), completed in +[@vite-plus-test/utils]: ➤ YN0000: Done in +[@vite-plus-test/utils]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vp pm pack --out ./dist/package.tgz` @@ -95,7 +95,7 @@ should pack with output file ``` ➤ YN0000: package.json ➤ YN0000: Package archive generated in /dist/package.tgz -➤ YN0000: Done in +➤ YN0000: Done in ``` ## `vp pm pack --json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_rebuild_yarn4/snapshots/command_rebuild_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_rebuild_yarn4/snapshots/command_rebuild_yarn4.md index 2132db1563..9e04aa2d64 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_rebuild_yarn4/snapshots/command_rebuild_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_rebuild_yarn4/snapshots/command_rebuild_yarn4.md @@ -15,7 +15,7 @@ VITE+ - The Unified Toolchain for the Web ➤ YN0000: ┌ Link step ➤ YN0007: │ command-rebuild-yarn4@workspace:. must be built because it never has been before or the last one failed ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file builds.txt` @@ -37,7 +37,7 @@ Yarn Berry rebuilds all packages instead of returning a no-op. ➤ YN0000: ┌ Link step ➤ YN0007: │ command-rebuild-yarn4@workspace:. must be built because it never has been before or the last one failed ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file builds.txt` @@ -60,7 +60,7 @@ Rebuild only the named package. ➤ YN0000: ┌ Link step ➤ YN0007: │ command-rebuild-yarn4@workspace:. must be built because it never has been before or the last one failed ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file builds.txt` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4/snapshots/command_remove_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4/snapshots/command_remove_yarn4.md index 36812df7d0..e50ab482ec 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4/snapshots/command_remove_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4/snapshots/command_remove_yarn4.md @@ -28,7 +28,7 @@ should add packages to dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vp add -D test-vite-plus-install` @@ -43,7 +43,7 @@ should add packages to dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vp add -O test-vite-plus-package-optional` @@ -58,7 +58,7 @@ should add packages to dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -93,7 +93,7 @@ should remove packages from dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -122,7 +122,7 @@ support ignore -O flag and remove package from optional dependencies ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4_with_workspace/snapshots/command_remove_yarn4_with_workspace.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4_with_workspace/snapshots/command_remove_yarn4_with_workspace.md index df6ae81533..18fe450c40 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4_with_workspace/snapshots/command_remove_yarn4_with_workspace.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_yarn4_with_workspace/snapshots/command_remove_yarn4_with_workspace.md @@ -89,8 +89,8 @@ warn: yarn does not support --workspace-root. [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in [@vite-plus-test/utils]: Process started [@vite-plus-test/utils]: ➤ YN0000: · Yarn @@ -100,10 +100,10 @@ warn: yarn does not support --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 -[@vite-plus-test/utils]: Process exited (exit code 0), completed in +[@vite-plus-test/utils]: ➤ YN0000: · Done in +[@vite-plus-test/utils]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` @@ -174,7 +174,7 @@ should remove package from all workspaces and root ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` @@ -237,7 +237,7 @@ should remove optional package from all workspaces ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` @@ -288,10 +288,10 @@ recursive remove affects only app [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` @@ -339,10 +339,10 @@ should remove package by filter=* [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vp remove test-vite-plus-install --filter=*` @@ -356,8 +356,8 @@ Done in [command-remove-yarn4-with-workspace]: ➤ YN0000: └ Completed [command-remove-yarn4-with-workspace]: ➤ YN0000: ┌ Link step [command-remove-yarn4-with-workspace]: ➤ YN0000: └ Completed -[command-remove-yarn4-with-workspace]: ➤ YN0000: · Done in -[command-remove-yarn4-with-workspace]: Process exited (exit code 0), completed in +[command-remove-yarn4-with-workspace]: ➤ YN0000: · Done in +[command-remove-yarn4-with-workspace]: Process exited (exit code 0), completed in [admin]: Process started [admin]: ➤ YN0000: · Yarn @@ -367,8 +367,8 @@ Done in [admin]: ➤ YN0000: └ Completed [admin]: ➤ YN0000: ┌ Link step [admin]: ➤ YN0000: └ Completed -[admin]: ➤ YN0000: · Done in -[admin]: Process exited (exit code 0), completed in +[admin]: ➤ YN0000: · Done in +[admin]: Process exited (exit code 0), completed in [app]: Process started [app]: ➤ YN0000: · Yarn @@ -378,10 +378,10 @@ Done in [app]: ➤ YN0000: └ Completed [app]: ➤ YN0000: ┌ Link step [app]: ➤ YN0000: └ Completed -[app]: ➤ YN0000: · Done in -[app]: Process exited (exit code 0), completed in +[app]: ➤ YN0000: · Done in +[app]: Process exited (exit code 0), completed in -Done in +Done in ``` ## `vpt print-file package.json packages/app/package.json packages/admin/package.json packages/utils/package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_tool_help/snapshots/command_tool_deep_help_delegation.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_tool_help/snapshots/command_tool_deep_help_delegation.md index 327af269cb..11c6db2967 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_tool_help/snapshots/command_tool_deep_help_delegation.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_tool_help/snapshots/command_tool_deep_help_delegation.md @@ -5,7 +5,7 @@ Help requests with additional arguments delegate to the underlying tool. ## `vp test --help --coverage` ``` -vitest/4.1.11 +vitest/ Usage: $ vitest [...filters] @@ -17,6 +17,7 @@ Commands: dev [...filters] bench [...filters] init + doctor [...filters] list [...filters] [...filters] complete [shell] @@ -28,6 +29,7 @@ For more info, run any command with the `--help` flag: $ vitest dev --help $ vitest bench --help $ vitest init --help + $ vitest doctor --help $ vitest list --help $ vitest --help $ vitest complete --help @@ -47,7 +49,7 @@ Options: --coverage.allowExternal Collect coverage of files outside the project root (default: false) --coverage.skipFull Do not show files with 100% statement, branch, and function coverage (default: false) --coverage.thresholds.100 Shortcut to set all coverage thresholds to 100 (default: false) - --coverage.thresholds.perFile Check thresholds per file. See --coverage.thresholds.lines, --coverage.thresholds.functions, --coverage.thresholds.branches and --coverage.thresholds.statements for the actual thresholds (default: false) + --coverage.thresholds.perFile Check thresholds per file. See --coverage.thresholds.lines, --coverage.thresholds.functions, --coverage.thresholds.branches and --coverage.thresholds.statements for the actual thresholds (default: false). Object form is available in config files only. --coverage.thresholds.autoUpdate Update threshold values: "lines", "functions", "branches" and "statements" to configuration file when current coverage is above the configured thresholds (default: false) --coverage.thresholds.lines Threshold for lines. Visit https://github.com/istanbuljs/nyc#coverage-thresholds for more information. This option is not available for custom providers --coverage.thresholds.functions Threshold for functions. Visit https://github.com/istanbuljs/nyc#coverage-thresholds for more information. This option is not available for custom providers @@ -63,4 +65,5 @@ Options: --coverage.changed Collect coverage only for files changed since a specified commit or branch (e.g., origin/main or HEAD~1). Inherits value from --changed by default. --coverage.excludeAfterRemap Apply exclusions again after coverage has been remapped to original sources. (default: false) --coverage.htmlDir Directory of HTML coverage output to be served in UI mode and HTML reporter. + --coverage.autoAttachSubprocess Track coverage of the node:child_process and node:worker_threads spawned during test run. Supported only by v8 provider. (default: false) ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_yarn4/snapshots/command_unlink_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_yarn4/snapshots/command_unlink_yarn4.md index 53e3073c3b..5db048eb19 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_yarn4/snapshots/command_unlink_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_yarn4/snapshots/command_unlink_yarn4.md @@ -25,7 +25,7 @@ link the library first ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -53,7 +53,7 @@ should unlink the package ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -78,7 +78,7 @@ link again ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -106,7 +106,7 @@ should unlink all with --all flag ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -131,7 +131,7 @@ should work with -r short form ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4/snapshots/command_update_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4/snapshots/command_update_yarn4.md index d230a72b11..be90576ec4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4/snapshots/command_update_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4/snapshots/command_update_yarn4.md @@ -15,7 +15,7 @@ warn: yarn does not support --no-save. ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -50,7 +50,7 @@ should to absolute latest version ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vp add testnpm2@1.0.0 -D` @@ -65,7 +65,7 @@ should to absolute latest version ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vp update testnpm2 --latest` @@ -80,7 +80,7 @@ should to absolute latest version ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -112,7 +112,7 @@ should update and ignore -D options ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` @@ -144,7 +144,7 @@ should update all packages but won't change the package.json ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4_with_workspace/snapshots/command_update_yarn4_with_workspace.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4_with_workspace/snapshots/command_update_yarn4_with_workspace.md index 442d2408e9..6552a2d247 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4_with_workspace/snapshots/command_update_yarn4_with_workspace.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_yarn4_with_workspace/snapshots/command_update_yarn4_with_workspace.md @@ -118,7 +118,7 @@ unfiltered update still updates all testnpm2 versions ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json packages/utils/package.json` @@ -168,7 +168,7 @@ warn: yarn does not support --no-save. ➤ YN0000: └ Completed ➤ YN0000: ┌ Link step ➤ YN0000: └ Completed -➤ YN0000: · Done in +➤ YN0000: · Done in ``` ## `vpt print-file package.json packages/app/package.json` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_yarn4/snapshots/command_why_yarn4.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_yarn4/snapshots/command_why_yarn4.md index 3f2ef70f63..11a36d36c7 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_yarn4/snapshots/command_why_yarn4.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_yarn4/snapshots/command_why_yarn4.md @@ -17,7 +17,7 @@ VITE+ - The Unified Toolchain for the Web ➤ YN0000: ┌ Link step ➤ YN0073: │ Skipped due to mode=update-lockfile ➤ YN0000: └ Completed -➤ YN0000: · Done with warnings in +➤ YN0000: · Done with warnings in ``` ## `vp why testnpm2` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-npm-layout.mjs b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-npm-layout.mjs index db39f0147f..7d71f37cc7 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-npm-layout.mjs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-npm-layout.mjs @@ -7,10 +7,23 @@ const vitestRequire = createRequire(cliRequire.resolve('vitest/package.json')); const project = require('./package.json'); assert.equal(project.overrides, undefined); assert.equal(cliRequire('vite/package.json').name, '@voidzero-dev/vite-plus-core'); -assert.equal(vitestRequire('vite/package.json').name, 'vite'); -assert.notEqual(cliRequire.resolve('vite/package.json'), vitestRequire.resolve('vite/package.json')); -if (!project.devDependencies.vite) { +if (project.devDependencies.vite) { + assert.equal( + project.devDependencies.vite, + `npm:@voidzero-dev/vite-plus-core@${cliRequire('vite-plus/package.json').version}`, + ); + assert.equal(require.resolve('vite/package.json'), cliRequire.resolve('vite/package.json')); + assert.equal(vitestRequire.resolve('vite/package.json'), cliRequire.resolve('vite/package.json')); + console.log( + 'npm shares the exact core alias between the project, CLI, and Vitest without overrides', + ); +} else { assert.deepEqual(Object.keys(project.devDependencies), ['vite-plus']); assert.equal(require('vite/package.json').name, 'vite'); + assert.equal(vitestRequire('vite/package.json').name, 'vite'); + assert.notEqual( + cliRequire.resolve('vite/package.json'), + vitestRequire.resolve('vite/package.json'), + ); + console.log('npm installed separate CLI core and upstream Vitest peer without overrides'); } -console.log('npm installed separate CLI core and upstream Vitest peer without overrides'); diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-tagged-alias.mjs b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-tagged-alias.mjs new file mode 100644 index 0000000000..40e971754c --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/check-tagged-alias.mjs @@ -0,0 +1,24 @@ +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { createRequire } from 'node:module'; + +const require = createRequire(import.meta.url); +const cliRequire = createRequire(require.resolve('vite-plus/package.json')); +const project = require('./package.json'); +assert.equal(project.overrides, undefined); +assert.equal(project.devDependencies.vite, 'npm:@voidzero-dev/vite-plus-core@latest'); +// npm 11.11 accepts a peer's upstream Vite as satisfying the tagged alias. +assert.equal(require('vite/package.json').name, 'vite'); +assert.equal(cliRequire('vite/package.json').name, '@voidzero-dev/vite-plus-core'); +assert.notEqual(require.resolve('vite/package.json'), cliRequire.resolve('vite/package.json')); + +for (const args of [['dev'], ['pack', 'entry.js']]) { + const result = spawnSync('vp', args, { encoding: 'utf8', timeout: 30_000 }); + assert.ifError(result.error); + const output = result.stdout + result.stderr; + assert.equal(result.status, 1, output); + assert.match(output, /Expected @voidzero-dev\/vite-plus-core@/); + assert.match(output, /but found vite@/); + assert.match(output, /Run `vp migrate` to align the Vite alias, then run `vp install`\./); + console.log(`vp ${args[0]} rejects the replaced npm alias and reports the repair command`); +} diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/pin-core-alias.mjs b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/pin-core-alias.mjs new file mode 100644 index 0000000000..b1e29e051d --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/pin-core-alias.mjs @@ -0,0 +1,10 @@ +import { readFileSync, writeFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; + +// Before installation, resolve the checkout exposed by the snapshot runner. +// CI can stamp its version, so do not hard-code the committed package version. +const require = createRequire(import.meta.url); +const { version } = require('vite-plus/package.json'); +const project = JSON.parse(readFileSync('package.json', 'utf8')); +project.devDependencies.vite = `npm:@voidzero-dev/vite-plus-core@${version}`; +writeFileSync('package.json', `${JSON.stringify(project, null, 2)}\n`); diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots.toml index d7371dfb43..9b5cd5a383 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots.toml @@ -139,14 +139,26 @@ vp = "global" local-registry = true steps = [ { argv = ["vpt", "write-file", "package.json", "{\"name\":\"core-module-identity\",\"private\":true,\"type\":\"module\",\"packageManager\":\"npm@11.11.0\",\"devDependencies\":{\"vite-plus\":\"latest\",\"vite\":\"npm:@voidzero-dev/vite-plus-core@latest\"}}\n"], snapshot = false }, + { argv = ["node", "pin-core-alias.mjs"], snapshot = false }, { argv = ["vp", "install", "--ignore-scripts"], timeout = 120000, snapshot = false }, { argv = ["node", "check-npm-layout.mjs"] }, { argv = ["node", "check-api.mjs"] }, { argv = ["vp", "dev"] }, { argv = ["vp", "build"] }, + { argv = ["vp", "test", "run"], snapshot = false }, { argv = ["vp", "pack", "entry.js"] }, { argv = ["vpt", "write-file", "typecheck/package.json", "{\"name\":\"typecheck-tools\",\"private\":true,\"dependencies\":{\"typescript\":\"6.0.3\"},\"packageManager\":\"npm@11.11.0\"}\n"], snapshot = false }, { argv = ["vp", "install", "--ignore-scripts"], cwd = "typecheck", snapshot = false }, { argv = ["vpt", "cp", "check-config.mts", "check-config.cts"], snapshot = false }, { argv = ["node", "typecheck/node_modules/typescript/bin/tsc", "--noEmit", "--skipLibCheck", "--module", "NodeNext", "--target", "ESNext", "check-config.mts", "check-config.cts"] }, ] + +[[case]] +name = "core_module_identity_npm_tagged_alias_rejected" +vp = "global" +local-registry = true +steps = [ + { argv = ["vpt", "write-file", "package.json", "{\"name\":\"core-module-identity\",\"private\":true,\"type\":\"module\",\"packageManager\":\"npm@11.11.0\",\"devDependencies\":{\"vite-plus\":\"latest\",\"vite\":\"npm:@voidzero-dev/vite-plus-core@latest\"}}\n"], snapshot = false }, + { argv = ["vp", "install", "--ignore-scripts"], timeout = 120000, snapshot = false }, + ["node", "check-tagged-alias.mjs"], +] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_matching_alias_no_override.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_matching_alias_no_override.md index ad57acf182..572998d838 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_matching_alias_no_override.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_matching_alias_no_override.md @@ -4,13 +4,16 @@ '` +## `node pin-core-alias.mjs` + + ## `vp install --ignore-scripts` ## `node check-npm-layout.mjs` ``` -npm installed separate CLI core and upstream Vitest peer without overrides +npm shares the exact core alias between the project, CLI, and Vitest without overrides ``` ## `node check-api.mjs` @@ -43,6 +46,9 @@ dist/assets/index-.js kB │ gzip: kB ✓ built in ``` +## `vp test run` + + ## `vp pack entry.js` ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_tagged_alias_rejected.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_tagged_alias_rejected.md new file mode 100644 index 0000000000..8f3b5c664c --- /dev/null +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_npm_tagged_alias_rejected.md @@ -0,0 +1,15 @@ +# core_module_identity_npm_tagged_alias_rejected + +## `vpt write-file package.json '{"name":"core-module-identity","private":true,"type":"module","packageManager":"npm@11.11.0","devDependencies":{"vite-plus":"latest","vite":"npm:@voidzero-dev/vite-plus-core@latest"}} +'` + + +## `vp install --ignore-scripts` + + +## `node check-tagged-alias.mjs` + +``` +vp dev rejects the replaced npm alias and reports the repair command +vp pack rejects the replaced npm alias and reports the repair command +``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_without_project_alias.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_without_project_alias.md index 121227e830..e6e7a495b4 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_without_project_alias.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/core_module_identity/snapshots/core_module_identity_without_project_alias.md @@ -60,7 +60,7 @@ VITE+ - The Unified Toolchain for the Web Test Files 1 passed (1) Tests 1 passed (1) Start at