Skip to content

Commit 005a68e

Browse files
committed
build: setup rules_ts for compiling TypeScript sources
This commit sets up `rules_ts`, providing the `ts_library` equivalent for the `rules_js` migration.
1 parent 05a9c37 commit 005a68e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Required by `rules_ts`.
2+
common --@aspect_rules_ts//ts:skipLibCheck=always
3+
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
4+
15
###############################
26
# Filesystem interactions #
37
###############################

WORKSPACE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,16 @@ npm_translate_lock(
177177
load("@npm2//:repositories.bzl", "npm_repositories")
178178

179179
npm_repositories()
180+
181+
http_archive(
182+
name = "aspect_rules_ts",
183+
sha256 = "9acd128abe77397505148eaa6895faed57839560dbf2177dd6285e51235e2724",
184+
strip_prefix = "rules_ts-3.3.1",
185+
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.3.1/rules_ts-v3.3.1.tar.gz",
186+
)
187+
188+
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
189+
190+
rules_ts_dependencies(
191+
ts_version_from = "//:package.json",
192+
)

src/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@npm//@bazel/concatjs:index.bzl", "ts_config")
2+
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
23
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS")
34
load("//src/material:config.bzl", "MATERIAL_ENTRYPOINTS", "MATERIAL_TESTING_ENTRYPOINTS")
45
load("//tools/dgeni:index.bzl", "dgeni_api_docs")
@@ -58,3 +59,9 @@ ts_config(
5859
"//goldens:tsec-exemption.json",
5960
],
6061
)
62+
63+
rules_js_tsconfig(
64+
name = "build-tsconfig",
65+
src = "bazel-tsconfig-build.json",
66+
deps = [],
67+
)

0 commit comments

Comments
 (0)