From e8f5f796e02d11b67765c5a0a1ca94b49f3d0d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 17 Jul 2020 14:33:38 +0200 Subject: [PATCH] refactor: move framework packages to `devDependencies` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: Extensions no longer install framework packages as their own dependencies, they use the framework packages provided by the target application instead. If you are getting `npm install` errors after upgrade, then make sure your project lists all dependencies required by the extensions you are using. Signed-off-by: Miroslav Bajtoš --- extensions/apiconnect/package.json | 8 ++++++-- extensions/authentication-jwt/package.json | 10 ++++++++-- extensions/authentication-passport/package.json | 9 +++++++-- extensions/context-explorer/package.json | 8 ++++++-- extensions/cron/package.json | 5 ++++- extensions/health/package.json | 8 ++++++-- extensions/logging/package.json | 8 ++++++-- extensions/metrics/package.json | 8 ++++++-- extensions/pooling/package.json | 5 ++++- extensions/typeorm/package.json | 11 ++++++++--- packages/authentication/package.json | 8 ++++++-- packages/authorization/package.json | 5 ++++- packages/boot/package.json | 5 ++++- packages/booter-lb3app/package.json | 10 +++++----- packages/express/package.json | 5 ++++- packages/openapi-v3/package.json | 5 ++++- packages/repository-json-schema/package.json | 8 ++++++-- packages/repository-tests/package.json | 9 +++++---- packages/repository/package.json | 5 ++++- packages/rest-crud/package.json | 10 +++++----- packages/rest-explorer/package.json | 8 ++++++-- packages/rest/package.json | 5 ++++- packages/security/package.json | 5 ++++- packages/service-proxy/package.json | 5 ++++- 24 files changed, 126 insertions(+), 47 deletions(-) diff --git a/extensions/apiconnect/package.json b/extensions/apiconnect/package.json index 6e081e4721bb..433b283b5e3a 100644 --- a/extensions/apiconnect/package.json +++ b/extensions/apiconnect/package.json @@ -38,14 +38,18 @@ "url": "https://github.com/strongloop/loopback-next.git", "directory": "extensions/apiconnect" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27" } diff --git a/extensions/authentication-jwt/package.json b/extensions/authentication-jwt/package.json index f5918e69235a..cbf83491a06a 100644 --- a/extensions/authentication-jwt/package.json +++ b/extensions/authentication-jwt/package.json @@ -20,22 +20,28 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/authentication": "^4.2.9", "@loopback/core": "^2.9.1", "@loopback/rest": "^5.2.0", + "@loopback/service-proxy": "^2.3.4" + }, + "dependencies": { "@loopback/rest-explorer": "^2.2.6", "@loopback/security": "^0.2.14", - "@loopback/service-proxy": "^2.3.4", "@types/bcryptjs": "2.4.2", "bcryptjs": "^2.4.3", "jsonwebtoken": "^8.5.1" }, "devDependencies": { + "@loopback/authentication": "^4.2.9", "@loopback/boot": "^2.3.5", "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/repository": "^2.9.0", + "@loopback/rest": "^5.2.0", + "@loopback/service-proxy": "^2.3.4", "@loopback/testlab": "^2.0.2", "@types/lodash": "^4.14.157", "@types/node": "^10.17.27", diff --git a/extensions/authentication-passport/package.json b/extensions/authentication-passport/package.json index 36dba5560c5f..445d8731fbd6 100644 --- a/extensions/authentication-passport/package.json +++ b/extensions/authentication-passport/package.json @@ -39,20 +39,25 @@ "url": "https://github.com/strongloop/loopback-next.git", "directory": "extensions/authentication-passport" }, - "dependencies": { + "peerDependencies": { "@loopback/authentication": "^4.2.9", "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "@loopback/security": "^0.2.14", "passport": "^0.4.1", "tslib": "^2.0.0", "util-promisifyall": "^1.0.6" }, "devDependencies": { + "@loopback/authentication": "^4.2.9", "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/mock-oauth2-provider": "^0.1.3", "@loopback/openapi-spec-builder": "^2.1.9", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/jsonwebtoken": "^8.5.0", "@types/lodash": "^4.14.157", diff --git a/extensions/context-explorer/package.json b/extensions/context-explorer/package.json index be7260b4f190..e6decc76e967 100644 --- a/extensions/context-explorer/package.json +++ b/extensions/context-explorer/package.json @@ -20,15 +20,19 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "ts-graphviz": "^0.13.1", "viz.js": "^2.1.2" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27" }, diff --git a/extensions/cron/package.json b/extensions/cron/package.json index f724c846a391..6a7eb315d508 100644 --- a/extensions/cron/package.json +++ b/extensions/cron/package.json @@ -20,8 +20,10 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@types/cron": "^1.7.2", "@types/debug": "^4.1.5", "cron": "^1.8.2", @@ -30,6 +32,7 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27" diff --git a/extensions/health/package.json b/extensions/health/package.json index fa71d30e9788..69e80c097e65 100644 --- a/extensions/health/package.json +++ b/extensions/health/package.json @@ -21,15 +21,19 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1", + "@loopback/rest": "^5.2.0" + }, "dependencies": { "@cloudnative/health": "^2.1.2", - "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27" }, diff --git a/extensions/logging/package.json b/extensions/logging/package.json index 4998b01d45d8..0b9ef44fd5cb 100644 --- a/extensions/logging/package.json +++ b/extensions/logging/package.json @@ -20,9 +20,11 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "fluent-logger": "^3.4.1", "morgan": "^1.10.0", "tslib": "^2.0.0", @@ -31,7 +33,9 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/morgan": "^1.9.1", "@types/node": "^10.17.27" diff --git a/extensions/metrics/package.json b/extensions/metrics/package.json index 4822ca40974b..8a8786f72a85 100644 --- a/extensions/metrics/package.json +++ b/extensions/metrics/package.json @@ -20,15 +20,19 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "prom-client": "^12.0.0", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/express": "^4.17.7", "@types/node": "^10.17.27", diff --git a/extensions/pooling/package.json b/extensions/pooling/package.json index b7a3c6d637ca..fa8ef95d474c 100644 --- a/extensions/pooling/package.json +++ b/extensions/pooling/package.json @@ -31,14 +31,17 @@ "src", "!*/__tests__" ], + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@types/generic-pool": "^3.1.9", "generic-pool": "^3.7.1", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27", "typescript": "~3.9.7" diff --git a/extensions/typeorm/package.json b/extensions/typeorm/package.json index cf2f3b5158e8..16fdc15f2d72 100644 --- a/extensions/typeorm/package.json +++ b/extensions/typeorm/package.json @@ -21,19 +21,24 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/boot": "^2.3.3", + "@loopback/core": "^2.8.0", + "@loopback/rest": "^5.1.1" + }, "devDependencies": { + "@loopback/boot": "^2.3.3", "@loopback/build": "^5.4.3", + "@loopback/core": "^2.8.0", "@loopback/eslint-config": "^8.0.1", "@loopback/repository": "^2.7.0", + "@loopback/rest": "^5.1.1", "@loopback/testlab": "^3.1.7", "@types/json-schema": "^7.0.5", "@types/node": "^10.17.27", "sqlite3": "^5.0.0" }, "dependencies": { - "@loopback/boot": "^2.3.3", - "@loopback/core": "^2.8.0", - "@loopback/rest": "^5.1.1", "tslib": "^2.0.0", "typeorm": "^0.2.25" }, diff --git a/packages/authentication/package.json b/packages/authentication/package.json index fc3d777fda64..bd26f8da93dc 100644 --- a/packages/authentication/package.json +++ b/packages/authentication/package.json @@ -23,9 +23,11 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "@loopback/security": "^0.2.14", "@types/express": "^4.17.7", "@types/lodash": "^4.14.157", @@ -34,8 +36,10 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/openapi-spec-builder": "^2.1.9", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27", "jsonwebtoken": "^8.5.1" diff --git a/packages/authorization/package.json b/packages/authorization/package.json index 761389a2ff7e..d5f525ad48b5 100644 --- a/packages/authorization/package.json +++ b/packages/authorization/package.json @@ -23,14 +23,17 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/security": "^0.2.14", "debug": "^4.1.1", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/testlab": "^3.2.0", "@types/debug": "^4.1.5", "@types/node": "10.17.27", diff --git a/packages/boot/package.json b/packages/boot/package.json index ed44145f4853..e51f808b4ca3 100644 --- a/packages/boot/package.json +++ b/packages/boot/package.json @@ -23,8 +23,10 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/model-api-builder": "^2.1.9", "@loopback/repository": "^2.9.0", "@loopback/service-proxy": "^2.3.4", @@ -36,6 +38,7 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/rest": "^5.2.0", "@loopback/rest-crud": "^0.8.9", diff --git a/packages/booter-lb3app/package.json b/packages/booter-lb3app/package.json index 653e8fe413b8..b18f9dccdc2b 100644 --- a/packages/booter-lb3app/package.json +++ b/packages/booter-lb3app/package.json @@ -20,6 +20,11 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/boot": "^2.3.5", + "@loopback/core": "^2.9.1", + "@loopback/rest": "^5.2.0" + }, "dependencies": { "@types/express": "^4.17.7", "debug": "^4.1.1", @@ -28,11 +33,6 @@ "swagger2openapi": "^6.2.1", "tslib": "^2.0.0" }, - "peerDependencies": { - "@loopback/boot": "^2.3.5", - "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0" - }, "devDependencies": { "@loopback/boot": "^2.3.5", "@loopback/build": "^6.1.0", diff --git a/packages/express/package.json b/packages/express/package.json index 46db58d3e095..e27903fc9f61 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -36,8 +36,10 @@ "src", "!*/__tests__" ], + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/http-server": "^2.1.9", "@types/body-parser": "^1.19.0", "@types/express": "^4.17.7", @@ -52,6 +54,7 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/testlab": "^3.2.0", "@types/debug": "^4.1.5", "@types/node": "^10.17.27", diff --git a/packages/openapi-v3/package.json b/packages/openapi-v3/package.json index 426b5e2371d4..88eff0976b0d 100644 --- a/packages/openapi-v3/package.json +++ b/packages/openapi-v3/package.json @@ -7,8 +7,10 @@ "engines": { "node": ">=10.16" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/repository-json-schema": "^2.4.6", "debug": "^4.1.1", "http-status": "^1.4.2", @@ -19,6 +21,7 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/openapi-spec-builder": "^2.1.9", "@loopback/repository": "^2.9.0", diff --git a/packages/repository-json-schema/package.json b/packages/repository-json-schema/package.json index 8f4aec1b7657..b27d5925949f 100644 --- a/packages/repository-json-schema/package.json +++ b/packages/repository-json-schema/package.json @@ -25,16 +25,20 @@ "TypeScript", "JSON Schema" ], - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/repository": "^2.9.0", + "@loopback/repository": "^2.9.0" + }, + "dependencies": { "@types/json-schema": "^7.0.5", "debug": "^4.1.1", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/repository": "^2.9.0", "@loopback/testlab": "^3.2.0", "@types/debug": "^4.1.5", "@types/node": "^10.17.27", diff --git a/packages/repository-tests/package.json b/packages/repository-tests/package.json index 4bf6eaa0ba00..9e1fa9033f2f 100644 --- a/packages/repository-tests/package.json +++ b/packages/repository-tests/package.json @@ -20,8 +20,13 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1", + "@loopback/repository": "^2.9.0" + }, "devDependencies": { "@loopback/build": "^1.7.1", + "@loopback/core": "^2.9.1", "@loopback/repository": "^2.9.0", "@types/debug": "^4.1.5", "@types/lodash": "^4.14.157", @@ -29,15 +34,11 @@ "lodash": "^4.17.19" }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/testlab": "^3.2.0", "@types/debug": "^4.1.5", "debug": "^4.1.1", "tslib": "^2.0.0" }, - "peerDependencies": { - "@loopback/repository": "^2.9.0" - }, "files": [ "README.md", "dist", diff --git a/packages/repository/package.json b/packages/repository/package.json index 7280cf38648d..67afafad00a3 100644 --- a/packages/repository/package.json +++ b/packages/repository/package.json @@ -21,8 +21,12 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/testlab": "^3.2.0", "@types/bson": "^4.0.2", @@ -32,7 +36,6 @@ "bson": "4.0.4" }, "dependencies": { - "@loopback/core": "^2.9.1", "@types/debug": "^4.1.5", "debug": "^4.1.1", "lodash": "^4.17.19", diff --git a/packages/rest-crud/package.json b/packages/rest-crud/package.json index 56e22cdea6f8..f3ee21473e18 100644 --- a/packages/rest-crud/package.json +++ b/packages/rest-crud/package.json @@ -20,6 +20,11 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1", + "@loopback/repository": "^2.9.0", + "@loopback/rest": "^5.2.0" + }, "dependencies": { "@loopback/model-api-builder": "^2.1.9", "debug": "^4.1.1", @@ -34,11 +39,6 @@ "@types/debug": "^4.1.5", "@types/node": "^10.17.27" }, - "peerDependencies": { - "@loopback/core": "^2.9.1", - "@loopback/repository": "^2.9.0", - "@loopback/rest": "^5.2.0" - }, "files": [ "README.md", "dist", diff --git a/packages/rest-explorer/package.json b/packages/rest-explorer/package.json index 19fca7ff1397..d7494f167690 100644 --- a/packages/rest-explorer/package.json +++ b/packages/rest-explorer/package.json @@ -20,16 +20,20 @@ "publishConfig": { "access": "public" }, - "dependencies": { + "peerDependencies": { "@loopback/core": "^2.9.1", - "@loopback/rest": "^5.2.0", + "@loopback/rest": "^5.2.0" + }, + "dependencies": { "ejs": "^3.1.3", "swagger-ui-dist": "^3.30.0", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", + "@loopback/rest": "^5.2.0", "@loopback/testlab": "^3.2.0", "@types/ejs": "^3.0.4", "@types/express": "^4.17.7", diff --git a/packages/rest/package.json b/packages/rest/package.json index 9df43fa9e7cf..b1b805eb2e85 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -23,8 +23,10 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "@loopback/express": "^1.2.5", "@loopback/http-server": "^2.1.9", "@loopback/openapi-v3": "^3.4.5", @@ -58,6 +60,7 @@ }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/openapi-spec-builder": "^2.1.9", "@loopback/repository": "^2.9.0", diff --git a/packages/security/package.json b/packages/security/package.json index c9cecb1e5e82..f76c6b5ce5c1 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -23,13 +23,16 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "dependencies": { - "@loopback/core": "^2.9.1", "debug": "^4.1.1", "tslib": "^2.0.0" }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/testlab": "^3.2.0", "@types/debug": "^4.1.5", "@types/node": "^10.17.27" diff --git a/packages/service-proxy/package.json b/packages/service-proxy/package.json index 6362cf4e20e0..2d20a66bc119 100644 --- a/packages/service-proxy/package.json +++ b/packages/service-proxy/package.json @@ -23,14 +23,17 @@ "publishConfig": { "access": "public" }, + "peerDependencies": { + "@loopback/core": "^2.9.1" + }, "devDependencies": { "@loopback/build": "^6.1.0", + "@loopback/core": "^2.9.1", "@loopback/eslint-config": "^8.0.3", "@loopback/testlab": "^3.2.0", "@types/node": "^10.17.27" }, "dependencies": { - "@loopback/core": "^2.9.1", "loopback-datasource-juggler": "^4.21.2", "tslib": "^2.0.0" },