Skip to content

Commit 9aa49e9

Browse files
josephperrottalan-agius4
authored andcommitted
build: remove ts_project interop
1 parent 566de64 commit 9aa49e9

File tree

35 files changed

+49
-200
lines changed

35 files changed

+49
-200
lines changed

packages/angular/build/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ ts_project(
8181
"//packages/angular/build:src/builders/ng-packagr/schema.ts",
8282
],
8383
data = RUNTIME_ASSETS,
84-
module_name = "@angular/build",
8584
deps = [
8685
":node_modules/@ampproject/remapping",
8786
":node_modules/@angular-devkit/architect",

packages/angular/build/private/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

55
ts_project(
66
name = "private",
77
srcs = ["index.ts"],
8-
module_name = "@angular/build/private",
98
deps = [
109
"//packages/angular/build",
1110
],

packages/angular/cli/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ ts_project(
4343
"//packages/angular/cli:src/commands/update/schematic/schema.ts",
4444
],
4545
data = RUNTIME_ASSETS,
46-
module_name = "@angular/cli",
4746
deps = [
4847
":node_modules/@angular-devkit/architect",
4948
":node_modules/@angular-devkit/core",

packages/angular/create/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ts_project(
2222
"src/*.ts",
2323
]),
2424
data = RUNTIME_ASSETS,
25-
module_name = "@angular/create",
2625
deps = [
2726
"//:node_modules/@types/node",
2827
"//packages/angular/cli:angular-cli",

packages/angular/pwa/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ ts_project(
3232
"//packages/angular/pwa:pwa/schema.ts",
3333
],
3434
data = RUNTIME_ASSETS,
35-
module_name = "@angular/pwa",
3635
deps = [
3736
":node_modules/@angular-devkit/schematics",
3837
":node_modules/@schematics/angular",

packages/angular/ssr/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ts_project(
2525
data = [
2626
"//packages/angular/ssr/third_party/beasties:beasties_bundled",
2727
],
28-
module_name = "@angular/ssr",
2928
source_map = True,
3029
tsconfig = "//:build-tsconfig-esm",
3130
deps = [

packages/angular/ssr/node/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

@@ -16,7 +16,6 @@ ts_project(
1616
],
1717
# TODO: Fix strict_deps failure
1818
ignore_strict_deps = True,
19-
module_name = "@angular/ssr/node",
2019
source_map = True,
2120
tsconfig = "//:build-tsconfig-esm",
2221
deps = [

packages/angular/ssr/schematics/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ ts_project(
5757
"//packages/angular/ssr/schematics:" + src.replace(".json", ".ts")
5858
for (src, _) in ALL_SCHEMA_TARGETS
5959
],
60-
module_name = "@angular/ssr/schematics",
6160
deps = [
6261
"//packages/angular/ssr:node_modules/@angular-devkit/schematics",
6362
"//packages/angular/ssr:node_modules/@schematics/angular",

packages/angular_devkit/architect/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ ts_project(
6666
],
6767
# Ensure tests can execute the output JS, relying on schemas/JSON files.
6868
data = JSON_FILES,
69-
module_name = "@angular-devkit/architect",
7069
deps = [
7170
":node_modules/@angular-devkit/core",
7271
":node_modules/rxjs",

packages/angular_devkit/architect/node/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ts_project(
1515
include = ["**/*.ts"],
1616
exclude = ["**/*_spec.ts"],
1717
),
18-
module_name = "@angular-devkit/architect/node",
1918
deps = [
2019
"//:node_modules/@types/node",
2120
"//packages/angular_devkit/architect",

packages/angular_devkit/architect/node/test/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
ts_project(
44
name = "test_lib",

packages/angular_devkit/architect/testing/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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("//tools:interop.bzl", "ts_project")
6+
load("//tools:defaults.bzl", "ts_project")
77

88
licenses(["notice"])
99

@@ -15,7 +15,6 @@ ts_project(
1515
include = ["**/*.ts"],
1616
exclude = ["**/*_spec.ts"],
1717
),
18-
module_name = "@angular-devkit/architect/testing",
1918
deps = [
2019
"//:node_modules/@types/node",
2120
"//packages/angular_devkit/architect",

packages/angular_devkit/architect_cli/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ts_project(
1616
srcs = [
1717
"bin/architect.ts",
1818
] + glob(["src/**/*.ts"]),
19-
module_name = "@angular-devkit/architect-cli",
2019
deps = [
2120
":node_modules/@angular-devkit/architect",
2221
":node_modules/@angular-devkit/core",

packages/angular_devkit/build_angular/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ ts_project(
127127
"//packages/angular_devkit/build_angular:src/builders/web-test-runner/schema.ts",
128128
],
129129
data = RUNTIME_ASSETS,
130-
module_name = "@angular-devkit/build-angular",
131130
deps = [
132131
":node_modules/@ampproject/remapping",
133132
":node_modules/@angular-devkit/architect",

packages/angular_devkit/build_webpack/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ ts_project(
4545
"//packages/angular_devkit/build_webpack:src/builders/webpack/schema.ts",
4646
],
4747
data = RUNTIME_ASSETS,
48-
module_name = "@angular-devkit/build-webpack",
4948
deps = [
5049
":node_modules/@angular-devkit/architect",
5150
":node_modules/rxjs",

packages/angular_devkit/core/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ts_project(
3030
],
3131
) + ["index.ts"],
3232
data = RUNTIME_ASSETS,
33-
module_name = "@angular-devkit/core",
3433
deps = [
3534
":node_modules/ajv",
3635
":node_modules/ajv-formats",

packages/angular_devkit/core/node/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ts_project(
1818
"**/*_spec.ts",
1919
],
2020
),
21-
module_name = "@angular-devkit/core/node",
2221
deps = [
2322
"//:node_modules/@types/node",
2423
"//packages/angular_devkit/core",

packages/angular_devkit/core/node/testing/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#
@@ -16,7 +16,6 @@ ts_project(
1616
"**/*_spec.ts",
1717
],
1818
),
19-
module_name = "@angular-devkit/core/node/testing",
2019
deps = [
2120
"//:node_modules/@types/jasmine",
2221
"//:node_modules/@types/node",

packages/angular_devkit/schematics/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ts_project(
2525
data = [
2626
"package.json",
2727
],
28-
module_name = "@angular-devkit/schematics",
2928
deps = [
3029
":node_modules/@angular-devkit/core",
3130
":node_modules/jsonc-parser",

packages/angular_devkit/schematics/tasks/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#
@@ -18,7 +18,6 @@ ts_project(
1818
],
1919
),
2020
data = ["package.json"],
21-
module_name = "@angular-devkit/schematics/tasks",
2221
deps = [
2322
"//:node_modules/@types/node",
2423
"//packages/angular_devkit/schematics",

packages/angular_devkit/schematics/tasks/node/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#
@@ -16,7 +16,6 @@ ts_project(
1616
"**/*_spec.ts",
1717
],
1818
),
19-
module_name = "@angular-devkit/schematics/tasks/node",
2019
deps = [
2120
"//:node_modules/@types/node",
2221
"//packages/angular_devkit/core",

packages/angular_devkit/schematics/testing/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#
@@ -14,7 +14,6 @@ ts_project(
1414
include = ["**/*.ts"],
1515
),
1616
data = ["package.json"],
17-
module_name = "@angular-devkit/schematics/testing",
1817
deps = [
1918
"//packages/angular_devkit/schematics",
2019
"//packages/angular_devkit/schematics:node_modules/@angular-devkit/core",

packages/angular_devkit/schematics/tools/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ts_project(
1818
],
1919
),
2020
data = ["package.json"],
21-
module_name = "@angular-devkit/schematics/tools",
2221
deps = [
2322
"//:node_modules/@types/node",
2423
"//packages/angular_devkit/schematics",

packages/angular_devkit/schematics_cli/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ ts_project(
4444
"//packages/angular_devkit/schematics_cli:schematic/schema.ts",
4545
],
4646
data = RUNTIME_ASSETS,
47-
module_name = "@angular-devkit/schematics-cli",
4847
deps = [
4948
":node_modules/@angular-devkit/core",
5049
":node_modules/@angular-devkit/schematics",

packages/ngtools/webpack/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ ts_project(
2929
data = [
3030
"package.json",
3131
],
32-
module_name = "@ngtools/webpack",
3332
deps = [
3433
":node_modules/webpack",
3534
"//:node_modules/@angular/compiler-cli",

packages/schematics/angular/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ ts_project(
9595
for (src, _) in ALL_SCHEMA_TARGETS
9696
],
9797
data = RUNTIME_ASSETS,
98-
module_name = "@schematics/angular",
9998
deps = [
10099
":node_modules/@angular-devkit/core",
101100
":node_modules/@angular-devkit/schematics",

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# files fetched on 2025-03-03 from
44
# https://github.com/microsoft/TypeScript/releases/tag/v5.8.2

tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#

tests/legacy-cli/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
22
load("@npm2//:rollup/package_json.bzl", rollup = "bin")
3-
load("//tools:interop.bzl", "ts_project")
3+
load("//tools:defaults.bzl", "ts_project")
44
load(":e2e.bzl", "e2e_suites")
55

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

tests/legacy-cli/e2e/initialize/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

tests/legacy-cli/e2e/setup/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

tests/legacy-cli/e2e/tests/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

tests/legacy-cli/e2e/utils/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:interop.bzl", "ts_project")
1+
load("//tools:defaults.bzl", "ts_project")
22

33
package(default_visibility = ["//visibility:public"])
44

tools/defaults.bzl

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
11
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
22
load("@aspect_rules_jasmine//jasmine:defs.bzl", _jasmine_test = "jasmine_test")
33
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary")
4+
load("@aspect_rules_ts//ts:defs.bzl", _ts_project = "ts_project")
5+
load("@devinfra//bazel/ts_project:index.bzl", "strict_deps_test")
46
load("@rules_angular//src/ng_package:index.bzl", _ng_package = "ng_package")
5-
load("//tools:interop.bzl", _ts_project = "ts_project")
67
load("//tools:substitutions.bzl", "substitutions")
78
load("//tools/bazel:npm_package.bzl", _npm_package = "npm_package")
89

9-
def ts_project(**kwargs):
10-
_ts_project(**kwargs)
10+
def ts_project(
11+
name,
12+
deps = [],
13+
tsconfig = None,
14+
testonly = False,
15+
visibility = None,
16+
ignore_strict_deps = False,
17+
**kwargs):
18+
if tsconfig == None:
19+
tsconfig = "//:test-tsconfig" if testonly else "//:build-tsconfig"
20+
21+
_ts_project(
22+
name = name,
23+
testonly = testonly,
24+
declaration = True,
25+
tsconfig = tsconfig,
26+
visibility = visibility,
27+
# Use the worker from our own Angular rules, as the default worker
28+
# from `rules_ts` is incompatible with TS5+ and abandoned. We need
29+
# worker for efficient, fast DX and avoiding Windows no-sandbox issues.
30+
supports_workers = 1,
31+
tsc_worker = "//tools:vanilla_ts_worker",
32+
deps = deps,
33+
**kwargs
34+
)
35+
36+
if not ignore_strict_deps:
37+
strict_deps_test(
38+
name = "%s_strict_deps_test" % name,
39+
srcs = kwargs.get("srcs", []),
40+
deps = deps,
41+
)
1142

1243
def npm_package(**kwargs):
1344
_npm_package(**kwargs)

0 commit comments

Comments
 (0)