CLAUDE.md gains the header-content, module-store and saved-views rows. docs/development.md says what a new page is and which tests hold it. components/ui/README.md names every file in the directory, and a contract test keeps it that way: seventeen had slipped in unlisted. copyItems' comment still claimed it was a feature file.
21 lines
1005 B
TypeScript
21 lines
1005 B
TypeScript
import { readdirSync, readFileSync } from "node:fs";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
// components/ui/README.md is how the platform layer is found: "reuse before build" only works if a
|
|
// primitive is listed where the next author looks. A dozen files had slipped in unlisted, so every
|
|
// source file in the directory must be named there, in backticks, by its file name.
|
|
const UI = resolve(dirname(fileURLToPath(import.meta.url)), "../components/ui");
|
|
|
|
describe("the platform layer's README", () => {
|
|
it("names every file in components/ui", () => {
|
|
const readme = readFileSync(resolve(UI, "README.md"), "utf8");
|
|
const unlisted = readdirSync(UI)
|
|
.filter((f) => /\.tsx?$/.test(f) && !/\.test\.tsx?$/.test(f) && !f.endsWith(".testkit.ts"))
|
|
.map((f) => f.replace(/\.tsx?$/, ""))
|
|
.filter((name) => !readme.includes("`" + name + "`"));
|
|
expect(unlisted).toEqual([]);
|
|
});
|
|
});
|