diff --git a/apps/code-of-conduct/BUILD.bazel b/apps/code-of-conduct/BUILD.bazel index 2b027addf..77e4c764d 100644 --- a/apps/code-of-conduct/BUILD.bazel +++ b/apps/code-of-conduct/BUILD.bazel @@ -15,6 +15,7 @@ ng_project( ":node_modules/@angular/animations", ":node_modules/@angular/common", ":node_modules/@angular/compiler", + ":node_modules/@angular/core", ":node_modules/@angular/fire", ":node_modules/@angular/platform-browser", ":node_modules/@angular/router", diff --git a/apps/code-of-conduct/app/BUILD.bazel b/apps/code-of-conduct/app/BUILD.bazel index a21a6d230..440f65252 100644 --- a/apps/code-of-conduct/app/BUILD.bazel +++ b/apps/code-of-conduct/app/BUILD.bazel @@ -14,6 +14,7 @@ ng_project( deps = [ "//apps/code-of-conduct:node_modules/@angular/common", "//apps/code-of-conduct:node_modules/@angular/core", + "//apps/code-of-conduct:node_modules/@angular/material", "//apps/code-of-conduct:node_modules/@angular/router", "//apps/code-of-conduct/app/account", "//apps/code-of-conduct/app/block-user", diff --git a/apps/code-of-conduct/app/app.component.ts b/apps/code-of-conduct/app/app.component.ts index 9b2681e12..c92f389b3 100644 --- a/apps/code-of-conduct/app/app.component.ts +++ b/apps/code-of-conduct/app/app.component.ts @@ -2,8 +2,6 @@ import {Component} from '@angular/core'; import {MatToolbarModule} from '@angular/material/toolbar'; import {RouterModule} from '@angular/router'; import {AccountComponent} from './account/account.component.js'; -import {BlockUserComponent} from './block-user/block-user.component.js'; -import {UserTableComponent} from './user-table/user-table.component.js'; @Component({ standalone: true, diff --git a/apps/code-of-conduct/app/login/BUILD.bazel b/apps/code-of-conduct/app/login/BUILD.bazel index 77e0a4bc3..b72c28c60 100644 --- a/apps/code-of-conduct/app/login/BUILD.bazel +++ b/apps/code-of-conduct/app/login/BUILD.bazel @@ -13,6 +13,7 @@ ng_project( "//apps/code-of-conduct:node_modules/@angular/common", "//apps/code-of-conduct:node_modules/@angular/core", "//apps/code-of-conduct:node_modules/@angular/material", + "//apps/code-of-conduct:node_modules/@angular/router", "//apps/code-of-conduct/app/account", ], ) diff --git a/bazel/ts_project/strict_deps/index.mts b/bazel/ts_project/strict_deps/index.mts index 2e10fb67d..38bf69552 100644 --- a/bazel/ts_project/strict_deps/index.mts +++ b/bazel/ts_project/strict_deps/index.mts @@ -56,9 +56,7 @@ function checkPathsForMatch(moduleSpecifier: string, paths?: ts.MapLike { if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) { + const leadingComments = ts.getLeadingCommentRanges(content, node.pos) || []; + for (const comment of leadingComments) { + const commentText = content.substring(comment.pos, comment.end); + if (/@ts-ignore.*strict-deps/.test(commentText)) { + return; + } + } + const moduleSpecifier = node.moduleSpecifier as ts.StringLiteral; // If not moduleSpecifier is included in the declaration, it is infered to be the local file, // essentially a self import and can be ignored. diff --git a/github-actions/bazel/configure-remote/index.ts b/github-actions/bazel/configure-remote/index.ts index 7020c1df3..9425d78bd 100644 --- a/github-actions/bazel/configure-remote/index.ts +++ b/github-actions/bazel/configure-remote/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -// @ts-ignore-next-line +// @ts-ignore-next-line strict-deps import tokenRaw from './gcp_token.data'; import {k, iv, alg, at} from './constants.js'; import {createDecipheriv} from 'crypto'; diff --git a/github-actions/browserstack/index.ts b/github-actions/browserstack/index.ts index 29de51862..bc2957728 100644 --- a/github-actions/browserstack/index.ts +++ b/github-actions/browserstack/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -// @ts-ignore +// @ts-ignore-next-line strict-deps import tokenRaw from './browserstack_token.data'; import {k, iv, alg, at} from './constants.js'; import {createDecipheriv} from 'crypto'; diff --git a/github-actions/saucelabs/index.ts b/github-actions/saucelabs/index.ts index d7a52d026..2ebeaf0e2 100644 --- a/github-actions/saucelabs/index.ts +++ b/github-actions/saucelabs/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -// @ts-ignore +// @ts-ignore-next-line strict-deps import tokenRaw from './saucelabs_token.data'; import {k, iv, alg, at} from './constants.js'; import {createDecipheriv} from 'crypto'; diff --git a/ng-dev/utils/yarn-lock-file.d.ts b/ng-dev/utils/yarn-lock-file.d.ts deleted file mode 100644 index b776c2599..000000000 --- a/ng-dev/utils/yarn-lock-file.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @license - * Copyright Google LLC - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1033 -// TODO: Remove when the type resolution is fixed. -declare module '@yarnpkg/lockfile' { - export * from 'yarnpkg__lockfile'; -} diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 7e8ea3bad..fb2f07d8e 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -10,6 +10,7 @@ load("@rules_angular//src/ng_project:index.bzl", _ng_project = "ng_project") load("@rules_angular//src/ts_project:index.bzl", _ts_project = "ts_project") load("@rules_sass//src:index.bzl", _npm_sass_library = "npm_sass_library", _sass_binary = "sass_binary") load("//bazel:extract_types.bzl", _extract_types = "extract_types") +load("//bazel/ts_project:index.bzl", _strict_deps_test = "strict_deps_test") copy_to_bin = _copy_to_bin ts_config = _ts_config @@ -28,6 +29,8 @@ def _determine_tsconfig(testonly): def ts_project( name, + srcs = [], + deps = [], source_map = True, testonly = False, tsconfig = None, @@ -38,6 +41,8 @@ def ts_project( _ts_project( name, + deps = deps, + srcs = srcs, source_map = source_map, testonly = testonly, tsconfig = tsconfig, @@ -45,13 +50,21 @@ def ts_project( **kwargs ) + _strict_deps_test( + name = "%s_strict_deps_test" % name, + tsconfig = tsconfig, + deps = deps, + srcs = srcs, + ) + def ng_project( name, + srcs = [], + deps = [], source_map = True, testonly = False, tsconfig = None, declaration = True, - deps = [], **kwargs): if tsconfig == None: tsconfig = _determine_tsconfig(testonly) @@ -59,14 +72,22 @@ def ng_project( deps = deps + ["//:node_modules/tslib"] _ng_project( name, + deps = deps, + srcs = srcs, source_map = source_map, declaration = declaration, testonly = testonly, tsconfig = tsconfig, - deps = deps, **kwargs ) + _strict_deps_test( + name = "%s_strict_deps_test" % name, + tsconfig = tsconfig, + deps = deps, + srcs = srcs, + ) + def npm_package(name, srcs = [], substitutions = {}, **kwargs): _text_replace( name = "%s_substituted" % name,