build: update to rules_nodejs 1.1.0 (#34736)
This release resolves the bootstrap require patching issue with jasmine_node_test. Require patches are now included before any bootstrap scripts. PR Close #34736
This commit is contained in:
parent
6174dffc2a
commit
436e7388c3
|
@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|||
# Fetch rules_nodejs so we can install our npm dependencies
|
||||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
sha256 = "e1a0d6eb40ec89f61a13a028e7113aa3630247253bcb1406281b627e44395145",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.0.1/rules_nodejs-1.0.1.tar.gz"],
|
||||
sha256 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.1.0/rules_nodejs-1.1.0.tar.gz"],
|
||||
)
|
||||
|
||||
# Check the bazel version and download npm dependencies
|
||||
|
|
|
@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|||
# Fetch rules_nodejs so we can install our npm dependencies
|
||||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
sha256 = "e1a0d6eb40ec89f61a13a028e7113aa3630247253bcb1406281b627e44395145",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.0.1/rules_nodejs-1.0.1.tar.gz"],
|
||||
sha256 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.1.0/rules_nodejs-1.1.0.tar.gz"],
|
||||
)
|
||||
|
||||
# Fetch sass rules for compiling sass files
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
"@angular/compiler": "file:../../dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@bazel/bazel": "file:../../node_modules/@bazel/bazel",
|
||||
"@bazel/karma": "1.0.1",
|
||||
"@bazel/protractor": "1.0.1",
|
||||
"@bazel/rollup": "1.0.1",
|
||||
"@bazel/terser": "1.0.1",
|
||||
"@bazel/typescript": "1.0.1",
|
||||
"@bazel/karma": "1.1.0",
|
||||
"@bazel/protractor": "1.1.0",
|
||||
"@bazel/rollup": "1.1.0",
|
||||
"@bazel/terser": "1.1.0",
|
||||
"@bazel/typescript": "1.1.0",
|
||||
"@types/jasmine": "2.8.8",
|
||||
"http-server": "0.12.0",
|
||||
"karma": "4.4.1",
|
||||
|
|
|
@ -92,32 +92,32 @@
|
|||
resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-0.38.3.tgz#e98231d3d360d51860d9c1a7c3345b40dab4cf81"
|
||||
integrity sha512-o+dNkfDm3qxWQ8h/04cWuTcjR7qnjZi3pQGv4aklVb16oPWx2jF8BzbkwvWuIkdbOl9VnqYP0vaHzwQVJRRcIA==
|
||||
|
||||
"@bazel/karma@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.0.1.tgz#f60de501367125ece03af1250ccb69d836fee2cc"
|
||||
integrity sha512-AJ7KOx+oWHTAwstTMH95jpPP4MSKnG2eZiTms5OilhLz6KWg+l4hGumJ+jB8ntt/ZlMv9nrLVohS5zjEUyeTYA==
|
||||
"@bazel/karma@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.1.0.tgz#3340904942acd970964ad40a28177f780d2d658a"
|
||||
integrity sha512-4AwY86r/MNPCcVkR4z5wO9d4dftdSWi7nFnIEFGsl++Mzpgrfc70dGReu35BFC38JavWrEkZuh7RU1d8bbD8WQ==
|
||||
dependencies:
|
||||
tmp "0.1.0"
|
||||
|
||||
"@bazel/protractor@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.0.1.tgz#48d1f12c9edec114b04b45a159fa8c231c65c688"
|
||||
integrity sha512-gAJ4nMQRXu4/k+EvH/aD4BUBrSy9dn/xtAI0qRs8t2997Zafb2HI0Ejd0Ep3geBcnloC/EWGSQAIBt5vQrOWAw==
|
||||
"@bazel/protractor@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.1.0.tgz#0adf7c76a73ee437e0ba223662d98ba2f1a3356d"
|
||||
integrity sha512-k1Oqt0FMmnxk4lJZ4vA/CHOWcMKWuCr85Ljlq0hZrxfDokuxwGBMAUZgTQIh5KkvRnAo0utYRESMhWed8H2DpA==
|
||||
|
||||
"@bazel/rollup@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-1.0.1.tgz#aaef886ff6cb00fc19995479aef4275359b57eee"
|
||||
integrity sha512-LL9eszGoHbw50+59KqqgmHB1AFQKlYeJFDCMzJU5DnAMLWz/bSlf77CaC3iipL7AVQXVqu1aJEviiNYDVGTlig==
|
||||
"@bazel/rollup@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-1.1.0.tgz#e1e496d77fcd55971ff4ef51e982476dfe092ac8"
|
||||
integrity sha512-FiSiXZ/AOWnAVR39gLVYlATe/clGyvap5skiILtDksVtm6C620Rkqr/4QfIdFHZzdMb+eaxbRbMkOxux4O2McQ==
|
||||
|
||||
"@bazel/terser@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-1.0.1.tgz#edc22ef7d507ddf249ab039fc9f8c4d05c4789f9"
|
||||
integrity sha512-ldww7M6V6itnhCbtIdiGenKJZVwfpeA+h1z41KYCPQouNBrf0zBH717NYUx1IXkxmWfuT1cmgDWLYEhBC+R2Sw==
|
||||
"@bazel/terser@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-1.1.0.tgz#e737ed06ef445e2c510ac08f956607434771dbf1"
|
||||
integrity sha512-oGnRvDi/ESZ+fY7BzTvlUiLa5kbzY370gLtByFFX0Ix2PlVIs558bsbLMmt3Lbnts75t4GQTkB5NanZkk1Sjkg==
|
||||
|
||||
"@bazel/typescript@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.0.1.tgz#23c8232f9a08199971a306a688843f10832f2458"
|
||||
integrity sha512-dEZVAqmsJRcxnUPedXJ5QJIcmzxxXLDSybNO2uBXET8PvDfRpFGwu/ui+FE3uC3gYYXUFUas6WIEw5oiSeicVQ==
|
||||
"@bazel/typescript@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.1.0.tgz#b57ac6c6d627577f394a60fb540fbbdf53bcff0d"
|
||||
integrity sha512-QnTdb6rwZUR+KfUuAdyazpkA7BOvrWRe7tkPDdyIZHJdBPYdpJW+AapnFSfxvXEIP0Nwesl5KP6Saau0GPiBLg==
|
||||
dependencies:
|
||||
protobufjs "6.8.8"
|
||||
semver "5.6.0"
|
||||
|
|
12
package.json
12
package.json
|
@ -41,12 +41,12 @@
|
|||
"@angular-devkit/schematics": "9.0.0-rc.4",
|
||||
"@angular/bazel": "file:./tools/npm/@angular_bazel",
|
||||
"@babel/core": "^7.6.4",
|
||||
"@bazel/jasmine": "1.0.1",
|
||||
"@bazel/karma": "1.0.1",
|
||||
"@bazel/protractor": "1.0.1",
|
||||
"@bazel/rollup": "1.0.1",
|
||||
"@bazel/terser": "1.0.1",
|
||||
"@bazel/typescript": "1.0.1",
|
||||
"@bazel/jasmine": "1.1.0",
|
||||
"@bazel/karma": "1.1.0",
|
||||
"@bazel/protractor": "1.1.0",
|
||||
"@bazel/rollup": "1.1.0",
|
||||
"@bazel/terser": "1.1.0",
|
||||
"@bazel/typescript": "1.1.0",
|
||||
"@microsoft/api-extractor": "^7.3.9",
|
||||
"@schematics/angular": "9.0.0-rc.4",
|
||||
"@types/angular": "^1.6.47",
|
||||
|
|
|
@ -15,8 +15,8 @@ workspace(
|
|||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
RULES_NODEJS_VERSION = "1.0.1"
|
||||
RULES_NODEJS_SHA256 = "e1a0d6eb40ec89f61a13a028e7113aa3630247253bcb1406281b627e44395145"
|
||||
RULES_NODEJS_VERSION = "1.1.0"
|
||||
RULES_NODEJS_SHA256 = "c97bf38546c220fa250ff2cc052c1a9eac977c662c1fc23eda797b0ce8e70a43"
|
||||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
sha256 = RULES_NODEJS_SHA256,
|
||||
|
|
|
@ -40,11 +40,11 @@ function addDevDependenciesToPackageJson(options: Schema) {
|
|||
['@angular/bazel', angularCore.version],
|
||||
['@bazel/bazel', '1.1.0'],
|
||||
['@bazel/ibazel', '0.10.3'],
|
||||
['@bazel/karma', '1.0.1'],
|
||||
['@bazel/protractor', '1.0.1'],
|
||||
['@bazel/rollup', '1.0.1'],
|
||||
['@bazel/terser', '1.0.1'],
|
||||
['@bazel/typescript', '1.0.1'],
|
||||
['@bazel/karma', '1.1.0'],
|
||||
['@bazel/protractor', '1.1.0'],
|
||||
['@bazel/rollup', '1.1.0'],
|
||||
['@bazel/terser', '1.1.0'],
|
||||
['@bazel/typescript', '1.1.0'],
|
||||
['history-server', '1.3.1'],
|
||||
['html-insert-assets', '0.2.0'],
|
||||
['karma', '4.4.1'],
|
||||
|
|
|
@ -291,16 +291,11 @@ def jasmine_node_test(bootstrap = [], **kwargs):
|
|||
"@npm//source-map-support",
|
||||
"@npm//tslib",
|
||||
"@npm//xhr2",
|
||||
"//tools/testing:bazel_patch_require.js",
|
||||
]
|
||||
configuration_env_vars = kwargs.pop("configuration_env_vars", []) + [
|
||||
"angular_ivy_enabled",
|
||||
]
|
||||
templated_args = [
|
||||
# bazel_patch_require.js must be first
|
||||
# TODO(gregmagolan): remove this once linker has been applied to nodejs_binary targets by default in rules_nodejs
|
||||
"--node_options=--require=$(rlocation $(location //tools/testing:bazel_patch_require.js))",
|
||||
] + kwargs.pop("templated_args", [])
|
||||
templated_args = kwargs.pop("templated_args", [])
|
||||
for label in bootstrap:
|
||||
deps += [label]
|
||||
templated_args += ["--node_options=--require=$(rlocation $(location %s))" % label]
|
||||
|
|
|
@ -2,8 +2,6 @@ load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
|||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files(["bazel_patch_require.js"])
|
||||
|
||||
ts_library(
|
||||
name = "browser",
|
||||
testonly = 1,
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
// Load the Bazel Node runfiles helper script and patch the NodeJS module resolution. This is
|
||||
// necessary to ensure that imports are properly resolved in Bazel. By default, the module
|
||||
// resolution is patched in `nodejs_binary` targets when the main script loads, but since we
|
||||
// --require boostrap scripts before the main script, this bootstrap script is loaded first so that
|
||||
// subsequent bootstrap scripts can resolve their imports.
|
||||
//
|
||||
// We're in a valley with the runfiles support right now having removed the `bootstrap` attribute
|
||||
// for rule_nodejs 1.0 but not applied the linker to run targets yet in rules_nodejs. In a near
|
||||
// future rules_nodejs release, the runfiles helper won't be required as standard node module
|
||||
// resolution works with the linker.
|
||||
//
|
||||
// We could have left the `bootstrap` attribute in for 1.0 and removed it for 2.0 but since we had
|
||||
// an alternate approach that we're using here that isn't going to be broken in the future by the
|
||||
// linker being added we decided to pull it for 1.0 so that we have fewer major breaking changes in
|
||||
// 2.0.
|
||||
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
|
||||
require(process.env['BAZEL_NODE_RUNFILES_HELPER']).patchRequire();
|
||||
}
|
48
yarn.lock
48
yarn.lock
|
@ -981,41 +981,41 @@
|
|||
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.11.1.tgz#c07ceaded388f1e39d6aa732953e0dd04f3dbdf0"
|
||||
integrity sha512-qAdEquFAudYyN+CYfLzvuRWNubdsh6C8+o5CiViUEfchq1HQM5Rs8xAOE3fzGsTZ1EUsvgca/PY0kn0VIxckBA==
|
||||
|
||||
"@bazel/jasmine@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.0.1.tgz#e3a7450017d685446745bb59f5afcc05b8870f7f"
|
||||
integrity sha512-P9no3QiSLM7E2DKU+Ay/Vy4Y/Tv6oxsNeA9/y0ok0SPeNQwAZ75U/8KEDO8G3ymCK19rIXlz6CAeEBGDmj4+CA==
|
||||
"@bazel/jasmine@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-1.1.0.tgz#3900a99b57ceac1e979aa0d64b624a70a4ebd92e"
|
||||
integrity sha512-3KuA7eNBu4OyHWP5k8pZJlpdThPfvFQViNDMawmz80KLfp1qbHkMYaVd5Drfa6MmDXjC7QNAGG7zRe0DOrEJ2Q==
|
||||
dependencies:
|
||||
jasmine "~3.4.0"
|
||||
jasmine-core "~3.4.0"
|
||||
v8-coverage "1.0.9"
|
||||
|
||||
"@bazel/karma@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.0.1.tgz#f60de501367125ece03af1250ccb69d836fee2cc"
|
||||
integrity sha512-AJ7KOx+oWHTAwstTMH95jpPP4MSKnG2eZiTms5OilhLz6KWg+l4hGumJ+jB8ntt/ZlMv9nrLVohS5zjEUyeTYA==
|
||||
"@bazel/karma@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-1.1.0.tgz#3340904942acd970964ad40a28177f780d2d658a"
|
||||
integrity sha512-4AwY86r/MNPCcVkR4z5wO9d4dftdSWi7nFnIEFGsl++Mzpgrfc70dGReu35BFC38JavWrEkZuh7RU1d8bbD8WQ==
|
||||
dependencies:
|
||||
tmp "0.1.0"
|
||||
|
||||
"@bazel/protractor@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.0.1.tgz#48d1f12c9edec114b04b45a159fa8c231c65c688"
|
||||
integrity sha512-gAJ4nMQRXu4/k+EvH/aD4BUBrSy9dn/xtAI0qRs8t2997Zafb2HI0Ejd0Ep3geBcnloC/EWGSQAIBt5vQrOWAw==
|
||||
"@bazel/protractor@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-1.1.0.tgz#0adf7c76a73ee437e0ba223662d98ba2f1a3356d"
|
||||
integrity sha512-k1Oqt0FMmnxk4lJZ4vA/CHOWcMKWuCr85Ljlq0hZrxfDokuxwGBMAUZgTQIh5KkvRnAo0utYRESMhWed8H2DpA==
|
||||
|
||||
"@bazel/rollup@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-1.0.1.tgz#aaef886ff6cb00fc19995479aef4275359b57eee"
|
||||
integrity sha512-LL9eszGoHbw50+59KqqgmHB1AFQKlYeJFDCMzJU5DnAMLWz/bSlf77CaC3iipL7AVQXVqu1aJEviiNYDVGTlig==
|
||||
"@bazel/rollup@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-1.1.0.tgz#e1e496d77fcd55971ff4ef51e982476dfe092ac8"
|
||||
integrity sha512-FiSiXZ/AOWnAVR39gLVYlATe/clGyvap5skiILtDksVtm6C620Rkqr/4QfIdFHZzdMb+eaxbRbMkOxux4O2McQ==
|
||||
|
||||
"@bazel/terser@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-1.0.1.tgz#edc22ef7d507ddf249ab039fc9f8c4d05c4789f9"
|
||||
integrity sha512-ldww7M6V6itnhCbtIdiGenKJZVwfpeA+h1z41KYCPQouNBrf0zBH717NYUx1IXkxmWfuT1cmgDWLYEhBC+R2Sw==
|
||||
"@bazel/terser@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-1.1.0.tgz#e737ed06ef445e2c510ac08f956607434771dbf1"
|
||||
integrity sha512-oGnRvDi/ESZ+fY7BzTvlUiLa5kbzY370gLtByFFX0Ix2PlVIs558bsbLMmt3Lbnts75t4GQTkB5NanZkk1Sjkg==
|
||||
|
||||
"@bazel/typescript@1.0.1":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.0.1.tgz#23c8232f9a08199971a306a688843f10832f2458"
|
||||
integrity sha512-dEZVAqmsJRcxnUPedXJ5QJIcmzxxXLDSybNO2uBXET8PvDfRpFGwu/ui+FE3uC3gYYXUFUas6WIEw5oiSeicVQ==
|
||||
"@bazel/typescript@1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.1.0.tgz#b57ac6c6d627577f394a60fb540fbbdf53bcff0d"
|
||||
integrity sha512-QnTdb6rwZUR+KfUuAdyazpkA7BOvrWRe7tkPDdyIZHJdBPYdpJW+AapnFSfxvXEIP0Nwesl5KP6Saau0GPiBLg==
|
||||
dependencies:
|
||||
protobufjs "6.8.8"
|
||||
semver "5.6.0"
|
||||
|
|
Loading…
Reference in New Issue