Skip to content

Commit df960b7

Browse files
committed
Fix BE build
1 parent 34745cc commit df960b7

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

projects/backend/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Api_Error, Api_GetProject } from '../meta/api';
88
import { Config, configSchema } from '../meta/config';
99
import { loadJson } from './load-json';
1010
import { saveJson } from './save-json';
11-
import betterAjvErrors = require('better-ajv-errors');
11+
import betterAjvErrors from 'better-ajv-errors';
1212

1313
const cli = meow(`
1414
📜 ngxe
@@ -44,7 +44,7 @@ const ajv = new Ajv({
4444
useDefaults: true,
4545
});
4646
const validate = ajv.compile(configSchema);
47-
if (!validate(config)) {
47+
if (!validate(config) && validate.errors) {
4848
console.log(betterAjvErrors(configSchema, config, validate.errors));
4949
process.exit(1);
5050
}

projects/backend/load-json.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'fs';
33
import { resolve } from 'path';
44
import { configSchema } from '../meta/config';
55
import { JsonFile, jsonFileSchema } from '../meta/formats';
6-
import betterAjvErrors = require('better-ajv-errors');
6+
import betterAjvErrors from 'better-ajv-errors';
77

88
export function loadJson({path, shouldExist = true, forceLocale}: {
99
path: string;
@@ -25,7 +25,7 @@ export function loadJson({path, shouldExist = true, forceLocale}: {
2525

2626
const ajv = new Ajv();
2727
const validate = ajv.compile(jsonFileSchema);
28-
if (!validate(json)) {
28+
if (!validate(json) && validate.errors) {
2929
const errors = betterAjvErrors(configSchema, json, validate.errors, {format: 'js'});
3030
throw new Error(`Schema errors: ${errors ? errors.map(e => e.error) : 'NO_DATA'}`);
3131
}

projects/backend/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"strictBindCallApply": true,
1515
"strictNullChecks": true,
1616
"strictFunctionTypes": false,
17-
"strictPropertyInitialization": true
17+
"strictPropertyInitialization": true,
18+
"skipLibCheck": true
1819
},
1920
"exclude": [
2021
"node_modules",

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"target": "es2015",
1818
"module": "es2020",
1919
"resolveJsonModule": true,
20+
"skipLibCheck": true,
2021
"lib": [
2122
"es2020",
2223
"dom"

0 commit comments

Comments
 (0)