Skip to content

Commit 80db036

Browse files
josephperrottalan-agius4
authored andcommitted
build: enable strict deps enforcement for ts_project
1 parent 6fe01e6 commit 80db036

File tree

9 files changed

+29
-20
lines changed

9 files changed

+29
-20
lines changed

apps/code-of-conduct/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ng_project(
1515
":node_modules/@angular/animations",
1616
":node_modules/@angular/common",
1717
":node_modules/@angular/compiler",
18+
":node_modules/@angular/core",
1819
":node_modules/@angular/fire",
1920
":node_modules/@angular/platform-browser",
2021
":node_modules/@angular/router",

apps/code-of-conduct/app/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ng_project(
1414
deps = [
1515
"//apps/code-of-conduct:node_modules/@angular/common",
1616
"//apps/code-of-conduct:node_modules/@angular/core",
17+
"//apps/code-of-conduct:node_modules/@angular/material",
1718
"//apps/code-of-conduct:node_modules/@angular/router",
1819
"//apps/code-of-conduct/app/account",
1920
"//apps/code-of-conduct/app/block-user",

apps/code-of-conduct/app/app.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import {Component} from '@angular/core';
22
import {MatToolbarModule} from '@angular/material/toolbar';
33
import {RouterModule} from '@angular/router';
44
import {AccountComponent} from './account/account.component.js';
5-
import {BlockUserComponent} from './block-user/block-user.component.js';
6-
import {UserTableComponent} from './user-table/user-table.component.js';
75

86
@Component({
97
standalone: true,

apps/code-of-conduct/app/login/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ng_project(
1313
"//apps/code-of-conduct:node_modules/@angular/common",
1414
"//apps/code-of-conduct:node_modules/@angular/core",
1515
"//apps/code-of-conduct:node_modules/@angular/material",
16+
"//apps/code-of-conduct:node_modules/@angular/router",
1617
"//apps/code-of-conduct/app/account",
1718
],
1819
)

github-actions/bazel/configure-remote/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
// @ts-ignore-next-line
9+
// @ts-ignore-next-line strict-deps
1010
import tokenRaw from './gcp_token.data';
1111
import {k, iv, alg, at} from './constants.js';
1212
import {createDecipheriv} from 'crypto';

github-actions/browserstack/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
// @ts-ignore
9+
// @ts-ignore-next-line strict-deps
1010
import tokenRaw from './browserstack_token.data';
1111
import {k, iv, alg, at} from './constants.js';
1212
import {createDecipheriv} from 'crypto';

github-actions/saucelabs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
// @ts-ignore
9+
// @ts-ignore-next-line strict-deps
1010
import tokenRaw from './saucelabs_token.data';
1111
import {k, iv, alg, at} from './constants.js';
1212
import {createDecipheriv} from 'crypto';

ng-dev/utils/yarn-lock-file.d.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

tools/defaults.bzl

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ load("@rules_angular//src/ng_project:index.bzl", _ng_project = "ng_project")
1010
load("@rules_angular//src/ts_project:index.bzl", _ts_project = "ts_project")
1111
load("@rules_sass//src:index.bzl", _npm_sass_library = "npm_sass_library", _sass_binary = "sass_binary")
1212
load("//bazel:extract_types.bzl", _extract_types = "extract_types")
13+
load("//bazel/ts_project:index.bzl", _strict_deps_test = "strict_deps_test")
1314

1415
copy_to_bin = _copy_to_bin
1516
ts_config = _ts_config
@@ -28,6 +29,8 @@ def _determine_tsconfig(testonly):
2829

2930
def ts_project(
3031
name,
32+
srcs = [],
33+
deps = [],
3134
source_map = True,
3235
testonly = False,
3336
tsconfig = None,
@@ -38,35 +41,53 @@ def ts_project(
3841

3942
_ts_project(
4043
name,
44+
deps = deps,
45+
srcs = srcs,
4146
source_map = source_map,
4247
testonly = testonly,
4348
tsconfig = tsconfig,
4449
declaration = declaration,
4550
**kwargs
4651
)
4752

53+
_strict_deps_test(
54+
name = "%s_strict_deps_test" % name,
55+
tsconfig = tsconfig,
56+
deps = deps,
57+
srcs = srcs,
58+
)
59+
4860
def ng_project(
4961
name,
62+
srcs = [],
63+
deps = [],
5064
source_map = True,
5165
testonly = False,
5266
tsconfig = None,
5367
declaration = True,
54-
deps = [],
5568
**kwargs):
5669
if tsconfig == None:
5770
tsconfig = _determine_tsconfig(testonly)
5871

5972
deps = deps + ["//:node_modules/tslib"]
6073
_ng_project(
6174
name,
75+
deps = deps,
76+
srcs = srcs,
6277
source_map = source_map,
6378
declaration = declaration,
6479
testonly = testonly,
6580
tsconfig = tsconfig,
66-
deps = deps,
6781
**kwargs
6882
)
6983

84+
_strict_deps_test(
85+
name = "%s_strict_deps_test" % name,
86+
tsconfig = tsconfig,
87+
deps = deps,
88+
srcs = srcs,
89+
)
90+
7091
def npm_package(name, srcs = [], substitutions = {}, **kwargs):
7192
_text_replace(
7293
name = "%s_substituted" % name,

0 commit comments

Comments
 (0)