Skip to content

Commit 4bdcea1

Browse files
committed
fix: bzlmod npm_translate_lock(root_package) not propagating to npm_import(root_package)
1 parent e1cf23d commit 4bdcea1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

npm/extensions.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ load("//npm/private:npm_import.bzl", "npm_import_lib", "npm_import_links_lib")
1111
load("//npm/private:npm_translate_lock.bzl", "npm_translate_lock_lib", "npm_translate_lock_rule")
1212
load("//npm/private:npm_translate_lock_helpers.bzl", npm_translate_lock_helpers = "helpers")
1313
load("//npm/private:npm_translate_lock_macro_helpers.bzl", macro_helpers = "helpers")
14-
load("//npm/private:npm_translate_lock_state.bzl", "npm_translate_lock_state")
14+
load("//npm/private:npm_translate_lock_state.bzl", "npm_translate_lock_state", _DEFAULT_ROOT_PACKAGE = "DEFAULT_ROOT_PACKAGE")
1515
load("//npm/private:npmrc.bzl", "parse_npmrc")
1616
load("//npm/private:pnpm_extension.bzl", "DEFAULT_PNPM_REPO_NAME", "resolve_pnpm_repositories")
1717
load("//npm/private:transitive_closure.bzl", "translate_to_transitive_closure")
@@ -220,7 +220,7 @@ WARNING: Cannot determine home directory in order to load home `.npmrc` file in
220220
replace_packages = replace_packages,
221221
patched_dependencies = state.patched_dependencies(),
222222
only_built_dependencies = state.only_built_dependencies(),
223-
root_package = attr.pnpm_lock.package,
223+
root_package = attr.pnpm_lock.package if attr.root_package == _DEFAULT_ROOT_PACKAGE else attr.root_package,
224224
rctx_name = attr.name,
225225
attr = attr,
226226
all_lifecycle_hooks = lifecycle_hooks,

npm/private/npm_translate_lock_state.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def _new(rctx_name, rctx, attr, bzlmod):
575575
"npm_auth": {},
576576
"npm_registries": {},
577577
"packages": {},
578-
"root_package": None,
578+
"root_package": attr.root_package,
579579
"root_package_json": {},
580580
"patched_dependencies": {},
581581
"should_update_pnpm_lock": should_update_pnpm_lock,

0 commit comments

Comments
 (0)