build(bazel): replace yarn_install(name = "npm") with @npm local_reporsitory() to speed up build (#27469)
PR Close #27469
This commit is contained in:
parent
8f425701e4
commit
68074df0a2
|
@ -2,6 +2,7 @@
|
|||
|
||||
/dist/
|
||||
/bazel-*
|
||||
/integration/bazel/bazel-*
|
||||
e2e_test.*
|
||||
node_modules
|
||||
bower_components
|
||||
|
|
|
@ -64,10 +64,9 @@ node_repositories(
|
|||
yarn_version = "1.12.1",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
local_repository(
|
||||
name = "npm",
|
||||
package_json = "//tools:npm/package.json",
|
||||
yarn_lock = "//tools:npm/yarn.lock",
|
||||
path = "tools/npm_workspace",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
"@angular-devkit/architect": "^0.10.6",
|
||||
"@angular-devkit/core": "^7.0.4",
|
||||
"@angular-devkit/schematics": "^7.0.4",
|
||||
"@bazel/karma": "0.21.0",
|
||||
"@bazel/typescript": "0.21.0",
|
||||
"@schematics/angular": "^7.0.4",
|
||||
"@types/chokidar": "1.7.3",
|
||||
|
@ -91,7 +92,6 @@
|
|||
"devDependencies": {
|
||||
"@bazel/bazel": "^0.18.1",
|
||||
"@bazel/ibazel": "~0.8.2",
|
||||
"@bazel/karma": "0.21.0",
|
||||
"@types/angular": "^1.6.47",
|
||||
"@types/base64-js": "1.2.5",
|
||||
"@types/jasminewd2": "^2.0.4",
|
||||
|
@ -145,4 +145,4 @@
|
|||
"vrsource-tslint-rules": "5.1.1",
|
||||
"webpack": "1.12.9"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ load("//packages/bazel/src:ng_rollup_bundle.bzl", _ng_rollup_bundle = "ng_rollup
|
|||
_DEFAULT_TSCONFIG_BUILD = "//packages:tsconfig-build.json"
|
||||
_DEFAULT_TSCONFIG_TEST = "//packages:tsconfig-test.json"
|
||||
_DEFAULT_TS_TYPINGS = "@ngdeps//typescript:typescript__typings"
|
||||
_DEFAULT_KARMA_BIN = "@ngdeps//@bazel/karma/bin:karma"
|
||||
_INTERNAL_NG_MODULE_COMPILER = "//packages/bazel/src/ngc-wrapped"
|
||||
_INTERNAL_NG_MODULE_XI18N = "//packages/bazel/src/ngc-wrapped:xi18n"
|
||||
_INTERNAL_NG_PACKAGER_PACKAGER = "//packages/bazel/src/ng_package:packager"
|
||||
|
@ -131,6 +132,7 @@ def ts_web_test_suite(bootstrap = [], deps = [], **kwargs):
|
|||
_ts_web_test_suite(
|
||||
bootstrap = bootstrap,
|
||||
deps = local_deps,
|
||||
karma = _DEFAULT_KARMA_BIN,
|
||||
# Run unit tests on local Chromium by default.
|
||||
# You can exclude tests based on tags, e.g. to skip Firefox testing,
|
||||
# `yarn bazel test --test_tag_filters=-browser:firefox-local [targets]`
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"description": "minimal @npm repo required to build @rxjs from source and so that @npm//@angular/bazel is a valid target",
|
||||
"dependencies": {
|
||||
"@angular/bazel": "6.1.9",
|
||||
"@angular/compiler": "6.1.9",
|
||||
"@angular/compiler-cli": "6.1.9",
|
||||
"@bazel/karma": "0.21.0",
|
||||
"@bazel/typescript": "0.21.0",
|
||||
"typescript": "~3.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "TODO(gregmagolan): figure out how to keep @bazel/karma & @bazel/typescript dependencies here up to date with the root package.json; NOTE: versions of @angular/x don't matter here as they are only require to create the @npm//@angular/bazel target name"
|
||||
}
|
||||
}
|
3265
tools/npm/yarn.lock
3265
tools/npm/yarn.lock
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
# Empty filegroup here so that @npm//@angular/bazel is a valid Bazel target
|
||||
# for the @angular//:@angular/bazel/ngc-wrapped target
|
||||
filegroup(
|
||||
name = "bazel",
|
||||
srcs = [],
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
# Alias here so that @npm//@bazel/typescript is a valid Bazel target
|
||||
# which is reference in build_bazel_rules_typescript/BUILD.bazel
|
||||
alias(
|
||||
name = "typescript",
|
||||
actual = "@ngdeps//@bazel/typescript",
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
# Marker file that this directory is a bazel package
|
|
@ -0,0 +1 @@
|
|||
workspace(name = "npm")
|
Loading…
Reference in New Issue