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,36 @@
/**
* Spec-conformance test for `openspec/specs/crypto-utils/spec.md` —
* "No vendored code" requirement. Pins the structural invariant that
* `src/vendored/` does not exist anywhere in this package.
*/
import { existsSync, readdirSync, statSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "@suaveplan/testing/runner";
const HERE = dirname(fileURLToPath(import.meta.url));
function* walk(dir: string): Generator<string> {
for (const entry of readdirSync(dir)) {
const p = join(dir, entry);
const s = statSync(p);
if (s.isDirectory()) {
yield p;
yield* walk(p);
}
}
}
describe("crypto-utils — no vendored code", () => {
it("src/ contains no vendored directory", { timeout: 5000 }, () => {
const srcDir = HERE; // already inside src/
expect(existsSync(srcDir)).toBe(true);
const offenders: string[] = [];
for (const dir of walk(srcDir)) {
if (dir.endsWith("/vendored") || dir.endsWith("\\vendored")) {
offenders.push(dir);
}
}
expect(offenders).toEqual([]);
});
});