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,45 @@
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "@suaveplan/testing/runner";
describe("dep-graph", () => {
it("runtime deps are locked to the approved set", {
timeout: 5000,
}, () => {
const pkg = JSON.parse(
readFileSync(join(__dirname, "..", "package.json"), "utf8")
) as { dependencies?: Record<string, string> };
const runtime = Object.keys(pkg.dependencies ?? {}).sort();
expect(runtime).toEqual([
"@suaveplan/crypto-cipher",
"@suaveplan/crypto-curve",
"@suaveplan/crypto-hash",
"@suaveplan/crypto-utils",
"@suaveplan/error",
"@suaveplan/types",
"tslib",
"zod",
]);
});
it("no peerDependencies", { timeout: 5000 }, () => {
const pkg = JSON.parse(
readFileSync(join(__dirname, "..", "package.json"), "utf8")
) as { peerDependencies?: Record<string, string> };
expect(pkg.peerDependencies).toBeUndefined();
});
it("does not depend on any @noble/* package directly", {
timeout: 5000,
}, () => {
// Every @noble/* import must go through one of the @suaveplan/crypto-*
// selector packages. check-crypto-selects enforces the impl routing.
const pkg = JSON.parse(
readFileSync(join(__dirname, "..", "package.json"), "utf8")
) as { dependencies?: Record<string, string> };
const nobleDeps = Object.keys(pkg.dependencies ?? {}).filter((d) =>
d.startsWith("@noble/")
);
expect(nobleDeps).toEqual([]);
});
});