From b784fd8c3263abae365270b1a129f756b9ae2a10 Mon Sep 17 00:00:00 2001 From: bowenliang123 Date: Thu, 8 Oct 2026 01:39:30 +0800 Subject: [PATCH] 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. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 99a3f56..9fc7d0d 100644 --- a/package.json +++ b/package.json @@ -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",