Skip to content

Commit e840853

Browse files
committed
[INTERNAL] Schema: Add declareRawModules to bundleDefinition schema
1 parent 3d2b6cc commit e840853

File tree

3 files changed

+56
-8
lines changed

3 files changed

+56
-8
lines changed

lib/validation/schema/specVersion/2.0/kind/project.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141
"sort": {
142142
"type": "boolean",
143143
"default": true
144+
},
145+
"declareRawModules": {
146+
"type": "boolean",
147+
"default": false
144148
}
145149
}
146150
}

test/lib/validation/schema/specVersion/2.0/kind/project/application.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ test("Valid configuration", async (t) => {
8585
"resolve": false,
8686
"resolveConditional": false,
8787
"renderer": false,
88-
"sort": false
88+
"sort": false,
89+
"declareRawModules": true
8990
}
9091
]
9192
},
@@ -109,7 +110,8 @@ test("Valid configuration", async (t) => {
109110
"some/app/Component.js"
110111
],
111112
"resolve": true,
112-
"sort": true
113+
"sort": true,
114+
"declareRawModules": false
113115
},
114116
{
115117
"mode": "require",
@@ -329,7 +331,8 @@ test("Invalid builder configuration", async (t) => {
329331
"ui5loader-autoconfig.js"
330332
],
331333
"resolve": true,
332-
"sort": true
334+
"sort": true,
335+
"declareModules": true
333336
}
334337
]
335338
},
@@ -348,7 +351,8 @@ test("Invalid builder configuration", async (t) => {
348351
"some/app/Component.js"
349352
],
350353
"resolve": true,
351-
"sort": true
354+
"sort": true,
355+
"declareRawModules": []
352356
},
353357
{
354358
"mode": "provide",
@@ -380,6 +384,15 @@ test("Invalid builder configuration", async (t) => {
380384
},
381385
schemaPath: "#/additionalProperties"
382386
},
387+
{
388+
dataPath: "/builder/bundles/0/bundleDefinition/sections/0",
389+
keyword: "additionalProperties",
390+
message: "should NOT have additional properties",
391+
params: {
392+
additionalProperty: "declareModules",
393+
},
394+
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/additionalProperties",
395+
},
383396
{
384397
dataPath: "/builder/bundles/1/bundleDefinition",
385398
keyword: "required",
@@ -407,6 +420,15 @@ test("Invalid builder configuration", async (t) => {
407420
},
408421
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/required",
409422
},
423+
{
424+
dataPath: "/builder/bundles/1/bundleDefinition/sections/0/declareRawModules",
425+
keyword: "type",
426+
message: "should be boolean",
427+
params: {
428+
type: "boolean",
429+
},
430+
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/properties/declareRawModules/type",
431+
},
410432
{
411433
dataPath: "/builder/bundles/1/bundleDefinition/sections/1/mode",
412434
keyword: "enum",

test/lib/validation/schema/specVersion/2.0/kind/project/library.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ test("Valid configuration", async (t) => {
8585
"resolve": false,
8686
"resolveConditional": false,
8787
"renderer": false,
88-
"sort": false
88+
"sort": false,
89+
"declareRawModules": true
8990
}
9091
]
9192
},
@@ -109,7 +110,8 @@ test("Valid configuration", async (t) => {
109110
"some/app/Component.js"
110111
],
111112
"resolve": true,
112-
"sort": true
113+
"sort": true,
114+
"declareRawModules": false
113115
},
114116
{
115117
"mode": "require",
@@ -213,7 +215,8 @@ test("Invalid configuration", async (t) => {
213215
"ui5loader-autoconfig.js"
214216
],
215217
"resolve": true,
216-
"sort": true
218+
"sort": true,
219+
"declareModules": true
217220
}
218221
]
219222
},
@@ -232,7 +235,8 @@ test("Invalid configuration", async (t) => {
232235
"some/app/Component.js"
233236
],
234237
"resolve": true,
235-
"sort": true
238+
"sort": true,
239+
"declareRawModules": []
236240
},
237241
{
238242
"mode": "provide",
@@ -335,6 +339,15 @@ test("Invalid configuration", async (t) => {
335339
},
336340
schemaPath: "#/properties/jsdoc/properties/excludes/type",
337341
},
342+
{
343+
dataPath: "/builder/bundles/0/bundleDefinition/sections/0",
344+
keyword: "additionalProperties",
345+
message: "should NOT have additional properties",
346+
params: {
347+
additionalProperty: "declareModules",
348+
},
349+
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/additionalProperties",
350+
},
338351
{
339352
dataPath: "/builder/bundles/1/bundleDefinition",
340353
keyword: "required",
@@ -362,6 +375,15 @@ test("Invalid configuration", async (t) => {
362375
},
363376
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/required",
364377
},
378+
{
379+
dataPath: "/builder/bundles/1/bundleDefinition/sections/0/declareRawModules",
380+
keyword: "type",
381+
message: "should be boolean",
382+
params: {
383+
type: "boolean",
384+
},
385+
schemaPath: "../project.json#/definitions/builder-bundles/items/properties/bundleDefinition/properties/sections/items/properties/declareRawModules/type",
386+
},
365387
{
366388
dataPath: "/builder/bundles/1/bundleDefinition/sections/1/mode",
367389
keyword: "enum",

0 commit comments

Comments
 (0)