Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 97 to 318

Compare

+25 −5 in 5 places
Lines 15–24 at 318 (were 15–24 at 97)
1515// A change to setup (package.json, the lockfile, tsconfig.json, abso.json, biome.json) runs the full check.
1616import { spawn, spawnSync } from "node:child_process";
1717import { mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
18+import { createRequire } from "node:module";
1819import { availableParallelism } from "node:os";
1920import { dirname, extname, join, matchesGlob, relative, resolve, sep } from "node:path";
2021import { fileURLToPath } from "node:url";
21−import ts from "typescript";
2222
2323const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
2424
Lines 26–43 at 318 (were 26–37 at 97)
2626const TESTS = [
2727 {
2828 cwd: ".",
29− globs: ["src/**/*.test.ts", "worker/project/**/*.test.ts", "client/test/**/*.test.ts", "scripts/**/*.test.ts"],
29+ globs: [
30+ "src/**/*.test.ts",
31+ "worker/project/**/*.test.ts",
32+ "client/test/**/*.test.ts",
33+ "scripts/**/*.test.ts",
34+ "server/test/**/*.test.ts",
35+ ],
3036 args: ["--import", "./client/test/setup.ts"],
3137 },
3238];
3339/** Typechecks: a tsconfig, from the repo root. */
34−const TYPECHECKS = [{ tsconfig: "tsconfig.json" }];
40+const TYPECHECKS = [{ tsconfig: "tsconfig.json" }, { tsconfig: "server/tsconfig.json" }];
3541/** Files whose change can reach anything: the full check runs instead. */
3642const SETUP = [
3743 "**/package.json",
Lines 124–143 at 318 (were 118–123 at 97)
118124 return [...files].filter(Boolean);
119125}
120126
127+/**
128+ * A tsconfig's JSON. Plain JSON is read as it is; one with comments goes through TypeScript's reader, loaded
129+ * only then, since loading TypeScript takes seconds on a busy machine.
130+ */
131+function readTsconfig(path) {
132+ const text = readFileSync(path, "utf8");
133+ try {
134+ return JSON.parse(text);
135+ } catch {
136+ const ts = createRequire(join(root, "package.json"))("typescript");
137+ return ts.parseConfigFileTextToJson(path, text).config ?? {};
138+ }
139+}
121141/** What the changed files reach: test files to run per test group, tsconfigs to check, files for biome. */
122142export function plan(changed, files = allFiles()) {
123143 const known = new Set(files);
Lines 166–172 at 318 (were 146–152 at 97)
146166 if (t) t.files.push(t.cwd === "." ? f : f.slice(t.cwd.length + 1));
147167 }
148168 const typechecks = TYPECHECKS.filter((c) => {
149− const cfg = ts.readConfigFile(join(root, c.tsconfig), (p) => readFileSync(p, "utf8")).config ?? {};
169+ const cfg = readTsconfig(join(root, c.tsconfig));
150170 const dir = posix(dirname(c.tsconfig));
151171 const inc = (cfg.include ?? ["**/*"]).map((g) => posix(join(dir, g)));
152172 const exc = (cfg.exclude ?? []).map((g) => posix(join(dir, g)));
Lines 252–258 at 318 (were 232–238 at 97)
232252 console.log("");
233253 for (const r of results)
234254 console.log(`${r.code === 0 ? "ok " : "FAIL"} ${(r.ms / 1000).toFixed(1).padStart(6)} s ${r.name}`);
235− console.log(`${((Date.now() - started) / 1000).toFixed(1)} s in all. The full check runs when you publish.`);
255+ console.log(`${((Date.now() - started) / 1000).toFixed(1)} s in all. The full check runs when you push.`);
236256 if (results.some((r) => r.code !== 0)) process.exitCode = 1;
237257}
238258
MCP
compare on this site's /mcp
CLI
abso diff 97 318 scripts/check-changed.mjs --json
JSON
/christopher/abso-core/compare/97..318?file=scripts%2Fcheck-changed.mjs&format=json