mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
build: Prettify schema.json using the correct config (#15637)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user