Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line breaks to precompiled schemas so that git can merge changes in the output #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions precompile-schemas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down