Add D002 (malformed attribute blocks), R004 (skipped declare rows), and V001-V005 (CSV data files). CSV checks run once per referenced file and also cover inline spark-table bodies. Generate docs/reference.md from the known.ts catalog via npm run gen:reference, and add drift guards asserting the catalog matches the customElement call sites and the committed reference.
22 lines
706 B
JavaScript
22 lines
706 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Regenerate `docs/reference.md` from the `known.ts` catalog.
|
|
*
|
|
* npm run gen:reference
|
|
* npm run gen:reference -- --out ~/.agents/skills/tttk-authoring/reference.md
|
|
*/
|
|
|
|
import { mkdirSync, writeFileSync } from "fs";
|
|
import { dirname, resolve } from "path";
|
|
import { renderReference } from "../src/cli/validate/reference.js";
|
|
|
|
function argValue(flag: string): string | undefined {
|
|
const index = process.argv.indexOf(flag);
|
|
return index >= 0 ? process.argv[index + 1] : undefined;
|
|
}
|
|
|
|
const out = resolve(argValue("--out") ?? "docs/reference.md");
|
|
mkdirSync(dirname(out), { recursive: true });
|
|
writeFileSync(out, renderReference(), "utf-8");
|
|
console.log(`wrote ${out}`);
|