Skip to content

Commit

Permalink
Upgrade rules_nodejs to 5.4.2 (#6404)
Browse files Browse the repository at this point in the history
* Upgrade rules_nodejs to 5.4.2

* Lint and fix Bazel files
  • Loading branch information
mattsoulanille authored May 12, 2022
1 parent dbd362b commit de73970
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 55 deletions.
34 changes: 25 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,40 @@ bazel_skylib_workspace()

http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e4654",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz"],
sha256 = "e328cb2c9401be495fa7d79c306f5ee3040e8a03b2ebb79b022e15ca03770096",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.2/rules_nodejs-5.4.2.tar.gz"],
)

# Set up node version to use. Must come before rules_nodejs_dependencies()
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
# Install rules_nodejs dependencies.
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")

build_bazel_rules_nodejs_dependencies()

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

node_repositories(
nodejs_register_toolchains(
name = "nodejs",
node_version = "16.13.2",
package_json = ["//:package.json"],
)

# Install rules_nodejs dependencies.
load("@build_bazel_rules_nodejs//nodejs:repositories.bzl", "rules_nodejs_dependencies")
# Install the yarn tool
load("@rules_nodejs//nodejs:yarn_repositories.bzl", "yarn_repositories")

yarn_repositories(
name = "yarn",
node_repository = "nodejs",
)

rules_nodejs_dependencies()
# Install yarn packages
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")

yarn_install(
name = "npm",
exports_directories_only = False, # Required for ts_library
package_json = "//:package.json",
package_path = "/",
symlink_node_modules = True,
yarn = "@yarn//:bin/yarn",
yarn_lock = "//:yarn.lock",
)

Expand Down Expand Up @@ -86,6 +100,8 @@ esbuild_repositories(npm_repository = "npm")
# Emscripten toolchain
http_archive(
name = "emsdk",
# TODO: Remove repo_mapping when emsdk updates to rules_nodejs 5
repo_mapping = {"@nodejs": "@nodejs_host"},
sha256 = "7dc13d967705582e11ff62ae143425dbc63c38372f1a1b14f0cb681fda413714",
strip_prefix = "emsdk-3.1.4/bazel",
urls = ["https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.4.tar.gz"],
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"devDependencies": {
"@bazel/bazelisk": "^1.11.0",
"@bazel/buildifier": "4.2.4",
"@bazel/concatjs": "4.6.1",
"@bazel/esbuild": "4.6.1",
"@bazel/jasmine": "4.6.1",
"@bazel/rollup": "4.6.1",
"@bazel/terser": "4.6.1",
"@bazel/typescript": "4.6.1",
"@bazel/buildifier": "5.1.0",
"@bazel/concatjs": "5.4.2",
"@bazel/esbuild": "5.4.2",
"@bazel/jasmine": "5.4.2",
"@bazel/rollup": "5.4.2",
"@bazel/terser": "5.4.2",
"@bazel/typescript": "5.4.2",
"@octokit/rest": "15.17.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
Expand Down
2 changes: 1 addition & 1 deletion tfjs-converter/scripts/gen_op.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ gen_op = rule(
),
"gen_op_bin": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@//tfjs-converter/scripts:gen_op_bin"),
doc = "The script that generates ts ops from json",
),
Expand Down
2 changes: 1 addition & 1 deletion tfjs-converter/scripts/kernels_to_ops.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kernels_to_ops = rule(
attrs = {
"kernels_to_ops_bin": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@//tfjs-converter/scripts:kernels_to_ops_bin"),
doc = "The script that generates the kernel2op.json metadata file",
),
Expand Down
2 changes: 1 addition & 1 deletion tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"""Re-export of some bazel rules with repository-wide defaults."""

load("@npm//@bazel/concatjs:index.bzl", _ts_library = "ts_library")
load("@npm//@bazel/esbuild:index.bzl", _esbuild = "esbuild")
load("@npm//@bazel/typescript:index.bzl", _ts_library = "ts_library")

def ts_library(**kwargs):
# Use the ts_library tsconfig by default. The ts_library tsconfig does not
Expand Down
2 changes: 1 addition & 1 deletion tools/enumerate_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enumerate_tests = rule(
attrs = {
"enumerate_tests_bin": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@//tools:enumerate_tests_bin"),
doc = "The script that enumerates the tests",
),
Expand Down
2 changes: 1 addition & 1 deletion tools/make_version_test_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ make_version_test_file = rule(
attrs = {
"make_version_test_file_bin": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@//tools:make_version_test_file_bin"),
doc = "The script that generates the version test",
),
Expand Down
68 changes: 34 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,60 +35,60 @@
resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.11.0.tgz#f98d8438b4c14e3328126618b96775d271caa5f8"
integrity sha512-lxiQzVqSGDG0PIDQGJdVDjp7T+50p5NnM4EnRJa76mkZp6u5ul19GJNKhPKi81TZQALZEZDxAgxVqQKkWTUOxA==

"@bazel/buildifier@4.2.4":
version "4.2.4"
resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-4.2.4.tgz#48d4da5638ef0e0a650dda28beaa07d9c8124520"
integrity sha512-PwzTnPqD3W0fjdXY2qwnwh+BPeKAYsfOr4rPwH6u5j9MPHCOa9YRI7Qj8ZwmHC1hhORBYJoTQt589/mXYwfX+g==
"@bazel/buildifier@5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-5.1.0.tgz#ae0b93c5d14b2b080d5a492a8bfee231101b5385"
integrity sha512-gO0+//hkH+iE3AQ02mYttJAcWiE+rapP8IxmstDhwSqs+CmZJJI8Q1vAaIvMyJUT3NIf7lGljRNpzclkCPk89w==

"@bazel/concatjs@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-4.6.1.tgz#c40abc3fbe362cbad1e3383c4e78b58d1f4c8e13"
integrity sha512-eI79oS1F8vK9kw8ttg/zeQYyOiN9FfhJjYyammkc3q4WlNs3Xm717Cp/CquSwPyFh022mB00Tib4gHJ7zp+VpA==
"@bazel/concatjs@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-5.4.2.tgz#2ec0943b50e229a163a277a6de2cc38aeb852e14"
integrity sha512-MoQfmY+6N8RCgqDI2+bRuD+I0p3CLI1JCYZZNSnbZySv1SnT5oQHxoerojEYwyOmsS5sUt2sR8uGtMYZSdoycQ==
dependencies:
protobufjs "6.8.8"
source-map-support "0.5.9"
tsutils "3.21.0"

"@bazel/esbuild@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-4.6.1.tgz#823178fc3959ce880c1c89d0b29be215137eb0fc"
integrity sha512-EkLQN+DnqCTz1jDKgLA8dKwJUaehznhy/+0qH8Vz3MG4Zy7ibV3qJsNPYBHOndRJMoxoxv3OMybFLnHfQsuPWQ==
"@bazel/esbuild@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-5.4.2.tgz#07b46fd7b10667b6e56b94df2c316c19de17ab33"
integrity sha512-k1ZJzFlpfzTcJyHvVxSoOmiPwWNmJSVE0A2ygtXlyB4/dTnGAC6vcX03ECXovd+wk8py/DuFQDb6Xpv6RnWtAg==

"@bazel/jasmine@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-4.6.1.tgz#f1b618d8190fe30db03e6613255704c92c90c8b7"
integrity sha512-SkzBYh4f4BALB6du3/g0Z3lu3N9jcH3kVQHxqwmKkBHCp9Nny0xzhhEje/o5ncSNt+SMwIPwBrTGMPQnUUfmfg==
"@bazel/jasmine@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-5.4.2.tgz#073eef1a1b4c9a4f69522b4b96acd01d44daa05d"
integrity sha512-w0eco1CAipjLX1GFr8GqMTGpIiW9s/kkPDMAFuIVorZzMnAHov25ztr1Zjt5RBUpzMPBY+Sm0cp1d4x9UsjwIQ==
dependencies:
c8 "~7.5.0"
jasmine-reporters "~2.5.0"

"@bazel/rollup@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-4.6.1.tgz#7e5054b1b43c1052bdd8824d9f1a11a410d540e2"
integrity sha512-8a2halG0dnzjs0BgGiHOM47LVCotGW0I9lSWLdwrTxTNOp8fEdbZ8C7TMHFE+8Zc3Z5oerqR8uvIpMarOJQumQ==
"@bazel/rollup@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-5.4.2.tgz#4b640740f1d57f9acc39b407045ff69bea896057"
integrity sha512-IIawuwfh3OE1u7KAGagqw+3EOFW5O01W/HUtV48ereSOMILDsHi85oY9fQNJ76O1ZxrI3mRLCPKs9xWmHAenUQ==
dependencies:
"@bazel/worker" "4.6.1"
"@bazel/worker" "5.4.2"

"@bazel/terser@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-4.6.1.tgz#a3f70672cef7b9383b42930691d6fc8be4b8d993"
integrity sha512-LOXNSLCscyiNDxhLEgIL+Unj7UQpH6s+IkujizRpEyMrVVrhun5do972ab4TdqCXi9rxQKBBkgj8EL43gMimwg==
"@bazel/terser@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-5.4.2.tgz#c3ecf9be0c6c589bc981e67d0af2457d5a596e2a"
integrity sha512-bQFbsxaUTu0vhVCX+P6yY1t/Fg9vo/irOcB3OzX1iTBBS1eDK36fChMx6sFQu6QD5yq7zZxzpb6YH3RyPyri9w==

"@bazel/typescript@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.6.1.tgz#5c674698bda53006d784cb40ba1e2cb1263ecc20"
integrity sha512-T/2mOB9lSySaIQH47JsbKE8UG7eEChFltXCVNw2xk1+Eu7ym+osSIjaXoQVBPmAl/6qmIEzTyBIjFPEU2ohVrw==
"@bazel/typescript@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-5.4.2.tgz#73ff56d124841eeb3e55aa10c146d9cc25b0e973"
integrity sha512-QtCNPJHEeJhVGnRijRxzA3bUaY5mpURJ/Ss4QCjNTyJXbJAQ+F05LiEeFmxlhvouRXy4lW4/4EIhfucZ9YG5tw==
dependencies:
"@bazel/worker" "4.6.1"
"@bazel/worker" "5.4.2"
protobufjs "6.8.8"
semver "5.6.0"
source-map-support "0.5.9"
tsutils "3.21.0"

"@bazel/worker@4.6.1":
version "4.6.1"
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-4.6.1.tgz#96925f5819344225d4fe40ffa630a3c5f4847a0b"
integrity sha512-D6TsHxGSljmlLoz8FXL1+ISh8XnDuRkBpT6Mz0wD62eWajUZASTfX9I4HNiLNbsWY4Omc7nKXI+j4R8/BLciFg==
"@bazel/worker@5.4.2":
version "5.4.2"
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-5.4.2.tgz#b5229140c2087b7f3977ee671624f3c65c6a46a4"
integrity sha512-wQZ1ybgiCPkuITaiPfh91zB/lBYqBglf1XYh9hJZCQnWZ+oz9krCnZcywI/i1U9/E9p3A+4Y1ni5akAwTMmfUA==
dependencies:
google-protobuf "^3.6.1"

Expand Down

0 comments on commit de73970

Please sign in to comment.