Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 1d4d9d8

Browse files
authored
build: Update rules nodejs and bazel (#2256)
1 parent 9062e3c commit 1d4d9d8

File tree

8 files changed

+500
-1075
lines changed

8 files changed

+500
-1075
lines changed

.bazelrc

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ test --nolegacy_external_runfiles
2121
# when running bazel via `yarn bazel`.
2222
build --incompatible_strict_action_env
2323

24+
# Do not build runfile forests by default. If an execution strategy relies on runfile
25+
# forests, the forest is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
26+
# and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
27+
build --nobuild_runfile_links
28+
2429
###############################
2530
# Output control #
2631
###############################

WORKSPACE

+2-2
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 = "d0c4bb8b902c1658f42eb5563809c70a06e46015d64057d25560b0eb4bdc9007",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.5.0/rules_nodejs-1.5.0.tar.gz"],
11+
sha256 = "d14076339deb08e5460c221fae5c5e9605d2ef4848eee1f0c81c9ffdc1ab31c1",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.6.1/rules_nodejs-1.6.1.tar.gz"],
1313
)
1414

1515
load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "node_repositories", "yarn_install")

demos/yarn.lock

+263-236
Large diffs are not rendered by default.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/trimox/angular-mdc-web.git"
99
},
1010
"license": "MIT",
11-
"version": "6.0.0-canary.8",
11+
"version": "6.0.0-canary.9",
1212
"engines": {
1313
"node": ">= 12.0.0",
1414
"yarn": ">= 1.19.1"
@@ -53,10 +53,10 @@
5353
"@angular/router": "^9.1.2",
5454
"@bazel/bazelisk": "^1.4.0",
5555
"@bazel/buildifier": "^2.2.1",
56-
"@bazel/ibazel": "^0.12.4",
57-
"@bazel/jasmine": "~1.5.0",
58-
"@bazel/karma": "~1.5.0",
59-
"@bazel/typescript": "~1.5.0",
56+
"@bazel/ibazel": "^0.13.0",
57+
"@bazel/jasmine": "~1.6.1",
58+
"@bazel/karma": "~1.6.1",
59+
"@bazel/typescript": "~1.6.1",
6060
"@types/fs-extra": "^8.1.0",
6161
"@types/jasmine": "^3.5.9",
6262
"@types/minimatch": "^3.0.3",

packages/material-components-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "https://github.com/trimox/angular-mdc-web.git"
99
},
10-
"version": "6.0.0-canary.8",
10+
"version": "6.0.0-canary.9",
1111
"license": "MIT",
1212
"keywords": [
1313
"angular-mdc",

tools/postinstall/apply-patches.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const fs = require('fs');
1212
* Version of the post install patch. Needs to be incremented when
1313
* existing patches or edits have been modified.
1414
*/
15-
const PATCH_VERSION = 4;
15+
const PATCH_VERSION = 5;
1616

1717
/** Path to the project directory. */
1818
const projectDir = path.join(__dirname, '../..');

tools/postinstall/manifest_externs_hermeticity.patch

+33-23
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
diff --git node_modules/@bazel/typescript/internal/build_defs.bzl node_modules/@bazel/typescript/internal/build_defs.bzl
2-
index 7fef44c..4e25ed7 100644
2+
index 03cb68fdf..2f604234c 100755
33
--- node_modules/@bazel/typescript/internal/build_defs.bzl
44
+++ node_modules/@bazel/typescript/internal/build_defs.bzl
5-
@@ -93,25 +93,23 @@ def _filter_ts_inputs(all_inputs):
6-
if f.path.endswith(".js") or f.path.endswith(".ts") or f.path.endswith(".json")
5+
@@ -102,17 +102,17 @@ def _filter_ts_inputs(all_inputs):
6+
if f.extension in ["js", "jsx", "ts", "tsx", "json"]
77
]
8-
8+
99
+def _filter_compile_outputs(all_outputs):
1010
+ return [
1111
+ f
@@ -24,41 +24,51 @@ index 7fef44c..4e25ed7 100644
2424
- ctx.actions.write(output, content = "")
2525
- else:
2626
- action_outputs.append(output)
27-
-
28-
- # TODO(plf): For now we mock creation of files other than {name}.js.
29-
- for externs_file in externs_files:
30-
- ctx.actions.write(output = externs_file, content = "")
3127
+ compile_outputs = _filter_compile_outputs(outputs)
32-
28+
29+
# TODO(plf): For now we mock creation of files other than {name}.js.
30+
for externs_file in externs_files:
31+
@@ -120,7 +120,9 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
32+
3333
# A ts_library that has only .d.ts inputs will have no outputs,
3434
# therefore there are no actions to execute
3535
- if not action_outputs:
3636
+ if not compile_outputs:
3737
+ for file in [f for f in outputs if not f in compile_outputs]:
38-
+ ctx.actions.write(output = file, content = "")
38+
+ ctx.actions.write(output = file, content = "")
3939
return None
40-
40+
4141
action_inputs.extend(_filter_ts_inputs(ctx.files.node_modules))
42-
@@ -146,7 +142,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
43-
progress_message = "Compiling TypeScript (%s) %s" % (description, ctx.label),
44-
mnemonic = mnemonic,
45-
inputs = action_inputs,
46-
- outputs = action_outputs,
47-
+ outputs = outputs,
48-
# Use the built-in shell environment
49-
# Allow for users who set a custom shell that can locate standard binaries like tr and uname
50-
# See https://github.com/NixOS/nixpkgs/issues/43955#issuecomment-407546331
51-
@@ -163,7 +159,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
42+
@@ -156,7 +158,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
43+
progress_message = "Compiling TypeScript (%s) %s" % (description, ctx.label),
44+
mnemonic = "TypeScriptCompile",
45+
inputs = action_inputs,
46+
- outputs = action_outputs,
47+
+ outputs = outputs,
48+
# Use the built-in shell environment
49+
# Allow for users who set a custom shell that can locate standard binaries like tr and uname
50+
# See https://github.com/NixOS/nixpkgs/issues/43955#issuecomment-407546331
51+
@@ -179,7 +181,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
52+
progress_message = "Compiling TypeScript (%s) %s" % (description, ctx.label),
53+
mnemonic = "tsc",
54+
inputs = action_inputs,
55+
- outputs = action_outputs,
56+
+ outputs = compile_outputs,
57+
# Use the built-in shell environment
58+
# Allow for users who set a custom shell that can locate standard binaries like tr and uname
59+
# See https://github.com/NixOS/nixpkgs/issues/43955#issuecomment-407546331
60+
@@ -194,7 +196,7 @@ def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description
5261
label = ctx.label,
5362
tsconfig = tsconfig_file,
5463
inputs = action_inputs,
5564
- outputs = action_outputs,
5665
+ outputs = compile_outputs,
5766
compiler = ctx.executable.compiler,
5867
)
68+
5969

6070
diff --git node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js
61-
index 0346123..3d9bc64 100644
71+
index ec813f654..738342a8f 100755
6272
--- node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js
6373
+++ node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js
6474
@@ -381,6 +381,23 @@ function createProgramAndEmit(fileLoader, options, bazelOpts, files, disabledTse
@@ -84,4 +94,4 @@ index 0346123..3d9bc64 100644
8494
+ }
8595
}
8696
if (diagnostics.length > 0) {
87-
worker_1.debug('compilation failed at', new Error().stack);
97+
worker_1.debug('compilation failed at', new Error().stack);

0 commit comments

Comments
 (0)