Skip to content

Commit

Permalink
[FEATURE] Schema: Introduce specVersion 4.0 (#731)
Browse files Browse the repository at this point in the history
JIRA: CPOUI5FOUNDATION-835

---------

Co-authored-by: Merlin Beutlberger <m.beutlberger@sap.com>
  • Loading branch information
d3xter666 and RandomByte authored Jun 21, 2024
1 parent fcbd6db commit c5a9fde
Show file tree
Hide file tree
Showing 17 changed files with 955 additions and 116 deletions.
3 changes: 2 additions & 1 deletion lib/specifications/SpecificationVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const SPEC_VERSION_PATTERN = /^\d+\.\d+$/;
const SUPPORTED_VERSIONS = [
"0.1", "1.0", "1.1",
"2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6",
"3.0", "3.1", "3.2"
"3.0", "3.1", "3.2",
"4.0"
];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/schema/specVersion/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": ["3.2", "3.1", "3.0", "2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["4.0", "3.2", "3.1", "3.0", "2.6", "2.5", "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": ["3.0", "3.1", "3.2"] }
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": {
"enum": ["3.0", "3.1", "3.2"]
"enum": ["3.0", "3.1", "3.2", "4.0"]
},
"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": ["3.0", "3.1", "3.2"] }
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["3.0", "3.1", "3.2"] },
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
4 changes: 2 additions & 2 deletions lib/validation/schema/specVersion/kind/extension/task.json
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": ["3.0", "3.1", "3.2"] }
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["3.0", "3.1", "3.2"] },
"specVersion": { "enum": ["3.0", "3.1", "3.2", "4.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
159 changes: 157 additions & 2 deletions lib/validation/schema/specVersion/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": ["3.2", "3.1", "3.0", "2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["4.0", "3.2", "3.1", "3.0", "2.6", "2.5", "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 All @@ -19,7 +19,6 @@
]
}
},

"if": {
"properties": {
"type": {"const": null}
Expand Down Expand Up @@ -207,6 +206,22 @@
}
}
},
"builder-bundles-4.0": {
"type": "array",
"additionalProperties": false,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"bundleDefinition": {
"$ref": "#/definitions/builder-bundles-bundleDefinition-4.0"
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions-4.0"
}
}
}
},
"builder-bundles-bundleDefinition": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -381,6 +396,120 @@
}
}
},
"builder-bundles-bundleDefinition-4.0": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"defaultFileTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"sections": {
"type": "array",
"if": {
"$comment": "Add async prop only if mode = 'require'",
"items": {
"type": "object",
"mode": {
"enum": ["require"]
}
}
},
"then": {
"items": {
"type": "object",
"additionalProperties": false,
"required": ["mode", "filters"],
"properties": {
"name": {
"type": "string"
},
"mode": {
"enum": ["raw", "preload", "require", "provided", "bundleInfo", "depCache"]
},
"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
},
"async": {
"type": "boolean",
"default": true
}
}
}
},
"else": {
"items": {
"type": "object",
"additionalProperties": false,
"required": ["mode", "filters"],
"properties": {
"name": {
"type": "string"
},
"mode": {
"enum": ["raw", "preload", "require", "provided", "bundleInfo", "depCache"]
},
"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
}
}
}
}
}
}
},
"builder-bundles-bundleOptions": {
"type": "object",
"additionalProperties": false,
Expand Down Expand Up @@ -437,6 +566,32 @@
}
}
},
"builder-bundles-bundleOptions-4.0": {
"type": "object",
"additionalProperties": false,
"properties": {
"optimize": {
"type": "boolean",
"default": true
},
"decorateBootstrapModule": {
"type": "boolean",
"default": true
},
"addTryCatchRestartWrapper": {
"type": "boolean",
"default": false
},
"numberOfParts": {
"type": "number",
"default": 1
},
"sourceMap": {
"type": "boolean",
"default": true
}
}
},
"builder-componentPreload": {
"type": "object",
"additionalProperties": false,
Expand Down
Loading

0 comments on commit c5a9fde

Please sign in to comment.