Skip to content

Commit 8a512cc

Browse files
josephperrottalan-agius4
authored andcommitted
build: enable strict deps enforcement for ts_project
Enable strict_deps testings for all ts_project targets in the repo
1 parent 264848a commit 8a512cc

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

BUILD.bazel

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@ exports_files([
1818

1919
npm_link_all_packages()
2020

21+
rules_js_tsconfig(
22+
name = "tsconfig",
23+
src = "tsconfig.json",
24+
visibility = [
25+
"//:__pkg__",
26+
],
27+
)
28+
2129
rules_js_tsconfig(
2230
name = "build-tsconfig",
2331
src = "tsconfig-build.json",
2432
deps = [
25-
"tsconfig.json",
33+
":tsconfig",
2634
"//:node_modules/@types/node",
2735
],
2836
)
@@ -31,7 +39,7 @@ rules_js_tsconfig(
3139
name = "test-tsconfig",
3240
src = "tsconfig-test.json",
3341
deps = [
34-
"tsconfig.json",
42+
":tsconfig",
3543
"//:node_modules/@types/jasmine",
3644
"//:node_modules/@types/node",
3745
],
@@ -41,7 +49,7 @@ rules_js_tsconfig(
4149
name = "build-tsconfig-esm",
4250
src = "tsconfig-build-esm.json",
4351
deps = [
44-
"tsconfig.json",
52+
":tsconfig",
4553
],
4654
)
4755

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ git_override(
3939
bazel_dep(name = "devinfra")
4040
git_override(
4141
module_name = "devinfra",
42-
commit = "1ef1e98c528b9e9d0d636d1d768b6ebca195ce5d",
42+
commit = "acce054082b688da9a5a3d12c6550184eb9f7725",
4343
remote = "https://github.com/angular/dev-infra.git",
4444
)
4545

packages/angular/ssr/node/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ ts_project(
1414
"--types",
1515
"node",
1616
],
17-
# TODO: Fix strict_deps failure
18-
ignore_strict_deps = True,
1917
source_map = True,
2018
tsconfig = "//:build-tsconfig-esm",
2119
deps = [

packages/schematics/angular/third_party/github.com/Microsoft/TypeScript/BUILD.bazel

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:defaults.bzl", "ts_project")
1+
load("@aspect_rules_js//js:defs.bzl", "js_library")
22

33
# files fetched on 2025-08-01
44

@@ -14,8 +14,10 @@ exports_files([
1414
"LICENSE",
1515
])
1616

17-
ts_project(
17+
js_library(
1818
name = "TypeScript",
19-
srcs = ["lib/typescript.d.ts"],
20-
data = ["lib/typescript.js"],
19+
srcs = [
20+
"lib/typescript.d.ts",
21+
"lib/typescript.js",
22+
],
2123
)

tools/defaults.bzl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def ts_project(
1313
tsconfig = None,
1414
testonly = False,
1515
visibility = None,
16-
ignore_strict_deps = False,
1716
**kwargs):
1817
if tsconfig == None:
1918
tsconfig = "//:test-tsconfig" if testonly else "//:build-tsconfig"
@@ -28,12 +27,12 @@ def ts_project(
2827
**kwargs
2928
)
3029

31-
if not ignore_strict_deps:
32-
strict_deps_test(
33-
name = "%s_strict_deps_test" % name,
34-
srcs = kwargs.get("srcs", []),
35-
deps = deps,
36-
)
30+
strict_deps_test(
31+
name = "%s_strict_deps_test" % name,
32+
srcs = kwargs.get("srcs", []),
33+
tsconfig = tsconfig,
34+
deps = deps,
35+
)
3736

3837
def npm_package(**kwargs):
3938
_npm_package(**kwargs)

0 commit comments

Comments
 (0)