|
| 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..bde9e0d 100755 |
| 100 | +--- node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 101 | ++++ node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 102 | +@@ -14,8 +14,8 @@ specification of this format at https://goo.gl/jB3GVv |
| 103 | + """ |
| 104 | + |
| 105 | + load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") |
| 106 | +-load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleSources") |
| 107 | +-load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") |
| 108 | ++load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo") |
| 109 | ++load("@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl", "NpmPackageInfo") |
| 110 | + load( |
| 111 | + "@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl", |
| 112 | + "ROLLUP_ATTRS", |
| 113 | +@@ -347,9 +347,9 @@ def _ng_package_impl(ctx): |
| 114 | + node_modules_files = _filter_js_inputs(ctx.files.node_modules) |
| 115 | + |
| 116 | + # Also include files from npm fine grained deps as inputs. |
| 117 | +- # These deps are identified by the NodeModuleSources provider. |
| 118 | ++ # These deps are identified by the NpmPackageInfo provider. |
| 119 | + for d in ctx.attr.deps: |
| 120 | +- if NodeModuleSources in d: |
| 121 | ++ if NpmPackageInfo in d: |
| 122 | + node_modules_files += _filter_js_inputs(d.files) |
| 123 | + esm5_rollup_inputs = depset(node_modules_files, transitive = [esm5_sources]) |
| 124 | + |
| 125 | +@@ -455,9 +455,9 @@ def _ng_package_impl(ctx): |
| 126 | + |
| 127 | + devfiles = depset() |
| 128 | + if ctx.attr.include_devmode_srcs: |
| 129 | +- for d in ctx.attr.deps: |
| 130 | +- if hasattr(d, "node_sources"): |
| 131 | +- devfiles = depset(transitive = [devfiles, d.node_sources]) |
| 132 | ++ for dep in ctx.attr.deps: |
| 133 | ++ if JSNamedModuleInfo in dep: |
| 134 | ++ devfiles = depset(transitive = [devfiles, dep[JSNamedModuleInfo].sources]) |
| 135 | + |
| 136 | + # Re-use the create_package function from the nodejs npm_package rule. |
| 137 | + package_dir = create_package( |
| 138 | +@@ -469,7 +469,7 @@ def _ng_package_impl(ctx): |
| 139 | + files = depset([package_dir]), |
| 140 | + )] |
| 141 | + |
| 142 | +-DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect] |
| 143 | ++DEPS_ASPECTS = [esm5_outputs_aspect] |
| 144 | + |
| 145 | + # Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type |
| 146 | + [DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS] |
0 commit comments