Skip to content

Commit d4a4bc8

Browse files
committed
build: migrate @schematics/angular to ts_project
The `@schematics/angular` package has been migrated to the `rules_js` ts_project rule.
1 parent 2888673 commit d4a4bc8

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

packages/schematics/angular/BUILD.bazel

+24-26
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# found in the LICENSE file at https://angular.dev/license
55

66
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
7-
load("//tools:defaults.bzl", "pkg_npm", "ts_library")
7+
load("//tools:defaults.bzl", "pkg_npm")
8+
load("//tools:interop.bzl", "ts_project")
89
load("//tools:ts_json_schema.bzl", "ts_json_schema")
910

1011
licenses(["notice"])
@@ -35,9 +36,8 @@ ALL_SCHEMA_TARGETS = [
3536
for (src, name) in ALL_SCHEMA_TARGETS
3637
]
3738

38-
ts_library(
39+
ts_project(
3940
name = "angular",
40-
package_name = "@schematics/angular",
4141
srcs = glob(
4242
include = ["**/*.ts"],
4343
exclude = [
@@ -78,16 +78,18 @@ ts_library(
7878
"node_modules/**",
7979
],
8080
),
81-
module_name = "@schematics/angular",
82-
deps = [
83-
"//packages/angular_devkit/core",
81+
interop_deps = [
8482
"//packages/angular_devkit/schematics",
8583
"//packages/angular_devkit/schematics/tasks",
86-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript",
87-
"@npm//@inquirer/prompts",
88-
"@npm//@types/node",
89-
"@npm//browserslist",
90-
"@npm//jsonc-parser",
84+
],
85+
module_name = "@schematics/angular",
86+
deps = [
87+
"//:root_modules/@inquirer/prompts",
88+
"//:root_modules/@types/node",
89+
"//:root_modules/browserslist",
90+
"//:root_modules/jsonc-parser",
91+
"//packages/angular_devkit/core:core_rjs",
92+
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:TypeScript_rjs",
9193
],
9294
)
9395

@@ -96,11 +98,11 @@ jasmine_node_test(
9698
srcs = ["no_typescript_runtime_dep_spec.js"],
9799
deps = [
98100
":angular",
99-
"@npm//jasmine",
101+
"//:root_modules/@types/jasmine",
100102
],
101103
)
102104

103-
ts_library(
105+
ts_project(
104106
name = "angular_test_lib",
105107
testonly = True,
106108
srcs = glob(
@@ -113,28 +115,24 @@ ts_library(
113115
"node_modules/**",
114116
],
115117
),
116-
# @external_begin
117-
deps = [
118-
":angular",
119-
"//packages/angular_devkit/core",
120-
"//packages/angular_devkit/core/node/testing",
118+
interop_deps = [
121119
"//packages/angular_devkit/schematics",
122120
"//packages/angular_devkit/schematics/tasks",
123121
"//packages/angular_devkit/schematics/testing",
124-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript",
125-
"@npm//jsonc-parser",
126122
],
127-
# @external_end
123+
deps = [
124+
":angular_rjs",
125+
"//:root_modules/@types/jasmine",
126+
"//:root_modules/jsonc-parser",
127+
"//packages/angular_devkit/core:core_rjs",
128+
"//packages/angular_devkit/core/node/testing:testing_rjs",
129+
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript:TypeScript_rjs",
130+
],
128131
)
129132

130133
jasmine_node_test(
131134
name = "angular_test",
132135
srcs = [":angular_test_lib"],
133-
deps = [
134-
"//packages/schematics/angular/third_party/github.com/Microsoft/TypeScript",
135-
"@npm//jasmine",
136-
"@npm//source-map",
137-
],
138136
)
139137

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

33
# files fetched on 2024-11-28 from
44
# https://github.com/microsoft/TypeScript/releases/tag/v5.7.2
@@ -9,13 +9,14 @@ load("//tools:defaults.bzl", "ts_library")
99

1010
licenses(["notice"]) # Apache 2.0
1111

12+
package(default_visibility = ["//packages/schematics/angular:__subpackages__"])
13+
1214
exports_files([
1315
"LICENSE",
1416
])
1517

16-
ts_library(
18+
ts_project(
1719
name = "TypeScript",
1820
srcs = ["lib/typescript.d.ts"],
1921
data = ["lib/typescript.js"],
20-
visibility = ["//packages/schematics/angular:__subpackages__"],
2122
)

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"@angular/*": ["./packages/angular/*/src"],
3333
"@angular/build/private": ["./packages/angular/build/src/private"],
3434
"@ngtools/webpack": ["./packages/ngtools/webpack/index"],
35-
"@schematics/angular": ["./packages/schematics/angular"]
35+
"@schematics/angular": ["./packages/schematics/angular"],
36+
"@schematics/angular/utility": ["./packages/schematics/angular/utility/index"]
3637
}
3738
},
3839
"exclude": [

0 commit comments

Comments
 (0)