Switch rules_nodejs load points from defs.bzl to index.bzl

The former is about to be removed.

PiperOrigin-RevId: 276532382
diff --git a/BUILD.bazel b/BUILD.bazel
index d542231..7f69e55 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -19,10 +19,12 @@
 # https://github.com/bazelbuild/rules_go/blob/master/go/tools/gazelle/README.rst#directives
 # gazelle:exclude node_modules
 load("@bazel_gazelle//:def.bzl", "gazelle")
-load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package")
-load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library")
+load("@build_bazel_rules_nodejs//:index.bzl", "npm_package")
 
-exports_files(["LICENSE", "tsconfig.json"])
+exports_files([
+    "LICENSE",
+    "tsconfig.json",
+])
 
 gazelle(
     name = "gazelle",
@@ -33,18 +35,18 @@
 npm_package(
     name = "npm_bazel_typescript_package",
     srcs = [
-        "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets",
         "//internal:npm_package_assets",
+        "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets",
     ],
+    visibility = ["//visibility:public"],
     deps = [
-        "//internal:generated_BUILD",
-        "//internal:tsc_wrapped",
         "//devserver:devserver-darwin",
         "//devserver:devserver-linux",
         "//devserver:devserver-windows",
+        "//internal:generated_BUILD",
+        "//internal:tsc_wrapped",
         "//ts_auto_deps:ts_auto_deps-darwin",
         "//ts_auto_deps:ts_auto_deps-linux",
         "//ts_auto_deps:ts_auto_deps-windows",
     ],
-    visibility = ["//visibility:public"],
 )
diff --git a/WORKSPACE b/WORKSPACE
index f4157f2..c03057d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -23,7 +23,7 @@
 rules_typescript_dev_dependencies()
 
 # Setup nodejs toolchain
-load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
+load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
 
 # Download npm dependencies
 yarn_install(
diff --git a/internal/BUILD.bazel b/internal/BUILD.bazel
index 5eb3190..0c70b53 100644
--- a/internal/BUILD.bazel
+++ b/internal/BUILD.bazel
@@ -14,7 +14,7 @@
 
 # gazelle:exclude worker_protocol.proto
 
-load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
+load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
 load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
 load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
 load("@npm_bazel_typescript//:index.bzl", "ts_library")
@@ -81,12 +81,12 @@
     name = "tsc_wrapped_bin",
     data = [
         ":tsc_wrapped",
+        "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto",
         "@npm//protobufjs",
         "@npm//source-map-support",
         "@npm//tsickle",
         "@npm//tsutils",
         "@npm//typescript",
-        "//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto",
     ],
     entry_point = ":tsc_wrapped/tsc_wrapped.ts",
     visibility = ["//visibility:public"],
diff --git a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD
index c8a7fa3..13772f9 100644
--- a/internal/tsetse/tests/ban_expect_truthy_promise/BUILD
+++ b/internal/tsetse/tests/ban_expect_truthy_promise/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
 
 licenses(["notice"])  # Apache 2.0
 
diff --git a/internal/tsetse/tests/ban_promise_as_condition/BUILD b/internal/tsetse/tests/ban_promise_as_condition/BUILD
index 29073e1..019903d 100644
--- a/internal/tsetse/tests/ban_promise_as_condition/BUILD
+++ b/internal/tsetse/tests/ban_promise_as_condition/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
 
 licenses(["notice"])  # Apache 2.0
 
diff --git a/internal/tsetse/tests/check_return_value/BUILD b/internal/tsetse/tests/check_return_value/BUILD
index c319f13..2afcf62 100644
--- a/internal/tsetse/tests/check_return_value/BUILD
+++ b/internal/tsetse/tests/check_return_value/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
 
 licenses(["notice"])  # Apache 2.0
 
diff --git a/internal/tsetse/tests/equals_nan/BUILD b/internal/tsetse/tests/equals_nan/BUILD
index 7706253..5fb48ff 100644
--- a/internal/tsetse/tests/equals_nan/BUILD
+++ b/internal/tsetse/tests/equals_nan/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
 
 licenses(["notice"])  # Apache 2.0
 
diff --git a/internal/tsetse/tests/must_use_promises/BUILD b/internal/tsetse/tests/must_use_promises/BUILD
index 20372cd..8b9b2f7 100644
--- a/internal/tsetse/tests/must_use_promises/BUILD
+++ b/internal/tsetse/tests/must_use_promises/BUILD
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("@npm_bazel_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:index.bzl", "ts_library")
 
 licenses(["notice"])  # Apache 2.0
 
diff --git a/package.bzl b/package.bzl
index 792940d..2e4473d 100644
--- a/package.bzl
+++ b/package.bzl
@@ -30,8 +30,8 @@
     _maybe(
         http_archive,
         name = "build_bazel_rules_nodejs",
-        sha256 = "da72ea53fa1cb8ab5ef7781ba06b97259b7d579a431ce480476266bc81bdf21d",
-        urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.36.2/rules_nodejs-0.36.2.tar.gz"],
+        sha256 = "26c39450ce2d825abee5583a43733863098ed29d3cbaebf084ebaca59a21a1c8",
+        urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.0/rules_nodejs-0.39.0.tar.gz"],
     )
 
     # For protocol buffers
diff --git a/package.json b/package.json
index 9a86e26..320fed5 100644
--- a/package.json
+++ b/package.json
@@ -6,8 +6,8 @@
         "@bazel/bazel": "^0.26.0",
         "@bazel/buildifier": "^0.20.0",
         "@bazel/ibazel": "^0.2.0",
-        "@bazel/jasmine": "^0.32.0",
-        "@bazel/typescript": "^0.32.0",
+        "@bazel/jasmine": "^0.39.0",
+        "@bazel/typescript": "^0.39.0",
         "@types/jasmine": "^2.8.2",
         "@types/long": "^4.0.0",
         "@types/node": "10.12.20",
diff --git a/yarn.lock b/yarn.lock
index f14d230..41251e7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -131,10 +131,10 @@
   resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef"
   integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==
 
-"@types/node@7.0.18":
-  version "7.0.18"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.18.tgz#cd67f27d3dc0cfb746f0bdd5e086c4c5d55be173"
-  integrity sha1-zWfyfT3Az7dG8L3V4IbExdVb4XM=
+"@types/node@10.12.20":
+  version "10.12.20"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.20.tgz#f79f959acd3422d0889bd1ead1664bd2d17cd367"
+  integrity sha512-9spv6SklidqxevvZyOUGjZVz4QRXGu2dNaLyXIFzFYZW0AGDykzPRIUFJXTlQXyfzAucddwTcGtJNim8zqSOPA==
 
 "@types/node@^10.1.0":
   version "10.14.6"