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:
parent
bc3a0995d7
commit
c5bb562f73
2 changed files with 651 additions and 716 deletions
1360
schema.json
1360
schema.json
File diff suppressed because it is too large
Load diff
|
|
@ -3,6 +3,7 @@
|
||||||
import { exec } from "child_process";
|
import { exec } from "child_process";
|
||||||
import { readFileSync, writeFileSync } from "fs";
|
import { readFileSync, writeFileSync } from "fs";
|
||||||
import { promisify } from "util";
|
import { promisify } from "util";
|
||||||
|
import prettier from "prettier";
|
||||||
|
|
||||||
const execAsync = promisify(exec);
|
const execAsync = promisify(exec);
|
||||||
|
|
||||||
|
|
@ -31,7 +32,9 @@ async function generate(): Promise<string> {
|
||||||
const { stdout } = await execAsync(
|
const { stdout } = await execAsync(
|
||||||
`npx typescript-json-schema --defaultNumberType integer --required --skipLibCheck "${SCHEMA_TS}" "*"`,
|
`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> {
|
async function main(): Promise<void> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue