Skip to content

Commit

Permalink
refactor: move toolchain registration call to new rules_js_register_t…
Browse files Browse the repository at this point in the history
…oolchains WORKSPACE function (#1593)
  • Loading branch information
gregmagolan committed May 20, 2024
1 parent 1676ffd commit 8f34a4c
Show file tree
Hide file tree
Showing 48 changed files with 177 additions and 333 deletions.
15 changes: 6 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ load("//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", "register_expand_template_toolchains", "register_jq_toolchains")
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")

register_expand_template_toolchains()
rules_js_register_toolchains(node_version = "16.14.2")

register_jq_toolchains()
load("@aspect_bazel_lib//lib:repositories.bzl", "register_expand_template_toolchains")

load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
register_expand_template_toolchains()

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(
Expand Down
5 changes: 1 addition & 4 deletions docs/npm_import.md

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

8 changes: 0 additions & 8 deletions docs/npm_package.md

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

7 changes: 0 additions & 7 deletions docs/npm_translate_lock.md

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

7 changes: 2 additions & 5 deletions e2e/git_dep_metadata/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_import")

Expand Down
7 changes: 2 additions & 5 deletions e2e/gyp_no_install_script/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_bazel_lib//lib:repositories.bzl", "register_coreutils_toolchains")

Expand Down
1 change: 1 addition & 0 deletions e2e/js_image_docker/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.14.2
7 changes: 2 additions & 5 deletions e2e/js_image_docker/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = "16.14.2",
)
rules_js_register_toolchains(node_version_from_nvmrc = "//:.nvmrc")

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/js_image_oci/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = "16.14.2",
)
rules_js_register_toolchains(node_version = "16.14.2")

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/js_run_devserver/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_link_package-esm/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = "16.9.0",
)
rules_js_register_toolchains(node_version = "16.9.0")

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_link_package/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = "16.14.2",
)
rules_js_register_toolchains(node_version = "16.14.2")

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_auth/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_empty/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_git+ssh/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_multi/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_partial_clone/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_lock_subdir_patch/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_package_lock/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/npm_translate_yarn_lock/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/package_json_module/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
7 changes: 2 additions & 5 deletions e2e/patch_from_repo/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
4 changes: 4 additions & 0 deletions e2e/pnpm_lockfiles/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")

rules_js_register_toolchains()

load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

nodejs_register_toolchains(
Expand Down
7 changes: 2 additions & 5 deletions e2e/pnpm_repo_install/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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:toolchains.bzl", "rules_js_register_toolchains")

nodejs_register_toolchains(
name = "nodejs",
node_version = DEFAULT_NODE_VERSION,
)
rules_js_register_toolchains()

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

Expand Down
Loading

0 comments on commit 8f34a4c

Please sign in to comment.