Skip to content

Commit 4ee8284

Browse files
committed
bzlmod: allow custom node_repositories definitions
1 parent ea47e8d commit 4ee8284

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: nodejs/extensions.bzl

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ load(
77
"DEFAULT_NODE_VERSION",
88
"nodejs_register_toolchains",
99
)
10+
load("//nodejs/private:node_versions.bzl", "NODE_VERSIONS")
11+
1012

1113
def _toolchain_repr(toolchain):
1214
""" Return a `toolchain` tag object representation useful for diagnostics """
@@ -47,6 +49,7 @@ def _toolchain_extension(module_ctx):
4749
nodejs_register_toolchains(
4850
name = k,
4951
node_version = v.node_version,
52+
node_repositories = v.node_versions,
5053
node_version_from_nvmrc = v.node_version_from_nvmrc,
5154
node_urls = v.node_urls,
5255
include_headers = v.include_headers,
@@ -62,6 +65,10 @@ _ATTRS = {
6265
doc = "Version of the Node.js interpreter",
6366
default = DEFAULT_NODE_VERSION,
6467
),
68+
"node_versions": attr.string_list_dict(
69+
doc = "Overrides to the default list of Node.js versions to download.",
70+
default = NODE_VERSIONS,
71+
),
6572
"node_version_from_nvmrc": attr.label(
6673
allow_single_file = True,
6774
doc = """The .nvmrc file containing the version of Node.js to use.

0 commit comments

Comments
 (0)