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,42 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "@suaveplan/testing/runner";
const pkg = JSON.parse(
readFileSync(resolve(import.meta.dirname, "../package.json"), "utf-8")
) as Record<string, unknown>;
describe("dep-graph", () => {
it("has sideEffects: false", { timeout: 5000 }, () => {
expect(pkg["sideEffects"]).toBe(false);
});
it("has no disallowed @suaveplan/* runtime deps (only error, types, events, diff)", {
timeout: 5000,
}, () => {
const deps = Object.keys(
(pkg["dependencies"] as Record<string, string>) ?? {}
);
const suaveDeps = deps.filter((d) => d.startsWith("@suaveplan/"));
const allowed = new Set([
"@suaveplan/error",
"@suaveplan/types",
"@suaveplan/events",
"@suaveplan/diff",
]);
for (const dep of suaveDeps) {
expect(allowed.has(dep), `unexpected dep: ${dep}`).toBe(true);
}
});
it("workspace deps use workspace:^ range", { timeout: 5000 }, () => {
const deps = (pkg["dependencies"] as Record<string, string>) ?? {};
for (const [name, version] of Object.entries(deps)) {
if (name.startsWith("@suaveplan/")) {
expect(version, `${name} should use workspace:^`).toBe(
"workspace:^"
);
}
}
});
});