Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: deprecate node_repositories #3171

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions e2e/node_loader_no_preserve_symlinks/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 2 additions & 7 deletions examples/vue/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions internal/node/node_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down