Skip to content

Commit 78c6d97

Browse files
devversionmmalerba
authored andcommitted
build: update to rules_nodejs v3.3.0
Updates to the latest version of `rules_nodejs` that supports the most recent NodeJS lts version v14.16.1. Additionally the latest version of `rules_nodejs` provides a package for runfile resolution w/ types that we can leverage.
1 parent b722fcf commit 78c6d97

File tree

11 files changed

+68
-58
lines changed

11 files changed

+68
-58
lines changed

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88
# Add NodeJS rules
99
http_archive(
1010
name = "build_bazel_rules_nodejs",
11-
sha256 = "bfacf15161d96a6a39510e7b3d3b522cf61cb8b82a31e79400a84c5abcab5347",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.2.1/rules_nodejs-3.2.1.tar.gz"],
11+
sha256 = "f533eeefc8fe1ddfe93652ec50f82373d0c431f7faabd5e6323f6903195ef227",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.3.0/rules_nodejs-3.3.0.tar.gz"],
1313
)
1414

1515
# Add sass rules

integration/ts-compat/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typescript_version_packages = [
3131
"//src/material:npm_package",
3232
"//src/material-experimental:npm_package",
3333
"//src/youtube-player:npm_package",
34+
"@npm//@bazel/runfiles",
3435
"@npm//shelljs",
3536
"@npm//%s" % ts_pkg_name,
3637
"@npm//@types/node",

integration/ts-compat/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const {relative, sep, join} = require('path');
22
const {readdirSync, readFileSync, existsSync, unlinkSync} = require('fs');
33
const {set, ln, rm, mkdir} = require('shelljs');
44
const {fork} = require('child_process');
5-
const runfiles = require(process.env.BAZEL_NODE_RUNFILES_HELPER);
5+
const {runfiles} = require('@bazel/runfiles');
66

77
// Exit if any command fails.
88
set('-e');

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,16 @@
8181
"@angular/platform-server": "^12.0.0-next.7",
8282
"@angular/router": "^12.0.0-next.7",
8383
"@axe-core/webdriverjs": "^4.1.0",
84-
"@bazel/bazelisk": "^1.4.0",
85-
"@bazel/buildifier": "^4.0.0",
84+
"@bazel/bazelisk": "1.7.5",
85+
"@bazel/buildifier": "4.0.1",
8686
"@bazel/concatjs": "3.2.1",
87-
"@bazel/ibazel": "^0.14.0",
88-
"@bazel/jasmine": "3.2.1",
89-
"@bazel/protractor": "3.2.1",
90-
"@bazel/rollup": "3.2.1",
91-
"@bazel/terser": "3.2.2",
92-
"@bazel/typescript": "3.2.1",
87+
"@bazel/ibazel": "0.15.8",
88+
"@bazel/jasmine": "3.3.0",
89+
"@bazel/protractor": "3.3.0",
90+
"@bazel/rollup": "3.3.0",
91+
"@bazel/runfiles": "^3.3.0",
92+
"@bazel/terser": "3.3.0",
93+
"@bazel/typescript": "3.3.0",
9394
"@firebase/app-types": "^0.6.1",
9495
"@material/animation": "11.0.0-canary.15604bd0d.0",
9596
"@material/auto-init": "11.0.0-canary.15604bd0d.0",
@@ -222,7 +223,7 @@
222223
"yaml": "^1.10.0"
223224
},
224225
"resolutions": {
225-
"browser-sync-client" : "2.26.13",
226+
"browser-sync-client": "2.26.13",
226227
"dgeni-packages/typescript": "4.2.3"
227228
}
228229
}

src/cdk/schematics/testing/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ts_library(
1414
deps = [
1515
"@npm//@angular-devkit/core",
1616
"@npm//@angular-devkit/schematics",
17+
"@npm//@bazel/runfiles",
1718
"@npm//@schematics/angular",
1819
"@npm//@types/fs-extra",
1920
"@npm//@types/glob",

src/cdk/schematics/testing/resolve-bazel-path.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ export function resolveBazelPath(parent: string, relativePath: string) {
1818
if (process.env['RUNFILES_MANIFEST_ONLY'] !== '1') {
1919
return path.join(parent, relativePath);
2020
}
21-
// Imports the runfile helpers from the Bazel NodeJS rules. This should be ideally
22-
// a separate package with types. https://github.com/bazelbuild/rules_nodejs/issues/1793.
2321
// Note: We don't want to import this outside of this function as the runfile helpers are
2422
// quite large we don't want to load them for every import to `@angular/cdk/testing/private`.
25-
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']!);
23+
const {runfiles} = require('@bazel/runfiles');
2624
const projectDirs = [
2725
// Workspace symlinked into `@npm//:node_modules/`.
2826
path.join(runfiles.resolve('npm/node_modules'), runfiles.workspace),

src/cdk/testing/tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ ts_library(
8787
":test_harnesses",
8888
"//src/cdk/testing",
8989
"//src/cdk/testing/webdriver",
90+
"@npm//@bazel/runfiles",
9091
"@npm//@types/jasmine",
9192
"@npm//@types/node",
9293
"@npm//@types/selenium-webdriver",

src/cdk/testing/tests/webdriver.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {runfiles} from '@bazel/runfiles';
12
import {HarnessLoader, parallel} from '@angular/cdk/testing';
23
import {waitForAngularReady, WebDriverHarnessEnvironment} from '@angular/cdk/testing/webdriver';
34
import * as webdriver from 'selenium-webdriver';
@@ -22,7 +23,6 @@ if (process.env['WEB_TEST_METADATA'] === undefined) {
2223
process.exit(1);
2324
}
2425

25-
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']!);
2626
const webTestMetadata: WebTestMetadata =
2727
require(runfiles.resolve(process.env['WEB_TEST_METADATA']));
2828
const port = process.env['TEST_SERVER_PORT'];

tools/server-test/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ package(default_visibility = ["//visibility:public"])
55
ts_library(
66
name = "test_runner_lib",
77
srcs = ["test-runner.ts"],
8-
deps = ["@npm//@types/node"],
8+
deps = [
9+
"@npm//@bazel/runfiles",
10+
"@npm//@types/node",
11+
],
912
)

tools/server-test/test-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* to that port, and then running tests against it.
44
*/
55

6-
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']!);
76
import * as child_process from 'child_process';
87
import * as net from 'net';
8+
import {runfiles} from '@bazel/runfiles';
99

1010
/** Checks if the given port is free. */
1111
function isPortFree(port: number) {

0 commit comments

Comments
 (0)