Skip to content

Commit

Permalink
[FEATURE] specVersion 2.4
Browse files Browse the repository at this point in the history
- Adds new bundle section mode "bundleInfo"

JIRA: CPOUI5FOUNDATION-141
  • Loading branch information
RandomByte committed Jun 1, 2021
1 parent cb92b26 commit 69ffc6c
Show file tree
Hide file tree
Showing 26 changed files with 422 additions and 112 deletions.
5 changes: 3 additions & 2 deletions lib/projectPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ProjectPreprocessor {
if (project.specVersion !== "0.1" && project.specVersion !== "1.0" &&
project.specVersion !== "1.1" && project.specVersion !== "2.0" &&
project.specVersion !== "2.1" && project.specVersion !== "2.2" &&
project.specVersion !== "2.3") {
project.specVersion !== "2.3" && project.specVersion !== "2.4") {
throw new Error(
`Unsupported specification version ${project.specVersion} defined for project ` +
`${project.id}. Your UI5 CLI installation might be outdated. ` +
Expand Down Expand Up @@ -361,7 +361,8 @@ class ProjectPreprocessor {
extension.specVersion !== "2.0" &&
extension.specVersion !== "2.1" &&
extension.specVersion !== "2.2" &&
extension.specVersion !== "2.3") {
extension.specVersion !== "2.3" &&
extension.specVersion !== "2.4") {
throw new Error(
`Unsupported specification version ${extension.specVersion} defined for extension ` +
`${extension.metadata.name}. Your UI5 CLI installation might be outdated. ` +
Expand Down
6 changes: 4 additions & 2 deletions lib/translators/ui5Framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ const utils = {
}
if (
project.specVersion !== "2.0" && project.specVersion !== "2.1" &&
project.specVersion !== "2.2" && project.specVersion !== "2.3"
project.specVersion !== "2.2" && project.specVersion !== "2.3" &&
project.specVersion !== "2.4"
) {
log.warn(`Project ${project.metadata.name} defines invalid ` +
`specification version ${project.specVersion} for framework.libraries configuration`);
Expand Down Expand Up @@ -252,7 +253,8 @@ module.exports = {
if (
(
project.specVersion === "2.0" || project.specVersion === "2.1" ||
project.specVersion === "2.2" || project.specVersion === "2.3"
project.specVersion === "2.2" || project.specVersion === "2.3" ||
project.specVersion === "2.4"
) && project.framework && project.framework.libraries) {
const frameworkDeps = project.framework.libraries
.filter((dependency) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/schema/specVersion/2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion"],
"properties": {
"specVersion": { "enum": ["2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["project", "extension", null],
"$comment": "Using null to allow not defining 'kind' which defaults to project"
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/schema/specVersion/2.0/kind/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion", "kind", "type", "metadata"],
"properties": {
"specVersion": { "enum": ["2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"required": ["specVersion", "kind", "type", "metadata", "shims"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": {
"enum": ["2.1", "2.2", "2.3"]
"enum": ["2.1", "2.2", "2.3", "2.4"]
},
"kind": {
"enum": ["extension"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"required": ["specVersion", "kind", "type", "metadata", "middleware"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"required": ["specVersion", "kind", "type", "metadata", "task"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4"] },
"kind": {
"enum": ["extension"]
},
Expand Down
110 changes: 92 additions & 18 deletions lib/validation/schema/specVersion/2.0/kind/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "object",
"required": ["specVersion", "type"],
"properties": {
"specVersion": { "enum": ["2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["2.4", "2.3", "2.2", "2.1", "2.0"] },
"kind": {
"enum": ["project", null],
"$comment": "Using null to allow not defining 'kind' which defaults to project"
Expand Down Expand Up @@ -177,34 +177,108 @@
}
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions"
}
}
}
},
"builder-bundles-2.4": {
"type": "array",
"additionalProperties": false,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"bundleDefinition": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"optimize": {
"type": "boolean",
"default": false
},
"decorateBootstrapModule": {
"type": "boolean",
"default": true
},
"addTryCatchRestartWrapper": {
"type": "boolean",
"default": false
"name": {
"type": "string"
},
"usePredefineCalls": {
"type": "boolean",
"default": false
"defaultFileTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"numberOfParts": {
"type": "number",
"default": 1
"sections": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["mode", "filters"],
"properties": {
"name": {
"type": "string"
},
"mode": {
"enum": ["raw", "preload", "require", "provided", "bundleInfo"]
},
"filters": {
"type": "array",
"items": {
"type": "string"
}
},
"resolve": {
"type": "boolean",
"default": false
},
"resolveConditional": {
"type": "boolean",
"default": false
},
"renderer": {
"type": "boolean",
"default": false
},
"sort": {
"type": "boolean",
"default": true
},
"declareRawModules": {
"type": "boolean",
"default": false
}
}
}
}
}
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions"
}
}
}
},
"builder-bundles-bundleOptions": {
"type": "object",
"additionalProperties": false,
"properties": {
"optimize": {
"type": "boolean",
"default": false
},
"decorateBootstrapModule": {
"type": "boolean",
"default": true
},
"addTryCatchRestartWrapper": {
"type": "boolean",
"default": false
},
"usePredefineCalls": {
"type": "boolean",
"default": false
},
"numberOfParts": {
"type": "number",
"default": 1
}
}
},
"builder-componentPreload": {
"type": "object",
"additionalProperties": false,
Expand Down
Loading

0 comments on commit 69ffc6c

Please sign in to comment.