-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: patch ng_module to provide LinkablePackageInfo
Interim patch until angular/angular#36333 lands and makes it into a release. For ViewEngine however, upgrades past @angular/bazel 9.0.0-rc.10 are broken and given that ViewEngine will soon be deprecated there is not much impetus to fix that at the moment so the patch will be long lived for the legacy compilation mode if users are using ViewEngine and "module_name" with ng_module.
- Loading branch information
1 parent
a3b9768
commit 6a50217
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
examples/angular_view_engine/patches/@angular+bazel+9.0.0-rc.10.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
diff --git a/node_modules/@angular/bazel/src/external.bzl b/node_modules/@angular/bazel/src/external.bzl | ||
index 32b640a..84d37b3 100755 | ||
--- a/node_modules/@angular/bazel/src/external.bzl | ||
+++ b/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 a/node_modules/@angular/bazel/src/ng_module.bzl b/node_modules/@angular/bazel/src/ng_module.bzl | ||
index 9480c4b..0f67f18 100755 | ||
--- a/node_modules/@angular/bazel/src/ng_module.bzl | ||
+++ b/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] |