Skip to content
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

[bzlmod] Mark npm extension as reproducible #1541

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module(
# Do not bump these unless rules_js requires a newer version to function.
bazel_dep(name = "aspect_bazel_lib", version = "1.40.3")
bazel_dep(name = "aspect_rules_lint", version = "0.12.0")
bazel_dep(name = "bazel_features", version = "0.1.0")
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")

# Keep v5 in to avoid breaking changes.
Expand Down
7 changes: 7 additions & 0 deletions npm/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
See https://bazel.build/docs/bzlmod#extension-definition
"""

load("@bazel_features//:features.bzl", "bazel_features")
load("@aspect_bazel_lib//lib:repo_utils.bzl", "repo_utils")
load("//npm:repositories.bzl", "npm_import", "pnpm_repository", _LATEST_PNPM_VERSION = "LATEST_PNPM_VERSION")
load("//npm/private:npm_translate_lock.bzl", "npm_translate_lock", "npm_translate_lock_lib")
Expand Down Expand Up @@ -213,6 +214,12 @@ WARNING: Cannot determine home directory in order to load home `.npmrc` file in
register_copy_to_directory_toolchains = False, # this registration is handled elsewhere with bzlmod
)

if bazel_features.external_deps.extension_metadata_has_reproducible:
return module_ctx.extension_metadata(
reproducible = True,
)
return module_ctx.extension_metadata()

def _npm_translate_lock_attrs():
attrs = dict(**npm_translate_lock_lib.attrs)

Expand Down
Loading