Skip to content

Commit fac1a20

Browse files
authored
Merge branch 'main' into codex/remove-redundant-release-artifact-download
2 parents 9b087d5 + 1c693c2 commit fac1a20

20 files changed

Lines changed: 487 additions & 1056 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ jobs:
314314
node-version: 24
315315
command: |
316316
vp check --fix
317+
- name: varlet
318+
node-version: 22
319+
command: |
320+
# scripts/bootstrap.mjs spawns `pnpm build` via tinyexec and needs
321+
# pnpm on PATH (not exposed by the vp install itself).
322+
vp i -g pnpm
323+
node scripts/bootstrap.mjs
324+
vp run lint
325+
vp run test:coverage
317326
exclude:
318327
# frm-stack uses Docker (testcontainers) which doesn't work the same way on Windows
319328
- os: windows-latest
@@ -335,6 +344,10 @@ jobs:
335344
- os: windows-latest
336345
project:
337346
name: npmx.dev
347+
# varlet upstream CI is ubuntu-only
348+
- os: windows-latest
349+
project:
350+
name: varlet
338351

339352
steps:
340353
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ jobs:
159159
path: ./packages/cli/dist
160160
if-no-files-found: error
161161

162-
- name: Upload cli skills (docs for agent integration)
162+
- name: Upload cli docs
163163
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
164164
if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }}
165165
with:
166-
name: cli-skills
167-
path: ./packages/cli/skills
166+
name: cli-docs
167+
path: ./packages/cli/docs
168168
if-no-files-found: error
169169

170170
- name: Upload LICENSE files
@@ -209,11 +209,11 @@ jobs:
209209
pattern: cli
210210
merge-multiple: true
211211

212-
- name: Download cli skills
212+
- name: Download cli docs
213213
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
214214
with:
215-
path: packages/cli/skills
216-
pattern: cli-skills
215+
path: packages/cli/docs
216+
pattern: cli-docs
217217
merge-multiple: true
218218

219219
- name: Download cli binding

.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: [email protected]
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

ecosystem-ci/repo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,11 @@
119119
"branch": "main",
120120
"hash": "6192f60653c124ae068efaf5d7d0a4134c95edbd",
121121
"forceFreshMigration": true
122+
},
123+
"varlet": {
124+
"repository": "https://github.com/varletjs/varlet.git",
125+
"branch": "dev",
126+
"hash": "83f6c6a418ab9319e07d719d86d4fa952f99e266",
127+
"forceFreshMigration": true
122128
}
123129
}

packages/cli/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/npm
22
/artifacts
33
/LICENSE
4-
/skills/vite-plus/docs
4+
/docs

packages/cli/AGENTS.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44

55
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
66

7-
## Common Pitfalls
8-
9-
- **Running scripts:** Vite+ built-in commands (`vp lint`, `vp dev`, `vp build`, `vp test`, etc.) always run the Vite+ built-in tool. Use `vp run <script>` to run `package.json` scripts or tasks defined in `vite.config.ts`
10-
- **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. Do not install or upgrade them, use Vite+ directly.
11-
- **Import JavaScript modules from `vite-plus`:** Import modules from the `vite-plus` dependency, not from `vite` or `vitest`. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities.
7+
Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.
128

139
## Review Checklist
1410

1511
- [ ] Run `vp install` after pulling remote changes and before getting started.
1612
- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes.
17-
- [ ] Check if there are tasks or `package.json` scripts necessary for validation, run via `vp run <script>`.
13+
- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run <script>`.
1814

19-
* Docs: https://viteplus.dev/guide/
2015
<!--VITE PLUS END-->

packages/cli/build.ts

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* 3. syncCorePackageExports() - Creates shim files to re-export from @voidzero-dev/vite-plus-core
88
* 4. syncTestPackageExports() - Creates shim files to re-export from @voidzero-dev/vite-plus-test
99
* 5. syncVersionsExport() - Generates ./versions module with bundled tool versions
10-
* 6. copySkillDocs() - Copies docs into skills/vite-plus/docs for runtime MCP access
10+
* 6. copyBundledDocs() - Copies docs into docs/ for bundled package access
1111
* 7. syncReadmeFromRoot() - Keeps package README in sync
1212
*
1313
* The sync functions allow this package to be a drop-in replacement for 'vite' by
@@ -19,9 +19,9 @@
1919
*/
2020

2121
import { execSync } from 'node:child_process';
22-
import { existsSync, globSync, readdirSync, statSync } from 'node:fs';
23-
import { copyFile, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
24-
import { dirname, join } from 'node:path';
22+
import { existsSync, readdirSync, statSync } from 'node:fs';
23+
import { copyFile, cp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
24+
import { dirname, join, relative } from 'node:path';
2525
import { fileURLToPath } from 'node:url';
2626
import { parseArgs } from 'node:util';
2727

@@ -74,7 +74,7 @@ if (!skipTs) {
7474
await syncTestPackageExports();
7575
await syncVersionsExport();
7676
}
77-
await copySkillDocs();
77+
await copyBundledDocs();
7878
await syncReadmeFromRoot();
7979

8080
async function buildNapiBinding() {
@@ -387,42 +387,32 @@ async function syncVersionsExport() {
387387
}
388388

389389
/**
390-
* Copy markdown doc files from the monorepo docs/ directory into skills/vite-plus/docs/,
391-
* preserving the relative directory structure. This keeps stable file paths for
392-
* skills routing and MCP page slugs.
390+
* Copy the docs source tree into docs/, preserving relative paths.
391+
* Generated VitePress output and installed dependencies are excluded so the package
392+
* only ships authoring sources and referenced assets.
393393
*/
394-
async function copySkillDocs() {
395-
console.log('\nCopying skill docs...');
394+
async function copyBundledDocs() {
395+
console.log('\nCopying bundled docs...');
396396

397397
const docsSourceDir = join(projectDir, '..', '..', 'docs');
398-
const docsTargetDir = join(projectDir, 'skills', 'vite-plus', 'docs');
398+
const docsTargetDir = join(projectDir, 'docs');
399399

400400
if (!existsSync(docsSourceDir)) {
401-
console.log(' Docs source directory not found, skipping skill docs copy');
401+
console.log(' Docs source directory not found, skipping docs copy');
402402
return;
403403
}
404404

405-
// Clean and recreate target directory
405+
const skipPrefixes = ['node_modules', '.vitepress/cache', '.vitepress/dist'];
406406
await rm(docsTargetDir, { recursive: true, force: true });
407-
await mkdir(docsTargetDir, { recursive: true });
408-
409-
// Find all markdown files recursively and copy them with their relative paths.
410-
const mdFiles = globSync('**/*.md', { cwd: docsSourceDir }).filter(
411-
(f) => !f.includes('node_modules') && f !== 'index.md',
412-
);
413-
// eslint-disable-next-line unicorn/no-array-sort -- sorted traversal keeps output deterministic
414-
mdFiles.sort();
415-
416-
let copied = 0;
417-
for (const relPath of mdFiles) {
418-
const sourcePath = join(docsSourceDir, relPath);
419-
const targetPath = join(docsTargetDir, relPath);
420-
await mkdir(dirname(targetPath), { recursive: true });
421-
await copyFile(sourcePath, targetPath);
422-
copied++;
423-
}
407+
await cp(docsSourceDir, docsTargetDir, {
408+
recursive: true,
409+
filter: (src) => {
410+
const rel = relative(docsSourceDir, src).replaceAll('\\', '/');
411+
return !skipPrefixes.some((prefix) => rel === prefix || rel.startsWith(`${prefix}/`));
412+
},
413+
});
424414

425-
console.log(` Copied ${copied} doc files to skills/vite-plus/docs/ (with paths preserved)`);
415+
console.log(' Copied docs to docs/ (with paths preserved)');
426416
}
427417

428418
async function syncReadmeFromRoot() {

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"binding/index.d.ts",
2929
"binding/index.js",
3030
"dist/test",
31+
"docs",
3132
"rules",
32-
"skills",
3333
"templates"
3434
],
3535
"type": "module",

packages/cli/skills/vite-plus/SKILL.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)