Skip to content

Commit ad6ef95

Browse files
devversioncrisbeto
authored andcommitted
build: update to rules_nodejs v5 and update dev-infra
1 parent 1020602 commit ad6ef95

File tree

15 files changed

+1872
-2045
lines changed

15 files changed

+1872
-2045
lines changed

.github/workflows/dev-infra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.0.0
12-
- uses: angular/dev-infra/github-actions/commit-message-based-labels@138ec743c342cd2a4a75443d19e0ccd47244ee07
12+
- uses: angular/dev-infra/github-actions/commit-message-based-labels@2e2d1a6beeb26b0cc61c70f157f1dc073cdcf235
1313
with:
1414
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}

.github/workflows/feature-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
if: github.repository == 'angular/components'
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: angular/dev-infra/github-actions/feature-request@138ec743c342cd2a4a75443d19e0ccd47244ee07
13+
- uses: angular/dev-infra/github-actions/feature-request@2e2d1a6beeb26b0cc61c70f157f1dc073cdcf235
1414
with:
1515
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}

.github/workflows/lock-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
lock_closed:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: angular/dev-infra/github-actions/lock-closed@138ec743c342cd2a4a75443d19e0ccd47244ee07
12+
- uses: angular/dev-infra/github-actions/lock-closed@2e2d1a6beeb26b0cc61c70f157f1dc073cdcf235
1313
with:
1414
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}

BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
12
load("//:pkg-externals.bzl", "PKG_EXTERNALS")
23
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS")
34
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_ENTRYPOINTS")
@@ -11,6 +12,13 @@ exports_files([
1112
"package.json",
1213
])
1314

15+
nodejs_binary(
16+
name = "yarn_vendored",
17+
data = [".yarn/releases/yarn-1.22.17.cjs"],
18+
entry_point = ".yarn/releases/yarn-1.22.17.cjs",
19+
visibility = ["//integration:__subpackages__"],
20+
)
21+
1422
# Target which writes the list of package externals into a JSON file so that the
1523
# Starlark-configured externals (for the NPM package bundling) can be passed to
1624
# the `check-package-externals` Yarn script, which validates our module imports.

WORKSPACE

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +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-
patches = ["//tools:multiple-node-versions.patch"],
12-
sha256 = "f7037c8e295fdc921f714962aee7c496110052511e2b14076bd8e2d46bc9819c",
13-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.5/rules_nodejs-4.4.5.tar.gz"],
11+
sha256 = "3ceb1e5b5dcad5fa2ad8870a20201cfbb9c9c63cac4055c9ab370034c765297f",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.0/rules_nodejs-5.3.0.tar.gz"],
1413
)
1514

1615
# Add sass rules
@@ -28,10 +27,10 @@ http_archive(
2827
# for declaring Bazel build setting flags.
2928
http_archive(
3029
name = "bazel_skylib",
31-
sha256 = "191ea53b19b7e49b5b63d0ef81d1a6278227f9ac2c09fed1c2b3a75d573f1eeb",
32-
strip_prefix = "bazel-skylib-b2ed61686ebca2a44d44857fef5b3e1d31cc2483",
30+
sha256 = "a9c5d3a22461ed7063aa7b088f9c96fa0aaaa8b6984b601f84d705adc47d8a58",
31+
strip_prefix = "bazel-skylib-8334f938c1574ef6f1f7a38a03550a31df65274e",
3332
urls = [
34-
"https://github.com/bazelbuild/bazel-skylib/archive/b2ed61686ebca2a44d44857fef5b3e1d31cc2483.tar.gz",
33+
"https://github.com/bazelbuild/bazel-skylib/archive/8334f938c1574ef6f1f7a38a03550a31df65274e.tar.gz",
3534
],
3635
)
3736

@@ -52,27 +51,42 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
5251

5352
bazel_skylib_workspace()
5453

55-
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
54+
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
5655

57-
node_repositories(
58-
# TOOD: Bring this in sync with CircleCI and nvmrc once we are on `rules_nodejs`#v5.
59-
node_version = "16.10.0",
60-
package_json = ["//:package.json"],
56+
build_bazel_rules_nodejs_dependencies()
57+
58+
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
59+
60+
nodejs_register_toolchains(
61+
name = "nodejs",
62+
node_version = "16.14.0",
6163
)
6264

65+
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
6366
load("//tools:integration.bzl", "create_npm_package_archive_build_file")
6467

6568
yarn_install(
6669
name = "npm",
6770
# We add the postinstall patches file here so that Yarn will rerun whenever
6871
# the file is modified.
6972
data = [
73+
"//:.yarn/releases/yarn-1.22.17.cjs",
74+
"//:.yarnrc",
7075
"//:tools/postinstall/apply-patches.js",
76+
"//:tools/postinstall/devmode-es2020-bazel.patch",
7177
],
78+
# Currently disabled due to:
79+
# 1. Missing Windows support currently.
80+
# 2. Incompatibilites with the `ts_library` rule.
81+
exports_directories_only = False,
7282
# Add archive targets for some NPM packages that are needed in integration tests.
7383
manual_build_file_contents = create_npm_package_archive_build_file(),
7484
package_json = "//:package.json",
7585
quiet = False,
86+
# We prefer to symlink the `node_modules` to only maintain a single install.
87+
# See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
88+
symlink_node_modules = True,
89+
yarn = "//:.yarn/releases/yarn-1.22.17.cjs",
7690
yarn_lock = "//:yarn.lock",
7791
)
7892

@@ -106,4 +120,6 @@ _dev_infra_browser_repositories()
106120

107121
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
108122

109-
esbuild_repositories()
123+
esbuild_repositories(
124+
npm_repository = "npm",
125+
)

integration/harness-e2e-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"karma-jasmine": "~4.0.0",
4444
"karma-jasmine-html-reporter": "~1.7.0",
4545
"selenium-webdriver": "3.6.0",
46-
"ts-node": "~9.1.1",
46+
"ts-node": "~10.7.0",
4747
"typescript": "file:../../node_modules/typescript",
4848
"wait-on": "^6.0.0"
4949
}

0 commit comments

Comments
 (0)