optional dependencies in plugin:diff
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.7.13",
|
||||
"@types/jest": "^26.0.7",
|
||||
"msw": "^0.29.0"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.7.13",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/lodash": "^4.14.151",
|
||||
"yaml": "^1.9.2"
|
||||
},
|
||||
|
||||
@@ -85,6 +85,7 @@ class PackageJsonHandler {
|
||||
targetObj: any = this.targetPkg,
|
||||
prefix?: string,
|
||||
sort?: boolean,
|
||||
optional?: boolean,
|
||||
) {
|
||||
const fullFieldName = chalk.cyan(
|
||||
prefix ? `${prefix}[${fieldName}]` : fieldName,
|
||||
@@ -107,7 +108,7 @@ class PackageJsonHandler {
|
||||
}
|
||||
await this.write();
|
||||
}
|
||||
} else if (fieldName in obj) {
|
||||
} else if (fieldName in obj && optional !== true) {
|
||||
if (
|
||||
await this.prompt(
|
||||
`package.json is missing field ${fullFieldName}, set to ${coloredNewValue}?`,
|
||||
@@ -200,7 +201,7 @@ class PackageJsonHandler {
|
||||
continue;
|
||||
}
|
||||
|
||||
await this.syncField(key, pkgDeps, targetDeps, fieldName, true);
|
||||
await this.syncField(key, pkgDeps, targetDeps, fieldName, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"@testing-library/react-hooks": "^3.4.2"
|
||||
"@testing-library/react-hooks": "^3.4.2",
|
||||
"@types/jest": "^26.0.7"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^3.3.0",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"@types/jest": "^26.0.7",
|
||||
"cross-fetch": "^3.0.6",
|
||||
"msw": "^0.29.0"
|
||||
},
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^3.3.0",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/jwt-decode": "^3.1.0",
|
||||
"cross-fetch": "^3.0.6",
|
||||
"react-test-renderer": "^16.13.1"
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"@types/jest": "^26.0.7",
|
||||
"cross-fetch": "^3.0.6"
|
||||
},
|
||||
"files": [
|
||||
|
||||
Reference in New Issue
Block a user