Skip to content

Commit d0f9b16

Browse files
authored
Merge branch 'main' into improve-vpx-docs
2 parents 5c20419 + 9e35163 commit d0f9b16

51 files changed

Lines changed: 2228 additions & 1057 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/e2e-test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ jobs:
184184
command: |
185185
# FIXME: skip format for now, will re-enable after prettier migration support
186186
# vp run format
187-
vp run lint
187+
# FIXME: oxlint 1.59.0 no-useless-assignment has false positives on module-level
188+
# state variables and closure-captured variables (oxc-project/oxc#3022).
189+
# The migration sets the rule as "error" in vite.config.ts, so --allow can't override it.
190+
vp run lint || true
188191
vp run type
189192
vp run test -- --coverage
190193
# SKIP: vite-plugin-react - vite-task config loading incompatibility
@@ -282,7 +285,9 @@ jobs:
282285
node-version: 24
283286
command: |
284287
vp fmt
285-
vp run lint
288+
# FIXME: oxlint 1.59.0 vitest/require-mock-type-parameters errors
289+
# on vi.fn() calls — migration sets rule as "error" in config, --allow can't override
290+
vp run lint || true
286291
vp run test:types
287292
vp test --project unit
288293
- name: vite-plus-jest-dom-repro

.github/workflows/test-standalone-install.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,86 @@ jobs:
474474
vp upgrade --rollback
475475
vp --version
476476
477+
test-install-ps1-v76:
478+
name: Test install.ps1 (Windows x64, PowerShell 7.6)
479+
runs-on: windows-latest
480+
permissions:
481+
contents: read
482+
steps:
483+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
484+
485+
- name: Install PowerShell 7.6
486+
shell: pwsh
487+
run: |
488+
dotnet tool install --global PowerShell --version 7.6.0
489+
$pwsh76 = "$env:USERPROFILE\.dotnet\tools\pwsh.exe"
490+
echo "PWSH76=$pwsh76" >> $env:GITHUB_ENV
491+
$ver = & $pwsh76 -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
492+
Write-Host "PowerShell version: $ver"
493+
if (-not $ver.StartsWith("7.6")) {
494+
Write-Error "Expected PowerShell 7.6.x but got $ver"
495+
exit 1
496+
}
497+
498+
- name: Run install.ps1 via iex under PowerShell 7.6
499+
shell: pwsh
500+
run: |
501+
& $env:PWSH76 -NoProfile -Command "Get-Content ./packages/cli/install.ps1 -Raw | Invoke-Expression"
502+
503+
- name: Set PATH
504+
shell: bash
505+
run: |
506+
echo "$USERPROFILE\.vite-plus\bin" >> $GITHUB_PATH
507+
508+
- name: Verify installation
509+
shell: pwsh
510+
working-directory: ${{ runner.temp }}
511+
run: |
512+
Write-Host "PATH: $env:Path"
513+
vp --version
514+
vp --help
515+
vp create vite --no-interactive --no-agent -- hello --no-interactive -t vanilla
516+
cd hello
517+
vp run build
518+
vp --version
519+
520+
- name: Verify bin setup
521+
shell: pwsh
522+
run: |
523+
$binPath = "$env:USERPROFILE\.vite-plus\bin"
524+
Get-ChildItem -Force $binPath
525+
if (-not (Test-Path $binPath)) {
526+
Write-Error "Bin directory not found: $binPath"
527+
exit 1
528+
}
529+
530+
$expectedShims = @("node.exe", "npm.exe", "npx.exe")
531+
foreach ($shim in $expectedShims) {
532+
$shimFile = Join-Path $binPath $shim
533+
if (-not (Test-Path $shimFile)) {
534+
Write-Error "Shim not found: $shimFile"
535+
exit 1
536+
}
537+
Write-Host "Found shim: $shimFile"
538+
}
539+
where.exe node
540+
where.exe npm
541+
where.exe npx
542+
where.exe vp
543+
544+
$env:Path = "$env:USERPROFILE\.vite-plus\bin;$env:Path"
545+
vp env doctor
546+
vp env run --node 24 -- node -p "process.versions"
547+
548+
- name: Verify upgrade
549+
shell: pwsh
550+
run: |
551+
vp upgrade --check
552+
vp upgrade 0.1.14-alpha.1
553+
vp --version
554+
vp upgrade --rollback
555+
vp --version
556+
477557
test-install-ps1:
478558
name: Test install.ps1 (Windows x64)
479559
runs-on: windows-latest
Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
name: Test vp create
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'packages/cli/src/create/**'
12+
- 'packages/cli/templates/**'
13+
- 'packages/cli/src/migration/**'
14+
- '.github/workflows/test-vp-create.yml'
15+
pull_request:
16+
types: [opened, synchronize, labeled]
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
20+
cancel-in-progress: ${{ github.ref_name != 'main' }}
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
detect-changes:
28+
runs-on: namespace-profile-linux-x64-default
29+
permissions:
30+
contents: read
31+
pull-requests: read
32+
outputs:
33+
related-files-changed: ${{ steps.filter.outputs.related-files }}
34+
steps:
35+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
37+
id: filter
38+
with:
39+
filters: |
40+
related-files:
41+
- 'packages/cli/src/create/**'
42+
- 'packages/cli/templates/**'
43+
- 'packages/cli/src/migration/**'
44+
- .github/workflows/test-vp-create.yml
45+
46+
download-previous-rolldown-binaries:
47+
needs: detect-changes
48+
runs-on: namespace-profile-linux-x64-default
49+
# Run if: not a PR, OR PR has 'test: create-e2e' label, OR create-related files changed
50+
if: >-
51+
github.event_name != 'pull_request' ||
52+
contains(github.event.pull_request.labels.*.name, 'test: create-e2e') ||
53+
needs.detect-changes.outputs.related-files-changed == 'true'
54+
permissions:
55+
contents: read
56+
packages: read
57+
steps:
58+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
59+
- uses: ./.github/actions/download-rolldown-binaries
60+
with:
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
63+
build:
64+
name: Build vite-plus packages
65+
runs-on: namespace-profile-linux-x64-default
66+
permissions:
67+
contents: read
68+
packages: read
69+
needs:
70+
- download-previous-rolldown-binaries
71+
steps:
72+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73+
- uses: ./.github/actions/clone
74+
75+
- uses: oxc-project/setup-rust@23f38cfb0c04af97a055f76acee94d5be71c7c82 # v1.0.16
76+
with:
77+
save-cache: ${{ github.ref_name == 'main' }}
78+
cache-key: create-e2e-build
79+
80+
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
81+
82+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
83+
with:
84+
name: rolldown-binaries
85+
path: ./rolldown/packages/rolldown/src
86+
merge-multiple: true
87+
88+
- name: Build with upstream
89+
uses: ./.github/actions/build-upstream
90+
with:
91+
target: x86_64-unknown-linux-gnu
92+
93+
- name: Pack packages into tgz
94+
run: |
95+
mkdir -p tmp/tgz
96+
cd packages/core && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
97+
cd packages/test && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
98+
cd packages/cli && pnpm pack --pack-destination ../../tmp/tgz && cd ../..
99+
# Copy vp binary for test jobs
100+
cp target/x86_64-unknown-linux-gnu/release/vp tmp/tgz/vp
101+
ls -la tmp/tgz
102+
103+
- name: Upload tgz artifacts
104+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
105+
with:
106+
name: vite-plus-packages
107+
path: tmp/tgz/
108+
retention-days: 1
109+
110+
test-vp-create:
111+
name: vp create ${{ matrix.template.name }} (${{ matrix.package-manager }})
112+
runs-on: namespace-profile-linux-x64-default
113+
permissions:
114+
contents: read
115+
needs:
116+
- build
117+
timeout-minutes: 15
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
template:
122+
- name: monorepo
123+
create-args: vite:monorepo --directory test-project
124+
template-args: ''
125+
verify-command: vp run ready
126+
- name: application
127+
create-args: vite:application --directory test-project
128+
template-args: '-- --template vanilla-ts'
129+
verify-command: vp run build
130+
- name: library
131+
create-args: vite:library --directory test-project
132+
template-args: ''
133+
verify-command: |
134+
vp run build
135+
vp run test
136+
package-manager:
137+
- pnpm
138+
- npm
139+
- yarn
140+
- bun
141+
env:
142+
VP_OVERRIDE_PACKAGES: '{"vite":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz","vitest":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-test-0.0.0.tgz","@voidzero-dev/vite-plus-core":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-core-0.0.0.tgz","@voidzero-dev/vite-plus-test":"file:${{ github.workspace }}/tmp/tgz/voidzero-dev-vite-plus-test-0.0.0.tgz"}'
143+
VP_VERSION: 'file:${{ github.workspace }}/tmp/tgz/vite-plus-0.0.0.tgz'
144+
# Force full dependency rewriting so the library template's existing
145+
# vite-plus dep gets overridden with the local tgz
146+
VP_FORCE_MIGRATE: '1'
147+
steps:
148+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
149+
150+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
151+
with:
152+
node-version: 24
153+
154+
- name: Download vite-plus packages
155+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
156+
with:
157+
name: vite-plus-packages
158+
path: tmp/tgz
159+
160+
- name: Install vp CLI
161+
run: |
162+
mkdir -p target/release
163+
cp tmp/tgz/vp target/release/vp
164+
chmod +x target/release/vp
165+
node $GITHUB_WORKSPACE/packages/tools/src/install-global-cli.ts --tgz $GITHUB_WORKSPACE/tmp/tgz/vite-plus-0.0.0.tgz
166+
echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH
167+
168+
- name: Verify vp installation
169+
run: |
170+
which vp
171+
vp --version
172+
173+
- name: Run vp create ${{ matrix.template.name }} with ${{ matrix.package-manager }}
174+
working-directory: ${{ runner.temp }}
175+
run: |
176+
vp create ${{ matrix.template.create-args }} \
177+
--no-interactive \
178+
--no-agent \
179+
--package-manager ${{ matrix.package-manager }} \
180+
${{ matrix.template.template-args }}
181+
182+
- name: Verify project structure
183+
working-directory: ${{ runner.temp }}/test-project
184+
run: |
185+
# package.json must exist
186+
test -f package.json
187+
echo "✓ package.json exists"
188+
cat package.json
189+
190+
# List all files for debugging
191+
echo "--- Project root files ---"
192+
ls -la
193+
194+
# Check correct lockfile exists
195+
case "${{ matrix.package-manager }}" in
196+
pnpm)
197+
test -f pnpm-lock.yaml
198+
echo "✓ pnpm-lock.yaml exists"
199+
;;
200+
npm)
201+
test -f package-lock.json
202+
echo "✓ package-lock.json exists"
203+
;;
204+
yarn)
205+
test -f yarn.lock
206+
echo "✓ yarn.lock exists"
207+
;;
208+
bun)
209+
if [ -f bun.lock ]; then
210+
echo "✓ bun.lock exists"
211+
elif [ -f bun.lockb ]; then
212+
echo "✓ bun.lockb exists"
213+
else
214+
echo "✗ No bun lockfile found"
215+
exit 1
216+
fi
217+
;;
218+
esac
219+
220+
# node_modules must exist (vp install ran successfully)
221+
test -d node_modules
222+
echo "✓ node_modules exists"
223+
224+
# Monorepo-specific checks
225+
if [ "${{ matrix.template.name }}" = "monorepo" ]; then
226+
test -d apps/website
227+
echo "✓ apps/website exists"
228+
test -d packages/utils
229+
echo "✓ packages/utils exists"
230+
231+
case "${{ matrix.package-manager }}" in
232+
pnpm)
233+
test -f pnpm-workspace.yaml
234+
echo "✓ pnpm-workspace.yaml exists"
235+
;;
236+
yarn)
237+
test -f .yarnrc.yml
238+
echo "✓ .yarnrc.yml exists"
239+
;;
240+
esac
241+
fi
242+
243+
- name: Verify local tgz packages installed
244+
working-directory: ${{ runner.temp }}/test-project
245+
run: |
246+
node -e "
247+
const path = require('path');
248+
const pkg = require(path.resolve('node_modules/vite-plus/package.json'));
249+
if (pkg.version !== '0.0.0') {
250+
console.error('Expected vite-plus@0.0.0, got ' + pkg.version);
251+
process.exit(1);
252+
}
253+
console.log('✓ vite-plus@' + pkg.version + ' installed correctly');
254+
"
255+
256+
- name: Run vp check
257+
working-directory: ${{ runner.temp }}/test-project
258+
run: vp check
259+
260+
- name: Verify project builds
261+
working-directory: ${{ runner.temp }}/test-project
262+
run: ${{ matrix.template.verify-command }}
263+
264+
- name: Verify cache (monorepo only)
265+
if: matrix.template.name == 'monorepo'
266+
working-directory: ${{ runner.temp }}/test-project
267+
run: |
268+
output=$(vp run ready 2>&1)
269+
echo "$output"
270+
if ! echo "$output" | grep -q 'cache hit (100%)'; then
271+
echo "✗ Expected 100% cache hit on second run"
272+
exit 1
273+
fi
274+
echo "✓ 100% cache hit verified"

0 commit comments

Comments
 (0)