Skip to content

build: update to rules_nodejs 1.5.0 #18960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ jobs:
- *restore_cache
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *yarn_install
- *setup_bazel_binary
# Integration tests run with --config=view-engine because we release with View Engine.
- run: bazel test integration/... --build_tests_only --config=view-engine
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Add NodeJS rules
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "c9e59009049fa42198f7087b80398fc4b2698a0f0c7fdde4fb3540c899c9b309",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.4.0/rules_nodejs-1.4.0.tar.gz"],
sha256 = "d0c4bb8b902c1658f42eb5563809c70a06e46015d64057d25560b0eb4bdc9007",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.5.0/rules_nodejs-1.5.0.tar.gz"],
)

# Add sass rules
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"@bazel/bazelisk": "^1.3.0",
"@bazel/buildifier": "^0.29.0",
"@bazel/ibazel": "^0.12.3",
"@bazel/jasmine": "^1.4.0",
"@bazel/karma": "^1.4.0",
"@bazel/protractor": "^1.4.0",
"@bazel/typescript": "^1.4.0",
"@bazel/jasmine": "^1.5.0",
"@bazel/karma": "^1.5.0",
"@bazel/protractor": "^1.5.0",
"@bazel/typescript": "^1.5.0",
"@firebase/app-types": "^0.3.2",
"@octokit/rest": "16.28.7",
"@schematics/angular": "^9.0.7",
Expand Down
47 changes: 47 additions & 0 deletions tools/postinstall/@angular_bazel_ng_module.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git node_modules/@angular/bazel/src/external.bzl node_modules/@angular/bazel/src/external.bzl
index 32b640a..84d37b3 100755
--- node_modules/@angular/bazel/src/external.bzl
+++ node_modules/@angular/bazel/src/external.bzl
@@ -19,12 +19,14 @@ load(
)
load(
"@build_bazel_rules_nodejs//:providers.bzl",
+ _LinkablePackageInfo = "LinkablePackageInfo",
_NpmPackageInfo = "NpmPackageInfo",
_js_ecma_script_module_info = "js_ecma_script_module_info",
_js_named_module_info = "js_named_module_info",
_node_modules_aspect = "node_modules_aspect",
)

+LinkablePackageInfo = _LinkablePackageInfo
NpmPackageInfo = _NpmPackageInfo
node_modules_aspect = _node_modules_aspect

diff --git node_modules/@angular/bazel/src/ng_module.bzl node_modules/@angular/bazel/src/ng_module.bzl
index 9480c4b..0f67f18 100755
--- node_modules/@angular/bazel/src/ng_module.bzl
+++ node_modules/@angular/bazel/src/ng_module.bzl
@@ -13,6 +13,7 @@ load(
"DEFAULT_NG_COMPILER",
"DEFAULT_NG_XI18N",
"DEPS_ASPECTS",
+ "LinkablePackageInfo",
"NpmPackageInfo",
"TsConfigInfo",
"compile_ts",
@@ -631,6 +632,15 @@ def _ng_module_impl(ctx):
# once it is no longer needed.
])

+ if ctx.attr.module_name:
+ path = "/".join([p for p in [ctx.bin_dir.path, ctx.label.workspace_root, ctx.label.package] if p])
+ ts_providers["providers"].append(LinkablePackageInfo(
+ package_name = ctx.attr.module_name,
+ path = path,
+ files = ts_providers["typescript"]["es5_sources"],
+ _tslibrary = True,
+ ))
+
return ts_providers_dict_to_struct(ts_providers)

local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect]
4 changes: 4 additions & 0 deletions tools/postinstall/apply-patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ searchAndReplace(
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1208.
applyPatch(path.join(__dirname, './manifest_externs_hermeticity.patch'));

// Pre-req for https://github.com/angular/angular/pull/36333. Can be removed
// once @angular/bazel is updated here to include this patch.
applyPatch(path.join(__dirname, './@angular_bazel_ng_module.patch'));

// Workaround for https://github.com/angular/angular/issues/33452:
searchAndReplace(/angular_compiler_options = {/, `$&
"strictTemplates": True,`, 'node_modules/@angular/bazel/src/ng_module.bzl');
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -269,32 +269,32 @@
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.12.3.tgz#c8c82647f920cd529c7793c50e087e1a754a5973"
integrity sha512-dyx62Uo5kogrxFmqFNpGvbavfr8yjmuQlOyZczOuA60piULwlUsO7Oh3/1OUWKDSXaMMqHhFQfpdl+z0HjI6TQ==

"@bazel/jasmine@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.4.0.tgz#c4124090f933a879d8b0fc7c2c2c2436f17094fe"
integrity sha512-As7hqdmkUJLKNAUmj6CkFR2azaHA6dxdOLFNasrXX4Qc+jBXxDEgnGb4DSFewn5ds45BKahZOpCsKH3Fq1g4Sw==
"@bazel/jasmine@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.5.0.tgz#be980cb8e9f82a87036e27f86278bd7a54d74c43"
integrity sha512-r06GTWKxZYs6msPTbIJ+vcHLQke6wMULo3p4w3ecDybRzKq54syjSzlmejIm9wJ8OHrVyRRSvHgvygxCGJfhTA==
dependencies:
jasmine "~3.5.0"
jasmine-core "~3.5.0"
jasmine-reporters "~2.3.2"
v8-coverage "1.0.9"

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

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

"@bazel/typescript@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.4.0.tgz#8a86c3c58c3ebe17ccb2f71b35720457f4bc434a"
integrity sha512-VFUCAyGXMZDx/ZyZ8YUj5rn/Rg9xSxoZxcqxJ457YxMzWGISKpNyzgUty9J/ZVcPg1xKKoISSvcjQWFtWOwX2A==
"@bazel/typescript@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.5.0.tgz#d69324c08e7dbfe10b21a6fcb7b4d66c71c8d171"
integrity sha512-Vi8n1p35EhxGC22TEnmnVPlyakrALyH2ccVN5J6YeZXE1oWlSMSqQEhXKTjqUfQ3FT76nW1K91AdH4TG3me5nQ==
dependencies:
protobufjs "6.8.8"
semver "5.6.0"
Expand Down