diff --git a/WORKSPACE b/WORKSPACE index 277372ace2..3b56211302 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -65,12 +65,6 @@ nodejs_register_toolchains( node_version = "15.14.0", ) -load("//:index.bzl", "BAZEL_VERSION", "SUPPORTED_BAZEL_VERSIONS", "node_repositories") - -node_repositories( - node_version = "16.5.0", -) - load("@build_bazel_rules_nodejs//:npm_deps.bzl", "npm_deps") npm_deps() @@ -170,6 +164,7 @@ bazel_skylib_workspace() # RBE configuration # +load("//:index.bzl", "BAZEL_VERSION", "SUPPORTED_BAZEL_VERSIONS") load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig") # Creates toolchain configuration for remote execution with BuildKite CI diff --git a/e2e/node_loader_no_preserve_symlinks/WORKSPACE b/e2e/node_loader_no_preserve_symlinks/WORKSPACE index aad72269d9..e409ab965e 100644 --- a/e2e/node_loader_no_preserve_symlinks/WORKSPACE +++ b/e2e/node_loader_no_preserve_symlinks/WORKSPACE @@ -17,9 +17,11 @@ load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_depende rules_nodejs_dependencies() -load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") +load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") -node_repositories() +nodejs_register_toolchains(name = "nodejs") + +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/vue/WORKSPACE b/examples/vue/WORKSPACE index 2ba86f73ae..d4ebd53abc 100644 --- a/examples/vue/WORKSPACE +++ b/examples/vue/WORKSPACE @@ -19,16 +19,11 @@ load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") nodejs_register_toolchains( name = "node16", - node_version = "16.9.0", -) - -load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install") - -node_repositories( node_version = "16.0.0", - package_json = ["//:package.json"], ) +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") + npm_install( name = "npm", exports_directories_only = True, diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl index 0a6c72ef37..4e3bb72793 100644 --- a/internal/node/node_repositories.bzl +++ b/internal/node/node_repositories.bzl @@ -43,6 +43,14 @@ def node_repositories(**kwargs): minimum_bazel_version = "4.0.0", ) + # buildifier: disable=print + print("""WARN: node_repositories is deprecated, please instead use: + load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") + nodejs_register_toolchains(name = "nodejs") + + See https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0 + """) + # This needs to be setup so toolchains can access nodejs for all different versions node_version = kwargs.get("node_version", DEFAULT_NODE_VERSION) for os_arch_name in OS_ARCH_NAMES: