Skip to content

Commit b51cf8d

Browse files
filipesilvadgp1130
authored andcommitted
build: use ts_library macro with common defaults
1 parent a51c5cd commit b51cf8d

File tree

26 files changed

+99
-206
lines changed

26 files changed

+99
-206
lines changed

packages/angular/cli/BUILD.bazel

+3-10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
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.io/license
55

6-
licenses(["notice"]) # MIT
7-
86
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
9-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
107
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
118
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
129
load("//tools:ts_json_schema.bzl", "ts_json_schema")
10+
load("//tools:defaults.bzl", "ts_library")
11+
12+
licenses(["notice"]) # MIT
1313

1414
licenses(["notice"]) # MIT
1515

@@ -47,8 +47,6 @@ ts_library(
4747
"**/*.json",
4848
"**/*.md",
4949
]),
50-
devmode_module = "commonjs",
51-
devmode_target = "es2018",
5250
module_name = "@angular/cli",
5351
# strict_checks = False,
5452
deps = [
@@ -231,15 +229,10 @@ ts_library(
231229
name = "angular-cli_test_lib",
232230
testonly = True,
233231
srcs = glob(["**/*_spec.ts"]),
234-
devmode_module = "commonjs",
235-
devmode_target = "es2018",
236232
# strict_checks = False,
237-
tsconfig = "//:tsconfig-test.json",
238233
deps = [
239234
":angular-cli",
240235
"//packages/angular_devkit/core",
241-
"@npm//@types/jasmine",
242-
"@npm//@types/node",
243236
],
244237
)
245238

packages/angular/pwa/BUILD.bazel

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
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.io/license
55

6-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
76
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
7+
load("//tools:defaults.bzl", "ts_library")
88
load("//tools:ts_json_schema.bzl", "ts_json_schema")
99

1010
licenses(["notice"]) # MIT
1111

12+
licenses(["notice"]) # MIT
13+
1214
package(default_visibility = ["//visibility:public"])
1315

1416
ts_library(
@@ -35,8 +37,6 @@ ts_library(
3537
"pwa/files/**/*",
3638
],
3739
),
38-
devmode_module = "commonjs",
39-
devmode_target = "es2018",
4040
deps = [
4141
"//packages/angular_devkit/core",
4242
"//packages/angular_devkit/schematics",
@@ -56,15 +56,10 @@ ts_library(
5656
name = "pwa_test_lib",
5757
testonly = True,
5858
srcs = glob(["pwa/**/*_spec.ts"]),
59-
devmode_module = "commonjs",
60-
devmode_target = "es2018",
6159
# strict_checks = False,
62-
tsconfig = "//:tsconfig-test.json",
6360
deps = [
6461
":pwa",
6562
"//packages/angular_devkit/schematics/testing",
66-
"@npm//@types/jasmine",
67-
"@npm//@types/node",
6863
],
6964
)
7065

packages/angular_devkit/architect/BUILD.bazel

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
77
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
8-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
8+
load("//tools:defaults.bzl", "ts_library")
99

1010
# @external_begin
1111
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
@@ -50,8 +50,6 @@ ts_library(
5050
],
5151
# strict_checks = False,
5252
data = glob(["**/*.json"]),
53-
devmode_module = "commonjs",
54-
devmode_target = "es2018",
5553
module_name = "@angular-devkit/architect",
5654
module_root = "src/index.d.ts",
5755
deps = [
@@ -66,16 +64,11 @@ ts_library(
6664
name = "architect_test_lib",
6765
testonly = True,
6866
srcs = glob(["src/**/*_spec.ts"]),
69-
devmode_module = "commonjs",
70-
devmode_target = "es2018",
7167
# strict_checks = False,
72-
tsconfig = "//:tsconfig-test.json",
7368
deps = [
7469
":architect",
7570
"//packages/angular_devkit/architect/testing",
7671
"//packages/angular_devkit/core",
77-
"@npm//@types/jasmine",
78-
"@npm//@types/node",
7972
"@npm//rxjs",
8073
],
8174
)

packages/angular_devkit/architect/node/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
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.io/license
55

6-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
6+
load("//tools:defaults.bzl", "ts_library")
7+
8+
licenses(["notice"]) # MIT
79

810
licenses(["notice"]) # MIT
911

@@ -15,8 +17,6 @@ ts_library(
1517
include = ["**/*.ts"],
1618
exclude = ["**/*_spec.ts"],
1719
),
18-
devmode_module = "commonjs",
19-
devmode_target = "es2018",
2020
module_name = "@angular-devkit/architect/node",
2121
module_root = "index.d.ts",
2222
# strict_checks = False,

packages/angular_devkit/architect/testing/BUILD.bazel

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
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.io/license
55

6-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
6+
load("//tools:defaults.bzl", "ts_library")
7+
8+
licenses(["notice"]) # MIT
79

810
licenses(["notice"]) # MIT
911

@@ -15,8 +17,6 @@ ts_library(
1517
include = ["**/*.ts"],
1618
exclude = ["**/*_spec.ts"],
1719
),
18-
devmode_module = "commonjs",
19-
devmode_target = "es2018",
2020
module_name = "@angular-devkit/architect/testing",
2121
module_root = "index.d.ts",
2222
deps = [

packages/angular_devkit/architect_cli/BUILD.bazel

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
1+
load("//tools:defaults.bzl", "ts_library")
22

33
# Copyright Google Inc. All Rights Reserved.
44
#
55
# Use of this source code is governed by an MIT-style license that can be
66
# found in the LICENSE file at https://angular.io/license
7-
package(default_visibility = ["//visibility:public"])
8-
97
licenses(["notice"]) # MIT
108

9+
package(default_visibility = ["//visibility:public"])
10+
1111
ts_library(
1212
name = "architect_cli",
1313
srcs = [
1414
"bin/architect.ts",
1515
] + glob(["src/**/*.ts"]),
16-
devmode_module = "commonjs",
17-
devmode_target = "es2018",
1816
module_name = "@angular-devkit/architect-cli",
1917
deps = [
2018
"//packages/angular_devkit/architect",

packages/angular_devkit/benchmark/BUILD.bazel

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
77
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
8-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
98
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
9+
load("//tools:defaults.bzl", "ts_library")
1010

1111
licenses(["notice"]) # MIT
1212

@@ -21,8 +21,6 @@ ts_library(
2121
"src/**/*_benchmark.ts",
2222
],
2323
),
24-
devmode_module = "commonjs",
25-
devmode_target = "es2018",
2624
module_name = "@angular-devkit/benchmark",
2725
module_root = "src/index.d.ts",
2826
deps = [
@@ -46,16 +44,11 @@ ts_library(
4644
"src/test/watch-test-file.txt",
4745
"src/test/watch-test-script.js",
4846
],
49-
devmode_module = "commonjs",
50-
devmode_target = "es2018",
5147
# @external_begin
52-
tsconfig = "//:tsconfig-test.json",
5348
deps = [
5449
":benchmark",
5550
"//packages/angular_devkit/core",
5651
"//packages/angular_devkit/core/node",
57-
"@npm//@types/jasmine",
58-
"@npm//@types/node",
5952
"@npm//rxjs",
6053
],
6154
# @external_end

packages/angular_devkit/build_angular/BUILD.bazel

+3-18
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
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.io/license
55

6-
licenses(["notice"]) # MIT
7-
86
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
9-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
107
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
118
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
9+
load("//tools:defaults.bzl", "ts_library")
1210
load("//tools:ts_json_schema.bzl", "ts_json_schema")
1311

12+
licenses(["notice"]) # MIT
13+
1414
package(default_visibility = ["//visibility:public"])
1515

1616
ts_json_schema(
@@ -84,8 +84,6 @@ ts_library(
8484
"src/**/*.html",
8585
],
8686
),
87-
devmode_module = "commonjs",
88-
devmode_target = "es2018",
8987
module_name = "@angular-devkit/build-angular",
9088
module_root = "src/index.d.ts",
9189
deps = [
@@ -191,16 +189,11 @@ ts_library(
191189
],
192190
),
193191
data = glob(["test/**/*"]),
194-
devmode_module = "commonjs",
195-
devmode_target = "es2018",
196192
# strict_checks = False,
197-
tsconfig = "//:tsconfig-test.json",
198193
deps = [
199194
":build_angular",
200195
"//packages/angular_devkit/architect/testing",
201196
"//packages/angular_devkit/core",
202-
"@npm//@types/jasmine",
203-
"@npm//@types/node",
204197
"@npm//@types/webpack",
205198
"@npm//typescript",
206199
"@npm//webpack",
@@ -234,8 +227,6 @@ ts_library(
234227
testonly = True,
235228
srcs = [":src/test-utils.ts"],
236229
data = glob(["test/**/*"]),
237-
devmode_module = "commonjs",
238-
devmode_target = "es2018",
239230
tsconfig = "//:tsconfig-test.json",
240231
deps = [
241232
":build_angular",
@@ -244,8 +235,6 @@ ts_library(
244235
"//packages/angular_devkit/architect/testing",
245236
"//packages/angular_devkit/core",
246237
"//packages/angular_devkit/core/node",
247-
"@npm//@types/jasmine",
248-
"@npm//@types/node",
249238
],
250239
)
251240

@@ -327,8 +316,6 @@ LARGE_SPECS = {
327316
name = "build_angular_" + spec + "_test_lib",
328317
testonly = True,
329318
srcs = glob(["src/" + spec + "/**/*_spec.ts"]),
330-
devmode_module = "commonjs",
331-
devmode_target = "es2018",
332319
tsconfig = "//:tsconfig-test.json",
333320
deps = [
334321
# Dependencies needed to compile and run the specs themselves.
@@ -339,8 +326,6 @@ LARGE_SPECS = {
339326
"//packages/angular_devkit/architect/testing",
340327
"//packages/angular_devkit/core",
341328
"//packages/angular_devkit/core/node",
342-
"@npm//@types/jasmine",
343-
"@npm//@types/node",
344329

345330
# Base dependencies for the application in hello-world-app.
346331
# Some tests also require extra dependencies.

packages/angular_devkit/build_ng_packagr/BUILD.bazel

+3-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
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.io/license
55

6-
licenses(["notice"]) # MIT
7-
86
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
9-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
107
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
118
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
9+
load("//tools:defaults.bzl", "ts_library")
1210
load("//tools:ts_json_schema.bzl", "ts_json_schema")
1311

12+
licenses(["notice"]) # MIT
13+
1414
package(default_visibility = ["//visibility:public"])
1515

1616
ts_json_schema(
@@ -33,8 +33,6 @@ ts_library(
3333
"src/build/schema.json",
3434
],
3535
),
36-
devmode_module = "commonjs",
37-
devmode_target = "es2018",
3836
module_name = "@angular-devkit/build-ng-packagr",
3937
module_root = "src/index.d.ts",
4038
deps = [
@@ -70,9 +68,6 @@ ts_library(
7068
],
7169
),
7270
data = glob(["test/**/*"]),
73-
devmode_module = "commonjs",
74-
devmode_target = "es2018",
75-
tsconfig = "//:tsconfig-test.json",
7671
deps = [
7772
":build_ng_packagr",
7873
"//packages/angular_devkit/architect",
@@ -86,8 +81,6 @@ ts_library(
8681
"@npm//@angular/platform-browser",
8782
"@npm//@angular/platform-browser-dynamic",
8883
"@npm//@angular/router",
89-
"@npm//@types/jasmine",
90-
"@npm//@types/node",
9184
"@npm//ng-packagr",
9285
"@npm//rxjs",
9386
"@npm//tslib",

packages/angular_devkit/build_optimizer/BUILD.bazel

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
77
load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test")
8-
load("@npm_bazel_typescript//:index.bzl", "ts_library")
98
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
9+
load("//tools:defaults.bzl", "ts_library")
1010

1111
licenses(["notice"]) # MIT
1212

@@ -30,8 +30,6 @@ ts_library(
3030
"webpack-loader/package.json",
3131
],
3232
),
33-
devmode_module = "commonjs",
34-
devmode_target = "es2018",
3533
module_name = "@angular-devkit/build-optimizer",
3634
module_root = "src/index.d.ts",
3735
deps = [
@@ -48,15 +46,10 @@ ts_library(
4846
name = "build_optimizer_test_lib",
4947
testonly = True,
5048
srcs = glob(["src/**/*_spec.ts"]),
51-
devmode_module = "commonjs",
52-
devmode_target = "es2018",
5349
# @external_begin
54-
tsconfig = "//:tsconfig-test.json",
5550
deps = [
5651
":build_optimizer",
5752
"//packages/angular_devkit/core",
58-
"@npm//@types/jasmine",
59-
"@npm//@types/node",
6053
"@npm//source-map",
6154
],
6255
# @external_end

0 commit comments

Comments
 (0)