build: update to nodejs rules 0.37.1 (#32151)

This release includes a ts_config runfiles fix so also cleaning up the one line work-around from #31943.

This also updates to upstream rules_webtesting browser repositories load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories") to fix a breaking change in the chromedriver distro. This bumps up the version of chromium to the version here: https://github.com/bazelbuild/rules_webtesting/blob/master/web/versioned/browsers-0.3.2.bzl

PR Close #32151
This commit is contained in:
Greg Magolan
2019-08-15 08:35:33 -07:00
committed by Andrew Kushnir
parent c8be987b40
commit c1346462db
21 changed files with 221 additions and 279 deletions

View File

@ -15,8 +15,8 @@ workspace(
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_NODEJS_VERSION = "0.34.0"
RULES_NODEJS_SHA256 = "7c4a690268be97c96f04d505224ec4cb1ae53c2c2b68be495c9bd2634296a5cd"
RULES_NODEJS_VERSION = "0.37.1"
RULES_NODEJS_SHA256 = "da217044d24abd16667324626a33581f3eaccabf80985b2688d6a08ed2f864be"
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = RULES_NODEJS_SHA256,
@ -79,8 +79,8 @@ rules_karma_dependencies()
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
browser_repositories()
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")
browser_repositories(chromium = True, firefox = True)
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")
ts_setup_workspace()

View File

@ -47,6 +47,7 @@ ng_module(
rollup_bundle(
name = "bundle",
enable_code_splitting = False,
entry_point = ":main.prod.ts",
deps = [
"//src",
@ -145,6 +146,7 @@ ts_web_test_suite(
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
],
tags = ["native"],
deps = [
":rxjs_umd_modules",
":test_lib",

View File

@ -7,6 +7,7 @@
const protractorUtils = require('@bazel/protractor/protractor-utils');
const protractor = require('protractor');
const path = require('path');
module.exports = function(config) {
// In this example, `@bazel/protractor/protractor-utils` is used to run
@ -14,8 +15,8 @@ module.exports = function(config) {
// selected port (given a port flag to pass to the server as an argument).
// The port used is returned in serverSpec and the protractor serverUrl
// is the configured.
const portFlag = /prodserver(\.exe)?$/.test(config.server) ? '-p' : '-port';
return protractorUtils.runServer(config.workspace, config.server, portFlag, [])
const isProdserver = path.basename(config.server, path.extname(config.server)) === 'prodserver';
return protractorUtils.runServer(config.workspace, config.server, isProdserver ? '-p' : '-port', [])
.then(serverSpec => {
const serverUrl = `http://localhost:${serverSpec.port}`;
protractor.browser.baseUrl = serverUrl;

View File

@ -50,9 +50,9 @@ function addDevDependenciesToPackageJson(options: Schema) {
'@angular/bazel': angularCoreVersion,
'@bazel/bazel': '^0.28.1',
'@bazel/ibazel': '^0.10.2',
'@bazel/karma': '0.34.0',
'@bazel/protractor': '0.34.0',
'@bazel/typescript': '0.34.0',
'@bazel/karma': '0.37.1',
'@bazel/protractor': '0.37.1',
'@bazel/typescript': '0.37.1',
};
const recorder = host.beginUpdate(packageJson);