diff --git a/WORKSPACE b/WORKSPACE
index ba9f1bed9..7621a2203 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -15,26 +15,23 @@ http_archive(
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.1.0/rules_nodejs-v6.1.0.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 7617c7edf..11040adf7 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 7f536f9cd..434ce8fd1 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 b5a41caa7..6cfbceea0 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/git_dep_metadata/WORKSPACE b/e2e/git_dep_metadata/WORKSPACE
index 639f1b98c..3aff4b101 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/WORKSPACE b/e2e/gyp_no_install_script/WORKSPACE
index 1db57136f..b2fd0875c 100644
--- a/e2e/gyp_no_install_script/WORKSPACE
+++ b/e2e/gyp_no_install_script/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/js_image_docker/WORKSPACE b/e2e/js_image_docker/WORKSPACE
index 0c87270da..bfbc19295 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 9e7df1dd8..69fb64f45 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/WORKSPACE b/e2e/js_run_devserver/WORKSPACE
index 762ce191f..0df90cadc 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 cfe378efb..8003b7365 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 4a853a1cf..3efb3984b 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/WORKSPACE b/e2e/npm_translate_lock/WORKSPACE
index 5631b25e9..a385453a8 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/WORKSPACE b/e2e/npm_translate_lock_auth/WORKSPACE
index 8e31b6545..025bd07a5 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/WORKSPACE b/e2e/npm_translate_lock_empty/WORKSPACE
index 6d21251f8..699955a86 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/WORKSPACE b/e2e/npm_translate_lock_git+ssh/WORKSPACE
index 8e31b6545..025bd07a5 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/WORKSPACE b/e2e/npm_translate_lock_multi/WORKSPACE
index bdd846b2a..d9dea8cc7 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/WORKSPACE b/e2e/npm_translate_lock_partial_clone/WORKSPACE
index 58a8f42bb..dbf6cc575 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/WORKSPACE b/e2e/npm_translate_lock_subdir_patch/WORKSPACE
index 5d76c8584..462333416 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/WORKSPACE b/e2e/npm_translate_package_lock/WORKSPACE
index c679ded11..a1dba35c5 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/WORKSPACE b/e2e/npm_translate_yarn_lock/WORKSPACE
index f14e83126..fccd508c0 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/WORKSPACE b/e2e/package_json_module/WORKSPACE
index ea3ccba58..ce9aad113 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/WORKSPACE b/e2e/patch_from_repo/WORKSPACE
index 1ccc9e8d5..4a553dfd2 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/WORKSPACE b/e2e/pnpm_repo_install/WORKSPACE
index ea3ccba58..ce9aad113 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/WORKSPACE b/e2e/pnpm_workspace/WORKSPACE
index 53eda86e1..6d0446ffb 100644
--- a/e2e/pnpm_workspace/WORKSPACE
+++ b/e2e/pnpm_workspace/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_deps/WORKSPACE b/e2e/pnpm_workspace_deps/WORKSPACE
index e43c4a5b9..ea83adff1 100644
--- a/e2e/pnpm_workspace_deps/WORKSPACE
+++ b/e2e/pnpm_workspace_deps/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_rerooted/WORKSPACE b/e2e/pnpm_workspace_rerooted/WORKSPACE
index 1245ca46f..03313e9ba 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 4a8215532..a2ca68398 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/WORKSPACE b/e2e/stamped_package_json/WORKSPACE
index 568e0f5dc..f9c2003be 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/WORKSPACE b/e2e/update_pnpm_lock/WORKSPACE
index 144abdba3..b2b8dacdc 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/WORKSPACE b/e2e/update_pnpm_lock_with_import/WORKSPACE
index 9d2b79e4a..ec61b568d 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/WORKSPACE b/e2e/vendored_node/WORKSPACE
index bf9bddbcf..a9743def6 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 6e439e759..afb898fc1 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/WORKSPACE b/e2e/vendored_tarfile/WORKSPACE
index 4c75f2cfb..08c0c9177 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/WORKSPACE b/e2e/verify_patches/WORKSPACE
index 1e7cc8666..a00aa0d39 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/WORKSPACE b/e2e/webpack_devserver/WORKSPACE
index afeb53a42..61814fa89 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/WORKSPACE b/e2e/webpack_devserver_esm/WORKSPACE
index afeb53a42..61814fa89 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/WORKSPACE b/e2e/worker/WORKSPACE
index fd70c1137..267b70039 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 6b21dcbc0..eb33107da 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 000000000..8ac5fa28d
--- /dev/null
+++ b/js/configure.bzl
@@ -0,0 +1,81 @@
+"""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("@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": "