Skip to content
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
34 changes: 17 additions & 17 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/testdata/nodejs24.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ commandTests:
- name: nodejs
command: "/nodejs/bin/node"
args: ["--version"]
expectedOutput: ["v24.7.0"]
expectedOutput: ["v24.8.0"]
32 changes: 16 additions & 16 deletions private/extensions/node.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -199,40 +199,40 @@ def _node_impl(module_ctx):

node_archive(
name = "nodejs24_amd64",
sha256 = "8cf85258402e056efa041168c9b162a4e3b229ebfad5000850b8941c974e9d5a",
strip_prefix = "node-v24.7.0-linux-x64/",
urls = ["https://nodejs.org/dist/v24.7.0/node-v24.7.0-linux-x64.tar.gz"],
version = "24.7.0",
sha256 = "daf68404b478b4c3616666580d02500a24148c0f439e4d0134d65ce70e90e655",
strip_prefix = "node-v24.8.0-linux-x64/",
urls = ["https://nodejs.org/dist/v24.8.0/node-v24.8.0-linux-x64.tar.gz"],
version = "24.8.0",
architecture = "amd64",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_arm64",
sha256 = "04df0283d2a8a06271a690fbe2528661527b3a09f0f28c8bb63327d8888be184",
strip_prefix = "node-v24.7.0-linux-arm64/",
urls = ["https://nodejs.org/dist/v24.7.0/node-v24.7.0-linux-arm64.tar.gz"],
version = "24.7.0",
sha256 = "5eb16b14af5a5f494ed54770822144e847c744fe590f8df093ad4927cf3dd7fd",
strip_prefix = "node-v24.8.0-linux-arm64/",
urls = ["https://nodejs.org/dist/v24.8.0/node-v24.8.0-linux-arm64.tar.gz"],
version = "24.8.0",
architecture = "arm64",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_ppc64le",
sha256 = "85378129414ca95c509317360c519328ae98d34160fc852408ba0209033e5f82",
strip_prefix = "node-v24.7.0-linux-ppc64le/",
urls = ["https://nodejs.org/dist/v24.7.0/node-v24.7.0-linux-ppc64le.tar.gz"],
version = "24.7.0",
sha256 = "20a0856e7b152a5e83b4fd6fe3d509aa54b75d6170cd89066c341d56f6c5de76",
strip_prefix = "node-v24.8.0-linux-ppc64le/",
urls = ["https://nodejs.org/dist/v24.8.0/node-v24.8.0-linux-ppc64le.tar.gz"],
version = "24.8.0",
architecture = "ppc64le",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_s390x",
sha256 = "d5b26b197795872dbd69f4dd8c275e8a08ca1be69c9e013e3cd9a6f68939e59d",
strip_prefix = "node-v24.7.0-linux-s390x/",
urls = ["https://nodejs.org/dist/v24.7.0/node-v24.7.0-linux-s390x.tar.gz"],
version = "24.7.0",
sha256 = "708d4edfafca2218fa98e0e8b8c20dc148334f2f882fcea1237c6536e8586d06",
strip_prefix = "node-v24.8.0-linux-s390x/",
urls = ["https://nodejs.org/dist/v24.8.0/node-v24.8.0-linux-s390x.tar.gz"],
version = "24.8.0",
architecture = "s390x",
control = "//nodejs:control",
)
Comment on lines 200 to 238
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce code duplication, consider refactoring the nodejs24 archive definitions. You can define the version and architecture-specific details in a data structure (like a dictionary) and then use a loop to generate the node_archive calls. This will make future version bumps easier and less error-prone. A similar refactoring could be applied to the other Node.js versions as well.

If this file is auto-generated, consider updating the generation script to produce this more compact and maintainable output.

    _NODE24_VERSION = "24.8.0"
    _NODE24_ARCHES = {
        "amd64": ("x64", "daf68404b478b4c3616666580d02500a24148c0f439e4d0134d65ce70e90e655"),
        "arm64": ("arm64", "5eb16b14af5a5f494ed54770822144e847c744fe590f8df093ad4927cf3dd7fd"),
        "ppc64le": ("ppc64le", "20a0856e7b152a5e83b4fd6fe3d509aa54b75d6170cd89066c341d56f6c5de76"),
        "s390x": ("s390x", "708d4edfafca2218fa98e0e8b8c20dc148334f2f882fcea1237c6536e8586d06"),
    }

    for arch, (platform, sha256) in _NODE24_ARCHES.items():
        node_archive(
            name = "nodejs24_{}".format(arch),
            sha256 = sha256,
            strip_prefix = "node-v{v}-linux-{p}/".format(v=_NODE24_VERSION, p=platform),
            urls = ["https://nodejs.org/dist/v{v}/node-v{v}-linux-{p}.tar.gz".format(v=_NODE24_VERSION, p=platform)],
            version = _NODE24_VERSION,
            architecture = arch,
            control = "//nodejs:control",
        )

Expand Down
Loading