@tramvai/cli 2.147.1 → 2.148.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  import stoppable from 'stoppable';
2
- export declare const createServer: () => import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> & stoppable.WithStop;
2
+ export declare const createServer: () => import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse> & stoppable.WithStop;
@@ -1,6 +1,6 @@
1
- export declare const SERVER_TOKEN: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> & import("stoppable").WithStop & {
1
+ export declare const SERVER_TOKEN: import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse> & import("stoppable").WithStop & {
2
2
  __type?: "base token";
3
3
  };
4
- export declare const STATIC_SERVER_TOKEN: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> & import("stoppable").WithStop & {
4
+ export declare const STATIC_SERVER_TOKEN: import("node:http").Server<typeof import("node:http").IncomingMessage, typeof import("node:http").ServerResponse> & import("stoppable").WithStop & {
5
5
  __type?: "base token";
6
6
  };
@@ -56,7 +56,7 @@ export declare const DEV_STATS_OPTIONS: {
56
56
  groupReasonsByOrigin?: boolean;
57
57
  hash?: boolean;
58
58
  ids?: boolean;
59
- logging?: boolean | "error" | "none" | "verbose" | "warn" | "info" | "log";
59
+ logging?: boolean | "error" | "log" | "none" | "verbose" | "warn" | "info";
60
60
  loggingDebug?: string | boolean | RegExp | (string | RegExp | ((value: string) => boolean))[] | ((value: string) => boolean);
61
61
  loggingTrace?: boolean;
62
62
  moduleAssets?: boolean;
@@ -62,8 +62,14 @@ class ConfigManager {
62
62
  const entry = configParameters.projects[projectName];
63
63
  configParameters.projects[projectName] = (0, merge_1.merge)(projectsConfig, entry);
64
64
  });
65
- const ajv = new ajv_1.default({ useDefaults: true });
66
- ajv.addKeyword('cli_overridable', {
65
+ const ajv = new ajv_1.default({
66
+ useDefaults: true,
67
+ allowUnionTypes: true,
68
+ strict: true,
69
+ strictSchema: false,
70
+ });
71
+ ajv.addKeyword({
72
+ keyword: 'cli_overridable',
67
73
  modifying: true,
68
74
  errors: false,
69
75
  validate(schemaValue, currentValue, propSchema) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/models/config.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,8EAAgD;AAChD,4EAA8C;AAC9C,yEAAyC;AAGzC,0DAAoE;AACpE,gEAA6D;AAC7D,0CAAuC;AACvC,+CAA2C;AAE3C,MAAa,aAAa;IAKxB,YAAY,EAAE,MAAM,EAAE,cAAc,EAAoD;QACtF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QAErC,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,CAAC,MAAM,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,WAAmB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEhD,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC5F,MAAM,IAAI,KAAK,CAAC,GAAG,WAAW,4BAA4B,CAAC,CAAC;SAC7D;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,UAAU,CAAC,WAAwB,EAAE,IAAI,GAAG,WAAW,CAAC,IAAI;QAC1D,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,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,WAAW,CAAC;qBACvC;iBACF;gBAED,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAM,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAEzC,8EAA8E;QAC9E,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC;QAE/B,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM;iBAClC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBACb,IAAI,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;gBAEtC,IAAI,KAAK,CAAC,OAAO,KAAK,uCAAuC,EAAE;oBAC7D,OAAO,IAAI,wBAAyB,KAAK,CAAC,MAAc,CAAC,kBAAkB,YAAY,CAAC;iBACzF;gBAED,OAAO,OAAO,CAAC;YACjB,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;YAEd,MAAM,IAAI,KAAK,CAAC;;;EAGpB,aAAa;CACd,CAAC,CAAC;SACE;IACH,CAAC;CACF;AA5ID,sCA4IC"}
@@ -1141,23 +1141,23 @@
1141
1141
  "dotAll": {
1142
1142
  "type": "boolean"
1143
1143
  },
1144
- "__@match@8264": {
1144
+ "__@match@8260": {
1145
1145
  "type": "object",
1146
1146
  "additionalProperties": false
1147
1147
  },
1148
- "__@replace@8266": {
1148
+ "__@replace@8262": {
1149
1149
  "type": "object",
1150
1150
  "additionalProperties": false
1151
1151
  },
1152
- "__@search@8269": {
1152
+ "__@search@8265": {
1153
1153
  "type": "object",
1154
1154
  "additionalProperties": false
1155
1155
  },
1156
- "__@split@8271": {
1156
+ "__@split@8267": {
1157
1157
  "type": "object",
1158
1158
  "additionalProperties": false
1159
1159
  },
1160
- "__@matchAll@8273": {
1160
+ "__@matchAll@8269": {
1161
1161
  "type": "object",
1162
1162
  "additionalProperties": false
1163
1163
  }
@@ -1802,23 +1802,23 @@
1802
1802
  "dotAll": {
1803
1803
  "type": "boolean"
1804
1804
  },
1805
- "__@match@8264": {
1805
+ "__@match@8260": {
1806
1806
  "type": "object",
1807
1807
  "additionalProperties": false
1808
1808
  },
1809
- "__@replace@8266": {
1809
+ "__@replace@8262": {
1810
1810
  "type": "object",
1811
1811
  "additionalProperties": false
1812
1812
  },
1813
- "__@search@8269": {
1813
+ "__@search@8265": {
1814
1814
  "type": "object",
1815
1815
  "additionalProperties": false
1816
1816
  },
1817
- "__@split@8271": {
1817
+ "__@split@8267": {
1818
1818
  "type": "object",
1819
1819
  "additionalProperties": false
1820
1820
  },
1821
- "__@matchAll@8273": {
1821
+ "__@matchAll@8269": {
1822
1822
  "type": "object",
1823
1823
  "additionalProperties": false
1824
1824
  }
@@ -2463,23 +2463,23 @@
2463
2463
  "dotAll": {
2464
2464
  "type": "boolean"
2465
2465
  },
2466
- "__@match@8264": {
2466
+ "__@match@8260": {
2467
2467
  "type": "object",
2468
2468
  "additionalProperties": false
2469
2469
  },
2470
- "__@replace@8266": {
2470
+ "__@replace@8262": {
2471
2471
  "type": "object",
2472
2472
  "additionalProperties": false
2473
2473
  },
2474
- "__@search@8269": {
2474
+ "__@search@8265": {
2475
2475
  "type": "object",
2476
2476
  "additionalProperties": false
2477
2477
  },
2478
- "__@split@8271": {
2478
+ "__@split@8267": {
2479
2479
  "type": "object",
2480
2480
  "additionalProperties": false
2481
2481
  },
2482
- "__@matchAll@8273": {
2482
+ "__@matchAll@8269": {
2483
2483
  "type": "object",
2484
2484
  "additionalProperties": false
2485
2485
  }
@@ -15,6 +15,7 @@ declare function _exports(autogeneratedSchema: any): {
15
15
  patternProperties: {
16
16
  '^[$a-zA-Z_-][0-9a-zA-Z_$-]*$': {
17
17
  if: {
18
+ type: string;
18
19
  properties: {
19
20
  type: {
20
21
  const: string;
@@ -24,6 +25,7 @@ declare function _exports(autogeneratedSchema: any): {
24
25
  then: any;
25
26
  else: {
26
27
  if: {
28
+ type: string;
27
29
  properties: {
28
30
  type: {
29
31
  const: string;
@@ -33,6 +35,7 @@ declare function _exports(autogeneratedSchema: any): {
33
35
  then: any;
34
36
  else: {
35
37
  if: {
38
+ type: string;
36
39
  properties: {
37
40
  type: {
38
41
  const: string;
@@ -18,6 +18,7 @@ module.exports = (autogeneratedSchema) => {
18
18
  patternProperties: {
19
19
  '^[$a-zA-Z_-][0-9a-zA-Z_$-]*$': {
20
20
  if: {
21
+ type: 'object',
21
22
  properties: {
22
23
  type: { const: 'application' },
23
24
  },
@@ -25,6 +26,7 @@ module.exports = (autogeneratedSchema) => {
25
26
  then: autogeneratedSchema.properties.application,
26
27
  else: {
27
28
  if: {
29
+ type: 'object',
28
30
  properties: {
29
31
  type: { const: 'module' },
30
32
  },
@@ -32,6 +34,7 @@ module.exports = (autogeneratedSchema) => {
32
34
  then: autogeneratedSchema.properties.module,
33
35
  else: {
34
36
  if: {
37
+ type: 'object',
35
38
  properties: {
36
39
  type: { const: 'child-app' },
37
40
  },
@@ -1 +1 @@
1
- {"version":3,"file":"topLevelSchema.js","sourceRoot":"","sources":["../../src/schema/topLevelSchema.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG,CAAC,mBAAmB,EAAE,EAAE;IACvC,6CAA6C;IAC7C,OAAO,mBAAmB,CAAC,OAAO,CAAC;IAEnC,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,qBAAqB;QAC5B,OAAO,EAAE,yCAAyC;QAClD,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,iBAAiB;gBACxB,aAAa,EAAE,CAAC;gBAChB,iBAAiB,EAAE;oBACjB,8BAA8B,EAAE;wBAC9B,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,EAAE,qDAAqD;wBAC5D,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/cli",
3
- "version": "2.147.1",
3
+ "version": "2.148.0",
4
4
  "description": "Cli инструмент для сборки и запуска приложений",
5
5
  "files": [
6
6
  "src",
@@ -62,7 +62,7 @@
62
62
  "@svgr/webpack": "^8.1.0",
63
63
  "@tinkoff/browserslist-config": "0.2.7",
64
64
  "@tinkoff/dippy": "0.8.15",
65
- "@tinkoff/is-modern-lib": "2.0.12",
65
+ "@tinkoff/is-modern-lib": "2.0.13",
66
66
  "@tinkoff/logger": "0.10.67",
67
67
  "@tinkoff/minicss-class-generator": "0.2.5",
68
68
  "@tinkoff/package-manager-wrapper": "0.1.9",
@@ -71,10 +71,10 @@
71
71
  "@tinkoff/utils": "^2.1.3",
72
72
  "@tinkoff/webpack-dedupe-plugin": "1.0.5",
73
73
  "@tramvai/build": "3.1.4",
74
- "@tramvai/react": "2.147.1",
74
+ "@tramvai/react": "2.148.0",
75
75
  "@tramvai/tools-check-versions": "0.4.18",
76
76
  "@tramvai/tools-migrate": "0.6.22",
77
- "ajv": "^6.12.6",
77
+ "ajv": "^8.12.0",
78
78
  "ansi-escapes": "^4.3.2",
79
79
  "autoprefixer": "^10.4.8",
80
80
  "babel-loader": "^8.2.5",
package/schema.json CHANGED
@@ -17,6 +17,7 @@
17
17
  "patternProperties": {
18
18
  "^[$a-zA-Z_-][0-9a-zA-Z_$-]*$": {
19
19
  "if": {
20
+ "type": "object",
20
21
  "properties": {
21
22
  "type": {
22
23
  "const": "application"
@@ -1162,23 +1163,23 @@
1162
1163
  "dotAll": {
1163
1164
  "type": "boolean"
1164
1165
  },
1165
- "__@match@8264": {
1166
+ "__@match@8260": {
1166
1167
  "type": "object",
1167
1168
  "additionalProperties": false
1168
1169
  },
1169
- "__@replace@8266": {
1170
+ "__@replace@8262": {
1170
1171
  "type": "object",
1171
1172
  "additionalProperties": false
1172
1173
  },
1173
- "__@search@8269": {
1174
+ "__@search@8265": {
1174
1175
  "type": "object",
1175
1176
  "additionalProperties": false
1176
1177
  },
1177
- "__@split@8271": {
1178
+ "__@split@8267": {
1178
1179
  "type": "object",
1179
1180
  "additionalProperties": false
1180
1181
  },
1181
- "__@matchAll@8273": {
1182
+ "__@matchAll@8269": {
1182
1183
  "type": "object",
1183
1184
  "additionalProperties": false
1184
1185
  }
@@ -1433,6 +1434,7 @@
1433
1434
  },
1434
1435
  "else": {
1435
1436
  "if": {
1437
+ "type": "object",
1436
1438
  "properties": {
1437
1439
  "type": {
1438
1440
  "const": "module"
@@ -1831,23 +1833,23 @@
1831
1833
  "dotAll": {
1832
1834
  "type": "boolean"
1833
1835
  },
1834
- "__@match@8264": {
1836
+ "__@match@8260": {
1835
1837
  "type": "object",
1836
1838
  "additionalProperties": false
1837
1839
  },
1838
- "__@replace@8266": {
1840
+ "__@replace@8262": {
1839
1841
  "type": "object",
1840
1842
  "additionalProperties": false
1841
1843
  },
1842
- "__@search@8269": {
1844
+ "__@search@8265": {
1843
1845
  "type": "object",
1844
1846
  "additionalProperties": false
1845
1847
  },
1846
- "__@split@8271": {
1848
+ "__@split@8267": {
1847
1849
  "type": "object",
1848
1850
  "additionalProperties": false
1849
1851
  },
1850
- "__@matchAll@8273": {
1852
+ "__@matchAll@8269": {
1851
1853
  "type": "object",
1852
1854
  "additionalProperties": false
1853
1855
  }
@@ -2102,6 +2104,7 @@
2102
2104
  },
2103
2105
  "else": {
2104
2106
  "if": {
2107
+ "type": "object",
2105
2108
  "properties": {
2106
2109
  "type": {
2107
2110
  "const": "child-app"
@@ -2500,23 +2503,23 @@
2500
2503
  "dotAll": {
2501
2504
  "type": "boolean"
2502
2505
  },
2503
- "__@match@8264": {
2506
+ "__@match@8260": {
2504
2507
  "type": "object",
2505
2508
  "additionalProperties": false
2506
2509
  },
2507
- "__@replace@8266": {
2510
+ "__@replace@8262": {
2508
2511
  "type": "object",
2509
2512
  "additionalProperties": false
2510
2513
  },
2511
- "__@search@8269": {
2514
+ "__@search@8265": {
2512
2515
  "type": "object",
2513
2516
  "additionalProperties": false
2514
2517
  },
2515
- "__@split@8271": {
2518
+ "__@split@8267": {
2516
2519
  "type": "object",
2517
2520
  "additionalProperties": false
2518
2521
  },
2519
- "__@matchAll@8273": {
2522
+ "__@matchAll@8269": {
2520
2523
  "type": "object",
2521
2524
  "additionalProperties": false
2522
2525
  }
@@ -440,3 +440,86 @@ it('should populate defaults for overridable options', () => {
440
440
  }
441
441
  `);
442
442
  });
443
+
444
+ it('should throw an error if added aditional unknown property', () => {
445
+ const config: any = {
446
+ projects: {
447
+ app: {
448
+ unknownOption: 'something',
449
+ name: 'test-app',
450
+ root: 'src',
451
+ type: 'application',
452
+ output: {
453
+ client: 'assets/compiled',
454
+ },
455
+ sourceMap: false,
456
+ externals: ['test'],
457
+ fileSystemPages: { enabled: true },
458
+ experiments: {
459
+ webpack: {
460
+ backCompat: true,
461
+ },
462
+ transpilation: {
463
+ loader: {
464
+ development: 'swc',
465
+ },
466
+ },
467
+ },
468
+ dedupe: {
469
+ strategy: 'semver',
470
+ },
471
+ define: {
472
+ shared: {
473
+ 'process.env.APP_ID': 'app',
474
+ },
475
+ },
476
+ svgo: {
477
+ plugins: [
478
+ {
479
+ name: 'test-plugin',
480
+ },
481
+ ],
482
+ },
483
+ },
484
+ 'child-app': {
485
+ name: 'test-child-app',
486
+ root: 'packages/child-app',
487
+ type: 'child-app',
488
+ sourceMap: {
489
+ development: true,
490
+ },
491
+ experiments: {
492
+ transpilation: {
493
+ loader: {},
494
+ },
495
+ },
496
+ define: {
497
+ shared: {
498
+ commonProp: 'unknown',
499
+ },
500
+ production: {
501
+ 'process.env.PROD': 'true',
502
+ },
503
+ },
504
+ webpack: {
505
+ resolveAlias: {
506
+ stream: 'browser-stream',
507
+ },
508
+ provide: {
509
+ Buffer: ['buffer', 'Buffer'],
510
+ },
511
+ },
512
+ },
513
+ },
514
+ };
515
+
516
+ expect.assertions(2);
517
+ try {
518
+ const configManager = new ConfigManager({ config, syncConfigFile });
519
+ } catch (e: any) {
520
+ // eslint-disable-next-line jest/no-conditional-expect
521
+ expect(e.message).toMatch('Config validation failed');
522
+ // eslint-disable-next-line jest/no-conditional-expect
523
+ expect(true).toBeTruthy();
524
+ }
525
+ });
@@ -81,9 +81,15 @@ export class ConfigManager {
81
81
  configParameters.projects[projectName] = merge(projectsConfig, entry);
82
82
  });
83
83
 
84
- const ajv = new Ajv({ useDefaults: true });
84
+ const ajv = new Ajv({
85
+ useDefaults: true,
86
+ allowUnionTypes: true,
87
+ strict: true,
88
+ strictSchema: false,
89
+ });
85
90
 
86
- ajv.addKeyword('cli_overridable', {
91
+ ajv.addKeyword({
92
+ keyword: 'cli_overridable',
87
93
  modifying: true,
88
94
  errors: false,
89
95
  validate(schemaValue, currentValue, propSchema) {
@@ -1141,23 +1141,23 @@
1141
1141
  "dotAll": {
1142
1142
  "type": "boolean"
1143
1143
  },
1144
- "__@match@8264": {
1144
+ "__@match@8260": {
1145
1145
  "type": "object",
1146
1146
  "additionalProperties": false
1147
1147
  },
1148
- "__@replace@8266": {
1148
+ "__@replace@8262": {
1149
1149
  "type": "object",
1150
1150
  "additionalProperties": false
1151
1151
  },
1152
- "__@search@8269": {
1152
+ "__@search@8265": {
1153
1153
  "type": "object",
1154
1154
  "additionalProperties": false
1155
1155
  },
1156
- "__@split@8271": {
1156
+ "__@split@8267": {
1157
1157
  "type": "object",
1158
1158
  "additionalProperties": false
1159
1159
  },
1160
- "__@matchAll@8273": {
1160
+ "__@matchAll@8269": {
1161
1161
  "type": "object",
1162
1162
  "additionalProperties": false
1163
1163
  }
@@ -1802,23 +1802,23 @@
1802
1802
  "dotAll": {
1803
1803
  "type": "boolean"
1804
1804
  },
1805
- "__@match@8264": {
1805
+ "__@match@8260": {
1806
1806
  "type": "object",
1807
1807
  "additionalProperties": false
1808
1808
  },
1809
- "__@replace@8266": {
1809
+ "__@replace@8262": {
1810
1810
  "type": "object",
1811
1811
  "additionalProperties": false
1812
1812
  },
1813
- "__@search@8269": {
1813
+ "__@search@8265": {
1814
1814
  "type": "object",
1815
1815
  "additionalProperties": false
1816
1816
  },
1817
- "__@split@8271": {
1817
+ "__@split@8267": {
1818
1818
  "type": "object",
1819
1819
  "additionalProperties": false
1820
1820
  },
1821
- "__@matchAll@8273": {
1821
+ "__@matchAll@8269": {
1822
1822
  "type": "object",
1823
1823
  "additionalProperties": false
1824
1824
  }
@@ -2463,23 +2463,23 @@
2463
2463
  "dotAll": {
2464
2464
  "type": "boolean"
2465
2465
  },
2466
- "__@match@8264": {
2466
+ "__@match@8260": {
2467
2467
  "type": "object",
2468
2468
  "additionalProperties": false
2469
2469
  },
2470
- "__@replace@8266": {
2470
+ "__@replace@8262": {
2471
2471
  "type": "object",
2472
2472
  "additionalProperties": false
2473
2473
  },
2474
- "__@search@8269": {
2474
+ "__@search@8265": {
2475
2475
  "type": "object",
2476
2476
  "additionalProperties": false
2477
2477
  },
2478
- "__@split@8271": {
2478
+ "__@split@8267": {
2479
2479
  "type": "object",
2480
2480
  "additionalProperties": false
2481
2481
  },
2482
- "__@matchAll@8273": {
2482
+ "__@matchAll@8269": {
2483
2483
  "type": "object",
2484
2484
  "additionalProperties": false
2485
2485
  }
@@ -19,6 +19,7 @@ module.exports = (autogeneratedSchema) => {
19
19
  patternProperties: {
20
20
  '^[$a-zA-Z_-][0-9a-zA-Z_$-]*$': {
21
21
  if: {
22
+ type: 'object',
22
23
  properties: {
23
24
  type: { const: 'application' },
24
25
  },
@@ -26,6 +27,7 @@ module.exports = (autogeneratedSchema) => {
26
27
  then: autogeneratedSchema.properties.application,
27
28
  else: {
28
29
  if: {
30
+ type: 'object',
29
31
  properties: {
30
32
  type: { const: 'module' },
31
33
  },
@@ -33,6 +35,7 @@ module.exports = (autogeneratedSchema) => {
33
35
  then: autogeneratedSchema.properties.module,
34
36
  else: {
35
37
  if: {
38
+ type: 'object',
36
39
  properties: {
37
40
  type: { const: 'child-app' },
38
41
  },
@@ -9,7 +9,7 @@ jest.mock('resolve');
9
9
 
10
10
  describe('JSON schema для tramvai.json', () => {
11
11
  it('Схема успешно компилируется', () => {
12
- const ajv = new Ajv();
12
+ const ajv = new Ajv({ strict: true, strictSchema: false, allowUnionTypes: true });
13
13
 
14
14
  expect(() => ajv.compile(schema)).not.toThrow();
15
15
  });
@@ -35,7 +35,13 @@ describe('JSON schema для tramvai.json', () => {
35
35
 
36
36
  const originalConfig = clone(config);
37
37
 
38
- const ajv = new Ajv({ allErrors: true, useDefaults: true, strictDefaults: 'log' });
38
+ const ajv = new Ajv({
39
+ allErrors: true,
40
+ useDefaults: true,
41
+ strict: true,
42
+ strictSchema: false,
43
+ allowUnionTypes: true,
44
+ });
39
45
  const validate = ajv.compile(schema);
40
46
  const valid = validate(config);
41
47