mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
22 lines
719 B
JavaScript
22 lines
719 B
JavaScript
#!/usr/bin/env node
|
|
// Regenerate schemas/permissions.schema.json from the zod source of truth.
|
|
// Run via `pnpm run gen:schema`. Never edit the JSON by hand — a parity test
|
|
// (test/config-schema.test.ts) fails if the committed file drifts from this.
|
|
|
|
import { writeFileSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { buildPermissionsJsonSchema } from "../src/config-schema.ts";
|
|
|
|
const outputPath = join(
|
|
dirname(fileURLToPath(import.meta.url)),
|
|
"..",
|
|
"schemas",
|
|
"permissions.schema.json",
|
|
);
|
|
|
|
const json = `${JSON.stringify(buildPermissionsJsonSchema(), null, 2)}\n`;
|
|
writeFileSync(outputPath, json);
|
|
console.log(`Wrote ${outputPath}`);
|