From 0b21e0b8c87869ac0fe9e59290357f8b27866f33 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Wed, 26 Mar 2025 15:25:11 -0400 Subject: [PATCH 1/2] fix: watch pnpm-lock from the module extension (#2148) --- npm/extensions.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/npm/extensions.bzl b/npm/extensions.bzl index 4784d5375..0f9199e35 100644 --- a/npm/extensions.bzl +++ b/npm/extensions.bzl @@ -31,6 +31,8 @@ def _npm_extension_impl(module_ctx): # We cannot read the pnpm_lock file before it has been bootstrapped. # See comment in e2e/update_pnpm_lock_with_import/test.sh. if attr.pnpm_lock: + if hasattr(module_ctx, "watch"): + module_ctx.watch(attr.pnpm_lock) _npm_lock_imports_bzlmod(module_ctx, attr) for i in mod.tags.npm_import: From 494fe631a8fbdcb57f23e81a74a131155e24035a Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Wed, 2 Apr 2025 18:47:23 -0700 Subject: [PATCH 2/2] fix: bzlmod invalid lockfile entry error (#2149) --- npm/private/repository_label_store.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/private/repository_label_store.bzl b/npm/private/repository_label_store.bzl index 011d5b0cd..31537b39e 100644 --- a/npm/private/repository_label_store.bzl +++ b/npm/private/repository_label_store.bzl @@ -60,7 +60,7 @@ def _add_root(priv, repo_root, key, path): root_path = priv["root"]["path"] # we have no idea what package this path is in so just assume the root package which works for repository rules - label = Label("@{}//:{}".format(root_workspace, path)) + label = Label("@@{}//:{}".format(root_workspace, path)) priv["labels"][key] = label priv["paths"][key] = paths.join(root_path, path) priv["repository_paths"][key] = paths.join(repo_root, path)