build: Move non-bazel deps to devDependencies (#26691)

This makes yarn_install of ngdeps under Bazel faster, since we don't need many of the large dependencies.
It's important because downstream angular/bazel users will observe the same install time.

PR Close #26691
This commit is contained in:
Alex Eagle 2018-10-22 14:26:52 -07:00 committed by Matias Niemelä
parent b95089db20
commit 66be3c9f51
5 changed files with 72 additions and 41 deletions

View File

@ -6,6 +6,16 @@ load(
"rules_angular_dev_dependencies",
)
# Uncomment for local bazel rules development
#local_repository(
# name = "build_bazel_rules_nodejs",
# path = "../rules_nodejs",
#)
#local_repository(
# name = "build_bazel_rules_typescript",
# path = "../rules_typescript",
#)
# Angular Bazel users will call this function
rules_angular_dependencies()
# These are the dependencies only for us

View File

@ -31,38 +31,22 @@
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot",
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy-aot --test_tag_filters=-no-ivy-aot"
},
"// 1": "dependencies are used locally and by bazel",
"dependencies": {
"@angular-devkit/schematics": "^0.5.5",
"@schematics/angular": "^0.5.4",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^6.3.0",
"tslib": "^1.7.1",
"zone.js": "^0.8.26"
},
"optionalDependencies": {
"fsevents": "1.1.2"
},
"devDependencies": {
"@bazel/ibazel": "^0.1.1",
"@bazel/karma": "0.20.3",
"@bazel/typescript": "0.20.3",
"@types/angular": "^1.6.47",
"@types/base64-js": "1.2.5",
"@schematics/angular": "^0.5.4",
"@types/chokidar": "1.7.3",
"@types/convert-source-map": "^1.5.1",
"@types/diff": "^3.2.2",
"@types/fs-extra": "4.0.2",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "^2.8.8",
"@types/jasminewd2": "^2.0.4",
"@types/minimist": "^1.2.0",
"@types/mock-fs": "^3.6.30",
"@types/node": "^10.9.4",
"@types/selenium-webdriver": "3.0.7",
"@types/shelljs": "^0.7.8",
"@types/source-map": "^0.5.1",
"@types/systemjs": "0.19.32",
"@types/yargs": "^11.1.1",
"@webcomponents/custom-elements": "^1.0.4",
"angular": "npm:angular@1.7",
@ -72,23 +56,56 @@
"angular-mocks-1.5": "npm:angular-mocks@1.5",
"angular-mocks-1.6": "npm:angular-mocks@1.6",
"base64-js": "1.2.1",
"bower": "1.8.2",
"browserstacktunnel-wrapper": "2.0.1",
"canonical-path": "0.0.2",
"chokidar": "1.7.0",
"convert-source-map": "^1.5.1",
"dependency-graph": "^0.7.2",
"domino": "2.1.0",
"fs-extra": "4.0.2",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"karma": "^2.0.4",
"magic-string": "^0.25.0",
"minimist": "1.2.0",
"mock-fs": "^4.5.0",
"node-uuid": "1.4.8",
"protractor": "5.1.2",
"reflect-metadata": "^0.1.3",
"selenium-webdriver": "3.5.0",
"shelljs": "^0.8.1",
"source-map": "^0.6.1",
"source-map-support": "0.4.18",
"tsickle": "0.32.1",
"tslib": "^1.7.1",
"typescript": "~3.1.1",
"xhr2": "0.1.4",
"yargs": "9.0.1",
"zone.js": "^0.8.26"
},
"optionalDependencies": {
"fsevents": "1.1.2"
},
"// 2": "devDependencies are not used under Bazel. Many can be removed after test.sh is deleted.",
"devDependencies": {
"@bazel/ibazel": "^0.1.1",
"@bazel/karma": "0.20.3",
"@types/angular": "^1.6.47",
"@types/base64-js": "1.2.5",
"@types/jasminewd2": "^2.0.4",
"@types/minimist": "^1.2.0",
"@types/systemjs": "0.19.32",
"bower": "1.8.2",
"browserstacktunnel-wrapper": "2.0.1",
"clang-format": "1.0.41",
"cldr": "4.10.0",
"cldr-data-downloader": "0.3.2",
"cldrjs": "0.5.0",
"conventional-changelog": "^2.0.3",
"convert-source-map": "^1.5.1",
"core-js": "^2.4.1",
"cors": "2.8.4",
"dependency-graph": "^0.7.2",
"diff": "^3.5.0",
"domino": "2.1.0",
"entities": "1.1.1",
"firefox-profile": "1.0.3",
"fs-extra": "4.0.2",
"glob": "7.1.2",
"gulp": "3.9.1",
"gulp-clang-format": "1.0.23",
@ -100,44 +117,29 @@
"hammerjs": "2.0.8",
"husky": "^0.14.3",
"incremental-dom": "0.4.1",
"jasmine": "^3.1.0",
"jasmine-core": "^3.1.0",
"jpm": "1.3.1",
"karma": "^2.0.4",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^1.1.2",
"karma-sauce-launcher": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"madge": "0.5.0",
"magic-string": "^0.25.0",
"minimist": "1.2.0",
"mock-fs": "^4.5.0",
"mutation-observer": "^1.0.3",
"node-uuid": "1.4.8",
"protractor": "5.1.2",
"rewire": "2.5.2",
"rollup": "0.47.4",
"rollup-plugin-commonjs": "8.1.0",
"rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-sourcemaps": "0.4.2",
"selenium-webdriver": "3.5.0",
"rxjs": "^6.3.0",
"semver": "5.4.1",
"shelljs": "^0.8.1",
"source-map": "^0.6.1",
"source-map-support": "0.4.18",
"systemjs": "0.18.10",
"tsickle": "0.32.1",
"tslint": "5.7.0",
"tslint-eslint-rules": "4.1.1",
"tsutils": "2.27.2",
"typescript": "~3.1.1",
"uglify-es": "^3.3.9",
"universal-analytics": "0.4.15",
"vlq": "0.2.2",
"vrsource-tslint-rules": "5.1.1",
"webpack": "1.12.9",
"xhr2": "0.1.4",
"yargs": "9.0.1"
"webpack": "1.12.9"
}
}

View File

@ -22,6 +22,13 @@ def rules_angular_dependencies():
# Download Bazel toolchain dependencies as needed by build actions
#
# TODO(gmagolan): updated to next tagged rules_typescript release
_maybe(
http_archive,
name = "build_bazel_rules_nodejs",
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.15.3.zip",
strip_prefix = "rules_nodejs-0.15.3",
)
_maybe(
http_archive,
name = "build_bazel_rules_typescript",

View File

@ -13,6 +13,9 @@
"paths": {
"@angular/compiler": ["../../dist/packages/compiler"]
},
"types": [
"node"
],
"outDir": "../../dist/packages/compiler-cli"
},
"bazelOptions": {

View File

@ -5,6 +5,7 @@
"Install angular source dependencies"
load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version")
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
load("@angular//packages/bazel/src:ng_setup_workspace.bzl", _ng_setup_workspace = "ng_setup_workspace")
@ -14,11 +15,19 @@ def ng_setup_workspace():
It creates some additional Bazel external repositories that are used internally
to build angular
"""
# The NodeJS rules version must be at least v0.15.3 because:
# - 0.15.2 Re-introduced the prod_only attribute on yarn_install
# - 0.15.3 Includes a fix for the `jasmine_node_test` rule ignoring target tags
check_rules_nodejs_version("0.15.3")
yarn_install(
name = "ngdeps",
package_json = "@angular//:package.json",
yarn_lock = "@angular//:yarn.lock",
data = ["@angular//:tools/yarn/check-yarn.js", "@angular//:tools/postinstall-patches.js"],
# Don't install devDependencies, they are large and not used under Bazel
prod_only = True,
)
yarn_install(