Skip to content

Commit 0cc841e

Browse files
authored
fix: npm_import(extract_full_archive) bzlmod attribute not being passed through (#2579)
Fix #2577 ### Changes are visible to end-users: no ### Test plan - Covered by existing test cases
1 parent 7ed1406 commit 0cc841e

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

npm/extensions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ def _npm_import_bzlmod(i):
229229
name = i.name,
230230
key = package_key,
231231
generate_package_json_bzl = True, # Always generate package_json.bzl explicitly declared imports
232-
generate_bzl_library_targets = None,
233-
extract_full_archive = None,
232+
generate_bzl_library_targets = None, # Not supported via bzlmod
233+
extract_full_archive = i.extract_full_archive,
234234
bins = i.bins,
235235
commit = i.commit,
236236
custom_postinstall = i.custom_postinstall,

npm/private/npm_import.bzl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,6 @@ _ATTRS = _COMMON_ATTRS | {
904904
"extra_build_content": attr.string(),
905905
"extract_full_archive": attr.bool(),
906906
"exclude_package_contents": attr.string_list(default = []),
907-
"generate_package_json_bzl": attr.bool(),
908-
"generate_bzl_library_targets": attr.bool(),
909907
"integrity": attr.string(),
910908
"lifecycle_hooks": attr.string_list(),
911909
"npm_auth": attr.string(),
@@ -1193,7 +1191,10 @@ npm_import_links_rule = repository_rule(
11931191

11941192
npm_import_rule = repository_rule(
11951193
implementation = _npm_import_rule_impl,
1196-
attrs = _ATTRS | _INTERNAL_COMMON_ATTRS,
1194+
attrs = _ATTRS | _INTERNAL_COMMON_ATTRS | {
1195+
"generate_package_json_bzl": attr.bool(),
1196+
"generate_bzl_library_targets": attr.bool(),
1197+
},
11971198
)
11981199

11991200
# Private API for importing + linking a single npm package

0 commit comments

Comments
 (0)