diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh
index 05f74f566e..85008cee65 100755
--- a/.github/workflows/release_prep.sh
+++ b/.github/workflows/release_prep.sh
@@ -33,7 +33,7 @@ bazel_dep(name = "aspect_rules_js", version = "${TAG:1}")
####### Node.js version #########
# By default you get the node version from DEFAULT_NODE_VERSION in @rules_nodejs//nodejs:repositories.bzl
# Optionally you can pin a different node version:
-bazel_dep(name = "rules_nodejs", version = "5.8.2")
+bazel_dep(name = "rules_nodejs", version = "6.0.5")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "16.14.2")
#################################
diff --git a/MODULE.bazel b/MODULE.bazel
index 01e43969b7..84cfdcb7aa 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -12,19 +12,16 @@ bazel_dep(name = "aspect_bazel_lib", version = "2.6.1")
bazel_dep(name = "aspect_rules_lint", version = "0.12.0")
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
+bazel_dep(name = "rules_nodejs", version = "6.0.5")
+bazel_dep(name = "platforms", version = "0.0.5")
-# Keep v5 in to avoid breaking changes.
-# TODO(2.0): change minimum to v6
-bazel_dep(name = "rules_nodejs", version = "5.8.2")
-
-# Override rules_nodejs to v6 to test the latest and recommended version internally.
-single_version_override(
+archive_override(
module_name = "rules_nodejs",
- version = "6.0.5",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
)
-bazel_dep(name = "platforms", version = "0.0.5")
-
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_darwin_amd64")
use_repo(node, "nodejs_darwin_arm64")
diff --git a/WORKSPACE b/WORKSPACE
index 4f6f21f6ad..e1f8e2540a 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -3,38 +3,23 @@ workspace(
name = "aspect_rules_js",
)
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-# Override rules_nodejs to v6 to test the latest and recommended versional internally,
-# while keeping v5 in rules_js_dependencies() to avoid breaking changes.
-# TODO(2.0): change minimum to v6 in repositories.bzl
-http_archive(
- name = "rules_nodejs",
- sha256 = "a50986c7d2f2dc43a5b9b81a6245fd89bdc4866f1d5e316d9cef2782dd859292",
- strip_prefix = "rules_nodejs-6.0.5",
- url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.0.5/rules_nodejs-v6.0.5.tar.gz",
-)
-
-load("//js:dev_repositories.bzl", "rules_js_dev_dependencies")
+load("@aspect_rules_js//js:dev_repositories.bzl", "rules_js_dev_dependencies")
rules_js_dev_dependencies()
-load("//js:repositories.bzl", "rules_js_dependencies")
+load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies", "register_jq_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-aspect_bazel_lib_dependencies()
+rules_js_configure(node_version = "16.14.2")
-register_jq_toolchains()
+load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+aspect_bazel_lib_dependencies()
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
# Alternate toolchains for testing across versions
nodejs_register_toolchains(
diff --git a/docs/npm_import.md b/docs/npm_import.md
index 7617c7edfb..11040adf78 100644
--- a/docs/npm_import.md
+++ b/docs/npm_import.md
@@ -28,8 +28,7 @@ npm_import(name, pa
link_workspace, link_packages, lifecycle_hooks, lifecycle_hooks_execution_requirements,
lifecycle_hooks_env, lifecycle_hooks_use_default_shell_env, integrity, url, commit,
replace_package, package_visibility, patch_args, patches, custom_postinstall, npm_auth,
- npm_auth_basic, npm_auth_username, npm_auth_password, bins, dev,
- register_copy_directory_toolchains, register_copy_to_directory_toolchains, kwargs)
+ npm_auth_basic, npm_auth_username, npm_auth_password, bins, dev, kwargs)
Import a single npm package into Bazel.
@@ -161,8 +160,6 @@ Read more about the downloader config: <https://blog.aspect.dev/configuring-b
| npm_auth_password | Auth password to authenticate with npm. When using Basic authentication. | ""
|
| bins | Dictionary of node_modules/.bin
binary files to create mapped to their node entry points.
This is typically derived from the "bin" attribute in the package.json file of the npm package being linked.
For example:
bins = { "foo": "./foo.js", "bar": "./bar.js", }
{}
|
| dev | Whether this npm package is a dev dependency | False
|
-| register_copy_directory_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_copy_directory_toolchains()
is called if the toolchain is not already registered | True
|
-| register_copy_to_directory_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_copy_to_directory_toolchains()
is called if the toolchain is not already registered | True
|
| kwargs | Internal use only | none |
diff --git a/docs/npm_package.md b/docs/npm_package.md
index 7f536f9cd0..434ce8fd1d 100644
--- a/docs/npm_package.md
+++ b/docs/npm_package.md
@@ -146,14 +146,6 @@ This ensures that actions which use the package.json file can get cache hits.
For more information on stamping, read https://docs.aspect.build/rules/aspect_bazel_lib/docs/stamping.
-Using this rule requires that you register the jq toolchain in your WORKSPACE:
-
-```starlark
-load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
-
-register_jq_toolchains()
-```
-
**PARAMETERS**
diff --git a/docs/npm_translate_lock.md b/docs/npm_translate_lock.md
index b5a41caa73..6cfbceea01 100644
--- a/docs/npm_translate_lock.md
+++ b/docs/npm_translate_lock.md
@@ -67,8 +67,6 @@ npm_translate_lock(name, lifecycle_hooks_use_default_shell_env, replace_packages, bins,
verify_node_modules_ignored, verify_patches, quiet,
external_repository_action_cache, link_workspace, pnpm_version, use_pnpm,
- register_copy_directory_toolchains, register_copy_to_directory_toolchains,
- register_coreutils_toolchains, register_yq_toolchains, register_tar_toolchains,
npm_package_target_name, use_starlark_yaml_parser, kwargs)
@@ -133,11 +131,6 @@ For more about how to use npm_translate_lock, read [pnpm and rules_js](/docs/pnp
| link_workspace | The workspace name where links will be created for the packages in this lock file.None
|
| pnpm_version | pnpm version to use when generating the @pnpm repository. Set to None to not create this repository.LATEST_PNPM_VERSION
will be used.use_pnpm
for bzlmod. | "8.15.3"
|
| use_pnpm | label of the pnpm extension to use.LATEST_PNPM_VERSION
) will be used.pnpm_version
for non-bzlmod. | None
|
-| register_copy_directory_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_copy_directory_toolchains()
is called if the toolchain is not already registered | True
|
-| register_copy_to_directory_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_copy_to_directory_toolchains()
is called if the toolchain is not already registered | True
|
-| register_coreutils_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_coreutils_toolchains()
is called if the toolchain is not already registered | True
|
-| register_yq_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_yq_toolchains()
is called if the toolchain is not already registered | True
|
-| register_tar_toolchains | if True, @aspect_bazel_lib//lib:repositories.bzl
register_tar_toolchains()
is called if the toolchain is not already registered | True
|
| npm_package_target_name | The name of linked npm_package
targets. When npm_package
targets are linked as pnpm workspace packages, the name of the target must align with this value.{dirname}
placeholder is replaced with the directory name of the target.{dirname}
| "{dirname}"
|
| use_starlark_yaml_parser | Opt-out of using yq
to parse the pnpm-lock file which was added in https://github.com/aspect-build/rules_js/pull/1458 and use the legacy starlark yaml parser instead. resolution: {tarball: https://gitpkg.vercel.app/blockprotocol/blockprotocol/packages/%40blockprotocol/type-system-web?6526c0e}
?
character in the tarball
value causes yq
to fail with: $ yq pnpm-lock.yaml -o=json Error: bad file 'pnpm-lock.yaml': yaml: line 7129: did not find expected ',' or '}'
False
|
| kwargs | Internal use only | none |
diff --git a/e2e/bzlmod/MODULE.bazel b/e2e/bzlmod/MODULE.bazel
index 63dc45f18f..34fdd06c60 100644
--- a/e2e/bzlmod/MODULE.bazel
+++ b/e2e/bzlmod/MODULE.bazel
@@ -13,6 +13,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
diff --git a/e2e/git_dep_metadata/MODULE.bazel b/e2e/git_dep_metadata/MODULE.bazel
index 53790230c4..6c51686e57 100644
--- a/e2e/git_dep_metadata/MODULE.bazel
+++ b/e2e/git_dep_metadata/MODULE.bazel
@@ -9,6 +9,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
diff --git a/e2e/git_dep_metadata/WORKSPACE b/e2e/git_dep_metadata/WORKSPACE
index 639f1b98cf..3aff4b101b 100644
--- a/e2e/git_dep_metadata/WORKSPACE
+++ b/e2e/git_dep_metadata/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_import")
diff --git a/e2e/gyp_no_install_script/MODULE.bazel b/e2e/gyp_no_install_script/MODULE.bazel
index 1372781b93..cee18937c0 100644
--- a/e2e/gyp_no_install_script/MODULE.bazel
+++ b/e2e/gyp_no_install_script/MODULE.bazel
@@ -5,6 +5,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/gyp_no_install_script/WORKSPACE b/e2e/gyp_no_install_script/WORKSPACE
index a7c5ba1c23..32a7bbbd8d 100644
--- a/e2e/gyp_no_install_script/WORKSPACE
+++ b/e2e/gyp_no_install_script/WORKSPACE
@@ -16,12 +16,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/js_image_docker/WORKSPACE b/e2e/js_image_docker/WORKSPACE
index 0c87270dac..bfbc19295e 100644
--- a/e2e/js_image_docker/WORKSPACE
+++ b/e2e/js_image_docker/WORKSPACE
@@ -12,12 +12,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+rules_js_configure(node_version = "16.14.2")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/js_image_oci/WORKSPACE b/e2e/js_image_oci/WORKSPACE
index 9e7df1dd8b..69fb64f45a 100644
--- a/e2e/js_image_oci/WORKSPACE
+++ b/e2e/js_image_oci/WORKSPACE
@@ -14,12 +14,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+rules_js_configure(node_version = "16.14.2")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/js_run_devserver/MODULE.bazel b/e2e/js_run_devserver/MODULE.bazel
index d618ac47af..c4065af92b 100644
--- a/e2e/js_run_devserver/MODULE.bazel
+++ b/e2e/js_run_devserver/MODULE.bazel
@@ -14,6 +14,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
use_repo(pnpm, "pnpm")
diff --git a/e2e/js_run_devserver/WORKSPACE b/e2e/js_run_devserver/WORKSPACE
index 762ce191fe..0df90cadca 100644
--- a/e2e/js_run_devserver/WORKSPACE
+++ b/e2e/js_run_devserver/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_link_package-esm/WORKSPACE b/e2e/npm_link_package-esm/WORKSPACE
index cfe378efb9..8003b7365a 100644
--- a/e2e/npm_link_package-esm/WORKSPACE
+++ b/e2e/npm_link_package-esm/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.9.0",
-)
+rules_js_configure(node_version = "16.9.0")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_link_package/WORKSPACE b/e2e/npm_link_package/WORKSPACE
index 4a853a1cf3..3efb3984b3 100644
--- a/e2e/npm_link_package/WORKSPACE
+++ b/e2e/npm_link_package/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+rules_js_configure(node_version = "16.14.2")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock/MODULE.bazel b/e2e/npm_translate_lock/MODULE.bazel
index a662b2d829..44c2cf3917 100644
--- a/e2e/npm_translate_lock/MODULE.bazel
+++ b/e2e/npm_translate_lock/MODULE.bazel
@@ -14,6 +14,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock/WORKSPACE b/e2e/npm_translate_lock/WORKSPACE
index 5631b25e93..a385453a8a 100644
--- a/e2e/npm_translate_lock/WORKSPACE
+++ b/e2e/npm_translate_lock/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_auth/MODULE.bazel b/e2e/npm_translate_lock_auth/MODULE.bazel
index a08b9d0c39..72de027d28 100644
--- a/e2e/npm_translate_lock_auth/MODULE.bazel
+++ b/e2e/npm_translate_lock_auth/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock_auth/WORKSPACE b/e2e/npm_translate_lock_auth/WORKSPACE
index 8e31b65456..025bd07a5d 100644
--- a/e2e/npm_translate_lock_auth/WORKSPACE
+++ b/e2e/npm_translate_lock_auth/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_empty/MODULE.bazel b/e2e/npm_translate_lock_empty/MODULE.bazel
index 0951f49973..aee100bf49 100644
--- a/e2e/npm_translate_lock_empty/MODULE.bazel
+++ b/e2e/npm_translate_lock_empty/MODULE.bazel
@@ -14,6 +14,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock_empty/WORKSPACE b/e2e/npm_translate_lock_empty/WORKSPACE
index 6d21251f8f..699955a86b 100644
--- a/e2e/npm_translate_lock_empty/WORKSPACE
+++ b/e2e/npm_translate_lock_empty/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_git+ssh/MODULE.bazel b/e2e/npm_translate_lock_git+ssh/MODULE.bazel
index 8fdfa23f49..6466ac46e4 100644
--- a/e2e/npm_translate_lock_git+ssh/MODULE.bazel
+++ b/e2e/npm_translate_lock_git+ssh/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock_git+ssh/WORKSPACE b/e2e/npm_translate_lock_git+ssh/WORKSPACE
index 8e31b65456..025bd07a5d 100644
--- a/e2e/npm_translate_lock_git+ssh/WORKSPACE
+++ b/e2e/npm_translate_lock_git+ssh/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_multi/MODULE.bazel b/e2e/npm_translate_lock_multi/MODULE.bazel
index 9be8a7e1b9..ebb6e1d5d8 100644
--- a/e2e/npm_translate_lock_multi/MODULE.bazel
+++ b/e2e/npm_translate_lock_multi/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "app1_npm",
diff --git a/e2e/npm_translate_lock_multi/WORKSPACE b/e2e/npm_translate_lock_multi/WORKSPACE
index bdd846b2a0..d9dea8cc7f 100644
--- a/e2e/npm_translate_lock_multi/WORKSPACE
+++ b/e2e/npm_translate_lock_multi/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_partial_clone/MODULE.bazel b/e2e/npm_translate_lock_partial_clone/MODULE.bazel
index 6ab0ba32f3..5974e9f0c1 100644
--- a/e2e/npm_translate_lock_partial_clone/MODULE.bazel
+++ b/e2e/npm_translate_lock_partial_clone/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock_partial_clone/WORKSPACE b/e2e/npm_translate_lock_partial_clone/WORKSPACE
index 58a8f42bb5..dbf6cc5755 100644
--- a/e2e/npm_translate_lock_partial_clone/WORKSPACE
+++ b/e2e/npm_translate_lock_partial_clone/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel
index 07f4464bb0..d638129a09 100644
--- a/e2e/npm_translate_lock_subdir_patch/MODULE.bazel
+++ b/e2e/npm_translate_lock_subdir_patch/MODULE.bazel
@@ -5,6 +5,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_lock_subdir_patch/WORKSPACE b/e2e/npm_translate_lock_subdir_patch/WORKSPACE
index 5d76c85843..4623334162 100644
--- a/e2e/npm_translate_lock_subdir_patch/WORKSPACE
+++ b/e2e/npm_translate_lock_subdir_patch/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_package_lock/MODULE.bazel b/e2e/npm_translate_package_lock/MODULE.bazel
index cfb93b3cf3..dbc816ae20 100644
--- a/e2e/npm_translate_package_lock/MODULE.bazel
+++ b/e2e/npm_translate_package_lock/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/npm_translate_package_lock/WORKSPACE b/e2e/npm_translate_package_lock/WORKSPACE
index c679ded11c..a1dba35c5d 100644
--- a/e2e/npm_translate_package_lock/WORKSPACE
+++ b/e2e/npm_translate_package_lock/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/npm_translate_yarn_lock/MODULE.bazel b/e2e/npm_translate_yarn_lock/MODULE.bazel
index a963a45c13..56fe685fe5 100644
--- a/e2e/npm_translate_yarn_lock/MODULE.bazel
+++ b/e2e/npm_translate_yarn_lock/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
name = "pnpm-old-version",
diff --git a/e2e/npm_translate_yarn_lock/WORKSPACE b/e2e/npm_translate_yarn_lock/WORKSPACE
index f14e83126e..fccd508c07 100644
--- a/e2e/npm_translate_yarn_lock/WORKSPACE
+++ b/e2e/npm_translate_yarn_lock/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/package_json_module/MODULE.bazel b/e2e/package_json_module/MODULE.bazel
index e50d4f9fe9..6415c54ffb 100644
--- a/e2e/package_json_module/MODULE.bazel
+++ b/e2e/package_json_module/MODULE.bazel
@@ -11,6 +11,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/package_json_module/WORKSPACE b/e2e/package_json_module/WORKSPACE
index ea3ccba585..ce9aad1139 100644
--- a/e2e/package_json_module/WORKSPACE
+++ b/e2e/package_json_module/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/patch_from_repo/MODULE.bazel b/e2e/patch_from_repo/MODULE.bazel
index b59a59ab91..9630f8b00f 100644
--- a/e2e/patch_from_repo/MODULE.bazel
+++ b/e2e/patch_from_repo/MODULE.bazel
@@ -8,6 +8,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
local_path_override(
module_name = "local_repo",
path = "./local_repo",
diff --git a/e2e/patch_from_repo/WORKSPACE b/e2e/patch_from_repo/WORKSPACE
index 1ccc9e8d57..4a553dfd25 100644
--- a/e2e/patch_from_repo/WORKSPACE
+++ b/e2e/patch_from_repo/WORKSPACE
@@ -12,12 +12,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/pnpm_repo_install/MODULE.bazel b/e2e/pnpm_repo_install/MODULE.bazel
index 7d9cdfa334..121f8cf365 100644
--- a/e2e/pnpm_repo_install/MODULE.bazel
+++ b/e2e/pnpm_repo_install/MODULE.bazel
@@ -11,6 +11,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
diff --git a/e2e/pnpm_repo_install/WORKSPACE b/e2e/pnpm_repo_install/WORKSPACE
index ea3ccba585..ce9aad1139 100644
--- a/e2e/pnpm_repo_install/WORKSPACE
+++ b/e2e/pnpm_repo_install/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/pnpm_workspace/MODULE.bazel b/e2e/pnpm_workspace/MODULE.bazel
index bc99a1027c..9c714d02c0 100644
--- a/e2e/pnpm_workspace/MODULE.bazel
+++ b/e2e/pnpm_workspace/MODULE.bazel
@@ -13,6 +13,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
diff --git a/e2e/pnpm_workspace/WORKSPACE b/e2e/pnpm_workspace/WORKSPACE
index dd33ea19dc..3647d6ecef 100644
--- a/e2e/pnpm_workspace/WORKSPACE
+++ b/e2e/pnpm_workspace/WORKSPACE
@@ -20,12 +20,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/pnpm_workspace_deps/MODULE.bazel b/e2e/pnpm_workspace_deps/MODULE.bazel
index 1943f8cb17..8b47895283 100644
--- a/e2e/pnpm_workspace_deps/MODULE.bazel
+++ b/e2e/pnpm_workspace_deps/MODULE.bazel
@@ -11,6 +11,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/pnpm_workspace_deps/WORKSPACE b/e2e/pnpm_workspace_deps/WORKSPACE
index aaeb000e73..3918784976 100644
--- a/e2e/pnpm_workspace_deps/WORKSPACE
+++ b/e2e/pnpm_workspace_deps/WORKSPACE
@@ -20,12 +20,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/pnpm_workspace_rerooted/MODULE.bazel b/e2e/pnpm_workspace_rerooted/MODULE.bazel
index a7e77bf4b0..f1678d5d75 100644
--- a/e2e/pnpm_workspace_rerooted/MODULE.bazel
+++ b/e2e/pnpm_workspace_rerooted/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(
name = "nodejs",
diff --git a/e2e/pnpm_workspace_rerooted/WORKSPACE b/e2e/pnpm_workspace_rerooted/WORKSPACE
index 1245ca46f1..03313e9bae 100644
--- a/e2e/pnpm_workspace_rerooted/WORKSPACE
+++ b/e2e/pnpm_workspace_rerooted/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+rules_js_configure(node_version = "16.14.2")
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/rules_foo/WORKSPACE b/e2e/rules_foo/WORKSPACE
index 4a82155329..a2ca683983 100644
--- a/e2e/rules_foo/WORKSPACE
+++ b/e2e/rules_foo/WORKSPACE
@@ -10,12 +10,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = "16.14.2",
-)
+rules_js_configure(node_version = "16.14.2")
load("@rules_foo//foo:repositories.bzl", "foo_repositories")
diff --git a/e2e/stamped_package_json/MODULE.bazel b/e2e/stamped_package_json/MODULE.bazel
index 47783e1b8e..9221f2d799 100644
--- a/e2e/stamped_package_json/MODULE.bazel
+++ b/e2e/stamped_package_json/MODULE.bazel
@@ -10,3 +10,10 @@ local_path_override(
module_name = "aspect_rules_js",
path = "../..",
)
+
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
diff --git a/e2e/stamped_package_json/WORKSPACE b/e2e/stamped_package_json/WORKSPACE
index 568e0f5dcd..f9c2003be6 100644
--- a/e2e/stamped_package_json/WORKSPACE
+++ b/e2e/stamped_package_json/WORKSPACE
@@ -7,6 +7,6 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@aspect_bazel_lib//lib:repositories.bzl", "register_jq_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-register_jq_toolchains()
+rules_js_configure()
diff --git a/e2e/update_pnpm_lock/MODULE.bazel b/e2e/update_pnpm_lock/MODULE.bazel
index 665bfe9a47..6d3c937e69 100644
--- a/e2e/update_pnpm_lock/MODULE.bazel
+++ b/e2e/update_pnpm_lock/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/update_pnpm_lock/WORKSPACE b/e2e/update_pnpm_lock/WORKSPACE
index 144abdba32..b2b8dacdc5 100644
--- a/e2e/update_pnpm_lock/WORKSPACE
+++ b/e2e/update_pnpm_lock/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/update_pnpm_lock_with_import/MODULE.bazel b/e2e/update_pnpm_lock_with_import/MODULE.bazel
index 0c823fa761..5b3af67879 100644
--- a/e2e/update_pnpm_lock_with_import/MODULE.bazel
+++ b/e2e/update_pnpm_lock_with_import/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
# Validate that we can use a yarn.lock file in place of pnpm-lock.yaml
diff --git a/e2e/update_pnpm_lock_with_import/WORKSPACE b/e2e/update_pnpm_lock_with_import/WORKSPACE
index 9d2b79e4a5..ec61b568db 100644
--- a/e2e/update_pnpm_lock_with_import/WORKSPACE
+++ b/e2e/update_pnpm_lock_with_import/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/vendored_node/MODULE.bazel b/e2e/vendored_node/MODULE.bazel
index 9edb4ac54b..deac42a65b 100644
--- a/e2e/vendored_node/MODULE.bazel
+++ b/e2e/vendored_node/MODULE.bazel
@@ -14,4 +14,11 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
register_toolchains("//toolchains:all")
diff --git a/e2e/vendored_node/WORKSPACE b/e2e/vendored_node/WORKSPACE
index bf9bddbcf6..a9743def62 100644
--- a/e2e/vendored_node/WORKSPACE
+++ b/e2e/vendored_node/WORKSPACE
@@ -7,9 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@bazel_features//:deps.bzl", "bazel_features_deps")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-bazel_features_deps()
+rules_js_configure(register_nodejs_toolchain = False)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
diff --git a/e2e/vendored_node/toolchains/BUILD.bazel b/e2e/vendored_node/toolchains/BUILD.bazel
index 6e439e7594..afb898fc1f 100644
--- a/e2e/vendored_node/toolchains/BUILD.bazel
+++ b/e2e/vendored_node/toolchains/BUILD.bazel
@@ -11,7 +11,7 @@ load("@rules_nodejs//nodejs:toolchain.bzl", "node_toolchain")
[
toolchain(
- name = "node15_%s_toolchain" % os,
+ name = "node_vendored_%s_toolchain" % os,
exec_compatible_with = [
"@platforms//os:" + os,
"@platforms//cpu:x86_64",
@@ -28,15 +28,15 @@ load("@rules_nodejs//nodejs:toolchain.bzl", "node_toolchain")
node_toolchain(
name = "node_linux",
- target_tool = "@vendored_node_linux_amd64//:bin/node",
+ node = "@vendored_node_linux_amd64//:bin/node",
)
node_toolchain(
name = "node_macos",
- target_tool = "@vendored_node_darwin_amd64//:bin/node",
+ node = "@vendored_node_darwin_amd64//:bin/node",
)
node_toolchain(
name = "node_windows",
- target_tool = "@vendored_node_windows_amd64//:node.exe",
+ node = "@vendored_node_windows_amd64//:node.exe",
)
diff --git a/e2e/vendored_tarfile/MODULE.bazel b/e2e/vendored_tarfile/MODULE.bazel
index b8b4c539c6..cdc7a6233b 100644
--- a/e2e/vendored_tarfile/MODULE.bazel
+++ b/e2e/vendored_tarfile/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/vendored_tarfile/WORKSPACE b/e2e/vendored_tarfile/WORKSPACE
index 4c75f2cfb3..08c0c9177c 100644
--- a/e2e/vendored_tarfile/WORKSPACE
+++ b/e2e/vendored_tarfile/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/verify_patches/MODULE.bazel b/e2e/verify_patches/MODULE.bazel
index 41b0f53703..41167a4bd3 100644
--- a/e2e/verify_patches/MODULE.bazel
+++ b/e2e/verify_patches/MODULE.bazel
@@ -12,6 +12,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/verify_patches/WORKSPACE b/e2e/verify_patches/WORKSPACE
index 1e7cc86665..a00aa0d39a 100644
--- a/e2e/verify_patches/WORKSPACE
+++ b/e2e/verify_patches/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/webpack_devserver/MODULE.bazel b/e2e/webpack_devserver/MODULE.bazel
index 31b71c38e8..025362fdf8 100644
--- a/e2e/webpack_devserver/MODULE.bazel
+++ b/e2e/webpack_devserver/MODULE.bazel
@@ -7,6 +7,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/webpack_devserver/WORKSPACE b/e2e/webpack_devserver/WORKSPACE
index afeb53a424..61814fa89a 100644
--- a/e2e/webpack_devserver/WORKSPACE
+++ b/e2e/webpack_devserver/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/webpack_devserver_esm/MODULE.bazel b/e2e/webpack_devserver_esm/MODULE.bazel
index 74621c676c..cdf47170f1 100644
--- a/e2e/webpack_devserver_esm/MODULE.bazel
+++ b/e2e/webpack_devserver_esm/MODULE.bazel
@@ -7,6 +7,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
diff --git a/e2e/webpack_devserver_esm/WORKSPACE b/e2e/webpack_devserver_esm/WORKSPACE
index afeb53a424..61814fa89a 100644
--- a/e2e/webpack_devserver_esm/WORKSPACE
+++ b/e2e/webpack_devserver_esm/WORKSPACE
@@ -7,12 +7,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
+rules_js_configure()
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/e2e/worker/MODULE.bazel b/e2e/worker/MODULE.bazel
index 5761643951..d1d1beb1f4 100644
--- a/e2e/worker/MODULE.bazel
+++ b/e2e/worker/MODULE.bazel
@@ -11,6 +11,13 @@ local_path_override(
path = "../..",
)
+archive_override(
+ module_name = "rules_nodejs",
+ integrity = "sha256-pqOPIuJHFcv7kOCqYExYr6p0j/wPxdd4ywK/PMYXiBA=",
+ strip_prefix = "rules_nodejs-dd02dc8bda04ab272e392f3b6dbef8dab71587e6",
+ urls = ["https://github.com/bazelbuild/rules_nodejs/archive/dd02dc8bda04ab272e392f3b6dbef8dab71587e6.tar.gz"],
+)
+
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
diff --git a/e2e/worker/WORKSPACE b/e2e/worker/WORKSPACE
index fd70c11374..267b700391 100644
--- a/e2e/worker/WORKSPACE
+++ b/e2e/worker/WORKSPACE
@@ -7,14 +7,7 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- # nodejs 14 is used intentionally here, to assert AbortController polyfill is installed properly.
- node_version = "14.20.0",
-)
-
-load("@bazel_features//:deps.bzl", "bazel_features_deps")
-
-bazel_features_deps()
+# nodejs 14 is used intentionally here, to assert AbortController polyfill is installed properly.
+rules_js_configure(node_version = "14.20.0")
diff --git a/e2e/workspace/WORKSPACE b/e2e/workspace/WORKSPACE
index 6b21dcbc09..eb33107da4 100644
--- a/e2e/workspace/WORKSPACE
+++ b/e2e/workspace/WORKSPACE
@@ -9,17 +9,9 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
-load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")
+load("@aspect_rules_js//js:configure.bzl", "DEFAULT_NODE_VERSION", "rules_js_configure")
-nodejs_register_toolchains(
- name = "nodejs",
- node_version = DEFAULT_NODE_VERSION,
-)
-
-# For convenience, npm_translate_lock does this call automatically.
-# Uncomment if you don't call npm_translate_lock at all.
-#load("@bazel_features//:deps.bzl", "bazel_features_deps")
-#bazel_features_deps()
+rules_js_configure(node_version = DEFAULT_NODE_VERSION)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
diff --git a/js/configure.bzl b/js/configure.bzl
new file mode 100644
index 0000000000..e62854249c
--- /dev/null
+++ b/js/configure.bzl
@@ -0,0 +1,84 @@
+"""Configures transitive deps and registers toolchains required by rules_js.
+"""
+
+load(
+ "@aspect_bazel_lib//lib:repositories.bzl",
+ _register_copy_directory_toolchains = "register_copy_directory_toolchains",
+ _register_copy_to_directory_toolchains = "register_copy_to_directory_toolchains",
+ _register_coreutils_toolchains = "register_coreutils_toolchains",
+ _register_jq_toolchains = "register_jq_toolchains",
+ _register_tar_toolchains = "register_tar_toolchains",
+ _register_yq_toolchains = "register_yq_toolchains",
+)
+load("@bazel_features//:deps.bzl", "bazel_features_deps")
+load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains", _DEFAULT_NODE_REPOSITORY = "DEFAULT_NODE_REPOSITORY", _DEFAULT_NODE_VERSION = "DEFAULT_NODE_VERSION")
+
+DEFAULT_NODE_REPOSITORY = _DEFAULT_NODE_REPOSITORY
+DEFAULT_NODE_VERSION = _DEFAULT_NODE_VERSION
+
+def rules_js_configure(
+ node_download_auth = {},
+ node_repositories = {},
+ node_urls = None,
+ node_version = DEFAULT_NODE_VERSION,
+ node_version_from_nvmrc = None,
+ **kwargs):
+ """Configures transitive deps and toolchains required by rules_js.
+
+ Node.js toolchain comes from [rules_nodejs](https://docs.aspect.build/rulesets/rules_nodejs).
+ For more details on Node.js toolchain registration see
+ https://docs.aspect.build/rulesets/rules_nodejs/docs/core#node_repositories.
+
+ Additional required toolchains (jq, yq, copy_directory and copy_to_directory) come
+ from [Aspect bazel-lib](https://docs.aspect.build/rulesets/aspect_bazel_lib).
+
+ Args:
+ node_download_auth: Auth to use for all url requests when downloading Node
+
+ Example: {"type": "basic", "login": "