5
5
package (default_visibility = ["//visibility:public" ])
6
6
7
7
load ("//tools:defaults.bzl" , "ts_library" )
8
+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "jasmine_node_test" )
8
9
9
10
licenses (["notice" ]) # MIT License
10
11
12
+ # @angular-devkit/schematics
13
+
11
14
ts_library (
12
15
name = "schematics" ,
13
16
srcs = glob (
14
17
include = ["src/**/*.ts" ],
15
18
exclude = [
16
19
"src/**/*_spec.ts" ,
20
+ "src/**/*_spec_large.ts" ,
17
21
"src/**/*_benchmark.ts" ,
18
22
],
19
23
),
20
24
module_name = "@angular-devkit/schematics" ,
21
- module_root = "src" ,
25
+ module_root = "src/index.d.ts " ,
22
26
deps = [
23
27
"//packages/angular_devkit/core" ,
24
28
"//packages/angular_devkit/core:node" , # TODO: get rid of this for 6.0
@@ -28,18 +32,51 @@ ts_library(
28
32
],
29
33
)
30
34
35
+ ts_library (
36
+ name = "schematics_test_lib" ,
37
+ srcs = glob (
38
+ include = [
39
+ "src/**/*_spec.ts" ,
40
+ "src/**/*_spec_large.ts" ,
41
+ ],
42
+ exclude = [
43
+ # Instances of extended errors are showing Error as the constructor instead.
44
+ # TODO(@filipesilva): figure out why that is.
45
+ "src/rules/call_spec.ts" ,
46
+ ],
47
+ ),
48
+ deps = [
49
+ ":schematics" ,
50
+ ":testing" ,
51
+ "//packages/angular_devkit/core" ,
52
+ "//packages/angular_devkit/core:node" ,
53
+ "@rxjs" ,
54
+ "@rxjs//operators" ,
55
+ # @typings: jasmine
56
+ # @typings: node
57
+ ],
58
+ )
59
+
60
+ jasmine_node_test (
61
+ name = "schematics_test" ,
62
+ srcs = [":schematics_test_lib" ],
63
+ )
64
+
65
+
66
+ # @angular-devkit/schematics/tasks
67
+
31
68
ts_library (
32
69
name = "tasks" ,
33
70
srcs = glob (
34
71
include = ["tasks/**/*.ts" ],
35
72
exclude = [
36
73
"tasks/**/*_spec.ts" ,
37
74
"tasks/**/*_benchmark.ts" ,
75
+ "tasks/tslint-fix/test/**/*" ,
38
76
],
39
77
),
40
78
module_name = "@angular-devkit/schematics/tasks" ,
41
- module_root = "tasks" ,
42
- tsconfig = "//:tsconfig.json" ,
79
+ module_root = "tasks/index.d.ts" ,
43
80
deps = [
44
81
":schematics" ,
45
82
"//packages/angular_devkit/core" ,
@@ -53,73 +90,120 @@ ts_library(
53
90
)
54
91
55
92
ts_library (
56
- name = "tools " ,
93
+ name = "tasks_test_lib " ,
57
94
srcs = glob (
58
- include = ["tools/**/*.ts" ],
95
+ include = [
96
+ "tasks/**/*_spec.ts" ,
97
+ "tasks/**/*_spec_large.ts" ,
98
+ "tasks/tslint-fix/test/**/*.ts" ,
99
+ ],
59
100
exclude = [
60
- "tools/**/*_spec.ts" ,
61
- "tools/**/*_benchmark.ts" ,
101
+ # Disabled because 'collection.json' cannot be resolved in bazel.
102
+ # TODO(@filipesilva): figure out how to make data files resolve correctly.
103
+ "tasks/tslint-fix/executor_spec.ts" ,
62
104
],
63
105
),
64
- module_name = "@angular-devkit/schematics/tools" ,
65
- module_root = "tools" ,
106
+ data = [
107
+ "tasks/tslint-fix/test/collection.json" ,
108
+ ],
66
109
deps = [
67
- ":schematics" ,
68
110
":tasks" ,
111
+ ":testing" ,
112
+ ":schematics" ,
69
113
"//packages/angular_devkit/core" ,
70
114
"//packages/angular_devkit/core:node" ,
115
+ "//packages/angular_devkit/core:node_testing" ,
71
116
"@rxjs" ,
72
117
"@rxjs//operators" ,
118
+ # @typings: jasmine
73
119
# @typings: node
74
120
],
75
121
)
76
122
123
+
124
+ # Disabled since we are excluding the only test in tasks.
125
+ # jasmine_node_test(
126
+ # name = "tasks_test",
127
+ # srcs = [":tasks_test_lib"],
128
+ # )
129
+
130
+
131
+ # @angular-devkit/schematics/tools
132
+
77
133
ts_library (
78
- name = "testing " ,
134
+ name = "tools " ,
79
135
srcs = glob (
80
- include = ["testing/**/*.ts" ],
81
- exclude = [],
136
+ include = ["tools/**/*.ts" ],
137
+ exclude = [
138
+ "tools/**/*_spec.ts" ,
139
+ "tools/**/*_benchmark.ts" ,
140
+ ],
82
141
),
83
- module_name = "@angular-devkit/schematics/testing " ,
84
- module_root = "testing " ,
142
+ module_name = "@angular-devkit/schematics/tools " ,
143
+ module_root = "tools/index.d.ts " ,
85
144
deps = [
86
145
":schematics" ,
87
146
":tasks" ,
88
- ":tools" ,
89
147
"//packages/angular_devkit/core" ,
148
+ "//packages/angular_devkit/core:node" ,
90
149
"@rxjs" ,
91
150
"@rxjs//operators" ,
151
+ # @typings: node
92
152
],
93
153
)
94
154
95
155
ts_library (
96
- name = "spec " ,
156
+ name = "tools_test_lib " ,
97
157
srcs = glob (
98
- include = ["src/**/*_spec.ts" ],
158
+ include = [
159
+ "tools/**/*_spec.ts" ,
160
+ "tools/**/*_spec_large.ts" ,
161
+ ],
162
+ exclude = [
163
+ # The node resolve spec uses the _devKitRoot global, which isn't available in Bazel.
164
+ # TODO(@filipesilva): figure out an alternative to that global.
165
+ "tools/file-system-engine-host_spec.ts" ,
166
+ ],
167
+ ),
168
+ data = glob (
169
+ include = ["tools/test/file-system-engine-host/**/collection.json" ],
99
170
),
100
171
deps = [
172
+ ":tools" ,
173
+ ":tasks" ,
101
174
":schematics" ,
102
175
":testing" ,
103
176
"//packages/angular_devkit/core" ,
177
+ "//packages/angular_devkit/core:node" ,
104
178
"@rxjs" ,
105
179
"@rxjs//operators" ,
106
180
# @typings: jasmine
181
+ # @typings: node
107
182
],
108
183
)
109
184
185
+ jasmine_node_test (
186
+ name = "tools_test" ,
187
+ srcs = [":tools_test_lib" ],
188
+ )
189
+
190
+
191
+ # @angular-devkit/schematics/testing
192
+
110
193
ts_library (
111
- name = "tools_spec " ,
194
+ name = "testing " ,
112
195
srcs = glob (
113
- include = ["tools/**/*_spec.ts" ],
196
+ include = ["testing/**/*.ts" ],
197
+ exclude = [],
114
198
),
199
+ module_name = "@angular-devkit/schematics/testing" ,
200
+ module_root = "testing/index.d.ts" ,
115
201
deps = [
116
202
":schematics" ,
203
+ ":tasks" ,
117
204
":tools" ,
118
205
"//packages/angular_devkit/core" ,
119
- "//packages/angular_devkit/core:node" ,
120
206
"@rxjs" ,
121
207
"@rxjs//operators" ,
122
- # @typings: jasmine
123
- # @typings: node
124
208
],
125
- )
209
+ )
0 commit comments