Revert "build(bazel): remove deprecated rules_nodejs NodeModuleInfo provider (#31019)" (#31267)

This reverts commit 72e4ff7591.

Reason: this causes failures in g3 with i18n extraction. See #31267.

PR Close #31267
This commit is contained in:
Alex Rickabaugh 2019-06-25 13:11:52 -07:00 committed by Kara Erickson
parent 35acd44a07
commit 5eb4691dec
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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(