From e33a9667d5a341cb895f7ed323c7dbed0a663dea Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 18 Jun 2026 10:59:25 +0800 Subject: [PATCH 1/4] test: add node 20 to node-version matrix Cover Node.js 20 in the test-node-version job alongside lts, 22, and 24. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 85f3ac2..0219e5d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["lts", "22", "24"] + node-version: ["lts", "20", "22", "24"] runs-on: ubuntu-latest steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 From d986d3d5baca337f5b3421362bf4a7d058ee0511 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 18 Jun 2026 11:18:12 +0800 Subject: [PATCH 2/4] test: assert Vite+ rejects Node 20 instead of testing it as supported Vite+ requires Node ^22.18.0 || >=24.11.0, so Node 20 is unsupported. A happy-path matrix entry for 20 passed vacuously because the engine gate is only enforced by workload commands like vp install, not by vp env use or vp --version. Replace it with a negative test that runs vp install under Node 20 and asserts it fails with the incompatibility error, reproducing the rolldown CI failure. --- .github/workflows/test.yml | 50 +++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0219e5d..d7df4f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["lts", "20", "22", "24"] + node-version: ["lts", "22", "24"] runs-on: ubuntu-latest steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 @@ -69,6 +69,54 @@ jobs: echo "$ACTUAL" | grep -q "^v${{ matrix.node-version }}\." || (echo "Expected Node.js v${{ matrix.node-version }}.x but got $ACTUAL" && exit 1) fi + # Negative test: Vite+ requires Node.js ^22.18.0 || >=24.11.0, so Node 20 is + # unsupported. `vp env use 20` and `vp --version` both succeed (the engine gate + # is not enforced there), so a "happy path" matrix entry for 20 would pass + # vacuously. A real workload command like `vp install` is what enforces the + # gate, so this job pins that failure mode: vp install must reject Node 20 with + # a clear incompatibility error. Reproduces the rolldown CI failure and guards + # against a regression (Vite+ silently accepting Node 20, or changing the text). + test-node-20-incompatible: + runs-on: ubuntu-latest + steps: + - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 + + # Installs Vite+ and selects Node 20 (both succeed). run-install is + # disabled here so the engine gate is exercised explicitly in the step + # below, where the output can be captured and asserted on. + - name: Setup Vite+ with Node.js 20 + uses: ./ + with: + node-version: "20" + run-install: false + cache: false + + - name: Create test project + run: | + mkdir -p test-project + cd test-project + echo '{"name":"test-project","private":true}' > package.json + + - name: Assert vp install rejects Node 20 + shell: bash + working-directory: test-project + run: | + set +e + OUTPUT=$(vp install 2>&1) + CODE=$? + set -e + echo "$OUTPUT" + echo "vp install exit code: $CODE" + if [ "$CODE" -eq 0 ]; then + echo "::error::vp install unexpectedly succeeded on Node 20. Vite+ may now support Node 20 (check its engines range, currently ^22.18.0 || >=24.11.0). If so, delete this negative test and add 20 back to the test-node-version matrix." + exit 1 + fi + if ! echo "$OUTPUT" | grep -qiF "is incompatible with Vite+ CLI"; then + echo "::error::vp install exited $CODE on Node 20 but without the expected incompatibility error. It likely failed for an unrelated reason, or Vite+ changed the engine-gate message. Update the marker grep if the message format changed." + exit 1 + fi + echo "OK: vp install rejected Node 20 with the expected incompatibility error (exit $CODE)." + test-cache-pnpm: runs-on: ubuntu-latest steps: From a20aca5d4e5da6a17d1514ef1886957092093843 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 18 Jun 2026 11:24:55 +0800 Subject: [PATCH 3/4] test: add node 20 to node-version matrix (expected to fail until Vite+ supports it) Run vp install in the matrix so Node 20 throws at Vite+'s engine gate (requires ^22.18.0 || >=24.11.0). Node 20 is kept red on purpose until Vite+ adds Node 20 support; drop the separate negative-test job. --- .github/workflows/test.yml | 66 +++++++++----------------------------- 1 file changed, 16 insertions(+), 50 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d7df4f3..cc3e7f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,16 +45,30 @@ jobs: strategy: fail-fast: false matrix: - node-version: ["lts", "22", "24"] + # NOTE: Node 20 is expected to FAIL. Vite+ requires Node + # ^22.18.0 || >=24.11.0, so `vp install` rejects Node 20 at its engine + # gate. This entry is kept red on purpose until Vite+ adds Node 20 + # support; remove this note once it does. + node-version: ["lts", "20", "22", "24"] runs-on: ubuntu-latest steps: - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 + - name: Create test project + run: | + mkdir -p test-project + cd test-project + echo '{"name":"test-project","private":true}' > package.json + + # Runs `vp env use ` then `vp install`. The install enforces + # Vite+'s Node engine range, so Node 20 throws here while supported + # versions install cleanly. - name: Setup Vite+ with Node.js ${{ matrix.node-version }} uses: ./ with: node-version: ${{ matrix.node-version }} - run-install: false + run-install: | + - cwd: test-project cache: false - name: Verify installation @@ -69,54 +83,6 @@ jobs: echo "$ACTUAL" | grep -q "^v${{ matrix.node-version }}\." || (echo "Expected Node.js v${{ matrix.node-version }}.x but got $ACTUAL" && exit 1) fi - # Negative test: Vite+ requires Node.js ^22.18.0 || >=24.11.0, so Node 20 is - # unsupported. `vp env use 20` and `vp --version` both succeed (the engine gate - # is not enforced there), so a "happy path" matrix entry for 20 would pass - # vacuously. A real workload command like `vp install` is what enforces the - # gate, so this job pins that failure mode: vp install must reject Node 20 with - # a clear incompatibility error. Reproduces the rolldown CI failure and guards - # against a regression (Vite+ silently accepting Node 20, or changing the text). - test-node-20-incompatible: - runs-on: ubuntu-latest - steps: - - uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2 - - # Installs Vite+ and selects Node 20 (both succeed). run-install is - # disabled here so the engine gate is exercised explicitly in the step - # below, where the output can be captured and asserted on. - - name: Setup Vite+ with Node.js 20 - uses: ./ - with: - node-version: "20" - run-install: false - cache: false - - - name: Create test project - run: | - mkdir -p test-project - cd test-project - echo '{"name":"test-project","private":true}' > package.json - - - name: Assert vp install rejects Node 20 - shell: bash - working-directory: test-project - run: | - set +e - OUTPUT=$(vp install 2>&1) - CODE=$? - set -e - echo "$OUTPUT" - echo "vp install exit code: $CODE" - if [ "$CODE" -eq 0 ]; then - echo "::error::vp install unexpectedly succeeded on Node 20. Vite+ may now support Node 20 (check its engines range, currently ^22.18.0 || >=24.11.0). If so, delete this negative test and add 20 back to the test-node-version matrix." - exit 1 - fi - if ! echo "$OUTPUT" | grep -qiF "is incompatible with Vite+ CLI"; then - echo "::error::vp install exited $CODE on Node 20 but without the expected incompatibility error. It likely failed for an unrelated reason, or Vite+ changed the engine-gate message. Update the marker grep if the message format changed." - exit 1 - fi - echo "OK: vp install rejected Node 20 with the expected incompatibility error (exit $CODE)." - test-cache-pnpm: runs-on: ubuntu-latest steps: From c21f42acd75e7d5987bff857cdbfc01f708b15a8 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 18 Jun 2026 13:49:00 +0800 Subject: [PATCH 4/4] test: pin test-project packageManager to pnpm 10 for Node 20 Vite+'s bundled pnpm 11 requires node:sqlite (Node >= 22.5) and crashes on Node 20. Pin the test project to pnpm@10.34.3 so vp install runs the whole node-version matrix, including Node 20. --- .github/workflows/test.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc3e7f5..c7194a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,10 +45,6 @@ jobs: strategy: fail-fast: false matrix: - # NOTE: Node 20 is expected to FAIL. Vite+ requires Node - # ^22.18.0 || >=24.11.0, so `vp install` rejects Node 20 at its engine - # gate. This entry is kept red on purpose until Vite+ adds Node 20 - # support; remove this note once it does. node-version: ["lts", "20", "22", "24"] runs-on: ubuntu-latest steps: @@ -58,11 +54,11 @@ jobs: run: | mkdir -p test-project cd test-project - echo '{"name":"test-project","private":true}' > package.json + # Pin pnpm to v10. Vite+'s bundled pnpm 11 requires node:sqlite + # (Node >= 22.5) and crashes on Node 20; pnpm 10 still runs on Node 20. + echo '{"name":"test-project","private":true,"packageManager":"pnpm@10.34.3"}' > package.json - # Runs `vp env use ` then `vp install`. The install enforces - # Vite+'s Node engine range, so Node 20 throws here while supported - # versions install cleanly. + # Runs `vp env use ` then `vp install` in the test project. - name: Setup Vite+ with Node.js ${{ matrix.node-version }} uses: ./ with: