Move schemas to public in order to use it on runtime
This commit is contained in:
parent
5411684a0f
commit
4678471761
7 changed files with 2 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ export default abstract class UnzipData {
|
|||
path.resolve(__dirname, "../src/assets/data.json"),
|
||||
{ encoding: "utf8", flag: "r" }
|
||||
);
|
||||
const jsonSchemaPath = "schemas";
|
||||
const jsonSchemaPath = "public/schemas";
|
||||
|
||||
if (!UnzipData.validateAgainstJsonSchema(jsonSchemaPath, jsonData)) {
|
||||
log.warn(`Data for file ${UnzipData.zipFileToUse} is not valid JSON`);
|
||||
|
|
@ -88,7 +88,7 @@ export default abstract class UnzipData {
|
|||
try {
|
||||
const schemaList = fs.readdirSync(jsonSchemaPath)
|
||||
.filter(schemaPath => schemaPath.endsWith(".schema.json"))
|
||||
.map(schemaPath => JSON.parse(fs.readFileSync(`schemas/${schemaPath}`, { encoding: "utf8", flag: "r" })) as Record<string,string|any>);
|
||||
.map(schemaPath => JSON.parse(fs.readFileSync(`${jsonSchemaPath}/${schemaPath}`, { encoding: "utf8", flag: "r" })) as Record<string,string|any>);
|
||||
const appSchemaIndex = schemaList.findIndex((schema) => String(schema.$id).endsWith("app.schema.json"));
|
||||
if (appSchemaIndex === -1) {
|
||||
throw new Error("app.schema.json not found");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue