Skip to content

Commit

Permalink
refactor: don't gather files from NpmPackageStoreInfo providers in ga…
Browse files Browse the repository at this point in the history
…ther_files_from_js_info
  • Loading branch information
gregmagolan committed Apr 19, 2024
1 parent 63c2d10 commit 3bfd482
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions js/private/js_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""

load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_file_to_bin_action")
load("//npm:providers.bzl", "NpmPackageStoreInfo")
load(":js_info.bzl", "JsInfo")

def gather_transitive_sources(sources, targets):
Expand Down Expand Up @@ -131,8 +130,8 @@ def gather_runfiles(
"""Creates a runfiles object containing files in `sources`, default outputs from `data` and transitive runfiles from `data` & `deps`.
As a defense in depth against `data` & `deps` targets not supplying all required runfiles, also
gathers the transitive sources & transitive npm sources from the `JsInfo` &
`NpmPackageStoreInfo` providers of `data` & `deps` targets.
gathers the transitive sources & transitive npm sources from the `JsInfo` providers of
`data` & `deps` targets.
See https://bazel.build/extending/rules#runfiles for more info on providing runfiles in build rules.
Expand Down Expand Up @@ -259,7 +258,7 @@ def gather_files_from_js_info(
include_transitive_sources,
include_transitive_types,
include_npm_sources):
"""Gathers files from JsInfo and NpmPackageStoreInfo providers.
"""Gathers files from JsInfo providers.
Args:
targets: list of target to gather from
Expand Down Expand Up @@ -303,9 +302,4 @@ def gather_files_from_js_info(
for target in targets
if JsInfo in target and hasattr(target[JsInfo], "npm_sources")
])
files_depsets.extend([
target[NpmPackageStoreInfo].transitive_files
for target in targets
if NpmPackageStoreInfo in target and hasattr(target[NpmPackageStoreInfo], "transitive_files")
])
return depset([], transitive = files_depsets)

0 comments on commit 3bfd482

Please sign in to comment.