Skip to content

Commit

Permalink
feat(builtin): add js_library JSEcmaScriptModuleInfo support
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed May 6, 2021
1 parent 4965db6 commit a18acf3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ load(
"//:providers.bzl",
"DeclarationInfo",
"ExternalNpmPackageInfo",
"JSEcmaScriptModuleInfo",
"JSModuleInfo",
"JSNamedModuleInfo",
"LinkablePackageInfo",
"declaration_info",
"js_ecma_script_module_info",
"js_module_info",
"js_named_module_info",
)
Expand Down Expand Up @@ -164,6 +166,7 @@ def _impl(ctx):

files_depsets = [files_depset]
npm_sources_depsets = [files_depset]
direct_ecma_script_module_depsets = [files_depset]
direct_sources_depsets = [files_depset]
direct_named_module_sources_depsets = [named_module_files_depset]
typings_depsets = [typings_depset]
Expand All @@ -173,6 +176,9 @@ def _impl(ctx):
if ExternalNpmPackageInfo in dep:
npm_sources_depsets.append(dep[ExternalNpmPackageInfo].sources)
else:
if JSEcmaScriptModuleInfo in dep:
direct_ecma_script_module_depsets.append(dep[JSEcmaScriptModuleInfo].direct_sources)
direct_sources_depsets.append(dep[JSEcmaScriptModuleInfo].direct_sources)
if JSModuleInfo in dep:
js_files_depsets.append(dep[JSModuleInfo].direct_sources)
direct_sources_depsets.append(dep[JSModuleInfo].direct_sources)
Expand All @@ -196,6 +202,10 @@ def _impl(ctx):
),
),
AmdNamesInfo(names = ctx.attr.amd_names),
js_ecma_script_module_info(
sources = depset(transitive = direct_ecma_script_module_depsets),
deps = ctx.attr.deps,
),
js_module_info(
sources = depset(transitive = js_files_depsets),
deps = ctx.attr.deps,
Expand Down

0 comments on commit a18acf3

Please sign in to comment.