mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
build: Prettify schema.json before writing it (#15600)
This commit is contained in:
@@ -3,6 +3,7 @@ import { zodToJsonSchema } from 'zod-to-json-schema';
|
|||||||
import { writeFile } from 'fs/promises';
|
import { writeFile } from 'fs/promises';
|
||||||
import { dirname, resolve } from 'path';
|
import { dirname, resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
|
import { format } from 'prettier';
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
const rootDir = resolve(__dirname, '..');
|
const rootDir = resolve(__dirname, '..');
|
||||||
@@ -13,5 +14,8 @@ const jsonSchema = zodToJsonSchema(extensionManifestSchema, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
await writeFile(resolve(rootDir, 'schema.json'), JSON.stringify(jsonSchema, null, 2));
|
const filepath = 'schema.json';
|
||||||
|
const schema = JSON.stringify(jsonSchema, null, 2);
|
||||||
|
const formattedSchema = await format(schema, { filepath: filepath });
|
||||||
|
await writeFile(resolve(rootDir, filepath), formattedSchema);
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user