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": { "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.", "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": [ "enum": ["dark", "light"],
"dark",
"light"
],
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["src"],
"src"
],
"type": "object" "type": "object"
}, },
"Input": { "Input": {
@ -65,12 +60,7 @@
}, },
"format": { "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.", "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": [ "enum": ["boolean", "filepath", "number", "string"],
"boolean",
"filepath",
"number",
"string"
],
"type": "string" "type": "string"
}, },
"isRequired": { "isRequired": {
@ -112,12 +102,7 @@
}, },
"format": { "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.", "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": [ "enum": ["boolean", "filepath", "number", "string"],
"boolean",
"filepath",
"number",
"string"
],
"type": "string" "type": "string"
}, },
"isRequired": { "isRequired": {
@ -166,12 +151,7 @@
}, },
"format": { "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.", "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": [ "enum": ["boolean", "filepath", "number", "string"],
"boolean",
"filepath",
"number",
"string"
],
"type": "string" "type": "string"
}, },
"isRequired": { "isRequired": {
@ -202,9 +182,7 @@
"type": "object" "type": "object"
} }
}, },
"required": [ "required": ["name"],
"name"
],
"type": "object" "type": "object"
}, },
"MetaObject": { "MetaObject": {
@ -231,12 +209,7 @@
}, },
"format": { "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.", "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": [ "enum": ["boolean", "filepath", "number", "string"],
"boolean",
"filepath",
"number",
"string"
],
"type": "string" "type": "string"
}, },
"isRepeated": { "isRepeated": {
@ -275,10 +248,7 @@
"type": "object" "type": "object"
} }
}, },
"required": [ "required": ["name", "type"],
"name",
"type"
],
"type": "object" "type": "object"
}, },
"Package": { "Package": {
@ -344,11 +314,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["identifier", "registryType", "transport"],
"identifier",
"registryType",
"transport"
],
"type": "object" "type": "object"
}, },
"PackageTransport": { "PackageTransport": {
@ -385,12 +351,7 @@
}, },
"format": { "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.", "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": [ "enum": ["boolean", "filepath", "number", "string"],
"boolean",
"filepath",
"number",
"string"
],
"type": "string" "type": "string"
}, },
"isRepeated": { "isRepeated": {
@ -429,9 +390,7 @@
"type": "object" "type": "object"
} }
}, },
"required": [ "required": ["type"],
"type"
],
"type": "object" "type": "object"
}, },
"Remote": { "Remote": {
@ -453,10 +412,7 @@
}, },
"type": { "type": {
"description": "The transport type for this remote endpoint.", "description": "The transport type for this remote endpoint.",
"enum": [ "enum": ["sse", "streamable-http"],
"sse",
"streamable-http"
],
"type": "string" "type": "string"
}, },
"url": { "url": {
@ -472,10 +428,7 @@
"type": "object" "type": "object"
} }
}, },
"required": [ "required": ["type", "url"],
"type",
"url"
],
"type": "object" "type": "object"
}, },
"Repository": { "Repository": {
@ -499,10 +452,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["source", "url"],
"source",
"url"
],
"type": "object" "type": "object"
}, },
"Server": { "Server": {
@ -573,12 +523,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["$schema", "description", "name", "version"],
"$schema",
"description",
"name",
"version"
],
"type": "object" "type": "object"
}, },
"ServerCard": { "ServerCard": {
@ -642,12 +587,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["$schema", "description", "name", "version"],
"$schema",
"description",
"name",
"version"
],
"type": "object" "type": "object"
}, },
"SsePackageTransport": { "SsePackageTransport": {
@ -670,10 +610,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["type", "url"],
"type",
"url"
],
"type": "object" "type": "object"
}, },
"StdioTransport": { "StdioTransport": {
@ -684,9 +621,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["type"],
"type"
],
"type": "object" "type": "object"
}, },
"StreamableHttpPackageTransport": { "StreamableHttpPackageTransport": {
@ -709,10 +644,7 @@
"type": "string" "type": "string"
} }
}, },
"required": [ "required": ["type", "url"],
"type",
"url"
],
"type": "object" "type": "object"
} }
} }

View file

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