1- diff --git a/node_modules/@angular/bazel/src/esm5.bzl b/node_modules/@angular/bazel/src/esm5.bzl
2- index 667f601..7907c12 100755
3- --- a/node_modules/@angular/bazel/src/esm5.bzl
4- +++ b/node_modules/@angular/bazel/src/esm5.bzl
5- @@ -30,7 +30,7 @@ ESM5Info = provider(
1+ diff --git a/node_modules/@angular/bazel/src/external.bzl b/node_modules/@angular/bazel/src/external.bzl
2+ index 4959f22..43f1c96 100755
3+ --- a/node_modules/@angular/bazel/src/external.bzl
4+ +++ b/node_modules/@angular/bazel/src/external.bzl
5+ @@ -14,17 +14,17 @@ load(
6+ _ts_providers_dict_to_struct = "ts_providers_dict_to_struct",
7+ )
8+ load(
9+ - "@build_bazel_rules_nodejs//internal/common:node_module_info.bzl",
10+ - _NodeModuleSources = "NodeModuleSources",
11+ - _collect_node_modules_aspect = "collect_node_modules_aspect",
12+ + "@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl",
13+ + _NpmPackageInfo = "NpmPackageInfo",
14+ + _node_modules_aspect = "node_modules_aspect",
15+ )
16+ load(
17+ "@npm_bazel_typescript//internal:ts_config.bzl",
18+ _TsConfigInfo = "TsConfigInfo",
619 )
720
8- def _map_closure_path(file):
9- - result = file.short_path[:-len(".closure.js")]
10- + result = file.short_path[:-len(".mjs")]
21+ - NodeModuleSources = _NodeModuleSources
22+ - collect_node_modules_aspect = _collect_node_modules_aspect
23+ + NpmPackageInfo = _NpmPackageInfo
24+ + node_modules_aspect = _node_modules_aspect
1125
12- # short_path is meant to be used when accessing runfiles in a binary, where
13- # the CWD is inside the current repo. Therefore files in external repo have a
26+ tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig
27+ COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES
1428diff --git a/node_modules/@angular/bazel/src/modify_tsconfig.js b/node_modules/@angular/bazel/src/modify_tsconfig.js
1529index 9d3c491..3c99746 100755
1630--- a/node_modules/@angular/bazel/src/modify_tsconfig.js
@@ -25,14 +39,23 @@ index 9d3c491..3c99746 100755
2539 fs.writeFileSync(output, JSON.stringify(data));
2640 }
2741diff --git a/node_modules/@angular/bazel/src/ng_module.bzl b/node_modules/@angular/bazel/src/ng_module.bzl
28- index 9b88fbb..68217d0 100755
42+ index 9b88fbb..54bf2c7 100755
2943--- a/node_modules/@angular/bazel/src/ng_module.bzl
3044+++ b/node_modules/@angular/bazel/src/ng_module.bzl
31- @@ -20,6 +20,7 @@ load(
45+ @@ -13,13 +13,14 @@ load(
46+ "DEFAULT_NG_COMPILER",
47+ "DEFAULT_NG_XI18N",
48+ "DEPS_ASPECTS",
49+ - "NodeModuleSources",
50+ + "NpmPackageInfo",
51+ "TsConfigInfo",
52+ - "collect_node_modules_aspect",
53+ + "node_modules_aspect",
54+ "compile_ts",
3255 "ts_providers_dict_to_struct",
3356 "tsc_wrapped_tsconfig",
3457 )
35- + load("@build_bazel_rules_nodejs//:providers.bzl", "transitive_js_ecma_script_module_info ")
58+ + load("@build_bazel_rules_nodejs//:providers.bzl", "js_ecma_script_module_info", "js_named_module_info ")
3659
3760 _FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts"
3861 _R3_SYMBOLS_DTS_FILE = "src/r3_symbols.d.ts"
@@ -54,22 +77,96 @@ index 9b88fbb..68217d0 100755
5477 bundle_index_typings = ctx.actions.declare_file("%s.d.ts" % flat_module_out)
5578 declaration_files.append(bundle_index_typings)
5679 if is_legacy_ngc:
57- @@ -603,7 +604,17 @@ def ng_module_impl(ctx, ts_compile_actions):
80+ @@ -517,11 +518,11 @@ def _compile_action(ctx, inputs, outputs, dts_bundles_out, messages_out, tsconfi
81+ file_inputs += ctx.attr.tsconfig[TsConfigInfo].deps
82+
83+ # Also include files from npm fine grained deps as action_inputs.
84+ - # These deps are identified by the NodeModuleSources provider.
85+ + # These deps are identified by the NpmPackageInfo provider.
86+ for d in ctx.attr.deps:
87+ - if NodeModuleSources in d:
88+ + if NpmPackageInfo in d:
89+ # Note: we can't avoid calling .to_list() on sources
90+ - file_inputs.extend(_filter_ts_inputs(d[NodeModuleSources].sources.to_list()))
91+ + file_inputs.extend(_filter_ts_inputs(d[NpmPackageInfo].sources.to_list()))
92+
93+ # Collect the inputs and summary files from our deps
94+ action_inputs = depset(
95+ @@ -603,9 +604,23 @@ def ng_module_impl(ctx, ts_compile_actions):
5896 return providers
5997
6098 def _ng_module_impl(ctx):
6199- return ts_providers_dict_to_struct(ng_module_impl(ctx, compile_ts))
100+ -
101+ - local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect]
62102+ ts_providers = ng_module_impl(ctx, compile_ts)
63103+
64104+ # Add in new JS providers
65105+ ts_providers["providers"].extend([
66- + transitive_js_ecma_script_module_info(
106+ + js_named_module_info(
107+ + sources = ts_providers["typescript"]["es5_sources"],
108+ + deps = ctx.attr.deps,
109+ + ),
110+ + js_ecma_script_module_info(
67111+ sources = ts_providers["typescript"]["es6_sources"],
68112+ deps = ctx.attr.deps,
69113+ ),
70114+ ])
71115+
72116+ return ts_providers_dict_to_struct(ts_providers)
117+ +
118+ + local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect]
119+
120+ # Workaround skydoc bug which assumes DEPS_ASPECTS is a str type
121+ [local_deps_aspects.append(a) for a in DEPS_ASPECTS]
122+ diff --git a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
123+ index 48d7619..ea635bb 100755
124+ --- a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
125+ +++ b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl
126+ @@ -13,9 +13,8 @@ It packages your library following the Angular Package Format, see the
127+ specification of this format at https://goo.gl/jB3GVv
128+ """
129+
130+ - load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources")
131+ - load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleSources")
132+ - load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect")
133+ + load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo", "JSNamedModuleInfo")
134+ + load("@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl", "NpmPackageInfo")
135+ load(
136+ "@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl",
137+ "ROLLUP_ATTRS",
138+ @@ -207,7 +206,12 @@ def _filter_js_inputs(all_inputs):
139+ def _ng_package_impl(ctx):
140+ npm_package_directory = ctx.actions.declare_directory("%s.ng_pkg" % ctx.label.name)
141+
142+ - esm_2015_files = _filter_out_generated_files(collect_es6_sources(ctx), "js")
143+ + esm_2015_files = []
144+ + for dep in ctx.attr.deps:
145+ + if JSEcmaScriptModuleInfo in dep:
146+ + esm_2015_files += dep[JSEcmaScriptModuleInfo].sources.to_list()
147+ +
148+ + esm_2015_files = _filter_out_generated_files(esm_2015_files, "js")
149+ esm5_sources = _filter_out_generated_files(flatten_esm5(ctx), "js")
150+
151+ # These accumulators match the directory names where the files live in the
152+ @@ -347,9 +351,9 @@ def _ng_package_impl(ctx):
153+ node_modules_files = _filter_js_inputs(ctx.files.node_modules)
154+
155+ # Also include files from npm fine grained deps as inputs.
156+ - # These deps are identified by the NodeModuleSources provider.
157+ + # These deps are identified by the NpmPackageInfo provider.
158+ for d in ctx.attr.deps:
159+ - if NodeModuleSources in d:
160+ + if NpmPackageInfo in d:
161+ node_modules_files += _filter_js_inputs(d.files)
162+ esm5_rollup_inputs = depset(node_modules_files, transitive = [esm5_sources])
163+
164+ @@ -469,7 +473,7 @@ def _ng_package_impl(ctx):
165+ files = depset([package_dir]),
166+ )]
73167
74- local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect]
168+ - DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect]
169+ + DEPS_ASPECTS = [esm5_outputs_aspect]
75170
171+ # Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type
172+ [DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS]
0 commit comments