{"draft":null,"from":97,"to":318,"files":[{"path":"scripts/check-changed.mjs","added":25,"removed":5,"diff":"--- a/scripts/check-changed.mjs\n+++ b/scripts/check-changed.mjs\n@@ -15,10 +15,10 @@\n // A change to setup (package.json, the lockfile, tsconfig.json, abso.json, biome.json) runs the full check.\n import { spawn, spawnSync } from \"node:child_process\";\n import { mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from \"node:fs\";\n+import { createRequire } from \"node:module\";\n import { availableParallelism } from \"node:os\";\n import { dirname, extname, join, matchesGlob, relative, resolve, sep } from \"node:path\";\n import { fileURLToPath } from \"node:url\";\n-import ts from \"typescript\";\n \n const root = resolve(dirname(fileURLToPath(import.meta.url)), \"..\");\n \n@@ -26,12 +26,18 @@\n const TESTS = [\n \t{\n \t\tcwd: \".\",\n-\t\tglobs: [\"src/**/*.test.ts\", \"worker/project/**/*.test.ts\", \"client/test/**/*.test.ts\", \"scripts/**/*.test.ts\"],\n+\t\tglobs: [\n+\t\t\t\"src/**/*.test.ts\",\n+\t\t\t\"worker/project/**/*.test.ts\",\n+\t\t\t\"client/test/**/*.test.ts\",\n+\t\t\t\"scripts/**/*.test.ts\",\n+\t\t\t\"server/test/**/*.test.ts\",\n+\t\t],\n \t\targs: [\"--import\", \"./client/test/setup.ts\"],\n \t},\n ];\n /** Typechecks: a tsconfig, from the repo root. */\n-const TYPECHECKS = [{ tsconfig: \"tsconfig.json\" }];\n+const TYPECHECKS = [{ tsconfig: \"tsconfig.json\" }, { tsconfig: \"server/tsconfig.json\" }];\n /** Files whose change can reach anything: the full check runs instead. */\n const SETUP = [\n \t\"**/package.json\",\n@@ -118,6 +124,20 @@\n \treturn [...files].filter(Boolean);\n }\n \n+/**\n+ * A tsconfig's JSON. Plain JSON is read as it is; one with comments goes through TypeScript's reader, loaded\n+ * only then, since loading TypeScript takes seconds on a busy machine.\n+ */\n+function readTsconfig(path) {\n+\tconst text = readFileSync(path, \"utf8\");\n+\ttry {\n+\t\treturn JSON.parse(text);\n+\t} catch {\n+\t\tconst ts = createRequire(join(root, \"package.json\"))(\"typescript\");\n+\t\treturn ts.parseConfigFileTextToJson(path, text).config ?? {};\n+\t}\n+}\n+\n /** What the changed files reach: test files to run per test group, tsconfigs to check, files for biome. */\n export function plan(changed, files = allFiles()) {\n \tconst known = new Set(files);\n@@ -146,7 +166,7 @@\n \t\tif (t) t.files.push(t.cwd === \".\" ? f : f.slice(t.cwd.length + 1));\n \t}\n \tconst typechecks = TYPECHECKS.filter((c) => {\n-\t\tconst cfg = ts.readConfigFile(join(root, c.tsconfig), (p) => readFileSync(p, \"utf8\")).config ?? {};\n+\t\tconst cfg = readTsconfig(join(root, c.tsconfig));\n \t\tconst dir = posix(dirname(c.tsconfig));\n \t\tconst inc = (cfg.include ?? [\"**/*\"]).map((g) => posix(join(dir, g)));\n \t\tconst exc = (cfg.exclude ?? []).map((g) => posix(join(dir, g)));\n@@ -232,7 +252,7 @@\n \tconsole.log(\"\");\n \tfor (const r of results)\n \t\tconsole.log(`${r.code === 0 ? \"ok  \" : \"FAIL\"} ${(r.ms / 1000).toFixed(1).padStart(6)} s  ${r.name}`);\n-\tconsole.log(`${((Date.now() - started) / 1000).toFixed(1)} s in all. The full check runs when you publish.`);\n+\tconsole.log(`${((Date.now() - started) / 1000).toFixed(1)} s in all. The full check runs when you push.`);\n \tif (results.some((r) => r.code !== 0)) process.exitCode = 1;\n }\n "}],"unmatched":[]}