Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
/**
* CI check: fail if any `<id>.select.ts` has drifted from the content that
* `gen-crypto-selects.ts` would write given the current `crypto.config.ts`
* and primitive-id registry.
*/
import { existsSync, readFileSync } from "node:fs";
import { plan } from "./gen-crypto-selects.js";
async function main(): Promise<void> {
const stale: string[] = [];
const missing: string[] = [];
for (const p of plan()) {
if (!existsSync(p.path)) {
missing.push(p.path);
continue;
}
const current = readFileSync(p.path, "utf8");
if (current !== p.contents) {
stale.push(p.path);
}
}
if (missing.length > 0 || stale.length > 0) {
console.error("crypto-selects check FAILED");
if (missing.length > 0) {
console.error(" missing generated files:");
for (const m of missing) console.error(` ${m}`);
}
if (stale.length > 0) {
console.error(" stale / out-of-date generated files:");
for (const s of stale) console.error(` ${s}`);
}
console.error(
"Run `bun scripts/gen-crypto-selects.ts` and commit the result."
);
process.exit(1);
}
console.log("crypto-selects: OK");
}
if (import.meta.main) {
await main();
}