Skip to content

fix: include package.json in npm_sources #1919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions npm/private/npm_package_store.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ deps of npm_package_store must be in the same package.""" % (ctx.label.package,
for npm_package_store_info in npm_package_store_infos:
transitive_files_depsets.append(npm_package_store_info.files)

for jsinfo in js_infos:
for source in jsinfo.sources.to_list():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use to_list() like this and will need a better solution if a fix like this is required

if source.basename == "package.json":
files.append(source)
break

npm_sources = depset(files, transitive = [jsinfo.npm_sources for jsinfo in js_infos])
transitive_files_depset = depset(files, transitive = transitive_files_depsets)
files_depset = depset(files)
Expand Down