From 5eb4691dec14377f4ffc4d9c60d84e1a8d4cf04e Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Tue, 25 Jun 2019 13:11:52 -0700 Subject: [PATCH] Revert "build(bazel): remove deprecated rules_nodejs NodeModuleInfo provider (#31019)" (#31267) This reverts commit 72e4ff7591b29f82645abf1e079c2d58df9179df. Reason: this causes failures in g3 with i18n extraction. See #31267. PR Close #31267 --- packages/bazel/src/external.bzl | 2 ++ packages/bazel/src/ng_package/ng_package.bzl | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/bazel/src/external.bzl b/packages/bazel/src/external.bzl index 4959f22dde..d15d777960 100644 --- a/packages/bazel/src/external.bzl +++ b/packages/bazel/src/external.bzl @@ -15,6 +15,7 @@ load( ) load( "@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", + _NodeModuleInfo = "NodeModuleInfo", _NodeModuleSources = "NodeModuleSources", _collect_node_modules_aspect = "collect_node_modules_aspect", ) @@ -23,6 +24,7 @@ load( _TsConfigInfo = "TsConfigInfo", ) +NodeModuleInfo = _NodeModuleInfo NodeModuleSources = _NodeModuleSources collect_node_modules_aspect = _collect_node_modules_aspect diff --git a/packages/bazel/src/ng_package/ng_package.bzl b/packages/bazel/src/ng_package/ng_package.bzl index c2f77e13c4..c984032559 100644 --- a/packages/bazel/src/ng_package/ng_package.bzl +++ b/packages/bazel/src/ng_package/ng_package.bzl @@ -14,7 +14,7 @@ specification of this format at https://goo.gl/jB3GVv """ load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") -load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleSources") +load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo") load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") load( "@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl", @@ -292,9 +292,9 @@ def _ng_package_impl(ctx): node_modules_files = _filter_js_inputs(ctx.files.node_modules) # Also include files from npm fine grained deps as inputs. - # These deps are identified by the NodeModuleSources provider. + # These deps are identified by the NodeModuleInfo provider. for d in ctx.attr.deps: - if NodeModuleSources in d: + if NodeModuleInfo in d: node_modules_files += _filter_js_inputs(d.files) esm5_rollup_inputs = depset(node_modules_files, transitive = [esm5_sources]) @@ -396,8 +396,8 @@ def _ng_package_impl(ctx): devfiles = depset() if ctx.attr.include_devmode_srcs: for d in ctx.attr.deps: - if hasattr(d, "node_sources"): - devfiles = depset(transitive = [devfiles, d.node_sources]) + if not NodeModuleInfo in d: + devfiles = depset(transitive = [devfiles, d.files, d.node_sources]) # Re-use the create_package function from the nodejs npm_package rule. package_dir = create_package(