diff --git a/MODULE.bazel b/MODULE.bazel index f3351c571..d6e953a01 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -12,7 +12,17 @@ bazel_dep(name = "aspect_bazel_lib", version = "1.40.0") bazel_dep(name = "aspect_rules_lint", version = "0.9.1") bazel_dep(name = "bazel_features", version = "0.1.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") + +# 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( + module_name = "rules_nodejs", + version = "6.0.5", +) + bazel_dep(name = "platforms", version = "0.0.5") node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") diff --git a/WORKSPACE b/WORKSPACE index 9a4cf5d0c..4c1a7776d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -3,6 +3,18 @@ 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") rules_js_dev_dependencies() diff --git a/e2e/pnpm_repo_install/MODULE.bazel b/e2e/pnpm_repo_install/MODULE.bazel index 5d2aad31e..7d9cdfa33 100644 --- a/e2e/pnpm_repo_install/MODULE.bazel +++ b/e2e/pnpm_repo_install/MODULE.bazel @@ -4,7 +4,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "rules_nodejs", version = "5.8.2") +bazel_dep(name = "rules_nodejs", version = "6.0.5") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/e2e/pnpm_workspace/MODULE.bazel b/e2e/pnpm_workspace/MODULE.bazel index 1569b73e0..950b0719f 100644 --- a/e2e/pnpm_workspace/MODULE.bazel +++ b/e2e/pnpm_workspace/MODULE.bazel @@ -5,7 +5,7 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.4.1") -bazel_dep(name = "rules_nodejs", version = "5.8.2") +bazel_dep(name = "rules_nodejs", version = "6.0.5") bazel_dep(name = "aspect_bazel_lib", version = "2.2.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( diff --git a/e2e/pnpm_workspace_rerooted/MODULE.bazel b/e2e/pnpm_workspace_rerooted/MODULE.bazel index 51cfb513a..efb970613 100644 --- a/e2e/pnpm_workspace_rerooted/MODULE.bazel +++ b/e2e/pnpm_workspace_rerooted/MODULE.bazel @@ -4,7 +4,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "rules_nodejs", version = "5.8.2") +bazel_dep(name = "rules_nodejs", version = "6.0.5") bazel_dep(name = "aspect_bazel_lib", version = "1.40.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( diff --git a/e2e/vendored_node/MODULE.bazel b/e2e/vendored_node/MODULE.bazel index b34914099..1f27a2c61 100644 --- a/e2e/vendored_node/MODULE.bazel +++ b/e2e/vendored_node/MODULE.bazel @@ -6,7 +6,7 @@ module( bazel_dep(name = "aspect_bazel_lib", version = "1.40.0") bazel_dep(name = "aspect_rules_js", version = "0.0.0") -bazel_dep(name = "rules_nodejs", version = "5.8.2") +bazel_dep(name = "rules_nodejs", version = "6.0.5") bazel_dep(name = "platforms", version = "0.0.4") local_path_override( diff --git a/e2e/worker/MODULE.bazel b/e2e/worker/MODULE.bazel index 9ed1fafff..576164395 100644 --- a/e2e/worker/MODULE.bazel +++ b/e2e/worker/MODULE.bazel @@ -4,7 +4,7 @@ module( compatibility_level = 1, ) -bazel_dep(name = "rules_nodejs", version = "5.8.2") +bazel_dep(name = "rules_nodejs", version = "6.0.5") bazel_dep(name = "aspect_rules_js", version = "0.0.0") local_path_override( module_name = "aspect_rules_js", diff --git a/js/repositories.bzl b/js/repositories.bzl index 25eefda74..aa561d3b7 100644 --- a/js/repositories.bzl +++ b/js/repositories.bzl @@ -14,6 +14,7 @@ def rules_js_dependencies(): urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz"], ) + # TODO(2.0): update to rules_nodejs v6 http_archive( name = "rules_nodejs", sha256 = "8fc8e300cb67b89ceebd5b8ba6896ff273c84f6099fc88d23f24e7102319d8fd",