Skip to content

Commit 1f3331f

Browse files
gregmagolanIgorMinar
authored andcommittedOct 20, 2018
build(bazel): use fine-grained npm deps (angular#26111) (angular#26488)
PR Close angular#26488
1 parent b6c9678 commit 1f3331f

File tree

104 files changed

+6704
-1837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+6704
-1837
lines changed
 

‎BUILD.bazel

+31-15
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,47 @@ alias(
1515
actual = "@nodejs//:yarn",
1616
)
1717

18-
alias(
19-
name = "node_modules",
20-
actual = "@angular_deps//:node_modules",
21-
)
22-
2318
filegroup(
2419
name = "web_test_bootstrap_scripts",
2520
# do not sort
2621
srcs = [
27-
"@angular_deps//:node_modules/reflect-metadata/Reflect.js",
28-
"@angular_deps//:node_modules/zone.js/dist/zone.js",
29-
"@angular_deps//:node_modules/zone.js/dist/zone-testing.js",
30-
"@angular_deps//:node_modules/zone.js/dist/task-tracking.js",
22+
"@ngdeps//node_modules/reflect-metadata:Reflect.js",
23+
"@ngdeps//node_modules/zone.js:dist/zone.js",
24+
"@ngdeps//node_modules/zone.js:dist/zone-testing.js",
25+
"@ngdeps//node_modules/zone.js:dist/task-tracking.js",
3126
"//:test-events.js",
3227
],
3328
)
3429

3530
filegroup(
3631
name = "angularjs_scripts",
3732
srcs = [
38-
"@angular_deps//:node_modules/angular-1.5/angular.js",
39-
"@angular_deps//:node_modules/angular-1.6/angular.js",
40-
"@angular_deps//:node_modules/angular-mocks-1.5/angular-mocks.js",
41-
"@angular_deps//:node_modules/angular-mocks-1.6/angular-mocks.js",
42-
"@angular_deps//:node_modules/angular-mocks/angular-mocks.js",
43-
"@angular_deps//:node_modules/angular/angular.js",
33+
"@ngdeps//node_modules/angular:angular.js",
34+
"@ngdeps//node_modules/angular-1.5:angular.js",
35+
"@ngdeps//node_modules/angular-1.6:angular.js",
36+
"@ngdeps//node_modules/angular-mocks:angular-mocks.js",
37+
"@ngdeps//node_modules/angular-mocks-1.5:angular-mocks.js",
38+
"@ngdeps//node_modules/angular-mocks-1.6:angular-mocks.js",
4439
],
4540
)
41+
42+
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
43+
44+
# Override for ts_web_test_suite to use @ngdeps instead of @npm
45+
nodejs_binary(
46+
name = "@bazel/karma/karma",
47+
data = ["@ngdeps//@bazel/karma"],
48+
entry_point = "@bazel/karma/karma.js",
49+
install_source_map_support = False,
50+
visibility = ["//visibility:public"],
51+
)
52+
53+
# Override for ts_library to use @ngdeps instead of @npm
54+
nodejs_binary(
55+
name = "@bazel/typescript/tsc_wrapped",
56+
data = ["@ngdeps//@bazel/typescript"],
57+
entry_point = "@bazel/typescript/tsc_wrapped/tsc_wrapped.js",
58+
install_source_map_support = False,
59+
templated_args = ["--node_options=--expose-gc"],
60+
visibility = ["//visibility:public"],
61+
)

‎WORKSPACE

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ local_repository(
4040
#
4141
# Load and install our dependencies downloaded above.
4242
#
43-
44-
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
43+
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
4544

4645
check_bazel_version("0.17.0", """
4746
If you are on a Mac and using Homebrew, there is a breaking change to the installation in Bazel 0.16
@@ -56,6 +55,12 @@ node_repositories(
5655
yarn_version = "1.9.2",
5756
)
5857

58+
yarn_install(
59+
name = "npm",
60+
package_json = "//tools:npm/package.json",
61+
yarn_lock = "//tools:npm/yarn.lock",
62+
)
63+
5964
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
6065

6166
go_rules_dependencies()

0 commit comments

Comments
 (0)
Please sign in to comment.