chore: format schema.json with prettier in generator

Wire prettier into scripts/generate-schema.ts so the generated schema.json
matches the repo's prettier config, fixing the failing `format:check` CI job.
Regenerated schema.json to apply the formatting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Sam Morrow 2026-05-18 15:50:17 +02:00
commit c5bb562f73
No known key found for this signature in database
2 changed files with 651 additions and 716 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
import { exec } from "child_process";
import { readFileSync, writeFileSync } from "fs";
import { promisify } from "util";
import prettier from "prettier";
const execAsync = promisify(exec);
@ -31,7 +32,9 @@ async function generate(): Promise<string> {
const { stdout } = await execAsync(
`npx typescript-json-schema --defaultNumberType integer --required --skipLibCheck "${SCHEMA_TS}" "*"`,
);
return applyJsonSchema202012Transformations(stdout).trim() + "\n";
const transformed = applyJsonSchema202012Transformations(stdout);
const config = (await prettier.resolveConfig(SCHEMA_JSON)) ?? {};
return prettier.format(transformed, { ...config, filepath: SCHEMA_JSON });
}
async function main(): Promise<void> {