Files
vue-tui/vite.config.ts
T
Yunfei He bdadea0d02 perf(ci): parallelize verification via a vp run.tasks graph
Replace ci.yml's five serial steps with a single `vp run ci` whose graph lives
in vite.config.ts (run.tasks). The vp task runner fans out independent branches
concurrently: fmt and lint start immediately while check:type and the test
suites wait on build (their consumers resolve @vue-tui/runtime from the built
dist/*.d.mts). The wall-clock critical path becomes build -> test:pty instead
of the sum of every check.

Measured cold (no task cache, no prebuilt dist — the real CI condition): the
graph completes in ~41s vs ~60s serial, ~32% faster, with build correctly
fanned out before the type and test branches. `vp run --last-details` (and the
run summary) still pinpoints which sub-task failed.

Also set run.cache=false so neither local nor CI verification depends on any
task-cache replay. The serial `ready` script in package.json is kept for simple
local use.
2026-05-29 16:54:13 +08:00

35 lines
1.3 KiB
TypeScript

import { defineConfig } from "vite-plus";
export default defineConfig({
staged: {
"*": "vp check --fix",
},
fmt: {},
lint: { options: { typeAware: true, typeCheck: false } },
run: {
cache: false,
// `ci` is the parallel verification graph used by .github/workflows/ci.yml.
// The task runner fans out independent branches concurrently; the wall-clock
// critical path is build -> test:pty. fmt and lint have no build dependency,
// so they run immediately alongside build. check:type and the test suites
// need the built dist (@vue-tui/runtime exposes no "types" export — its
// consumers resolve types and runtime from dist/*.d.mts), so they depend on
// build. The serial `ready` script in package.json stays for simple local use.
tasks: {
"ci:build": { command: "vp run build" },
"ci:fmt": { command: "vp run check:fmt" },
"ci:lint": { command: "vp run check:lint" },
"ci:type": { command: "vp run check:type", dependsOn: ["ci:build"] },
"ci:test:integration": {
command: "vp run -r test:integration",
dependsOn: ["ci:build"],
},
"ci:test:pty": { command: "vp run -r test:pty", dependsOn: ["ci:build"] },
ci: {
command: "echo ci ok",
dependsOn: ["ci:fmt", "ci:lint", "ci:type", "ci:test:integration", "ci:test:pty"],
},
},
},
});