Skip to content

Commit d776e56

Browse files
committed
ci(test-vp-create): add remote vite@9.0.5 + react-ts migration matrix entry
The existing matrix only covers builtin templates (vite:monorepo, vite:application, vite:library) — none of which ship ESLint or Prettier, so the recent ESLint/Prettier auto-migration path in `vp create` goes untested by this workflow. Add `remote-vite-react-ts` that scaffolds with `vp create vite@9.0.5 -- test-project --template react-ts` (pinned so the snap is stable against upstream template changes) and asserts the post-migration end state: - eslint.config.js deleted - .oxlintrc.json merged into vite.config.ts (not left loose) - vite.config.ts contains a `lint:` section - package.json: eslint devDep removed, vite-plus devDep present, `lint` script rewritten to `vp lint …` The verification step is gated on a new matrix `verify-migration` field so builtin entries skip it. All four package managers (pnpm, npm, yarn, bun) exercise the path.
1 parent f4f7e71 commit d776e56

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/test-vp-create.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,29 @@ jobs:
123123
create-args: vite:monorepo --directory test-project
124124
template-args: ''
125125
verify-command: vp run ready
126+
verify-migration: 'false'
126127
- name: application
127128
create-args: vite:application --directory test-project
128129
template-args: '-- --template vanilla-ts'
129130
verify-command: vp run build
131+
verify-migration: 'false'
130132
- name: library
131133
create-args: vite:library --directory test-project
132134
template-args: ''
133135
verify-command: |
134136
vp run build
135137
vp run test
138+
verify-migration: 'false'
139+
# Remote template that ships ESLint (+ an eslint.config.js importing
140+
# @eslint/js etc.). Exercises the migrate-before-rewrite reorder in
141+
# `vp create`: after scaffold, ESLint → oxlint and Prettier → oxfmt
142+
# run before the vite-plus rewrite so `.oxlintrc` / `.oxfmtrc` get
143+
# merged into vite.config.ts.
144+
- name: remote-vite-react-ts
145+
create-args: vite@9.0.5
146+
template-args: '-- test-project --template react-ts'
147+
verify-command: vp run build
148+
verify-migration: 'true'
136149
package-manager:
137150
- pnpm
138151
- npm
@@ -253,6 +266,41 @@ jobs:
253266
console.log('✓ vite-plus@' + pkg.version + ' installed correctly');
254267
"
255268
269+
- name: Verify ESLint/Prettier auto-migration
270+
if: matrix.template.verify-migration == 'true'
271+
working-directory: ${{ runner.temp }}/test-project
272+
run: |
273+
# eslint.config.js must be gone (migration deleted it)
274+
test ! -f eslint.config.js
275+
echo "✓ eslint.config.js removed"
276+
277+
# .oxlintrc.json must NOT be loose on disk — it was merged into
278+
# vite.config.ts by the rewrite step that runs after migration.
279+
test ! -f .oxlintrc.json
280+
echo "✓ .oxlintrc.json merged into vite.config.ts"
281+
282+
# vite.config.ts must contain the merged oxlint config.
283+
grep -q '^[[:space:]]*lint:' vite.config.ts
284+
echo "✓ vite.config.ts has merged lint section"
285+
286+
# package.json: eslint devDep removed, vite-plus present, lint script rewritten.
287+
node -e "
288+
const pkg = require('./package.json');
289+
if (pkg.devDependencies && pkg.devDependencies.eslint) {
290+
console.error('✗ eslint devDependency should have been removed');
291+
process.exit(1);
292+
}
293+
if (!pkg.devDependencies || !pkg.devDependencies['vite-plus']) {
294+
console.error('✗ vite-plus devDependency missing');
295+
process.exit(1);
296+
}
297+
if (!pkg.scripts || !pkg.scripts.lint || !pkg.scripts.lint.includes('vp lint')) {
298+
console.error('✗ lint script should invoke vp lint, got: ' + (pkg.scripts && pkg.scripts.lint));
299+
process.exit(1);
300+
}
301+
console.log('✓ package.json migrated (eslint gone, vite-plus added, lint script rewritten)');
302+
"
303+
256304
- name: Run vp check
257305
working-directory: ${{ runner.temp }}/test-project
258306
run: vp check

0 commit comments

Comments
 (0)