-
Notifications
You must be signed in to change notification settings - Fork 190
refactor: replace @voidzero-dev/vite-plus-test with upstream vitest@4.1.5 #1588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
510d5b0
03d2490
b18f1e1
41d3671
0672ed4
2159a19
1578ca3
a3c6ebf
d58322f
f60e002
dd16440
21b62e6
b7e393c
09f65d4
7400223
3cf5fa9
a9572c5
73ad4b3
10cc1c4
4d14555
f3d9a74
d1eb9b5
cf12ee4
fc38ae2
aeb834e
426224b
e9a8fd3
40ed602
51caa6b
2d5756e
95b71c8
8f1e604
b7737a6
79c2254
a7859fd
ef3b17a
ca6e3ab
b4dde84
b9d62d9
b327596
eb733d8
72c4898
3fd73c5
079a696
8d3239d
b07ea84
cf43391
c1c7cb3
b2efc18
40272f1
07af786
aef9c85
62c3d5e
9b451f4
632f215
c9513a3
2d88fd9
03e24a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,9 +93,34 @@ jobs: | |
| - name: Pack packages into tgz | ||
| run: | | ||
| mkdir -p tmp/tgz | ||
| # Every tgz consumer below references fixed `*-0.0.0.tgz` filenames. | ||
| # A release commit can leave `packages/{core,cli}` at a published | ||
| # version (e.g. 0.1.22), which would make `pnpm pack` emit | ||
| # `*-0.1.22.tgz` instead. Pin both to 0.0.0 so the names stay stable. | ||
| (cd packages/core && npm pkg set version=0.0.0) | ||
| (cd packages/cli && npm pkg set version=0.0.0) | ||
| cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../.. | ||
| cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../.. | ||
| cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../.. | ||
| # Bun is uniquely strict about peer-dep resolution: | ||
| # 1. It checks the *resolved target's* package name and version | ||
| # against the peer range (vitest 4.1.7 declares peer | ||
| # `vite ^6 || ^7 || ^8`). | ||
| # 2. A file: override pointing at the vite-plus-core tgz fails | ||
| # both the name check (target is `@voidzero-dev/vite-plus-core`, | ||
| # not `vite`) and the version check (0.0.0 is outside `^6|^7|^8`). | ||
| # pnpm/npm/yarn don't enforce either, and using the same core tgz as | ||
| # the file: target for both `vite` and `@voidzero-dev/vite-plus-core` | ||
| # is the only configuration they install cleanly. See | ||
| # https://github.com/oven-sh/bun/issues/8406. | ||
| # | ||
| # Generate a sibling vite-7.99.0.tgz: a copy of the core tgz with | ||
| # `package.json#name` rewritten to "vite" and `version` to 7.99.0. | ||
| # Only the bun matrix entry below points its vite override at this | ||
| # alias tgz; pnpm/npm/yarn keep pointing at the real core tgz so | ||
| # pnpm's workspace resolver doesn't trip on a "vite@<version>" | ||
| # registry lookup (the renamed tgz makes pnpm register the dep as | ||
| # vite@7.99.0 and then probe npmjs.org to validate the version). | ||
| pnpm exec tool repack-vite-tgz tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz tmp/tgz/vite-7.99.0.tgz vite 7.99.0 | ||
|
Brooooooklyn marked this conversation as resolved.
|
||
| # Copy vp binary for test jobs | ||
| cp target/x86_64-unknown-linux-gnu/release/vp tmp/tgz/vp | ||
| ls -la tmp/tgz | ||
|
|
@@ -152,6 +177,13 @@ jobs: | |
| - yarn | ||
| - bun | ||
| env: | ||
| # Bun's strict peer check requires the `vite` override target's tgz to be | ||
| # named "vite" with a version satisfying vitest's `peer vite ^6 || ^7 || ^8`. | ||
| # The bun matrix entry uses the masquerade tgz (vite-7.99.0.tgz). pnpm/npm/yarn | ||
| # point at the real core tgz — anything else trips a registry lookup for | ||
| # vite@<version> when sub-package and override targets are both file: tgz aliases. | ||
| VITE_OVERRIDE_TGZ: ${{ matrix.package-manager == 'bun' && 'vite-7.99.0.tgz' || 'voidzero-dev-vite-plus-core-0.0.0.tgz' }} | ||
| VP_VERSION: 'file:${{ github.workspace }}/tmp/tgz/vite-plus-0.0.0.tgz' | ||
| # Force full dependency rewriting so the library template's existing | ||
| # vite-plus dep gets overridden with the local tgz | ||
| VP_FORCE_MIGRATE: '1' | ||
|
|
@@ -168,22 +200,12 @@ jobs: | |
| name: vite-plus-packages | ||
| path: tmp/tgz | ||
|
|
||
| - name: Resolve tgz paths | ||
| run: | | ||
| CLI_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/vite-plus-[0-9]*.tgz | head -n1) | ||
| CORE_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/voidzero-dev-vite-plus-core-[0-9]*.tgz | head -n1) | ||
| TEST_TGZ=$(ls "$GITHUB_WORKSPACE"/tmp/tgz/voidzero-dev-vite-plus-test-[0-9]*.tgz | head -n1) | ||
| echo "CLI_TGZ=$CLI_TGZ" >> $GITHUB_ENV | ||
| echo "VP_VERSION=file:$CLI_TGZ" >> $GITHUB_ENV | ||
| printf 'VP_OVERRIDE_PACKAGES={"vite":"file:%s","vitest":"file:%s","@voidzero-dev/vite-plus-core":"file:%s","@voidzero-dev/vite-plus-test":"file:%s"}\n' \ | ||
| "$CORE_TGZ" "$TEST_TGZ" "$CORE_TGZ" "$TEST_TGZ" >> $GITHUB_ENV | ||
|
|
||
| - name: Install vp CLI | ||
| run: | | ||
| mkdir -p target/release | ||
| cp tmp/tgz/vp target/release/vp | ||
| chmod +x target/release/vp | ||
| node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz "$CLI_TGZ" | ||
| node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz $GITHUB_WORKSPACE/tmp/tgz/vite-plus-0.0.0.tgz | ||
| echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Verify vp installation | ||
|
|
@@ -193,6 +215,8 @@ jobs: | |
|
|
||
| - name: Run vp create ${{ matrix.template.name }} with ${{ matrix.package-manager }} | ||
| working-directory: ${{ runner.temp }} | ||
| env: | ||
| VP_OVERRIDE_PACKAGES: '{"vite":"file:${{ github.workspace }}/tmp/tgz/${{ env.VITE_OVERRIDE_TGZ }}","@voidzero-dev/vite-plus-core":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz","vitest":"4.1.7","@vitest/expect":"4.1.7","@vitest/runner":"4.1.7","@vitest/snapshot":"4.1.7","@vitest/spy":"4.1.7","@vitest/utils":"4.1.7","@vitest/mocker":"4.1.7","@vitest/pretty-format":"4.1.7","@vitest/coverage-v8":"4.1.7","@vitest/coverage-istanbul":"4.1.7"}' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflow hardcodes vitest versions upgrade script won't updateLow Severity The Reviewed by Cursor Bugbot for commit 03e24a2. Configure here. |
||
| run: | | ||
| vp create ${{ matrix.template.create-args }} \ | ||
| --no-interactive \ | ||
|
|
@@ -266,10 +290,9 @@ jobs: | |
| run: | | ||
| node -e " | ||
| const path = require('path'); | ||
| const expected = require('$GITHUB_WORKSPACE/packages/cli/package.json').version; | ||
| const pkg = require(path.resolve('node_modules/vite-plus/package.json')); | ||
| if (pkg.version !== expected) { | ||
| console.error('Expected vite-plus@' + expected + ', got ' + pkg.version); | ||
| if (pkg.version !== '0.0.0') { | ||
| console.error('Expected vite-plus@0.0.0, got ' + pkg.version); | ||
| process.exit(1); | ||
| } | ||
| console.log('✓ vite-plus@' + pkg.version + ' installed correctly'); | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.