From 9df92b7f92baaffe7e64cf47bca136ba897a2d6f Mon Sep 17 00:00:00 2001 From: Karlis Gangis Date: Wed, 22 Dec 2021 14:52:12 +0200 Subject: [PATCH] Add line breaks to precompiled schemas so that git can merge changes in the output --- precompile-schemas/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/precompile-schemas/index.js b/precompile-schemas/index.js index 9999931..ef519c8 100644 --- a/precompile-schemas/index.js +++ b/precompile-schemas/index.js @@ -8,6 +8,7 @@ const glob = require("glob"); const findCommonDir = require("commondir"); const { pathToFileURL, fileURLToPath } = require("url"); const processSchema = require("../lib/process-schema"); +const prettier = require("prettier"); const terser = require("terser"); const { default: Ajv, _, Name } = require("ajv"); const standaloneCode = require("ajv/dist/standalone").default; @@ -126,6 +127,13 @@ const postprocess = async (code) => { }) ).code; + // format to enable diff merging + code = prettier.format(code, { + parser: "typescript", + printWidth: 200, + tabWidth: 0, + }); + // banner code = `/* * This file was automatically generated.