Update to nodejs rules 0.29.0 and @bazel/bazel 0.25.1

Can now remove temporary postinstall patch

Closes #446

PiperOrigin-RevId: 247510682
diff --git a/WORKSPACE b/WORKSPACE
index d83690a..7bb6346 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -34,7 +34,6 @@
     name = "npm",
     package_json = "//:package.json",
     yarn_lock = "//:yarn.lock",
-    data = ["//:postinstall-patches.js"],
 )
 
 load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
diff --git a/package.bzl b/package.bzl
index feabcbe..f4511ea 100644
--- a/package.bzl
+++ b/package.bzl
@@ -30,9 +30,8 @@
     _maybe(
         http_archive,
         name = "build_bazel_rules_nodejs",
-        urls = ["https://github.com/bazelbuild/rules_nodejs/archive/39c941ddf4ba2c730cd69505dd190770e60d6315.zip"],
-        strip_prefix = "rules_nodejs-39c941ddf4ba2c730cd69505dd190770e60d6315",
-        sha256 = "94aa159e95359d828edd878f5748cba22a515b9a6f7626892fb9fdf2e6676bb8",
+        urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.29.0/rules_nodejs-0.29.0.tar.gz"],
+        sha256 = "1db950bbd27fb2581866e307c0130983471d4c3cd49c46063a2503ca7b6770a4",
     )
 
     # For protocol buffers
diff --git a/package.json b/package.json
index 765534a..5d98dad 100644
--- a/package.json
+++ b/package.json
@@ -7,10 +7,10 @@
         "semver": "5.6.0",
         "source-map-support": "0.5.9",
         "tsutils": "2.27.2",
-        "@bazel/bazel": "~0.22.0",
+        "@bazel/bazel": "0.25.1",
         "@bazel/buildifier": "^0.20.0",
         "@bazel/ibazel": "^0.2.0",
-        "@bazel/typescript": "0.28.0",
+        "@bazel/typescript": "0.29.0",
         "@types/jasmine": "^2.8.2",
         "@types/long": "^4.0.0",
         "@types/node": "7.0.18",
@@ -37,7 +37,6 @@
         "which": "~1.0.5"
     },
     "scripts": {
-        "postinstall": "node --preserve-symlinks --preserve-symlinks-main ./postinstall-patches.js",
         "pree2e": "webdriver-manager update $CHROMEDRIVER_VERSION_ARG && bazel build //examples/app:e2e //examples/protocol_buffers:e2e",
         "e2e": "yarn e2e-examples-app-devserver && yarn e2e-examples-app-prodserver && yarn e2e-examples-protobuf-devserver && yarn e2e-examples-protobuf-prodserver",
         "e2e-examples-app-devserver": "concurrently \"bazel run //examples/app:devserver\" \"while ! nc -z 127.0.0.1 8080; do sleep 1; done && protractor --suite app\" --kill-others --success first",
diff --git a/postinstall-patches.js b/postinstall-patches.js
deleted file mode 100644
index 8a8623b..0000000
--- a/postinstall-patches.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @license
- * 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.
- */
-
-try {
-  require.resolve('shelljs');
-} catch (e) {
-  // We are in an bazel managed external node_modules repository
-  // and the resolve has failed because node did not preserve the symlink
-  // when loading the script.
-  // This can be fixed using the --preserve-symlinks-main flag which
-  // is introduced in node 10.2.0
-  throw new Error(
-      `Running postinstall-patches.js script in an external repository requires --preserve-symlinks-main node flag introduced in node 10.2.0. ` +
-      `Current node version is ${process.version}. Node called with '${process.argv.join(' ')}'.`);
-}
-
-const {set, cd, sed, rm} = require('shelljs');
-const path = require('path');
-
-// fail on first error
-set('-e');
-// print commands as being executed
-set('-v');
-// jump to project root
-cd(__dirname);
-
-// Temporary patch to land strict npm deps
-console.log(
-    '\n# patching ts_library in @bazel/typescript to support strict deps');
-sed('-i', 'deps \\= \\[d for d in ctx\\.attr\\.deps if not NodeModuleInfo in d\\],', 'deps = ctx.attr.deps,',
-    'node_modules/@bazel/typescript/internal/build_defs.bzl');
diff --git a/yarn.lock b/yarn.lock
index 5ebc1f4..7e86026 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,29 +2,29 @@
 # yarn lockfile v1
 
 
-"@bazel/bazel-darwin_x64@0.22.0":
-  version "0.22.0"
-  resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248"
-  integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA==
+"@bazel/bazel-darwin_x64@0.25.1":
+  version "0.25.1"
+  resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.25.1.tgz#6526aba1cd912830595c3903ad29dfcb338114a3"
+  integrity sha512-VYPHaXZFlyl/1MOnUdByusox0RataI+dvQ37FiuuK9byFlcgCoIvhAx20nLK56tEhi/obXXaG2AO4w6rfOcgWg==
 
-"@bazel/bazel-linux_x64@0.22.0":
-  version "0.22.0"
-  resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8"
-  integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ==
+"@bazel/bazel-linux_x64@0.25.1":
+  version "0.25.1"
+  resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.25.1.tgz#7f0d098725f0bde4f0904b72b64ea2f22fdbf2bc"
+  integrity sha512-i+b6RSWn5qGZlrcct+lpWVHd3sen7UaBqQyi/0Rn+J72XCIbY2AFoi+j6SlCXb3EFltxJBCHKJHZqEtkP79bDQ==
 
-"@bazel/bazel-win32_x64@0.22.0":
-  version "0.22.0"
-  resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50"
-  integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw==
+"@bazel/bazel-win32_x64@0.25.1":
+  version "0.25.1"
+  resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.25.1.tgz#43bdec698fbb7babfd02470a1dcab384f01f9d6b"
+  integrity sha512-LM/rY8cxioCFe0m6WxdfvZ6pbD9eKzp69C1BhIkoESyp0IDLDvnLJ6uvs722e3hl8Zj1sIEIbiCwrYk33lPkTg==
 
-"@bazel/bazel@~0.22.0":
-  version "0.22.0"
-  resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9"
-  integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ==
+"@bazel/bazel@0.25.1":
+  version "0.25.1"
+  resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.25.1.tgz#fc76ad9c07371e9ce0bf5bde6ff61cf8abbeaefd"
+  integrity sha512-HM2IsX9M4siW8b2AHZP4ixtT1NH9H74M0/DJfh0hr15NlivTapvkVQSfEfW57CCMfkuMcDjvfJQK+KzfuVyMgw==
   optionalDependencies:
-    "@bazel/bazel-darwin_x64" "0.22.0"
-    "@bazel/bazel-linux_x64" "0.22.0"
-    "@bazel/bazel-win32_x64" "0.22.0"
+    "@bazel/bazel-darwin_x64" "0.25.1"
+    "@bazel/bazel-linux_x64" "0.25.1"
+    "@bazel/bazel-win32_x64" "0.25.1"
 
 "@bazel/buildifier-darwin_x64@0.20.0":
   version "0.20.0"
@@ -49,10 +49,10 @@
   resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.2.0.tgz#c119aef4344a789cef5e792caaee52264123e71c"
   integrity sha1-wRmu9DRKeJzvXnksqu5SJkEj5xw=
 
-"@bazel/typescript@0.28.0":
-  version "0.28.0"
-  resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.28.0.tgz#fdc9ca63c097c8de6aa8c3e81b3dd870b5605791"
-  integrity sha512-sGi8+pRuPDe7bmK1cUmHfN/3uxHHpJTX9S3edq75pr6MytORIQZBxjSu9aRCgposIe1dPFTGt4B7TOZT8Ln+zw==
+"@bazel/typescript@0.29.0":
+  version "0.29.0"
+  resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.29.0.tgz#d276afe034f37b5f35ee1369c99dc33c637fc9f6"
+  integrity sha512-Dp5ucrE1vXTORGiwEi6Ur4dlICpLsmZ1dscsEQT4ywF7xTT0/NmIG0ecBghiCFPFQTxt1D05TR3SH06rPtTAew==
   dependencies:
     protobufjs "6.8.8"
     semver "5.6.0"