55
66load ("@npm//@angular/build-tooling/bazel/api-golden:index.bzl" , "api_golden_test_npm_package" )
77load ("@npm//@bazel/jasmine:index.bzl" , "jasmine_node_test" )
8- load ("//tools:defaults.bzl" , "pkg_npm" , "ts_library" )
8+ load ("//tools:defaults.bzl" , "pkg_npm" )
99load ("//tools:interop.bzl" , "ts_project" )
1010load ("//tools:ts_json_schema.bzl" , "ts_json_schema" )
1111
@@ -93,6 +93,7 @@ ts_project(
9393 "src/testing/**/*.ts" ,
9494 ],
9595 ) + [
96+ "index.ts" ,
9697 "//packages/angular_devkit/build_angular:src/builders/app-shell/schema.ts" ,
9798 "//packages/angular_devkit/build_angular:src/builders/browser-esbuild/schema.ts" ,
9899 "//packages/angular_devkit/build_angular:src/builders/browser/schema.ts" ,
@@ -147,6 +148,7 @@ ts_project(
147148 "//:root_modules/@babel/runtime" ,
148149 "//:root_modules/@discoveryjs/json-ext" ,
149150 "//:root_modules/@types/babel__core" ,
151+ "//:root_modules/@types/babel__generator" ,
150152 "//:root_modules/@types/browser-sync" ,
151153 "//:root_modules/@types/karma" ,
152154 "//:root_modules/@types/less" ,
@@ -203,7 +205,7 @@ ts_project(
203205 ],
204206)
205207
206- ts_library (
208+ ts_project (
207209 name = "build_angular_test_lib" ,
208210 testonly = True ,
209211 srcs = glob (
@@ -215,15 +217,17 @@ ts_library(
215217 ],
216218 ),
217219 data = glob (["test/**/*" ]),
218- deps = [
219- ":build_angular" ,
220- ":build_angular_test_utils" ,
221- "//packages/angular_devkit/architect/testing" ,
220+ interop_deps = [
222221 "//packages/angular_devkit/core" ,
223- "@npm//fast-glob" ,
224- "@npm//prettier" ,
225- "@npm//typescript" ,
226- "@npm//webpack" ,
222+ ],
223+ deps = [
224+ ":build_angular_rjs" ,
225+ ":build_angular_test_utils_rjs" ,
226+ "//:root_modules/fast-glob" ,
227+ "//:root_modules/prettier" ,
228+ "//:root_modules/typescript" ,
229+ "//:root_modules/webpack" ,
230+ "//packages/angular_devkit/architect/testing:testing_rjs" ,
227231 ],
228232)
229233
@@ -268,7 +272,7 @@ api_golden_test_npm_package(
268272
269273# Large build_angular specs
270274
271- ts_library (
275+ ts_project (
272276 name = "build_angular_test_utils" ,
273277 testonly = True ,
274278 srcs = glob (
@@ -281,17 +285,19 @@ ts_library(
281285 ],
282286 ),
283287 data = glob (["test/**/*" ]),
284- tsconfig = "//:tsconfig-test.json" ,
285- deps = [
286- ":build_angular" ,
288+ interop_deps = [
287289 "//modules/testing/builder" ,
288290 "//packages/angular/build" ,
289291 "//packages/angular/build:private" ,
290- "//packages/angular_devkit/architect" ,
291- "//packages/angular_devkit/architect/node" ,
292- "//packages/angular_devkit/architect/testing" ,
293292 "//packages/angular_devkit/core" ,
294293 "//packages/angular_devkit/core/node" ,
294+ ],
295+ deps = [
296+ ":build_angular_rjs" ,
297+ "//:root_modules/@types/jasmine" ,
298+ "//packages/angular_devkit/architect:architect_rjs" ,
299+ "//packages/angular_devkit/architect/node:node_rjs" ,
300+ "//packages/angular_devkit/architect/testing:testing_rjs" ,
295301 "@npm//rxjs" ,
296302 ],
297303)
@@ -302,12 +308,14 @@ LARGE_SPECS = {
302308 "shards" : 10 ,
303309 "size" : "large" ,
304310 "flaky" : True ,
305- "extra_deps " : [
311+ "extra_interop_deps " : [
306312 "//packages/angular_devkit/build_webpack" ,
307- "@npm//@types/http-proxy" ,
308- "@npm//http-proxy" ,
309- "@npm//puppeteer" ,
310- "@npm//undici" ,
313+ ],
314+ "extra_deps" : [
315+ "//:root_modules/@types/http-proxy" ,
316+ "//:root_modules/http-proxy" ,
317+ "//:root_modules/puppeteer" ,
318+ "//:root_modules/undici" ,
311319 ],
312320 },
313321 "extract-i18n" : {},
@@ -316,21 +324,21 @@ LARGE_SPECS = {
316324 "size" : "large" ,
317325 "flaky" : True ,
318326 "extra_deps" : [
319- "@npm/ /karma" ,
320- "@npm/ /karma-chrome-launcher" ,
321- "@npm/ /karma-coverage" ,
322- "@npm/ /karma-jasmine" ,
323- "@npm/ /karma-jasmine-html-reporter" ,
324- "@npm/ /puppeteer" ,
325- "@npm/ /webpack" ,
327+ "//:root_modules /karma" ,
328+ "//:root_modules /karma-chrome-launcher" ,
329+ "//:root_modules /karma-coverage" ,
330+ "//:root_modules /karma-jasmine" ,
331+ "//:root_modules /karma-jasmine-html-reporter" ,
332+ "//:root_modules /puppeteer" ,
333+ "//:root_modules /webpack" ,
326334 ],
327335 },
328336 "protractor" : {
329337 "extra_deps" : [
330- "@npm/ /jasmine-spec-reporter" ,
331- "@npm/ /protractor" ,
332- "@npm/ /puppeteer" ,
333- "@npm/ /ts-node" ,
338+ "//:root_modules /jasmine-spec-reporter" ,
339+ "//:root_modules /protractor" ,
340+ "//:root_modules /puppeteer" ,
341+ "//:root_modules /ts-node" ,
334342 ],
335343 # NB: does not run on rbe because webdriver manager uses an absolute path to chromedriver
336344 "tags" : ["no-remote-exec" ],
@@ -340,7 +348,7 @@ LARGE_SPECS = {
340348 "server" : {
341349 "size" : "large" ,
342350 "extra_deps" : [
343- "@npm/ /@angular/animations" ,
351+ "//:root_modules /@angular/animations" ,
344352 ],
345353 },
346354 "ng-packagr" : {},
@@ -349,55 +357,60 @@ LARGE_SPECS = {
349357 "size" : "large" ,
350358 "flaky" : True ,
351359 "extra_deps" : [
352- "@npm/ /@angular/animations" ,
353- "@npm/ /@angular/material" ,
360+ "//:root_modules /@angular/animations" ,
361+ "//:root_modules /@angular/material" ,
354362 ],
355363 },
356364 "prerender" : {},
357365 "browser-esbuild" : {},
358366 "ssr-dev-server" : {
359- "extra_deps" : [
360- "@npm//@types/browser-sync" ,
361- "@npm//browser-sync" ,
362- "@npm//express" ,
363- "@npm//undici" ,
367+ "extra_interop_deps" : [
364368 "//packages/angular/ssr/node" ,
365369 ],
370+ "extra_deps" : [
371+ "//:root_modules/@types/browser-sync" ,
372+ "//:root_modules/browser-sync" ,
373+ "//:root_modules/express" ,
374+ "//:root_modules/undici" ,
375+ ],
366376 },
367377}
368378
369379[
370- ts_library (
380+ ts_project (
371381 name = "build_angular_" + spec + "_test_lib" ,
372382 testonly = True ,
373383 srcs = glob (["src/builders/" + spec + "/**/*_spec.ts" ]),
374- tsconfig = "//:tsconfig-test.json" ,
375- deps = [
384+ interop_deps = [
376385 # Dependencies needed to compile and run the specs themselves.
377- ":build_angular " ,
378- ":build_angular_test_utils " ,
386+ "//packages/angular_devkit/core " ,
387+ "//packages/angular_devkit/core/node " ,
379388 "//modules/testing/builder" ,
380389 "//packages/angular/build" ,
381390 "//packages/angular/build:private" ,
382- "//packages/angular_devkit/architect" ,
383- "//packages/angular_devkit/architect/node" ,
384- "//packages/angular_devkit/architect/testing" ,
385- "//packages/angular_devkit/core" ,
386- "//packages/angular_devkit/core/node" ,
391+ ] + LARGE_SPECS [spec ].get ("extra_interop_deps" , []),
392+ deps = [
393+ # Dependencies needed to compile and run the specs themselves.
394+ ":build_angular_rjs" ,
395+ ":build_angular_test_utils_rjs" ,
396+ "//packages/angular_devkit/architect:architect_rjs" ,
397+ "//packages/angular_devkit/architect/node:node_rjs" ,
398+ "//packages/angular_devkit/architect/testing:testing_rjs" ,
387399
388400 # Base dependencies for the application in hello-world-app.
389401 # Some tests also require extra dependencies.
390- "@npm//@angular/common" ,
391- "@npm//@angular/compiler" ,
392- "@npm//@angular/compiler-cli" ,
393- "@npm//@angular/core" ,
394- "@npm//@angular/platform-browser" ,
395- "@npm//@angular/platform-browser-dynamic" ,
396- "@npm//@angular/router" ,
397- "@npm//rxjs" ,
398- "@npm//tslib" ,
399- "@npm//typescript" ,
400- "@npm//zone.js" ,
402+ "//:root_modules/@angular/common" ,
403+ "//:root_modules/@angular/compiler" ,
404+ "//:root_modules/@angular/compiler-cli" ,
405+ "//:root_modules/@angular/core" ,
406+ "//:root_modules/@angular/platform-browser" ,
407+ "//:root_modules/@angular/platform-browser-dynamic" ,
408+ "//:root_modules/@angular/router" ,
409+ "//:root_modules/rxjs" ,
410+ "//:root_modules/tslib" ,
411+ "//:root_modules/typescript" ,
412+ "//:root_modules/zone.js" ,
413+ "//:root_modules/@types/jasmine" ,
401414 ] + LARGE_SPECS [spec ].get ("extra_deps" , []),
402415 )
403416 for spec in LARGE_SPECS
0 commit comments