Skip to content

Commit

Permalink
[FEATURE] specVersion 3.0 (#522)
Browse files Browse the repository at this point in the history
Adds schema support for UI5 Tooling v3
  • Loading branch information
d3xter666 committed Feb 6, 2023
1 parent 277d590 commit 4aac10b
Show file tree
Hide file tree
Showing 26 changed files with 616 additions and 270 deletions.
2 changes: 1 addition & 1 deletion lib/ui5Framework/AbstractResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import semver from "semver";
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
//
// This needs to be aligned with the ui5.yaml JSON schema:
// lib/validation/schema/specVersion/2.0/kind/project.json#/definitions/framework/properties/version/pattern
// lib/validation/schema/specVersion/kind/project.json#/definitions/framework/properties/version/pattern
//
// eslint-disable-next-line max-len
const SEMVER_VERSION_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://ui5.sap/schema/specVersion/2.0/kind/extension.json",
"$id": "http://ui5.sap/schema/specVersion/kind/extension.json",

"type": "object",
"required": ["specVersion", "kind", "type", "metadata"],
"properties": {
"specVersion": { "enum": ["2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["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
@@ -1,19 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://ui5.sap/schema/specVersion/2.0/kind/extension/project-shim.json",
"$id": "http://ui5.sap/schema/specVersion/kind/extension/project-shim.json",

"type": "object",
"required": ["specVersion", "kind", "type", "metadata", "shims"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": {
"enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"]
"enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"]
},
"kind": {
"enum": ["extension"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://ui5.sap/schema/specVersion/2.0/kind/extension/server-middleware.json",
"$id": "http://ui5.sap/schema/specVersion/kind/extension/server-middleware.json",

"type": "object",

"required": ["specVersion", "kind", "type", "metadata", "middleware"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://ui5.sap/schema/specVersion/2.0/kind/extension/task.json",
"$id": "http://ui5.sap/schema/specVersion/kind/extension/task.json",

"type": "object",
"required": ["specVersion", "kind", "type", "metadata", "task"],
"if": {
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] }
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"] }
}
},
"then": {
"additionalProperties": false,
"properties": {
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6"] },
"specVersion": { "enum": ["2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "3.0"] },
"kind": {
"enum": ["extension"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://ui5.sap/schema/specVersion/2.0/kind/project.json",
"$id": "http://ui5.sap/schema/specVersion/kind/project.json",

"type": "object",
"required": ["specVersion", "type"],
"properties": {
"specVersion": { "enum": ["2.6", "2.5", "2.4", "2.3", "2.2", "2.1", "2.0"] },
"specVersion": { "enum": ["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 Down Expand Up @@ -119,62 +119,7 @@
"additionalProperties": false,
"properties": {
"bundleDefinition": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"defaultFileTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"sections": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["mode", "filters"],
"properties": {
"name": {
"type": "string"
},
"mode": {
"enum": ["raw", "preload", "require", "provided"]
},
"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
}
}
}
}
}
"$ref": "#/definitions/builder-bundles-bundleDefinition"
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions"
Expand All @@ -190,65 +135,142 @@
"additionalProperties": false,
"properties": {
"bundleDefinition": {
"$ref": "#/definitions/builder-bundles-bundleDefinition-2.4"
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions"
}
}
}
},
"builder-bundles-3.0": {
"type": "array",
"additionalProperties": false,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"bundleDefinition": {
"$ref": "#/definitions/builder-bundles-bundleDefinition-2.4"
},
"bundleOptions": {
"$ref": "#/definitions/builder-bundles-bundleOptions-3.0"
}
}
}
},
"builder-bundles-bundleDefinition": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"defaultFileTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"sections": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"required": ["mode", "filters"],
"properties": {
"name": {
"type": "string"
},
"defaultFileTypes": {
"mode": {
"enum": ["raw", "preload", "require", "provided"]
},
"filters": {
"type": "array",
"items": {
"type": "string"
}
},
"sections": {
"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-bundleDefinition-2.4": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"defaultFileTypes": {
"type": "array",
"items": {
"type": "string"
}
},
"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": "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
}
}
"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"
}
}
}
Expand Down Expand Up @@ -279,6 +301,36 @@
}
}
},
"builder-bundles-bundleOptions-3.0": {
"type": "object",
"additionalProperties": false,
"properties": {
"optimize": {
"type": "boolean",
"default": true
},
"decorateBootstrapModule": {
"type": "boolean",
"default": true
},
"addTryCatchRestartWrapper": {
"type": "boolean",
"default": false
},
"usePredefineCalls": {
"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 4aac10b

Please sign in to comment.