diff --git a/packages/@n8n/extension-sdk/schema.json b/packages/@n8n/extension-sdk/schema.json index a1969ae6f8..b4cc9b083b 100644 --- a/packages/@n8n/extension-sdk/schema.json +++ b/packages/@n8n/extension-sdk/schema.json @@ -1,68 +1,29 @@ { "type": "object", "properties": { - "name": { - "type": "string" - }, - "displayName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "publisher": { - "type": "string" - }, - "version": { - "type": "string" - }, - "categories": { - "type": "array", - "items": { - "type": "string" - } - }, + "name": { "type": "string" }, + "displayName": { "type": "string" }, + "description": { "type": "string" }, + "publisher": { "type": "string" }, + "version": { "type": "string" }, + "categories": { "type": "array", "items": { "type": "string" } }, "entry": { "type": "object", - "properties": { - "backend": { - "type": "string" - }, - "frontend": { - "type": "string" - } - }, + "properties": { "backend": { "type": "string" }, "frontend": { "type": "string" } }, "required": ["backend", "frontend"], "additionalProperties": false }, - "minSDKVersion": { - "type": "string" - }, + "minSDKVersion": { "type": "string" }, "permissions": { "type": "object", "properties": { - "frontend": { - "type": "array", - "items": { - "type": "string" - } - }, - "backend": { - "type": "array", - "items": { - "type": "string" - } - } + "frontend": { "type": "array", "items": { "type": "string" } }, + "backend": { "type": "array", "items": { "type": "string" } } }, "required": ["frontend", "backend"], "additionalProperties": false }, - "events": { - "type": "array", - "items": { - "type": "string" - } - }, + "events": { "type": "array", "items": { "type": "string" } }, "extends": { "type": "object", "properties": { @@ -71,11 +32,7 @@ "properties": { "workflows": { "type": "object", - "properties": { - "header": { - "type": "string" - } - }, + "properties": { "header": { "type": "string" } }, "required": ["header"], "additionalProperties": false } diff --git a/packages/@n8n/extension-sdk/scripts/create-json-schema.ts b/packages/@n8n/extension-sdk/scripts/create-json-schema.ts index be2043a484..990b25aab1 100644 --- a/packages/@n8n/extension-sdk/scripts/create-json-schema.ts +++ b/packages/@n8n/extension-sdk/scripts/create-json-schema.ts @@ -3,7 +3,7 @@ import { zodToJsonSchema } from 'zod-to-json-schema'; import { writeFile } from 'fs/promises'; import { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; -import { format } from 'prettier'; +import { format, resolveConfig } from 'prettier'; const __dirname = dirname(fileURLToPath(import.meta.url)); const rootDir = resolve(__dirname, '..'); @@ -15,7 +15,8 @@ const jsonSchema = zodToJsonSchema(extensionManifestSchema, { (async () => { const filepath = 'schema.json'; - const schema = JSON.stringify(jsonSchema, null, 2); - const formattedSchema = await format(schema, { filepath: filepath }); + const schema = JSON.stringify(jsonSchema); + const config = await resolveConfig(filepath); + const formattedSchema = await format(schema, { ...config, filepath }); await writeFile(resolve(rootDir, filepath), formattedSchema); })();