Skip to content

Commit ba1c394

Browse files
committed
setup rules_ts
1 parent 0765a90 commit ba1c394

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Disable NG CLI TTY mode
22
build --action_env=NG_FORCE_TTY=false
33

4+
# Required by `rules_ts`.
5+
common --@aspect_rules_ts//ts:skipLibCheck=always
6+
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
7+
48
# Make TypeScript compilation fast, by keeping a few copies of the compiler
59
# running as daemons, and cache SourceFile AST's to reduce parse time.
610
build --strategy=TypeScriptCompile=worker

BUILD.bazel

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
2+
13
# Copyright Google Inc. All Rights Reserved.
24
#
35
# Use of this source code is governed by an MIT-style license that can be
@@ -24,6 +26,15 @@ npm_link_all_packages(
2426
name = "node_modules",
2527
)
2628

29+
rules_js_tsconfig(
30+
name = "build-tsconfig",
31+
src = "tsconfig-build.json",
32+
deps = [
33+
"tsconfig.json",
34+
"//:node_modules/@types/node",
35+
],
36+
)
37+
2738
# Files required by e2e tests
2839
copy_to_bin(
2940
name = "config-files",

WORKSPACE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,18 @@ npm_translate_lock(
190190
load("@npm2//:repositories.bzl", "npm_repositories")
191191

192192
npm_repositories()
193+
194+
http_archive(
195+
name = "aspect_rules_ts",
196+
sha256 = "9acd128abe77397505148eaa6895faed57839560dbf2177dd6285e51235e2724",
197+
strip_prefix = "rules_ts-3.3.1",
198+
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.3.1/rules_ts-v3.3.1.tar.gz",
199+
)
200+
201+
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
202+
203+
rules_ts_dependencies(
204+
# ts_version_from = "//:package.json",
205+
# TODO: Support in https://github.com/aspect-build/rules_ts/blob/main/ts/private/npm_repositories.bzl
206+
ts_version = "5.6.2",
207+
)

packages/angular_devkit/architect/testing/BUILD.bazel

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33
# Use of this source code is governed by an MIT-style license that can be
44
# found in the LICENSE file at https://angular.dev/license
55

6+
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
67
load("//tools:defaults.bzl", "ts_library")
78

89
licenses(["notice"])
910

1011
package(default_visibility = ["//visibility:public"])
1112

12-
ts_library(
13+
ts_project(
1314
name = "testing",
1415
srcs = glob(
1516
include = ["**/*.ts"],
1617
exclude = ["**/*_spec.ts"],
1718
),
18-
module_name = "@angular-devkit/architect/testing",
19-
module_root = "index.d.ts",
19+
declaration = True,
20+
#module_name = "@angular-devkit/architect/testing",
21+
# module_root = "index.d.ts",
22+
tsconfig = "//:build-tsconfig",
2023
deps = [
2124
"//packages/angular_devkit/architect",
2225
"//packages/angular_devkit/core",

0 commit comments

Comments
 (0)