build(test): enable tsc incremental for the typecheck

tsc --noEmit supports --incremental in TS >=5.6: it emits a .tsbuildinfo
(ignored via *.tsbuildinfo) and reuses it across runs, halving the
per-check cost (0.74s -> ~0.35s) on every pnpm test since vitest runs the
typecheck first. Still catches injected src errors (verified).

Vitest's experimental.fsModuleCache was measured and rejected: cold runs
pay a ~23MB write with no gain, warm runs sit inside the run-to-run noise
band, and caching transformed modules conflicts with the suite's stated
contract that specs import src/ directly so coverage reflects what ships.
This commit is contained in:
bowenliang123 committed 2026-10-08 01:39:30 +08:00
1 parent 5e6a5b862c
commit b784fd8c32
1 file changed
+1 -1
+1 -1
View File
@@ -44,7 +44,7 @@
"watch": "bash scripts/watch.sh",
"web": "bash scripts/web.sh",
"register": "bash scripts/register.sh",
"typecheck": "tsc --noEmit -p tsconfig.tests.json",
"typecheck": "tsc --noEmit -p tsconfig.tests.json --incremental",
"test": "pnpm run typecheck && vitest run --coverage",
"coverage": "vitest run --coverage",
"release": "bash scripts/publish.sh",