Skip to content

Commit c701acb

Browse files
devversionclydin
authored andcommitted
build: use worker for ts_project to enable fast DX and avoid no-sandbox issues
For the `rules_js` migration we are introducing a new ruleset for Angular rules. These rules are not used here by the CLI as we don't use `ng_module`, but we are building the rules in a way where we expose a worker binary that can also work with vanilla TS. The worker significantly speeds up compilations, bringing them to equivalent speeds of `ts_library`, and **importantly** fixes/avoids issues when actions are executing outside sandbox. E.g. on Windows where the tsc compilation currently can see many other files that aren't action inputs; and accidentally picks them up.
1 parent ad450e3 commit c701acb

File tree

5 files changed

+1022
-1329
lines changed

5 files changed

+1022
-1329
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-2023857461
5-
package.json=1474377014
6-
pnpm-lock.yaml=1733416088
5+
package.json=-429967005
6+
pnpm-lock.yaml=-1164942040
77
pnpm-workspace.yaml=1711114604
8-
yarn.lock=-607783516
8+
yarn.lock=80564211

WORKSPACE

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ register_toolchains(
88
"//tools:windows_tar_system_toolchain",
99
)
1010

11-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
11+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
1212

1313
http_archive(
1414
name = "bazel_skylib",
@@ -37,9 +37,9 @@ build_bazel_rules_nodejs_dependencies()
3737

3838
http_archive(
3939
name = "aspect_rules_js",
40-
sha256 = "75c25a0f15a9e4592bbda45b57aa089e4bf17f9176fd735351e8c6444df87b52",
41-
strip_prefix = "rules_js-2.1.0",
42-
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.0/rules_js-v2.1.0.tar.gz",
40+
sha256 = "3388abe9b9728ef68ea8d8301f932b11b2c9a271d74741ddd5f3b34d1db843ac",
41+
strip_prefix = "rules_js-2.1.1",
42+
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.1/rules_js-v2.1.1.tar.gz",
4343
)
4444

4545
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
@@ -218,3 +218,9 @@ rules_ts_dependencies(
218218
# TODO: Support in https://github.com/aspect-build/rules_ts/blob/main/ts/private/npm_repositories.bzl
219219
ts_version = "5.6.2",
220220
)
221+
222+
http_file(
223+
name = "tsc_worker",
224+
sha256 = "",
225+
urls = ["https://raw.githubusercontent.com/devversion/rules_angular/a270a74d1e64577bddba96a5484c7c5d2c5d2770/dist/worker.mjs"],
226+
)

0 commit comments

Comments
 (0)