Skip to content

Commit b82209e

Browse files
authored
build(deps-dev): Bump ajv from 6.12.6 to 8.18.0 and ajv-errors from 1.0.1 to 3.0.0 (#1309)
JIRA: CPOUI5FOUNDATION-859 PoC resolution in v4: SAP/ui5-project#427 v4 implementation: SAP/ui5-project#860 ### Performance There's a slight performance degradation after the update. This is an expected behaviour as the code behind the generated validation function has evolved. They have added more comprehensive checks in there and more verbose logging. This is clearly visible in the coverage reports that we have integrated for tha function in our test scenarios. #### Comparisson Command: `time ui5 build` ##### sap.m ###### After info ProjectBuilder Build succeeded in 18 s info ProjectBuilder Executing cleanup tasks... ui5 build 36.37s user 11.09s system 246% cpu 19.237 total ###### Before info ProjectBuilder Build succeeded in 17 s info ProjectBuilder Executing cleanup tasks... ui5 build 35.54s user 10.14s system 247% cpu 18.480 total --- ##### sap.ui.core ###### After info ProjectBuilder Build succeeded in 9.42 s info ProjectBuilder Executing cleanup tasks... ui5 build 23.09s user 5.16s system 276% cpu 10.212 total ###### Before info ProjectBuilder Build succeeded in 9.43 s info ProjectBuilder Executing cleanup tasks... ui5 build 22.54s user 5.43s system 273% cpu 10.242 total
1 parent 03a8076 commit b82209e

35 files changed

Lines changed: 1097 additions & 912 deletions

package-lock.json

Lines changed: 141 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/project/lib/validation/ValidationError.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class ValidationError extends Error {
8080
}
8181

8282
let message = "Configuration ";
83-
if (error.dataPath) {
84-
message += chalk.underline(chalk.red(error.dataPath.substr(1))) + " ";
83+
if (error.instancePath) {
84+
message += chalk.underline(chalk.red(error.instancePath.substr(1))) + " ";
8585
}
8686

8787
switch (error.keyword) {
@@ -107,7 +107,7 @@ class ValidationError extends Error {
107107

108108
static _findDuplicateError(error, errorIndex, errors) {
109109
const foundIndex = errors.findIndex(($) => {
110-
if ($.dataPath !== error.dataPath) {
110+
if ($.instancePath !== error.instancePath) {
111111
return false;
112112
} else if ($.keyword !== error.keyword) {
113113
return false;
@@ -131,13 +131,13 @@ class ValidationError extends Error {
131131
}
132132

133133
static analyzeYamlError({error, yaml}) {
134-
if (error.dataPath === "" && error.keyword === "required") {
134+
if (error.instancePath === "" && error.keyword === "required") {
135135
// There is no line/column for a missing required property on root level
136136
return {line: -1, column: -1};
137137
}
138138

139139
// Skip leading /
140-
const objectPath = error.dataPath.substr(1).split("/");
140+
const objectPath = error.instancePath.substr(1).split("/");
141141

142142
if (error.keyword === "additionalProperties") {
143143
objectPath.push(error.params.additionalProperty);

packages/project/lib/validation/schema/specVersion/kind/extension.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
},
2323
"if": {
24+
"type": "object",
2425
"properties": {
2526
"type": {"const": null}
2627
},
@@ -29,6 +30,7 @@
2930
"then": {},
3031
"else": {
3132
"if": {
33+
"type": "object",
3234
"properties": {
3335
"type": {"const": "task"}
3436
}
@@ -38,6 +40,7 @@
3840
},
3941
"else": {
4042
"if": {
43+
"type": "object",
4144
"properties": {
4245
"type": {"const": "server-middleware"}
4346
}
@@ -47,6 +50,7 @@
4750
},
4851
"else": {
4952
"if": {
53+
"type": "object",
5054
"properties": {
5155
"type": {"const": "project-shim"}
5256
}

0 commit comments

Comments
 (0)