Add json schema files for the layout-config.json

This commit is contained in:
Pieter Vander Vennet 2021-11-07 17:17:48 +01:00
parent bb283b59a4
commit e15ec387a2
25 changed files with 7340 additions and 0 deletions

14
scripts/fixSchemas.ts Normal file
View file

@ -0,0 +1,14 @@
import ScriptUtils from "./ScriptUtils";
import {readFileSync, writeFileSync} from "fs";
const allSchemas = ScriptUtils.readDirRecSync("./Docs/Schemas").filter(pth => pth.endsWith("JSC.ts"))
for (const path of allSchemas) {
const dir = path.substring(0, path.lastIndexOf("/"))
const name = path.substring(path.lastIndexOf("/"), path.length - "JSC.ts".length)
let content = readFileSync(path, "UTF-8")
content = content.substring("export default ".length)
let parsed = JSON.parse(content)
parsed["additionalProperties"] = false
writeFileSync(dir+"/"+name+".schema.json", JSON.stringify(parsed, null, " "), "UTF8")
}