Skip to content

Commit 255328a

Browse files
committed
build: update to [email protected]
Update to use [email protected] and update correseponding build rule usages and references
1 parent 65330c2 commit 255328a

File tree

17 files changed

+76
-104
lines changed

17 files changed

+76
-104
lines changed

WORKSPACE

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@ 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 = "b3521b29c7cb0c47a1a735cce7e7e811a4f80d8e3720cf3a1b624533e4bb7cb6",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.3.2/rules_nodejs-2.3.2.tar.gz"],
11+
sha256 = "dd4dc46066e2ce034cba0c81aa3e862b27e8e8d95871f567359f7a534cccb666",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.1.0/rules_nodejs-3.1.0.tar.gz"],
1313
)
14-
1514
# Add sass rules
1615
http_archive(
1716
name = "io_bazel_rules_sass",
18-
# Patch `rules_sass` to work around a bug that causes error messages to be not
19-
# printed in worker mode: https://github.com/bazelbuild/rules_sass/issues/96.
20-
# TODO(devversion): remove this patch once the Sass Node entry-point returns a `Promise`.
21-
patches = ["//tools/postinstall:sass_worker_async.patch"],
22-
sha256 = "cf28ff1bcfafb3c97f138bbc8ca9fe386e968ed3faaa9f8e6214abb5e88a2ecd",
23-
strip_prefix = "rules_sass-1.29.0",
17+
sha256 = "596ab3616d370135e0ecc710e103422e0aa3719f1c970303a0886b70c81ee819",
18+
strip_prefix = "rules_sass-1.32.2",
2419
urls = [
25-
"https://github.com/bazelbuild/rules_sass/archive/1.29.0.zip",
20+
"https://github.com/bazelbuild/rules_sass/archive/1.32.2.zip",
21+
"https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.32.2.zip",
2622
],
2723
)
2824

@@ -49,10 +45,6 @@ node_repositories(
4945

5046
yarn_install(
5147
name = "npm",
52-
# Redirects Yarn `stdout` output to `stderr`. This ensures that stdout is not accidentally
53-
# polluted when Bazel runs Yarn. Workaround until the upstream fix is available:
54-
# https://github.com/bazelbuild/bazel/pull/10611.
55-
args = ["1>&2"],
5648
# We add the postinstall patches file, and ngcc main fields update script here so
5749
# that Yarn will rerun whenever one of these files has been modified.
5850
data = [
@@ -61,22 +53,15 @@ yarn_install(
6153
],
6254
package_json = "//:package.json",
6355
quiet = False,
56+
strict_visibility = False,
6457
yarn_lock = "//:yarn.lock",
6558
)
6659

67-
# Install all bazel dependencies of the @ngdeps npm packages
68-
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
6960

70-
install_bazel_dependencies(
71-
# TODO(crisbeto): supress warnings for now so everything works like it has until now.
72-
# Eventually we should remove it and re-test everything.
73-
suppress_warning = True,
74-
)
61+
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
7562

76-
# Fetch transitive dependencies which are needed to use the karma rules.
77-
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
63+
npm_bazel_protractor_dependencies()
7864

79-
npm_bazel_karma_dependencies()
8065

8166
# Setup web testing. We need to setup a browser because the web testing rules for TypeScript need
8267
# a reference to a registered browser (ideally that's a hermetic version of a browser)

integration/size-test/index.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def size_test(name, file, deps):
7777
nodejs_binary(
7878
name = "%s.approve" % name,
7979
testonly = True,
80+
templated_args = ["--bazel_patch_module_resolver"],
8081
data = [
8182
"//goldens:size-test.yaml",
8283
"//integration/size-test:check-size",

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585
"@bazel/bazelisk": "^1.4.0",
8686
"@bazel/buildifier": "^4.0.0",
8787
"@bazel/ibazel": "^0.14.0",
88-
"@bazel/jasmine": "^2.3.2",
89-
"@bazel/karma": "^2.3.2",
90-
"@bazel/protractor": "^2.3.2",
91-
"@bazel/rollup": "^2.3.2",
92-
"@bazel/terser": "^2.3.2",
93-
"@bazel/typescript": "^2.3.2",
88+
"@bazel/jasmine": "3.1.0",
89+
"@bazel/concatjs": "3.1.0",
90+
"@bazel/protractor": "3.1.0",
91+
"@bazel/rollup": "3.1.0",
92+
"@bazel/terser": "3.1.0",
93+
"@bazel/typescript": "3.1.0",
9494
"@firebase/app-types": "^0.6.1",
9595
"@octokit/rest": "18.1.0",
9696
"@schematics/angular": "^12.0.0-next.0",

packages.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ VERSION_PLACEHOLDER_REPLACEMENTS = {
99
"0.0.0-MDC": MDC_PACKAGE_VERSION,
1010
"0.0.0-NG": ANGULAR_PACKAGE_VERSION,
1111
"0.0.0-TSLIB": TSLIB_PACKAGE_VERSION,
12+
"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}",
1213
}
1314

1415
# List of default Angular library UMD bundles which are not processed by ngcc.

src/e2e-app/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//@bazel/typescript:index.bzl", "ts_devserver")
1+
load("@npm//@bazel/concatjs:index.bzl", "concatjs_devserver")
22
load("//:packages.bzl", "getAngularUmdTargets")
33
load("//tools:defaults.bzl", "ng_module", "sass_binary")
44

@@ -85,7 +85,7 @@ sass_binary(
8585
],
8686
)
8787

88-
ts_devserver(
88+
concatjs_devserver(
8989
name = "devserver",
9090
testonly = True,
9191
additional_root_paths = [

src/universal-app/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,11 @@ nodejs_test(
5959
":server",
6060
":theme_scss",
6161
],
62+
63+
templated_args = [
64+
# TODO(josephperrott): update dependency usages to no longer need bazel patch module resolver
65+
# See: https://github.com/bazelbuild/rules_nodejs/wiki#--bazel_patch_module_resolver-now-defaults-to-false-2324
66+
"--bazel_patch_module_resolver",
67+
],
6268
entry_point = ":prerender.ts",
6369
)

test/bazel-karma-local-config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* Karma configuration that is used by Bazel karma_web_test targets which do not
2+
* concatjs configuration that is used by Bazel concatjs_web_test targets which do not
33
* want to launch any browser and just enable manual browser debugging.
44
*/
55

6-
const bazelKarma = require('@bazel/karma');
6+
const bazelconcatjs = require('@bazel/concatjs');
77

88
module.exports = config => {
99
const overwrites = {};
1010

11-
// By default "@bazel/karma" configures Chrome as browser. Since we don't want
11+
// By default "@bazel/concatjs" configures Chrome as browser. Since we don't want
1212
// to launch any browser at all, we overwrite the "browsers" option. Since the
1313
// default config tries to extend the browsers array with "Chrome", we need to
1414
// always return a new empty array.
@@ -19,18 +19,18 @@ module.exports = config => {
1919
});
2020

2121
// Ensures that tests start executing once browsers have been manually connected. We need
22-
// to use "defineProperty" because the default "@bazel/karma" config overwrites the option.
22+
// to use "defineProperty" because the default "@bazel/concatjs" config overwrites the option.
2323
Object.defineProperty(overwrites, 'autoWatch', {
2424
get: () => true,
2525
set: () => {},
2626
enumerable: true,
2727
});
2828

29-
// When not running with ibazel, do not set up the `@bazel/karma` watcher. This one
29+
// When not running with ibazel, do not set up the `@bazel/concatjs` watcher. This one
3030
// relies on ibazel to write to the `stdin` interface. When running without ibazel, the
31-
// watcher will kill Karma since there is no data written to the `stdin` interface.
31+
// watcher will kill concatjs since there is no data written to the `stdin` interface.
3232
if (process.env['IBAZEL_NOTIFY_CHANGES'] !== 'y') {
33-
delete bazelKarma['watcher'];
33+
delete bazelconcatjs['watcher'];
3434
}
3535

3636
config.set(overwrites);

tools/defaults.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
load("@io_bazel_rules_sass//:defs.bzl", _sass_binary = "sass_binary", _sass_library = "sass_library")
44
load("@npm//@angular/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
55
load("@npm//@bazel/jasmine:index.bzl", _jasmine_node_test = "jasmine_node_test")
6-
load("@npm//@bazel/karma:index.bzl", _karma_web_test = "karma_web_test", _karma_web_test_suite = "karma_web_test_suite")
6+
load("@npm//@bazel/concatjs:index.bzl", _karma_web_test = "karma_web_test", _karma_web_test_suite = "karma_web_test_suite")
77
load("@npm//@bazel/protractor:index.bzl", _protractor_web_test_suite = "protractor_web_test_suite")
88
load("@npm//@bazel/typescript:index.bzl", _ts_library = "ts_library")
99
load("//:packages.bzl", "VERSION_PLACEHOLDER_REPLACEMENTS", "getAngularUmdTargets")

tools/dev-server/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ts_library(
2525

2626
nodejs_binary(
2727
name = "dev-server_bin",
28+
templated_args = ["--bazel_patch_module_resolver"],
2829
data = [
2930
":dev-server_lib",
3031
],

tools/dgeni/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package(default_visibility = ["//visibility:public"])
55

66
nodejs_binary(
77
name = "dgeni",
8+
templated_args = ["--bazel_patch_module_resolver"],
89
data = [
910
":sources",
1011
"@npm//dgeni",

tools/example-module/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ts_library(
1515

1616
nodejs_binary(
1717
name = "bazel-bin",
18+
templated_args = ["--bazel_patch_module_resolver"],
1819
data = [
1920
":example-module.template",
2021
":example-module-lib",

tools/highlight-files/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ts_library(
1010
deps = [
1111
"//tools/region-parser",
1212
"@npm//@types/fs-extra",
13+
"@npm//fs-extra",
1314
"@npm//@types/node",
1415
],
1516
)
@@ -21,5 +22,10 @@ nodejs_binary(
2122
"@npm//fs-extra",
2223
"@npm//highlight.js",
2324
],
25+
templated_args = [
26+
# TODO(josephperrott): update dependency usages to no longer need bazel patch module resolver
27+
# See: https://github.com/bazelbuild/rules_nodejs/wiki#--bazel_patch_module_resolver-now-defaults-to-false-2324
28+
"--bazel_patch_module_resolver",
29+
],
2430
entry_point = ":highlight-files.ts",
2531
)

tools/markdown-to-html/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ts_library(
1515
deps = [
1616
"//tools/highlight-files:sources",
1717
"@npm//@types/marked",
18+
"@npm//marked",
1819
"@npm//@types/node",
1920
],
2021
)
@@ -26,6 +27,7 @@ nodejs_binary(
2627
"@npm//highlight.js",
2728
"@npm//marked",
2829
],
30+
templated_args = ["--bazel_patch_module_resolver"],
2931
entry_point = ":transform-markdown.ts",
3032
)
3133

tools/package-docs-content/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ nodejs_binary(
99
":sources",
1010
"@npm//fs-extra",
1111
],
12+
templated_args = ["--bazel_patch_module_resolver"],
1213
entry_point = ":package-docs-content.ts",
1314
)
1415

tools/postinstall/@bazel_typescript_tsc_wrapped_worker_cache_fix.patch

Lines changed: 0 additions & 34 deletions
This file was deleted.

tools/postinstall/apply-patches.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function applyPatches() {
8787
const hasFlatModuleBundle = fs.existsSync(filePath.replace('.d.ts', '.metadata.json'));
8888
if ((filePath.includes('node_modules/') || !hasFlatModuleBundle) && $1`,
8989
'node_modules/@angular/compiler-cli/src/transformers/compiler_host.js');
90-
applyPatch(path.join(__dirname, './flat_module_factory_resolution.patch'));
90+
// applyPatch(path.join(__dirname, './flat_module_factory_resolution.patch'));
9191
// The three replacements below ensure that metadata files can be read by NGC and
9292
// that metadata files are collected as Bazel action inputs.
9393
searchAndReplace(
@@ -108,10 +108,7 @@ function applyPatches() {
108108
'node_modules/@angular/bazel/src/ng_module.bzl');
109109

110110
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1208.
111-
applyPatch(path.join(__dirname, './manifest_externs_hermeticity.patch'));
112-
113-
// Patches the changes from: https://github.com/bazelbuild/rules_typescript/pull/504.
114-
applyPatch(path.join(__dirname, './@bazel_typescript_tsc_wrapped_worker_cache_fix.patch'));
111+
// applyPatch(path.join(__dirname, './manifest_externs_hermeticity.patch'));
115112

116113
// Workaround for https://github.com/angular/angular/issues/33452:
117114
searchAndReplace(

yarn.lock

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -677,43 +677,47 @@
677677
resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-4.0.0.tgz#c99fb21295c7e2858fa176c2b950c589217ae8ac"
678678
integrity sha512-e242AK+shp+5bpAc9l93pmG5YRYRfM0INV3gfbdxNeBxccx1MJUagaiwxqAV+Mw55zk92gsb99f2TAc9tt6C7w==
679679

680+
681+
version "3.1.0"
682+
resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-3.1.0.tgz#401099b03d47678af2fe4a4fb3f8ca94800ce235"
683+
integrity sha512-Jsve0lgOk9fD+KlsqYwrYc8MFsy+olNw+uv2l0Oxo2QMheUDMbcuUWg+AHmc3EOjZGSOJGJ0xw1SAvY7b5YNDQ==
684+
dependencies:
685+
protobufjs "6.8.8"
686+
source-map-support "0.5.9"
687+
tsutils "2.27.2"
688+
680689
"@bazel/ibazel@^0.14.0":
681690
version "0.14.0"
682691
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.14.0.tgz#86fa0002bed2ce1123b7ad98d4dd4623a0d93244"
683692
integrity sha512-s0gyec6lArcRDwVfIP6xpY8iEaFpzrSpyErSppd3r2O49pOEg7n6HGS/qJ8ncvme56vrDk6crl/kQ6VAdEO+rg==
684693

685-
"@bazel/jasmine@^2.3.2":
686-
version "2.3.2"
687-
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-2.3.2.tgz#ff120008a69a93ea2138c29cc266d7dec58333a9"
688-
integrity sha512-GG2xAvYXgoW9SHco8RETuxkBTeLF7RI4rtuvAJdVhwwzsUeGovKROTbHvQEyo1qxmeQjQu0hzKr11VfwZPcCMA==
694+
"@bazel/jasmine@3.1.0":
695+
version "3.1.0"
696+
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-3.1.0.tgz#f71b60194f083cd171bf18089e90df1c16cb0ade"
697+
integrity sha512-EPKbBtkqpolVhF9l9QCm8+wbdsRqtFvHgOruk/mkLXpvTmSV+cO//okunEMyeA03BIj1+Ek8Hqk4b4l4lAT4bw==
689698
dependencies:
690699
c8 "~7.1.0"
691700
jasmine-reporters "~2.3.2"
692701

693-
"@bazel/karma@^2.3.2":
694-
version "2.3.2"
695-
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-2.3.2.tgz#4120618f7edd141b155f6f830fd0f04dc748a37c"
696-
integrity sha512-+FFpem1Ul/BtqNrom8y1xPIa1cPEZeBvpao8BRLfQt46r7Nk9u11KI8ylNFk+yIQVhFqAD3JBaL3sbLAU7BJ5Q==
697-
698-
"@bazel/protractor@^2.3.2":
699-
version "2.3.3"
700-
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-2.3.3.tgz#44eca70d159d3e5a67654683f81266cc3594ce5a"
701-
integrity sha512-06EFGstTshvofjiUd1ZJJepGeTgkLZNZB9Bfb7IhMC/ca1ZaeKB8SRWHhiPw7wN1QojHf4JJ+uhbqDt60m+Xrg==
702+
703+
version "3.1.0"
704+
resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-3.1.0.tgz#9d4e2514fa6949c58996b38824409811408924a8"
705+
integrity sha512-39ilFP+grfdetXJOfeImNgNksB42vvlMmM/PU4cO5hUpGvDWSVpx9jIJUdr+NySf3M4A+Kizk3NtcO3xMNmwyQ==
702706

703-
"@bazel/rollup@^2.3.2":
704-
version "2.3.2"
705-
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-2.3.2.tgz#637c9219d75fd40469efe881057b27032aa5896c"
706-
integrity sha512-Eyz99eI/rsWDJws3eO2UGAmIoWmZWEzmchIBU30EoVzvQ5wqZciZ2lLOXkUIAosZsijjE1THiqCCf5gJtOmExw==
707+
"@bazel/rollup@3.1.0":
708+
version "3.1.0"
709+
resolved "https://registry.yarnpkg.com/@bazel/rollup/-/rollup-3.1.0.tgz#36346f052b2ce3c1e31e5ebb05ed80464548eb00"
710+
integrity sha512-lmgPhlR1VsJRsSE83Jlv+WT26Lso0/0FqXknlVuOmvCWFwSUKlriws729fqJZsvV5O2muAgJKuQl/zk+gqGCug==
707711

708-
"@bazel/terser@^2.3.2":
709-
version "2.3.2"
710-
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-2.3.2.tgz#30f0b551f43eeafb64cb834d1f2f3e7f2ddef262"
711-
integrity sha512-UasdVrMdaOEBwzNTTyWtUTH+ITQtXhV64XG6SdyWY1wWLgcgoUOiFYPN2lgXRZyKNpFezmq+CHJ5pqfYwzN3Rg==
712+
"@bazel/terser@3.1.0":
713+
version "3.1.0"
714+
resolved "https://registry.yarnpkg.com/@bazel/terser/-/terser-3.1.0.tgz#5801e83d4ac648fb1a8824a77a1a1f32c3af0c1e"
715+
integrity sha512-8oXZwy5G5dbr4zltBzLjfPw4ZARDEysB2E25dCqAo64XJ26ptS+D3/UnE3uZU9KuM/3ka1U+YIpit+f9SqCgTA==
712716

713-
"@bazel/typescript@^2.3.2":
714-
version "2.3.2"
715-
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-2.3.2.tgz#6d49cc064a9323905dcf791fe0e959f75ddf2ade"
716-
integrity sha512-O2lZfVGx1Uyc7GzLMyD4uiu1qWxy7xviVTEDPzFGcqZsHMCXMV/fEgMoiD0cI4diHwSWrc7Gm/CG9j/z+SRDzA==
717+
"@bazel/typescript@3.1.0":
718+
version "3.1.0"
719+
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-3.1.0.tgz#a07999ad7956b8c624604a521e653570bba32025"
720+
integrity sha512-sEWuvkUGIDeRhjLENHtJyop7wu4UqKN8h/nSgUwc5gkpWXQiT2wGH5jKVxBqODOBHB+IInEMtAjyRmCT+HbSHA==
717721
dependencies:
718722
protobufjs "6.8.8"
719723
semver "5.6.0"

0 commit comments

Comments
 (0)