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

View file

@ -33,16 +33,11 @@
},
"theme": {
"description": "Optional specifier for the theme this icon is designed for. `\"light\"` indicates\nthe icon is designed to be used with a light background, and `\"dark\"` indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
"enum": [
"dark",
"light"
],
"enum": ["dark", "light"],
"type": "string"
}
},
"required": [
"src"
],
"required": ["src"],
"type": "object"
},
"Input": {
@ -65,12 +60,7 @@
},
"format": {
"description": "Specifies the input format. `\"filepath\"` should be interpreted as a file\non the user's filesystem. When the input is converted to a string,\nbooleans should be represented by `\"true\"`/`\"false\"`, and numbers by\ndecimal values.",
"enum": [
"boolean",
"filepath",
"number",
"string"
],
"enum": ["boolean", "filepath", "number", "string"],
"type": "string"
},
"isRequired": {
@ -112,12 +102,7 @@
},
"format": {
"description": "Specifies the input format. `\"filepath\"` should be interpreted as a file\non the user's filesystem. When the input is converted to a string,\nbooleans should be represented by `\"true\"`/`\"false\"`, and numbers by\ndecimal values.",
"enum": [
"boolean",
"filepath",
"number",
"string"
],
"enum": ["boolean", "filepath", "number", "string"],
"type": "string"
},
"isRequired": {
@ -166,12 +151,7 @@
},
"format": {
"description": "Specifies the input format. `\"filepath\"` should be interpreted as a file\non the user's filesystem. When the input is converted to a string,\nbooleans should be represented by `\"true\"`/`\"false\"`, and numbers by\ndecimal values.",
"enum": [
"boolean",
"filepath",
"number",
"string"
],
"enum": ["boolean", "filepath", "number", "string"],
"type": "string"
},
"isRequired": {
@ -202,9 +182,7 @@
"type": "object"
}
},
"required": [
"name"
],
"required": ["name"],
"type": "object"
},
"MetaObject": {
@ -231,12 +209,7 @@
},
"format": {
"description": "Specifies the input format. `\"filepath\"` should be interpreted as a file\non the user's filesystem. When the input is converted to a string,\nbooleans should be represented by `\"true\"`/`\"false\"`, and numbers by\ndecimal values.",
"enum": [
"boolean",
"filepath",
"number",
"string"
],
"enum": ["boolean", "filepath", "number", "string"],
"type": "string"
},
"isRepeated": {
@ -275,10 +248,7 @@
"type": "object"
}
},
"required": [
"name",
"type"
],
"required": ["name", "type"],
"type": "object"
},
"Package": {
@ -344,11 +314,7 @@
"type": "string"
}
},
"required": [
"identifier",
"registryType",
"transport"
],
"required": ["identifier", "registryType", "transport"],
"type": "object"
},
"PackageTransport": {
@ -385,12 +351,7 @@
},
"format": {
"description": "Specifies the input format. `\"filepath\"` should be interpreted as a file\non the user's filesystem. When the input is converted to a string,\nbooleans should be represented by `\"true\"`/`\"false\"`, and numbers by\ndecimal values.",
"enum": [
"boolean",
"filepath",
"number",
"string"
],
"enum": ["boolean", "filepath", "number", "string"],
"type": "string"
},
"isRepeated": {
@ -429,9 +390,7 @@
"type": "object"
}
},
"required": [
"type"
],
"required": ["type"],
"type": "object"
},
"Remote": {
@ -453,10 +412,7 @@
},
"type": {
"description": "The transport type for this remote endpoint.",
"enum": [
"sse",
"streamable-http"
],
"enum": ["sse", "streamable-http"],
"type": "string"
},
"url": {
@ -472,10 +428,7 @@
"type": "object"
}
},
"required": [
"type",
"url"
],
"required": ["type", "url"],
"type": "object"
},
"Repository": {
@ -499,10 +452,7 @@
"type": "string"
}
},
"required": [
"source",
"url"
],
"required": ["source", "url"],
"type": "object"
},
"Server": {
@ -573,12 +523,7 @@
"type": "string"
}
},
"required": [
"$schema",
"description",
"name",
"version"
],
"required": ["$schema", "description", "name", "version"],
"type": "object"
},
"ServerCard": {
@ -642,12 +587,7 @@
"type": "string"
}
},
"required": [
"$schema",
"description",
"name",
"version"
],
"required": ["$schema", "description", "name", "version"],
"type": "object"
},
"SsePackageTransport": {
@ -670,10 +610,7 @@
"type": "string"
}
},
"required": [
"type",
"url"
],
"required": ["type", "url"],
"type": "object"
},
"StdioTransport": {
@ -684,9 +621,7 @@
"type": "string"
}
},
"required": [
"type"
],
"required": ["type"],
"type": "object"
},
"StreamableHttpPackageTransport": {
@ -709,10 +644,7 @@
"type": "string"
}
},
"required": [
"type",
"url"
],
"required": ["type", "url"],
"type": "object"
}
}

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> {