|
| 1 | +diff --git node_modules/@angular/bazel/src/external.bzl node_modules/@angular/bazel/src/external.bzl |
| 2 | +index 9cdb543..8b8d4d6 100755 |
| 3 | +--- node_modules/@angular/bazel/src/external.bzl |
| 4 | ++++ node_modules/@angular/bazel/src/external.bzl |
| 5 | +@@ -14,9 +14,9 @@ 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 | +@@ -24,11 +24,12 @@ load( |
| 19 | + ) |
| 20 | + load( |
| 21 | + "@build_bazel_rules_nodejs//:providers.bzl", |
| 22 | +- _transitive_js_ecma_script_module_info = "transitive_js_ecma_script_module_info", |
| 23 | ++ _js_ecma_script_module_info = "js_ecma_script_module_info", |
| 24 | ++ _js_named_module_info = "js_named_module_info", |
| 25 | + ) |
| 26 | + |
| 27 | +-NodeModuleSources = _NodeModuleSources |
| 28 | +-collect_node_modules_aspect = _collect_node_modules_aspect |
| 29 | ++NpmPackageInfo = _NpmPackageInfo |
| 30 | ++node_modules_aspect = _node_modules_aspect |
| 31 | + |
| 32 | + tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig |
| 33 | + COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES |
| 34 | +@@ -42,4 +43,5 @@ DEFAULT_NG_COMPILER = "@npm//@angular/bazel/bin:ngc-wrapped" |
| 35 | + DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n" |
| 36 | + FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts" |
| 37 | + TsConfigInfo = _TsConfigInfo |
| 38 | +-transitive_js_ecma_script_module_info = _transitive_js_ecma_script_module_info |
| 39 | ++js_ecma_script_module_info = _js_ecma_script_module_info |
| 40 | ++js_named_module_info = _js_named_module_info |
| 41 | +diff --git node_modules/@angular/bazel/src/ng_module.bzl node_modules/@angular/bazel/src/ng_module.bzl |
| 42 | +index 2b31963..98479f7 100755 |
| 43 | +--- node_modules/@angular/bazel/src/ng_module.bzl |
| 44 | ++++ node_modules/@angular/bazel/src/ng_module.bzl |
| 45 | +@@ -13,11 +13,12 @@ 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", |
| 55 | +- "transitive_js_ecma_script_module_info", |
| 56 | ++ "js_ecma_script_module_info", |
| 57 | ++ "js_named_module_info", |
| 58 | + "ts_providers_dict_to_struct", |
| 59 | + "tsc_wrapped_tsconfig", |
| 60 | + ) |
| 61 | +@@ -527,11 +528,11 @@ def _compile_action( |
| 62 | + file_inputs += ctx.attr.tsconfig[TsConfigInfo].deps |
| 63 | + |
| 64 | + # Also include files from npm fine grained deps as action_inputs. |
| 65 | +- # These deps are identified by the NodeModuleSources provider. |
| 66 | ++ # These deps are identified by the NpmPackageInfo provider. |
| 67 | + for d in ctx.attr.deps: |
| 68 | +- if NodeModuleSources in d: |
| 69 | ++ if NpmPackageInfo in d: |
| 70 | + # Note: we can't avoid calling .to_list() on sources |
| 71 | +- file_inputs.extend(_filter_ts_inputs(d[NodeModuleSources].sources.to_list())) |
| 72 | ++ file_inputs.extend(_filter_ts_inputs(d[NpmPackageInfo].sources.to_list())) |
| 73 | + |
| 74 | + # Collect the inputs and summary files from our deps |
| 75 | + action_inputs = depset( |
| 76 | +@@ -617,7 +618,11 @@ def _ng_module_impl(ctx): |
| 77 | + |
| 78 | + # Add in new JS providers |
| 79 | + ts_providers["providers"].extend([ |
| 80 | +- transitive_js_ecma_script_module_info( |
| 81 | ++ js_named_module_info( |
| 82 | ++ sources = ts_providers["typescript"]["es5_sources"], |
| 83 | ++ deps = ctx.attr.deps, |
| 84 | ++ ), |
| 85 | ++ js_ecma_script_module_info( |
| 86 | + sources = ts_providers["typescript"]["es6_sources"], |
| 87 | + deps = ctx.attr.deps, |
| 88 | + ), |
| 89 | +@@ -625,7 +630,7 @@ def _ng_module_impl(ctx): |
| 90 | + |
| 91 | + return ts_providers_dict_to_struct(ts_providers) |
| 92 | + |
| 93 | +-local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect] |
| 94 | ++local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect] |
| 95 | + |
| 96 | + # Workaround skydoc bug which assumes DEPS_ASPECTS is a str type |
| 97 | + [local_deps_aspects.append(a) for a in DEPS_ASPECTS] |
| 98 | +diff --git node_modules/@angular/bazel/src/ng_package/ng_package.bzl node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 99 | +index 2eb79b1..c1e886a 100755 |
| 100 | +--- node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 101 | ++++ node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 102 | +@@ -13,9 +13,8 @@ It packages your library following the Angular Package Format, see the |
| 103 | + specification of this format at https://goo.gl/jB3GVv |
| 104 | + """ |
| 105 | + |
| 106 | +-load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") |
| 107 | +-load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleSources") |
| 108 | +-load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") |
| 109 | ++load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo") |
| 110 | ++load("@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl", "NpmPackageInfo") |
| 111 | + load( |
| 112 | + "@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl", |
| 113 | + "ROLLUP_ATTRS", |
| 114 | +@@ -207,7 +206,12 @@ def _filter_js_inputs(all_inputs): |
| 115 | + def _ng_package_impl(ctx): |
| 116 | + npm_package_directory = ctx.actions.declare_directory("%s.ng_pkg" % ctx.label.name) |
| 117 | + |
| 118 | +- esm_2015_files = _filter_out_generated_files(collect_es6_sources(ctx), "js") |
| 119 | ++ esm_2015_files = [] |
| 120 | ++ for dep in ctx.attr.deps: |
| 121 | ++ if JSEcmaScriptModuleInfo in dep: |
| 122 | ++ esm_2015_files += dep[JSEcmaScriptModuleInfo].sources.to_list() |
| 123 | ++ |
| 124 | ++ esm_2015_files = _filter_out_generated_files(esm_2015_files, "js") |
| 125 | + esm5_sources = _filter_out_generated_files(flatten_esm5(ctx), "js") |
| 126 | + |
| 127 | + # These accumulators match the directory names where the files live in the |
| 128 | +@@ -347,9 +351,9 @@ def _ng_package_impl(ctx): |
| 129 | + node_modules_files = _filter_js_inputs(ctx.files.node_modules) |
| 130 | + |
| 131 | + # Also include files from npm fine grained deps as inputs. |
| 132 | +- # These deps are identified by the NodeModuleSources provider. |
| 133 | ++ # These deps are identified by the NpmPackageInfo provider. |
| 134 | + for d in ctx.attr.deps: |
| 135 | +- if NodeModuleSources in d: |
| 136 | ++ if NpmPackageInfo in d: |
| 137 | + node_modules_files += _filter_js_inputs(d.files) |
| 138 | + esm5_rollup_inputs = depset(node_modules_files, transitive = [esm5_sources]) |
| 139 | + |
| 140 | +@@ -469,7 +473,7 @@ def _ng_package_impl(ctx): |
| 141 | + files = depset([package_dir]), |
| 142 | + )] |
| 143 | + |
| 144 | +-DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect] |
| 145 | ++DEPS_ASPECTS = [esm5_outputs_aspect] |
| 146 | + |
| 147 | + # Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type |
| 148 | + [DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS] |
0 commit comments