{"draft":null,"from":97,"to":98,"files":[{"path":"scripts/check-changed.mjs","added":16,"removed":2,"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@@ -118,6 +118,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 +160,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)));"}],"unmatched":[]}