diff --git a/BUILD.bazel b/BUILD.bazel index ce59294879..d9a162e498 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,7 +14,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") -load("@build_bazel_rules_nodejs//:defs.bzl", "COMMON_REPLACEMENTS", "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", "COMMON_REPLACEMENTS", "npm_package") package(default_visibility = ["//visibility:public"]) @@ -28,7 +28,7 @@ bzl_library( name = "bzl", srcs = [ "declaration_provider.bzl", - "defs.bzl", + "index.bzl", "index.for_docs.bzl", ], visibility = ["//visibility:public"], diff --git a/WORKSPACE b/WORKSPACE index 2fe7625783..2610d7969c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -62,7 +62,7 @@ rules_nodejs_dev_dependencies() # Setup rules_nodejs npm dependencies # -load("//:defs.bzl", "npm_install", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install", "yarn_install") yarn_install( name = "npm", diff --git a/defs.bzl b/defs.bzl index 6af55821c3..d3620bc131 100644 --- a/defs.bzl +++ b/defs.bzl @@ -41,19 +41,6 @@ npm_package = _npm_package npm_package_bin = _npm_bin # ANY RULES ADDED HERE SHOULD BE DOCUMENTED, see index.for_docs.bzl -# Allows us to avoid a transitive dependency on bazel_skylib from leaking to users -def dummy_bzl_library(name, **kwargs): - native.filegroup(name = name) - -# @unsorted-dict-items -COMMON_REPLACEMENTS = { - # Replace loads from @bazel_skylib with the dummy rule above - "(load\\(\"@bazel_skylib//:bzl_library.bzl\", \"bzl_library\"\\))": "# bazel_skylib mocked out\n# $1\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", bzl_library = \"dummy_bzl_library\")", - # Cleanup up package.json @bazel/foobar package deps for published packages: - # "@bazel/foobar": "file:///..." => "@bazel/foobar": "0.0.0-PLACEHOLDER" - "\"@bazel/([a-zA-Z_-]+)\":\\s+\"(file|bazel)[^\"]+\"": "\"@bazel/$1\": \"0.0.0-PLACEHOLDER\"", -} - def node_modules_filegroup(packages, patterns = [], **kwargs): native.filegroup( srcs = native.glob(["/".join([ diff --git a/docs/Built-ins.md b/docs/Built-ins.md index 399c88afba..acb9146dd5 100755 --- a/docs/Built-ins.md +++ b/docs/Built-ins.md @@ -50,7 +50,7 @@ See the `npm_install` and `yarn_install` rules, and the discussion in the README Example: ``` -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") node_repositories(package_json = ["//:package.json", "//subpkg:package.json"]) ``` @@ -746,7 +746,7 @@ The npm_package rule creates a directory containing a publishable npm artifact. Example: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") npm_package( name = "my_package", @@ -851,7 +851,7 @@ npm_package(name, deps, packages, rename_build_files, replace_with_version, repl Produces several bundled JavaScript files using Rollup and terser. Load it with -`load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle")` +`load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle")` It performs this work in several separate processes: 1. Call rollup on the original sources @@ -1260,7 +1260,7 @@ early as possible. For example: ``` # in WORKSPACE: -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version") +load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version") check_bazel_version("0.26.0") ``` diff --git a/docs/index.md b/docs/index.md index 752b1184a5..b2c3850a44 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,7 +42,7 @@ See [Built-ins] If you have installed the [rollup] package, you could write this rule: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "rollup", @@ -66,7 +66,7 @@ See the `examples/parcel` example. We can reference a path in the local workspace to run a program we write. ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "example", diff --git a/docs/install.md b/docs/install.md index fb9c89e1c0..5b5bc5e477 100644 --- a/docs/install.md +++ b/docs/install.md @@ -29,7 +29,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") ``` Now you can choose from a few options to finish installation. @@ -96,7 +96,7 @@ If you'd like to use a version of NodeJS and/or Yarn that are not currently supp specify those in your `WORKSPACE`: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") # NOTE: this rule does NOT install your npm dependencies into your node_modules folder. # You must still run the package manager to do this. @@ -124,7 +124,7 @@ Finally, you could check Node.js and Yarn into your repository, and not fetch them from the internet. This is what we do internally at Google. ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") # Point node_repositories to use locally installed versions of Node.js and Yarn. # The vendored_node and vendored_yarn labels point to the extracted contents of @@ -182,7 +182,7 @@ file: Using Yarn (preferred): ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", @@ -194,7 +194,7 @@ yarn_install( Using NPM: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") npm_install( name = "npm", @@ -234,7 +234,7 @@ common --experimental_allow_incremental_repository_updates You can then reference individual npm packages in your `BUILD` rules via: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bar", @@ -308,7 +308,7 @@ with the `node_modules` attribute of nodejs rules. * `@npm//:node_modules` includes all packages under `node_modules` as well as the `.bin` folder ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bar", diff --git a/e2e/bazel_managed_deps/WORKSPACE b/e2e/bazel_managed_deps/WORKSPACE index 1ed3b287fc..4c956177a7 100644 --- a/e2e/bazel_managed_deps/WORKSPACE +++ b/e2e/bazel_managed_deps/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/fine_grained_symlinks/BUILD.bazel b/e2e/fine_grained_symlinks/BUILD.bazel index 7a26ed9ab4..56f06c1b3b 100644 --- a/e2e/fine_grained_symlinks/BUILD.bazel +++ b/e2e/fine_grained_symlinks/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") # Test for regressions to https://github.com/bazelbuild/rules_nodejs/issues/428 # and https://github.com/bazelbuild/rules_nodejs/issues/438. diff --git a/e2e/fine_grained_symlinks/WORKSPACE b/e2e/fine_grained_symlinks/WORKSPACE index 5b92c853c1..ebc5ca87cb 100644 --- a/e2e/fine_grained_symlinks/WORKSPACE +++ b/e2e/fine_grained_symlinks/WORKSPACE @@ -11,7 +11,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") # This test needs to run with yarn 1.9.2 to test the fix for # https://github.com/bazelbuild/rules_nodejs/issues/438 and diff --git a/e2e/jasmine/WORKSPACE b/e2e/jasmine/WORKSPACE index ab4eb17433..21f3d69aaf 100644 --- a/e2e/jasmine/WORKSPACE +++ b/e2e/jasmine/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/karma/WORKSPACE b/e2e/karma/WORKSPACE index e4d208b89e..bca79eeb6f 100644 --- a/e2e/karma/WORKSPACE +++ b/e2e/karma/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/karma_stack_trace/WORKSPACE b/e2e/karma_stack_trace/WORKSPACE index b35bf26c3e..f08ad58c29 100644 --- a/e2e/karma_stack_trace/WORKSPACE +++ b/e2e/karma_stack_trace/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/karma_typescript/WORKSPACE b/e2e/karma_typescript/WORKSPACE index 51fcee2b0f..534bc7cb4b 100644 --- a/e2e/karma_typescript/WORKSPACE +++ b/e2e/karma_typescript/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/node_loader_no_preserve_symlinks/BUILD.bazel b/e2e/node_loader_no_preserve_symlinks/BUILD.bazel index 4e5598d3e6..bdae16a513 100644 --- a/e2e/node_loader_no_preserve_symlinks/BUILD.bazel +++ b/e2e/node_loader_no_preserve_symlinks/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") package(default_visibility = ["//visibility:public"]) diff --git a/e2e/node_loader_no_preserve_symlinks/WORKSPACE b/e2e/node_loader_no_preserve_symlinks/WORKSPACE index 0cea8c5390..8f2d356af5 100644 --- a/e2e/node_loader_no_preserve_symlinks/WORKSPACE +++ b/e2e/node_loader_no_preserve_symlinks/WORKSPACE @@ -13,7 +13,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") node_repositories(preserve_symlinks = False) diff --git a/e2e/node_loader_preserve_symlinks/BUILD.bazel b/e2e/node_loader_preserve_symlinks/BUILD.bazel index 4e5598d3e6..bdae16a513 100644 --- a/e2e/node_loader_preserve_symlinks/BUILD.bazel +++ b/e2e/node_loader_preserve_symlinks/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") package(default_visibility = ["//visibility:public"]) diff --git a/e2e/node_loader_preserve_symlinks/WORKSPACE b/e2e/node_loader_preserve_symlinks/WORKSPACE index d2ad02b18f..c4ab6e43be 100644 --- a/e2e/node_loader_preserve_symlinks/WORKSPACE +++ b/e2e/node_loader_preserve_symlinks/WORKSPACE @@ -13,7 +13,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/packages/BUILD.bazel b/e2e/packages/BUILD.bazel index 1ded6ef548..a440b36107 100644 --- a/e2e/packages/BUILD.bazel +++ b/e2e/packages/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") # This is like a "js_library", but there are no actions to run on JS files so a # filegroup is semantically equivalent. diff --git a/e2e/packages/WORKSPACE b/e2e/packages/WORKSPACE index 1d96fcfced..4e3d4a67f9 100644 --- a/e2e/packages/WORKSPACE +++ b/e2e/packages/WORKSPACE @@ -8,7 +8,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "check_rules_nodejs_version", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories") # Test that check_rules_nodejs_version works as expected check_rules_nodejs_version(minimum_version_string = "0.11.2") diff --git a/e2e/packages/setup_workspace.bzl b/e2e/packages/setup_workspace.bzl index 2359ae82c3..89dce1602b 100644 --- a/e2e/packages/setup_workspace.bzl +++ b/e2e/packages/setup_workspace.bzl @@ -15,7 +15,7 @@ """Helper function to setup @e2e_packages workspace. """ -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install", "yarn_install") def e2e_packages_setup_workspace(): """Node repositories for @e2e_packagess diff --git a/e2e/symlinked_node_modules_npm/BUILD b/e2e/symlinked_node_modules_npm/BUILD index 33aa392d23..ecf405b082 100644 --- a/e2e/symlinked_node_modules_npm/BUILD +++ b/e2e/symlinked_node_modules_npm/BUILD @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") nodejs_test( name = "test", diff --git a/e2e/symlinked_node_modules_npm/WORKSPACE b/e2e/symlinked_node_modules_npm/WORKSPACE index 07d23108f9..c35c4f537b 100644 --- a/e2e/symlinked_node_modules_npm/WORKSPACE +++ b/e2e/symlinked_node_modules_npm/WORKSPACE @@ -24,7 +24,7 @@ load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dev_dependencies") rules_nodejs_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") npm_install( name = "npm", diff --git a/e2e/symlinked_node_modules_yarn/BUILD b/e2e/symlinked_node_modules_yarn/BUILD index 33aa392d23..ecf405b082 100644 --- a/e2e/symlinked_node_modules_yarn/BUILD +++ b/e2e/symlinked_node_modules_yarn/BUILD @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") nodejs_test( name = "test", diff --git a/e2e/symlinked_node_modules_yarn/WORKSPACE b/e2e/symlinked_node_modules_yarn/WORKSPACE index 0188fa04ed..ff567b7fec 100644 --- a/e2e/symlinked_node_modules_yarn/WORKSPACE +++ b/e2e/symlinked_node_modules_yarn/WORKSPACE @@ -24,7 +24,7 @@ load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dev_dependencies") rules_nodejs_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/ts_auto_deps/WORKSPACE b/e2e/ts_auto_deps/WORKSPACE index 597c1a0d97..9eb734c837 100644 --- a/e2e/ts_auto_deps/WORKSPACE +++ b/e2e/ts_auto_deps/WORKSPACE @@ -31,7 +31,7 @@ load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dev_dependencies") rules_nodejs_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/ts_devserver/WORKSPACE b/e2e/ts_devserver/WORKSPACE index 102985270a..ca50468380 100644 --- a/e2e/ts_devserver/WORKSPACE +++ b/e2e/ts_devserver/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/typescript/BUILD.bazel b/e2e/typescript/BUILD.bazel index 7a1dd6b4d3..aa99a7b9fe 100644 --- a/e2e/typescript/BUILD.bazel +++ b/e2e/typescript/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:index.bzl", "ts_library") diff --git a/e2e/typescript/WORKSPACE b/e2e/typescript/WORKSPACE index 4eced510cf..99d3817384 100644 --- a/e2e/typescript/WORKSPACE +++ b/e2e/typescript/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/webapp/BUILD.bazel b/e2e/webapp/BUILD.bazel index 6ad481e124..b223d68d6c 100644 --- a/e2e/webapp/BUILD.bazel +++ b/e2e/webapp/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") load("@npm_bazel_rollup//:index.bzl", "rollup_bundle") load("@npm_bazel_terser//:index.bzl", "terser_minified") diff --git a/e2e/webapp/WORKSPACE b/e2e/webapp/WORKSPACE index c20a1a5c14..280a751bdb 100644 --- a/e2e/webapp/WORKSPACE +++ b/e2e/webapp/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/e2e/webpack/WORKSPACE b/e2e/webpack/WORKSPACE index 5d3b3b6d62..aa822b05d4 100644 --- a/e2e/webpack/WORKSPACE +++ b/e2e/webpack/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/angular/WORKSPACE b/examples/angular/WORKSPACE index 34481dce27..5ac2b08208 100644 --- a/examples/angular/WORKSPACE +++ b/examples/angular/WORKSPACE @@ -30,7 +30,7 @@ http_archive( ) # Check the bazel version and download npm dependencies -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "yarn_install") # Bazel version must be at least the following version because: # - 0.27.0 Adds managed directories support diff --git a/examples/angular/src/BUILD.bazel b/examples/angular/src/BUILD.bazel index fa693b8194..a33eeb0338 100644 --- a/examples/angular/src/BUILD.bazel +++ b/examples/angular/src/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@io_bazel_rules_docker//container:container.bzl", "container_image") load("@io_bazel_rules_docker//nodejs:image.bzl", "nodejs_image") diff --git a/examples/app/BUILD.bazel b/examples/app/BUILD.bazel index 8c45ec440c..c5f9500b15 100644 --- a/examples/app/BUILD.bazel +++ b/examples/app/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@npm//http-server:index.bzl", "http_server") load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite") diff --git a/examples/app/WORKSPACE b/examples/app/WORKSPACE index 51219dce97..324fba8a21 100644 --- a/examples/app/WORKSPACE +++ b/examples/app/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/kotlin/BUILD.bazel b/examples/kotlin/BUILD.bazel index af44b5556d..cc0451aa0a 100644 --- a/examples/kotlin/BUILD.bazel +++ b/examples/kotlin/BUILD.bazel @@ -1,7 +1,7 @@ # Add rules here to build your software # See https://docs.bazel.build/versions/master/build-ref.html#BUILD_files -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_js_import", "kt_js_library") load("@npm//http-server:index.bzl", "http_server") diff --git a/examples/kotlin/WORKSPACE b/examples/kotlin/WORKSPACE index 1977d8a3cf..8bb31ded09 100644 --- a/examples/kotlin/WORKSPACE +++ b/examples/kotlin/WORKSPACE @@ -12,7 +12,7 @@ http_archive( ) # Install external npm dependencies -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") npm_install( # Name this npm so that Bazel Label references look like @npm//package diff --git a/examples/nestjs/WORKSPACE b/examples/nestjs/WORKSPACE index 0bdadff2dc..1b111b9ffd 100644 --- a/examples/nestjs/WORKSPACE +++ b/examples/nestjs/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/nestjs/src/BUILD.bazel b/examples/nestjs/src/BUILD.bazel index b3eb7f76be..42e9996435 100644 --- a/examples/nestjs/src/BUILD.bazel +++ b/examples/nestjs/src/BUILD.bazel @@ -27,7 +27,7 @@ ts_library( ], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") # bazel run //src:server -- --port=4000 # TODO(gregmagolan): add test for nest server with protractor rule once it is brought in diff --git a/examples/parcel/WORKSPACE b/examples/parcel/WORKSPACE index 0ef5587029..ea48266ffc 100644 --- a/examples/parcel/WORKSPACE +++ b/examples/parcel/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") npm_install( name = "npm", diff --git a/examples/protocol_buffers/BUILD.bazel b/examples/protocol_buffers/BUILD.bazel index f09071a23a..2416533ccf 100644 --- a/examples/protocol_buffers/BUILD.bazel +++ b/examples/protocol_buffers/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@npm//http-server:index.bzl", "http_server") load("@npm_bazel_labs//:index.bzl", "ts_proto_library") load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite") diff --git a/examples/protocol_buffers/WORKSPACE b/examples/protocol_buffers/WORKSPACE index 54ce498541..3feb079ac2 100644 --- a/examples/protocol_buffers/WORKSPACE +++ b/examples/protocol_buffers/WORKSPACE @@ -32,7 +32,7 @@ http_archive( urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.9.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/user_managed_deps/BUILD.bazel b/examples/user_managed_deps/BUILD.bazel index e0580f7bc1..eb856516dc 100644 --- a/examples/user_managed_deps/BUILD.bazel +++ b/examples/user_managed_deps/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@build_bazel_rules_nodejs//internal/common:typescript_mock_lib.bzl", "mock_typescript_lib") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") diff --git a/examples/user_managed_deps/WORKSPACE b/examples/user_managed_deps/WORKSPACE index fc55cfc03e..daf4002d38 100644 --- a/examples/user_managed_deps/WORKSPACE +++ b/examples/user_managed_deps/WORKSPACE @@ -12,7 +12,7 @@ load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dev_dependencies") rules_nodejs_dev_dependencies() -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") # Install a hermetic version of node. # After this is run, these labels will be available: diff --git a/examples/vendored_node/WORKSPACE b/examples/vendored_node/WORKSPACE index 813a499575..d63c27aaf3 100644 --- a/examples/vendored_node/WORKSPACE +++ b/examples/vendored_node/WORKSPACE @@ -32,7 +32,7 @@ http_archive( urls = ["https://nodejs.org/dist/v10.12.0/node-v10.12.0-linux-x64.tar.xz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install") # This example only works on linux as it downloads the linux node distribution # TODO(gregmagolan): make node_repositories acccept different archives for different platforms diff --git a/examples/vendored_node_and_yarn/WORKSPACE b/examples/vendored_node_and_yarn/WORKSPACE index 08c61f9f7a..25ff63b70b 100644 --- a/examples/vendored_node_and_yarn/WORKSPACE +++ b/examples/vendored_node_and_yarn/WORKSPACE @@ -38,7 +38,7 @@ http_archive( urls = ["https://github.com/yarnpkg/yarn/releases/download/v1.10.0/yarn-v1.10.0.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") # This example only works on linux as it downloads the linux node distribution # TODO(gregmagolan): make node_repositories acccept different archives for different platforms diff --git a/examples/web_testing/WORKSPACE b/examples/web_testing/WORKSPACE index 81adb30f24..7b1565270e 100644 --- a/examples/web_testing/WORKSPACE +++ b/examples/web_testing/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/webapp/WORKSPACE b/examples/webapp/WORKSPACE index 6581ce8536..d6d20e4538 100644 --- a/examples/webapp/WORKSPACE +++ b/examples/webapp/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/examples/worker/BUILD.bazel b/examples/worker/BUILD.bazel index a79c3b70bd..f81b1eb6d3 100644 --- a/examples/worker/BUILD.bazel +++ b/examples/worker/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load(":uses_workers.bzl", "work") # This is our program that we want to run as a worker diff --git a/examples/worker/WORKSPACE b/examples/worker/WORKSPACE index 05ab69df5f..0a20177295 100644 --- a/examples/worker/WORKSPACE +++ b/examples/worker/WORKSPACE @@ -25,7 +25,7 @@ http_archive( urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.37.1/rules_nodejs-0.37.1.tar.gz"], ) -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( name = "npm", diff --git a/index.bzl b/index.bzl new file mode 100644 index 0000000000..5b01b10044 --- /dev/null +++ b/index.bzl @@ -0,0 +1,116 @@ +# Copyright 2017 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Public API surface is re-exported here. + +Users should not load files under "/internal" +""" + +load("//internal/common:check_bazel_version.bzl", _check_bazel_version = "check_bazel_version") +load("//internal/common:check_version.bzl", "check_version") +load("//internal/jasmine_node_test:jasmine_node_test.bzl", _jasmine_node_test = "jasmine_node_test") +load( + "//internal/node:node.bzl", + _nodejs_binary = "nodejs_binary", + _nodejs_test = "nodejs_test", +) +load("//internal/node:node_repositories.bzl", _node_repositories = "node_repositories") +load("//internal/node:npm_package_bin.bzl", _npm_bin = "npm_package_bin") +load("//internal/npm_install:npm_install.bzl", _npm_install = "npm_install", _yarn_install = "yarn_install") +load("//internal/npm_package:npm_package.bzl", _npm_package = "npm_package") +load("//internal/rollup:rollup_bundle.bzl", _rollup_bundle = "rollup_bundle") + +check_bazel_version = _check_bazel_version +nodejs_binary = _nodejs_binary +nodejs_test = _nodejs_test +node_repositories = _node_repositories +jasmine_node_test = _jasmine_node_test +rollup_bundle = _rollup_bundle +npm_package = _npm_package +npm_package_bin = _npm_bin +# ANY RULES ADDED HERE SHOULD BE DOCUMENTED, see index.for_docs.bzl + +# Allows us to avoid a transitive dependency on bazel_skylib from leaking to users +def dummy_bzl_library(name, **kwargs): + native.filegroup(name = name) + +# @unsorted-dict-items +COMMON_REPLACEMENTS = { + # Replace loads from @bazel_skylib with the dummy rule above + "(load\\(\"@bazel_skylib//:bzl_library.bzl\", \"bzl_library\"\\))": "# bazel_skylib mocked out\n# $1\nload(\"@build_bazel_rules_nodejs//:index.bzl\", bzl_library = \"dummy_bzl_library\")", + # Cleanup up package.json @bazel/foobar package deps for published packages: + # "@bazel/foobar": "file:///..." => "@bazel/foobar": "0.0.0-PLACEHOLDER" + "\"@bazel/([a-zA-Z_-]+)\":\\s+\"(file|bazel)[^\"]+\"": "\"@bazel/$1\": \"0.0.0-PLACEHOLDER\"", +} + +def node_modules_filegroup(packages, patterns = [], **kwargs): + native.filegroup( + srcs = native.glob(["/".join([ + "node_modules", + pkg, + "**", + ext, + ]) for pkg in packages for ext in [ + "*.js", + "*.json", + "*.d.ts", + ]] + patterns), + **kwargs + ) + +def npm_install(**kwargs): + # Just in case the user didn't install nodejs, do it now + _node_repositories() + _npm_install(**kwargs) + +def yarn_install(**kwargs): + # Just in case the user didn't install nodejs, do it now + _node_repositories() + _yarn_install(**kwargs) + +# This version is synced with the version in package.json. +# It will be automatically synced via the npm "version" script +# that is run when running `npm version` during the release +# process. See `Releasing` section in README.md. +VERSION = "0.37.1" + +# Currently supported Bazel version. This version is what he rules here are tested +# against. It is also the version used when testing nested workspaces with +# bazel_integration_test. In the future, after an LTS version of Bazel is released +# we will test against multiple versions. +# This version should be updated together with the version of the @bazel/bazel +# package in package.json. This is asserted in //internal:package_json_test. +BAZEL_VERSION = "0.28.1" + +def check_rules_nodejs_version(minimum_version_string): + """ + Verify that a minimum build_bazel_rules_nodejs is loaded a WORKSPACE. + + This should be called from the `WORKSPACE` file so that the build fails as + early as possible. For example: + + ``` + # in WORKSPACE: + load("@build_bazel_rules_nodejs//:package.bzl", "check_rules_nodejs_version") + check_rules_nodejs_version("0.11.2") + ``` + + Args: + minimum_version_string: a string indicating the minimum version + """ + if not check_version(VERSION, minimum_version_string): + fail("\nCurrent build_bazel_rules_nodejs version is {}, expected at least {}\n".format( + VERSION, + minimum_version_string, + )) diff --git a/index.for_docs.bzl b/index.for_docs.bzl index 5f4425f169..886258b3ab 100644 --- a/index.for_docs.bzl +++ b/index.for_docs.bzl @@ -14,7 +14,7 @@ """"Symbols that should have their API docs generated by stardoc -This differs from :defs.bzl because we don't have wrapping macros that hide the real doc""" +This differs from :index.bzl because we don't have wrapping macros that hide the real doc""" load("//internal/common:check_bazel_version.bzl", _check_bazel_version = "check_bazel_version") load("//internal/node:node.bzl", _nodejs_binary = "nodejs_binary", _nodejs_test = "nodejs_test") diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel index 4531b62caa..9d7f691018 100644 --- a/internal/BUILD.bazel +++ b/internal/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("//:defs.bzl", "BAZEL_VERSION", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "BAZEL_VERSION", "nodejs_test") package(default_visibility = ["//visibility:public"]) diff --git a/internal/bazel_integration_test/BUILD.bazel b/internal/bazel_integration_test/BUILD.bazel index a013479acc..8f1ce697a9 100644 --- a/internal/bazel_integration_test/BUILD.bazel +++ b/internal/bazel_integration_test/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") package(default_visibility = ["//visibility:public"]) diff --git a/internal/bazel_integration_test/bazel_integration_test.bzl b/internal/bazel_integration_test/bazel_integration_test.bzl index 4a770c4859..e29ad6948f 100644 --- a/internal/bazel_integration_test/bazel_integration_test.bzl +++ b/internal/bazel_integration_test/bazel_integration_test.bzl @@ -15,7 +15,7 @@ """Bazel integration testing """ -load("@build_bazel_rules_nodejs//:defs.bzl", "BAZEL_VERSION") +load("@build_bazel_rules_nodejs//:index.bzl", "BAZEL_VERSION") load("@build_bazel_rules_nodejs//packages:index.bzl", "NPM_PACKAGES") load("//internal/common:windows_utils.bzl", "BATCH_RLOCATION_FUNCTION", "is_windows") diff --git a/internal/check_package_json.js b/internal/check_package_json.js index 5bb0b5fb8d..ec0a1ced2c 100644 --- a/internal/check_package_json.js +++ b/internal/check_package_json.js @@ -23,12 +23,12 @@ const [BAZEL_VERSION] = require('fs').readFileSync(paramsFile, 'utf-8').split(/\ const packageJson = require('build_bazel_rules_nodejs/package.json'); -// Test that the BAZEL_VERSION defined in //:defs.bzl is in sync with the @bazel/bazel +// Test that the BAZEL_VERSION defined in //:index.bzl is in sync with the @bazel/bazel // version in //:pacakge.json if (packageJson['devDependencies']['@bazel/bazel'] !== `^${BAZEL_VERSION}`) { console.error(`package.json @bazel/bazel '${ packageJson['devDependencies'] - ['@bazel/bazel']}' does not match BAZEL_VERSION in //:defs.bzl '${ + ['@bazel/bazel']}' does not match BAZEL_VERSION in //:index.bzl '${ BAZEL_VERSION}'`); process.exitCode = 1; } diff --git a/internal/common/check_bazel_version.bzl b/internal/common/check_bazel_version.bzl index 4029f6a7e5..7e6cfd64e4 100644 --- a/internal/common/check_bazel_version.bzl +++ b/internal/common/check_bazel_version.bzl @@ -34,7 +34,7 @@ def check_bazel_version(minimum_bazel_version, message = ""): ``` # in WORKSPACE: - load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version") + load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version") check_bazel_version("0.26.0") ``` @@ -69,7 +69,7 @@ def check_bazel_version_range(minimum_bazel_version, maximum_bazel_version, mess ``` # in WORKSPACE: - load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version_range") + load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version_range") check_bazel_version_range("0.11.0", "0.22.0") ``` diff --git a/internal/golden_file_test/golden_file_test.bzl b/internal/golden_file_test/golden_file_test.bzl index f7d091da45..7f12a5b671 100644 --- a/internal/golden_file_test/golden_file_test.bzl +++ b/internal/golden_file_test/golden_file_test.bzl @@ -1,6 +1,6 @@ "Convenience for testing that an output matches a file" -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test") def golden_file_test(name, golden, actual, **kwargs): """Tests an actual output against a golden output. diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl index a9177d523f..2047d8819f 100644 --- a/internal/node/node_repositories.bzl +++ b/internal/node/node_repositories.bzl @@ -56,7 +56,7 @@ See the `npm_install` and `yarn_install` rules, and the discussion in the README Example: ``` -load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories") +load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories") node_repositories(package_json = ["//:package.json", "//subpkg:package.json"]) ``` diff --git a/internal/node/test/BUILD.bazel b/internal/node/test/BUILD.bazel index befd98bed8..9f920de769 100644 --- a/internal/node/test/BUILD.bazel +++ b/internal/node/test/BUILD.bazel @@ -1,4 +1,4 @@ -load("//:defs.bzl", "nodejs_binary", "nodejs_test", "npm_package_bin") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test", "npm_package_bin") load("//internal/js_library:js_library.bzl", "js_library") load("//third_party/github.com/bazelbuild/bazel-skylib:rules/copy_file.bzl", "copy_file") load("//third_party/github.com/bazelbuild/bazel-skylib:rules/write_file.bzl", "write_file") diff --git a/internal/npm_install/BUILD.bazel b/internal/npm_install/BUILD.bazel index 032f5dbb77..4e6f752983 100644 --- a/internal/npm_install/BUILD.bazel +++ b/internal/npm_install/BUILD.bazel @@ -1,5 +1,5 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") bzl_library( name = "bzl", diff --git a/internal/npm_install/generate_build_file.js b/internal/npm_install/generate_build_file.js index f29fe40d94..e7e229f3c2 100644 --- a/internal/npm_install/generate_build_file.js +++ b/internal/npm_install/generate_build_file.js @@ -1022,7 +1022,7 @@ function printPackageBin(pkg) { let result = ''; const executables = _findExecutables(pkg); if (executables.size) { - result = `load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") + result = `load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") `; const data = [`//${pkg._dir}:${pkg._name}`]; @@ -1050,7 +1050,7 @@ function printIndexBzl(pkg) { let result = ''; const executables = _findExecutables(pkg); if (executables.size) { - result = `load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package_bin") + result = `load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "npm_package_bin") `; const data = [`@${WORKSPACE}//${pkg._dir}:${pkg._name}`]; diff --git a/internal/npm_install/test/BUILD.bazel b/internal/npm_install/test/BUILD.bazel index 1c1ccae1a1..22d38bb19e 100644 --- a/internal/npm_install/test/BUILD.bazel +++ b/internal/npm_install/test/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@build_bazel_rules_nodejs//internal/npm_install:npm_umd_bundle.bzl", "npm_umd_bundle") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") diff --git a/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden b/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden index 0581c9b23e..046d3b50f8 100644 --- a/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden +++ b/internal/npm_install/test/golden/@gregmagolan/test-a/bin/BUILD.bazel.golden @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "test", entry_point = "//:node_modules/@gregmagolan/test-a/@bin/test.js", diff --git a/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden b/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden index 6115a6304b..d29d8dc43d 100644 --- a/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden +++ b/internal/npm_install/test/golden/@gregmagolan/test-a/index.bzl.golden @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package_bin") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "npm_package_bin") def test(**kwargs): output_dir = kwargs.pop("output_dir", False) if "outs" in kwargs or output_dir: diff --git a/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden b/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden index 7676d8ee0c..6bd5143235 100644 --- a/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden +++ b/internal/npm_install/test/golden/jasmine/bin/BUILD.bazel.golden @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "jasmine", entry_point = "//:node_modules/jasmine/bin/jasmine.js", diff --git a/internal/npm_install/test/golden/jasmine/index.bzl.golden b/internal/npm_install/test/golden/jasmine/index.bzl.golden index f2d50687aa..283fbf630b 100644 --- a/internal/npm_install/test/golden/jasmine/index.bzl.golden +++ b/internal/npm_install/test/golden/jasmine/index.bzl.golden @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "npm_package_bin") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "npm_package_bin") def jasmine(**kwargs): output_dir = kwargs.pop("output_dir", False) if "outs" in kwargs or output_dir: diff --git a/internal/npm_package/BUILD.bazel b/internal/npm_package/BUILD.bazel index 875c18c560..5d44da157d 100644 --- a/internal/npm_package/BUILD.bazel +++ b/internal/npm_package/BUILD.bazel @@ -1,5 +1,5 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") package(default_visibility = ["//visibility:public"]) diff --git a/internal/npm_package/npm_package.bzl b/internal/npm_package/npm_package.bzl index 72a4920c54..0cbf203781 100644 --- a/internal/npm_package/npm_package.bzl +++ b/internal/npm_package/npm_package.bzl @@ -181,7 +181,7 @@ npm_package = rule( Example: ```python -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") npm_package( name = "my_package", diff --git a/internal/npm_package/test/BUILD.bazel b/internal/npm_package/test/BUILD.bazel index 618a8c479d..a7d6513883 100644 --- a/internal/npm_package/test/BUILD.bazel +++ b/internal/npm_package/test/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_package") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") load("//internal/common:typescript_mock_lib.bzl", "mock_typescript_lib") load("//third_party/github.com/bazelbuild/bazel-skylib:rules/write_file.bzl", "write_file") diff --git a/internal/rollup/BUILD.bazel b/internal/rollup/BUILD.bazel index 866608a0fd..e988c406b2 100644 --- a/internal/rollup/BUILD.bazel +++ b/internal/rollup/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") licenses(["notice"]) # Apache 2.0 diff --git a/internal/rollup/rollup_bundle.bzl b/internal/rollup/rollup_bundle.bzl index c04db441e4..bbffa23185 100644 --- a/internal/rollup/rollup_bundle.bzl +++ b/internal/rollup/rollup_bundle.bzl @@ -822,7 +822,7 @@ rollup_bundle = rule( doc = """Produces several bundled JavaScript files using Rollup and terser. Load it with -`load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle")` +`load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle")` It performs this work in several separate processes: 1. Call rollup on the original sources diff --git a/internal/rollup/test/rollup/BUILD.bazel b/internal/rollup/test/rollup/BUILD.bazel index 5b5eba89d8..0eda7f6b1a 100644 --- a/internal/rollup/test/rollup/BUILD.bazel +++ b/internal/rollup/test/rollup/BUILD.bazel @@ -1,5 +1,5 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") -load("//:defs.bzl", "rollup_bundle") # Tests in the new implementation want to reuse the golden files exports_files(glob(["*.js_"])) diff --git a/internal/rollup/test/rollup_code_splitting/BUILD.bazel b/internal/rollup/test/rollup_code_splitting/BUILD.bazel index 142087f95d..eeee850026 100644 --- a/internal/rollup/test/rollup_code_splitting/BUILD.bazel +++ b/internal/rollup/test/rollup_code_splitting/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") rollup_bundle( diff --git a/internal/rollup/test/rollup_fine_grained_deps/BUILD.bazel b/internal/rollup/test/rollup_fine_grained_deps/BUILD.bazel index d0611dadf6..711f32fda0 100644 --- a/internal/rollup/test/rollup_fine_grained_deps/BUILD.bazel +++ b/internal/rollup/test/rollup_fine_grained_deps/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "rollup_bundle") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") # You can have a rollup_bundle with no node_modules attribute diff --git a/internal/web_package/BUILD.bazel b/internal/web_package/BUILD.bazel index e8626f2513..9b4201be66 100644 --- a/internal/web_package/BUILD.bazel +++ b/internal/web_package/BUILD.bazel @@ -1,5 +1,5 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") # BEGIN-INTERNAL load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") diff --git a/internal/web_package/test/BUILD.bazel b/internal/web_package/test/BUILD.bazel index 84b66fcf94..ffa5da7ff8 100644 --- a/internal/web_package/test/BUILD.bazel +++ b/internal/web_package/test/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") diff --git a/internal/web_package/test2/BUILD.bazel b/internal/web_package/test2/BUILD.bazel index 6350257476..cfa7f88995 100644 --- a/internal/web_package/test2/BUILD.bazel +++ b/internal/web_package/test2/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") diff --git a/package.json b/package.json index 971471037c..c7afca0086 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "format": "git-clang-format", "format-all": "clang-format --glob='{internal/**/,examples/**/}*.{js,ts}' -i", "skydoc": "bazel build //docs && cp -f dist/bin/docs/*.md docs", - "version": "conventional-changelog -p angular -i CHANGELOG.md -s && node ./scripts/on-version.js && bazel build //:release && node ./scripts/on-release.js && git stage defs.bzl docs/install.md packages/create/index.js README.md CHANGELOG.md e2e/*/WORKSPACE examples/*/WORKSPACE" + "version": "conventional-changelog -p angular -i CHANGELOG.md -s && node ./scripts/on-version.js && bazel build //:release && node ./scripts/on-release.js && git stage defs.bzl index.bzl docs/install.md packages/create/index.js README.md CHANGELOG.md e2e/*/WORKSPACE examples/*/WORKSPACE" }, "husky": { "hooks": { diff --git a/packages/create/index.js b/packages/create/index.js index 58d084a627..7f66fcba1c 100644 --- a/packages/create/index.js +++ b/packages/create/index.js @@ -119,7 +119,7 @@ function main(argv, error = console.error, log = console.log) { const yarnInstallCmd = `# The yarn_install rule runs yarn anytime the package.json or yarn.lock file changes. # It also extracts and installs any Bazel rules distributed in an npm package. -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( # Name this npm so that Bazel Label references look like @npm//package name = "npm", @@ -130,7 +130,7 @@ yarn_install( const npmInstallCmd = `# The npm_install rule runs yarn anytime the package.json or package-lock.json file changes. # It also extracts any Bazel rules distributed in an npm package. -load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install") +load("@build_bazel_rules_nodejs//:index.bzl", "npm_install") npm_install( # Name this npm so that Bazel Label references look like @npm//package name = "npm", diff --git a/packages/jasmine/docs/BUILD.bazel b/packages/jasmine/docs/BUILD.bazel index 60bb010bdd..556c0544f7 100644 --- a/packages/jasmine/docs/BUILD.bazel +++ b/packages/jasmine/docs/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") load("//tools/stardoc:index.bzl", "stardoc") package(default_visibility = ["//visibility:public"]) diff --git a/packages/karma/docs/BUILD.bazel b/packages/karma/docs/BUILD.bazel index 9224264175..6cbcd6523f 100644 --- a/packages/karma/docs/BUILD.bazel +++ b/packages/karma/docs/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") load("//tools/stardoc:index.bzl", "stardoc") package(default_visibility = ["//visibility:public"]) diff --git a/packages/karma/src/BUILD.bazel b/packages/karma/src/BUILD.bazel index 10c6ca126e..a41ef4ab59 100644 --- a/packages/karma/src/BUILD.bazel +++ b/packages/karma/src/BUILD.bazel @@ -16,7 +16,7 @@ # Parts of this BUILD file only necessary when building from source. # The generated `@bazel/karma` npm package contains a trimmed BUILD file using INTERNAL fences. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@npm_bazel_typescript//:index.from_src.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/packages/labs/src/package.bzl b/packages/labs/src/package.bzl index 114ae9bab3..636bc63ef7 100644 --- a/packages/labs/src/package.bzl +++ b/packages/labs/src/package.bzl @@ -1,6 +1,6 @@ "Install toolchain dependencies" -load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install") +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") def npm_bazel_labs_dependencies(): yarn_install( diff --git a/packages/labs/src/protobufjs/BUILD.bazel b/packages/labs/src/protobufjs/BUILD.bazel index 48f12af2f5..0fe0742ecd 100644 --- a/packages/labs/src/protobufjs/BUILD.bazel +++ b/packages/labs/src/protobufjs/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library") package(default_visibility = ["//visibility:public"]) diff --git a/packages/labs/src/webpack/BUILD.bazel b/packages/labs/src/webpack/BUILD.bazel index 2f2d2fcf77..b88b3577cf 100644 --- a/packages/labs/src/webpack/BUILD.bazel +++ b/packages/labs/src/webpack/BUILD.bazel @@ -15,7 +15,7 @@ # BEGIN-INTERNAL # Parts of this BUILD file only necessary when building from source. # The generated `@bazel/labs` npm package contains a trimmed BUILD file using INTERNAL fences. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@npm_bazel_typescript//:index.from_src.bzl", "ts_library") package(default_visibility = ["//visibility:public"]) diff --git a/packages/protractor/docs/BUILD.bazel b/packages/protractor/docs/BUILD.bazel index 1322db734a..3d1521037a 100644 --- a/packages/protractor/docs/BUILD.bazel +++ b/packages/protractor/docs/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") load("//tools/stardoc:index.bzl", "stardoc") package(default_visibility = ["//visibility:public"]) diff --git a/packages/protractor/src/protractor_web_test.bzl b/packages/protractor/src/protractor_web_test.bzl index 1f261342d8..69dfa02b98 100644 --- a/packages/protractor/src/protractor_web_test.bzl +++ b/packages/protractor/src/protractor_web_test.bzl @@ -13,7 +13,7 @@ # limitations under the License. "Run end-to-end tests with Protractor" -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") load("@build_bazel_rules_nodejs//internal/common:windows_utils.bzl", "create_windows_native_launcher_script", "is_windows") load("@io_bazel_rules_webtesting//web:web.bzl", "web_test_suite") diff --git a/packages/protractor/test/protractor-2/BUILD.bazel b/packages/protractor/test/protractor-2/BUILD.bazel index 67930cad17..fb49f3e4ee 100644 --- a/packages/protractor/test/protractor-2/BUILD.bazel +++ b/packages/protractor/test/protractor-2/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle") +load("@build_bazel_rules_nodejs//:index.bzl", "rollup_bundle") load("@npm//http-server:index.bzl", "http_server") load("@npm_bazel_protractor//:index.from_src.bzl", "protractor_web_test_suite") load("@npm_bazel_typescript//:index.bzl", "ts_config") diff --git a/packages/protractor/test/protractor-utils/BUILD.bazel b/packages/protractor/test/protractor-utils/BUILD.bazel index 8c50c874fe..4319748387 100644 --- a/packages/protractor/test/protractor-utils/BUILD.bazel +++ b/packages/protractor/test/protractor-utils/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") load("@npm_bazel_typescript//:index.from_src.bzl", "ts_library") diff --git a/packages/terser/src/BUILD.bazel b/packages/terser/src/BUILD.bazel index c152356ded..f10fa77853 100644 --- a/packages/terser/src/BUILD.bazel +++ b/packages/terser/src/BUILD.bazel @@ -13,7 +13,7 @@ # limitations under the License. load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") package(default_visibility = ["//visibility:public"]) diff --git a/packages/typescript/docs/BUILD.bazel b/packages/typescript/docs/BUILD.bazel index 22e319135e..5e966993aa 100644 --- a/packages/typescript/docs/BUILD.bazel +++ b/packages/typescript/docs/BUILD.bazel @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_test") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") load("//tools/stardoc:index.bzl", "stardoc") package(default_visibility = ["//visibility:public"]) diff --git a/packages/typescript/replacements.bzl b/packages/typescript/replacements.bzl index c625860a03..06081bcbca 100644 --- a/packages/typescript/replacements.bzl +++ b/packages/typescript/replacements.bzl @@ -15,7 +15,7 @@ """Replacements for @npm/typescript package """ -load("@build_bazel_rules_nodejs//:defs.bzl", "COMMON_REPLACEMENTS") +load("@build_bazel_rules_nodejs//:index.bzl", "COMMON_REPLACEMENTS") TYPESCRIPT_REPLACEMENTS = dict( COMMON_REPLACEMENTS, diff --git a/packages/typescript/src/internal/devserver/ts_devserver.bzl b/packages/typescript/src/internal/devserver/ts_devserver.bzl index ac845d4ad5..66a80c35b8 100644 --- a/packages/typescript/src/internal/devserver/ts_devserver.bzl +++ b/packages/typescript/src/internal/devserver/ts_devserver.bzl @@ -223,7 +223,7 @@ def ts_devserver_macro(name, data = [], args = [], visibility = None, tags = [], that runs the Go devserver implementation. The `sh_binary` is the primary target that matches the specified "name" and executes the generated bash launcher script. - This is re-exported in `//:defs.bzl` as `ts_devserver` so if you load the rule + This is re-exported in `//:index.bzl` as `ts_devserver` so if you load the rule from there, you actually get this macro. Args: diff --git a/packages/typescript/src/internal/ts_repositories.bzl b/packages/typescript/src/internal/ts_repositories.bzl index ccd1fab793..82ab701e50 100644 --- a/packages/typescript/src/internal/ts_repositories.bzl +++ b/packages/typescript/src/internal/ts_repositories.bzl @@ -14,7 +14,7 @@ "Install toolchain dependencies" -load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "check_rules_nodejs_version") +load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "check_rules_nodejs_version") def ts_setup_workspace(): """This repository rule should be called from your WORKSPACE file. diff --git a/packages/typescript/test/some_module/BUILD.bazel b/packages/typescript/test/some_module/BUILD.bazel index 984545e41c..44777e9398 100644 --- a/packages/typescript/test/some_module/BUILD.bazel +++ b/packages/typescript/test/some_module/BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") load("@npm_bazel_typescript//:index.from_src.bzl", "ts_library") # We compile this library with the module name "sm" to make it possible to diff --git a/scripts/on-version.js b/scripts/on-version.js index 60e77d0960..8f5325ba61 100644 --- a/scripts/on-version.js +++ b/scripts/on-version.js @@ -1,7 +1,9 @@ // Called from "version" npm script when running `npm version` // during release process. This script updates the version -// in defs.bzl to match that of package.json. +// in index.bzl to match that of package.json. const shell = require('shelljs'); const version = require('../package.json').version; +// TODO: remove when we delete defs.bzl shell.sed('-i', /^VERSION \= \"[0-9\.]*\"/, `VERSION = "${version}"`, 'defs.bzl'); +shell.sed('-i', /^VERSION \= \"[0-9\.]*\"/, `VERSION = "${version}"`, 'index.bzl'); diff --git a/tools/defaults.bzl b/tools/defaults.bzl index fe448dfe85..fab21b2f1b 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -4,7 +4,7 @@ These set common default attributes and behaviors for our local repo """ load( - "@build_bazel_rules_nodejs//:defs.bzl", + "@build_bazel_rules_nodejs//:index.bzl", _COMMON_REPLACEMENTS = "COMMON_REPLACEMENTS", _nodejs_test = "nodejs_test", _npm_package = "npm_package", diff --git a/tools/npm_packages/bazel_workspaces/a/_BUILD.bazel b/tools/npm_packages/bazel_workspaces/a/_BUILD.bazel index f4363550d1..16d0cfc9e0 100644 --- a/tools/npm_packages/bazel_workspaces/a/_BUILD.bazel +++ b/tools/npm_packages/bazel_workspaces/a/_BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bin", diff --git a/tools/npm_packages/bazel_workspaces/a/subdir/_BUILD.bazel b/tools/npm_packages/bazel_workspaces/a/subdir/_BUILD.bazel index f4363550d1..16d0cfc9e0 100644 --- a/tools/npm_packages/bazel_workspaces/a/subdir/_BUILD.bazel +++ b/tools/npm_packages/bazel_workspaces/a/subdir/_BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bin", diff --git a/tools/npm_packages/bazel_workspaces/b/_BUILD.bazel b/tools/npm_packages/bazel_workspaces/b/_BUILD.bazel index f4363550d1..16d0cfc9e0 100644 --- a/tools/npm_packages/bazel_workspaces/b/_BUILD.bazel +++ b/tools/npm_packages/bazel_workspaces/b/_BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bin", diff --git a/tools/npm_packages/bazel_workspaces/b/subdir/_BUILD.bazel b/tools/npm_packages/bazel_workspaces/b/subdir/_BUILD.bazel index f4363550d1..16d0cfc9e0 100644 --- a/tools/npm_packages/bazel_workspaces/b/subdir/_BUILD.bazel +++ b/tools/npm_packages/bazel_workspaces/b/subdir/_BUILD.bazel @@ -1,4 +1,4 @@ -load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") nodejs_binary( name = "bin",