From 53e95233c33a3368cf1fde681200ff5bc78787e4 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 15 Jun 2020 23:03:32 +0200 Subject: [PATCH] refactor(dev-infra): cleanup shared package dependencies (#37594) Cleans up the dependencies used in the shared dev-infra package configuration. With the recent benchmarking utilities that have been added, a lot of peer dependencies have been added. We decided that we don't want to list every used dependencies as peer dependency as that could result in unnecessary churn/noise for consumers of the dev-infra package. Additionally, not all parts of the dev-infra package are necessarily used. Due to this, we want to apply the following rules for the package dependencies: 1. If a dependency is only used in a shipped Bazel macro/rule that can be optionally consumed, omit it from `package.json`. Bazel reports the missing dependency on its own, so we want to avoid adding it to the package json file. 2. Otherwise, if the dependency is large and commonly used (like buildifier), add it to the `peerDependencies`. If not, add it to the dependencies that are always brought in. We consider it as acceptable to bring in a few small dependencies that might not be used or not. Making all of those option would complicate the use of the dev-infra package. ds PR Close #37594 --- dev-infra/tmpl-package.json | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/dev-infra/tmpl-package.json b/dev-infra/tmpl-package.json index a0be76cc58..0f274839ac 100644 --- a/dev-infra/tmpl-package.json +++ b/dev-infra/tmpl-package.json @@ -9,7 +9,9 @@ "ts-circular-deps": "./ts-circular-dependencies/index.js" }, "dependencies": { + "@angular/benchpress": "0.2.0", "@octokit/graphql": "", + "brotli": "", "chalk": "", "cli-progress": "", "glob": "", @@ -19,35 +21,32 @@ "node-uuid": "", "semver": "", "shelljs": "", + "tslib": "", "typed-graphqlify": "", "yaml": "", "yargs": "" }, "peerDependencies": { - "@angular/bazel": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/benchpress": "^0.1.0", - "@angular-devkit/build-optimizer": "", "@bazel/buildifier": "", - "@bazel/protractor": "", - "@bazel/terser": "", - "@bazel/typescript": "", - "brotli": "", "clang-format": "", - "json5": "^1.0.1", "protractor": "", - "rollup": "", - "rollup-plugin-commonjs": "", - "rollup-plugin-node-resolve": "", - "rollup-plugin-sourcemaps": "", "selenium-webdriver": "", "ts-node": "", - "tslib": "", - "typescript": "", - "zone.js": "^0.10.3" + "typescript": "" }, "peerDependenciesMeta": { + "@bazel/buildifier": { + "optional": true + }, + "clang-format": { + "optional": true + }, + "protractor": { + "optional": true + }, + "selenium-webdriver": { + "optional": true + }, "ts-node": { "optional": true }