Skip to content

Commit 96af29a

Browse files
committed
build: add temporary patch to @angular/bazel
1 parent 0bcb083 commit 96af29a

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
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/components/pull/18960. 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');

0 commit comments

Comments
 (0)