Skip to content

Commit e4cfa2b

Browse files
authored
build: update to rules_nodejs 1.5.0 (#18960)
* updates to rules_nodejs 1.5.0 * adds temporary patch to @angular/tools-bazel * adds missing yarn_install to integration_test CI job
1 parent d51339c commit e4cfa2b

File tree

6 files changed

+74
-22
lines changed

6 files changed

+74
-22
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ jobs:
498498
- *restore_cache
499499
- *setup_bazel_ci_config
500500
- *setup_bazel_remote_execution
501+
- *yarn_install
501502
- *setup_bazel_binary
502503
# Integration tests run with --config=view-engine because we release with View Engine.
503504
- run: bazel test integration/... --build_tests_only --config=view-engine

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88
# Add NodeJS rules
99
http_archive(
1010
name = "build_bazel_rules_nodejs",
11-
sha256 = "c9e59009049fa42198f7087b80398fc4b2698a0f0c7fdde4fb3540c899c9b309",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.4.0/rules_nodejs-1.4.0.tar.gz"],
11+
sha256 = "d0c4bb8b902c1658f42eb5563809c70a06e46015d64057d25560b0eb4bdc9007",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.5.0/rules_nodejs-1.5.0.tar.gz"],
1313
)
1414

1515
# Add sass rules

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
"@bazel/bazelisk": "^1.3.0",
7777
"@bazel/buildifier": "^0.29.0",
7878
"@bazel/ibazel": "^0.12.3",
79-
"@bazel/jasmine": "^1.4.0",
80-
"@bazel/karma": "^1.4.0",
81-
"@bazel/protractor": "^1.4.0",
82-
"@bazel/typescript": "^1.4.0",
79+
"@bazel/jasmine": "^1.5.0",
80+
"@bazel/karma": "^1.5.0",
81+
"@bazel/protractor": "^1.5.0",
82+
"@bazel/typescript": "^1.5.0",
8383
"@firebase/app-types": "^0.3.2",
8484
"@octokit/rest": "16.28.7",
8585
"@schematics/angular": "^9.0.7",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
diff --git node_modules/@angular/bazel/src/external.bzl node_modules/@angular/bazel/src/external.bzl
2+
index 32b640a..84d37b3 100755
3+
--- node_modules/@angular/bazel/src/external.bzl
4+
+++ node_modules/@angular/bazel/src/external.bzl
5+
@@ -19,12 +19,14 @@ load(
6+
)
7+
load(
8+
"@build_bazel_rules_nodejs//:providers.bzl",
9+
+ _LinkablePackageInfo = "LinkablePackageInfo",
10+
_NpmPackageInfo = "NpmPackageInfo",
11+
_js_ecma_script_module_info = "js_ecma_script_module_info",
12+
_js_named_module_info = "js_named_module_info",
13+
_node_modules_aspect = "node_modules_aspect",
14+
)
15+
16+
+LinkablePackageInfo = _LinkablePackageInfo
17+
NpmPackageInfo = _NpmPackageInfo
18+
node_modules_aspect = _node_modules_aspect
19+
20+
diff --git node_modules/@angular/bazel/src/ng_module.bzl node_modules/@angular/bazel/src/ng_module.bzl
21+
index 9480c4b..0f67f18 100755
22+
--- node_modules/@angular/bazel/src/ng_module.bzl
23+
+++ node_modules/@angular/bazel/src/ng_module.bzl
24+
@@ -13,6 +13,7 @@ load(
25+
"DEFAULT_NG_COMPILER",
26+
"DEFAULT_NG_XI18N",
27+
"DEPS_ASPECTS",
28+
+ "LinkablePackageInfo",
29+
"NpmPackageInfo",
30+
"TsConfigInfo",
31+
"compile_ts",
32+
@@ -631,6 +632,15 @@ def _ng_module_impl(ctx):
33+
# once it is no longer needed.
34+
])
35+
36+
+ if ctx.attr.module_name:
37+
+ path = "/".join([p for p in [ctx.bin_dir.path, ctx.label.workspace_root, ctx.label.package] if p])
38+
+ ts_providers["providers"].append(LinkablePackageInfo(
39+
+ package_name = ctx.attr.module_name,
40+
+ path = path,
41+
+ files = ts_providers["typescript"]["es5_sources"],
42+
+ _tslibrary = True,
43+
+ ))
44+
+
45+
return ts_providers_dict_to_struct(ts_providers)
46+
47+
local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect]

tools/postinstall/apply-patches.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ searchAndReplace(
9898
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1208.
9999
applyPatch(path.join(__dirname, './manifest_externs_hermeticity.patch'));
100100

101+
// Pre-req for https://github.com/angular/angular/pull/36333. Can be removed
102+
// once @angular/bazel is updated here to include this patch.
103+
applyPatch(path.join(__dirname, './@angular_bazel_ng_module.patch'));
104+
101105
// Workaround for https://github.com/angular/angular/issues/33452:
102106
searchAndReplace(/angular_compiler_options = {/, `$&
103107
"strictTemplates": True,`, 'node_modules/@angular/bazel/src/ng_module.bzl');

yarn.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -269,32 +269,32 @@
269269
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.12.3.tgz#c8c82647f920cd529c7793c50e087e1a754a5973"
270270
integrity sha512-dyx62Uo5kogrxFmqFNpGvbavfr8yjmuQlOyZczOuA60piULwlUsO7Oh3/1OUWKDSXaMMqHhFQfpdl+z0HjI6TQ==
271271

272-
"@bazel/jasmine@^1.4.0":
273-
version "1.4.0"
274-
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.4.0.tgz#c4124090f933a879d8b0fc7c2c2c2436f17094fe"
275-
integrity sha512-As7hqdmkUJLKNAUmj6CkFR2azaHA6dxdOLFNasrXX4Qc+jBXxDEgnGb4DSFewn5ds45BKahZOpCsKH3Fq1g4Sw==
272+
"@bazel/jasmine@^1.5.0":
273+
version "1.5.0"
274+
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.5.0.tgz#be980cb8e9f82a87036e27f86278bd7a54d74c43"
275+
integrity sha512-r06GTWKxZYs6msPTbIJ+vcHLQke6wMULo3p4w3ecDybRzKq54syjSzlmejIm9wJ8OHrVyRRSvHgvygxCGJfhTA==
276276
dependencies:
277277
jasmine "~3.5.0"
278278
jasmine-core "~3.5.0"
279279
jasmine-reporters "~2.3.2"
280280
v8-coverage "1.0.9"
281281

282-
"@bazel/karma@^1.4.0":
283-
version "1.4.0"
284-
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.4.0.tgz#42517b3a236d0589da265e195814960e6b4a691c"
285-
integrity sha512-KLBKZHN4b9w+Ll9DrW6+mqKeR6a4kuc4PMPWNIqrgTHBTnJgRQpnDR4V/kyqEjcmJ9zG/rJgzkrboRHyXsQrxA==
282+
"@bazel/karma@^1.5.0":
283+
version "1.5.0"
284+
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.5.0.tgz#75ea27c3c2a8a7fadbb5c5ab644c3acd3bc22702"
285+
integrity sha512-j5S2Xya4Rr7vK0DzTaZ8FKDHBydtTNldwlx+rihjKJgbEBt76wQM7ucXD6aSA23lC+JM/dPRSKkpIIGeWf2JdQ==
286286
dependencies:
287287
tmp "0.1.0"
288288

289-
"@bazel/protractor@^1.4.0":
290-
version "1.4.0"
291-
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.4.0.tgz#577bc7243d88b58fc4733e39b233f38ee97eeebb"
292-
integrity sha512-flAzhCAfkVjOQQT1JOLvUz5PBiNKgg8/4jMUw90ZcOSj8u6mOSrR0Fh7LT7V+Rc3VLrH+uNaP9Iq31gjEKxl6A==
289+
"@bazel/protractor@^1.5.0":
290+
version "1.5.0"
291+
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.5.0.tgz#ac92442bf38f5cd718812e4cca41ba2e5ebf1fa5"
292+
integrity sha512-nUwOOUjNGJUU18JiE3sPOBzIul0jvGApEEikntKTLLwQ7w7/1TnOdXDWvHXrXRW3nwit6flWIzEUoFtWgwtCeg==
293293

294-
"@bazel/typescript@^1.4.0":
295-
version "1.4.0"
296-
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.4.0.tgz#8a86c3c58c3ebe17ccb2f71b35720457f4bc434a"
297-
integrity sha512-VFUCAyGXMZDx/ZyZ8YUj5rn/Rg9xSxoZxcqxJ457YxMzWGISKpNyzgUty9J/ZVcPg1xKKoISSvcjQWFtWOwX2A==
294+
"@bazel/typescript@^1.5.0":
295+
version "1.5.0"
296+
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.5.0.tgz#d69324c08e7dbfe10b21a6fcb7b4d66c71c8d171"
297+
integrity sha512-Vi8n1p35EhxGC22TEnmnVPlyakrALyH2ccVN5J6YeZXE1oWlSMSqQEhXKTjqUfQ3FT76nW1K91AdH4TG3me5nQ==
298298
dependencies:
299299
protobufjs "6.8.8"
300300
semver "5.6.0"

0 commit comments

Comments
 (0)