Skip to content

Commit c4f02e2

Browse files
committed
build: move repeated tsconfig attributes to a macro (angular#20964)
This helps ensure we use the same tsconfig.json file for all compilations. Next steps are to make it the same tsconfig.json file used by the editor PR Close angular#20964
1 parent f15ca6c commit c4f02e2

File tree

54 files changed

+83
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+83
-123
lines changed

packages/BUILD.bazel

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ exports_files([
55
"tsconfig.json",
66
])
77

8-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_config", "ts_library")
9-
10-
ts_config(
11-
name = "tsconfig",
12-
src = ":tsconfig-build.json",
13-
deps = [],
14-
)
8+
load("//tools:defaults.bzl", "ts_library")
159

1610
ts_library(
1711
name = "types",
1812
srcs = glob(["*.ts"]),
19-
tsconfig = ":tsconfig",
2013
)

packages/animations/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "animations",
@@ -11,7 +11,6 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/animations",
14-
tsconfig = "//packages:tsconfig",
1514
deps = [
1615
"//packages/core",
1716
],

packages/animations/browser/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "browser",
@@ -11,7 +11,6 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/animations/browser",
14-
tsconfig = "//packages:tsconfig",
1514
deps = [
1615
"//packages/animations",
1716
],

packages/animations/browser/test/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
1+
load("//tools:defaults.bzl", "ts_library")
22

33
ts_library(
44
name = "test",
55
testonly = 1,
66
srcs = glob(["**/*.ts"]),
7-
tsconfig = "//packages:tsconfig",
87
deps = [
98
"//packages:types",
109
"//packages/animations",

packages/animations/browser/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/animations/browser/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages/animations",
1312
"//packages/animations/browser",

packages/animations/test/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
1+
load("//tools:defaults.bzl", "ts_library")
22

33
ts_library(
44
name = "test",
55
testonly = 1,
66
srcs = glob(["test/**/*.ts"]),
7-
tsconfig = "//packages:tsconfig",
87
deps = [
98
"//packages:types",
109
"//packages/animations",

packages/common/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "common",
@@ -11,7 +11,6 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/common",
14-
tsconfig = "//packages:tsconfig",
1514
deps = [
1615
"//packages/core",
1716
"@rxjs",

packages/common/http/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "http",
@@ -11,7 +11,6 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/common/http",
14-
tsconfig = "//packages:tsconfig",
1514
deps = [
1615
"//packages/common",
1716
"//packages/core",

packages/common/http/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/common/http/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages/common/http",
1312
"//packages/core",

packages/common/locales/BUILD.bazel

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "locales",
@@ -9,7 +9,4 @@ ts_library(
99
exclude = ["closure-locale.ts"],
1010
),
1111
module_name = "@angular/common/locales",
12-
tsconfig = "//packages:tsconfig",
13-
deps = [
14-
],
1512
)

packages/common/test/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
1+
load("//tools:defaults.bzl", "ts_library")
2+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
23
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
34

45
ts_library(
@@ -8,7 +9,6 @@ ts_library(
89
["**/*.ts"],
910
exclude = ["**/*_node_only_spec.ts"],
1011
),
11-
tsconfig = "//packages:tsconfig",
1212
deps = [
1313
"//packages/common",
1414
"//packages/common/locales",

packages/common/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/common/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages/common",
1312
"//packages/core",

packages/compiler/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "compiler",
@@ -11,5 +11,4 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/compiler",
14-
tsconfig = "//packages:tsconfig",
1514
)

packages/compiler/test/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
1+
load("//tools:defaults.bzl", "ts_library")
2+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
23
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
34

45
ts_library(
@@ -8,7 +9,6 @@ ts_library(
89
["**/*.ts"],
910
exclude = ["**/*_node_only_spec.ts"],
1011
),
11-
tsconfig = "//packages:tsconfig",
1212
deps = [
1313
"//packages:types",
1414
"//packages/common",
@@ -27,7 +27,6 @@ ts_library(
2727
name = "test_node_only_lib",
2828
testonly = 1,
2929
srcs = glob(["**/*_node_only_spec.ts"]),
30-
tsconfig = "//packages:tsconfig",
3130
deps = [
3231
":test_lib",
3332
"//packages/compiler",

packages/compiler/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/compiler/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages:types",
1312
"//packages/compiler",

packages/core/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@angular//:index.bzl", "ng_module")
4-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ng_module")
54

65
ng_module(
76
name = "core",
@@ -12,7 +11,6 @@ ng_module(
1211
],
1312
),
1413
module_name = "@angular/core",
15-
tsconfig = "//packages:tsconfig",
1614
deps = [
1715
"//packages:types",
1816
"@rxjs",

packages/core/test/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
3+
load("//tools:defaults.bzl", "ts_library")
4+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
45
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
56

67
ts_library(
@@ -13,7 +14,6 @@ ts_library(
1314
"render3/**/*.ts",
1415
],
1516
),
16-
tsconfig = "//packages:tsconfig",
1717
deps = [
1818
"//packages/animations",
1919
"//packages/animations/browser",
@@ -37,7 +37,6 @@ ts_library(
3737
name = "test_node_only_lib",
3838
testonly = 1,
3939
srcs = glob(["**/*_node_only_spec.ts"]),
40-
tsconfig = "//packages:tsconfig",
4140
deps = [
4241
":test_lib",
4342
"//packages/compiler",

packages/core/test/render3/BUILD.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
3+
load("//tools:defaults.bzl", "ts_library")
4+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
45
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
56

67
ts_library(
@@ -14,6 +15,7 @@ ts_library(
1415
"load_domino.ts",
1516
],
1617
),
18+
# TODO(alexeagle): should not be different tsconfig
1719
tsconfig = "//packages:tsconfig.json",
1820
deps = [
1921
"//packages:types",
@@ -34,7 +36,6 @@ ts_library(
3436
"domino.d.ts",
3537
"load_domino.ts",
3638
],
37-
tsconfig = "//packages:tsconfig",
3839
deps = [
3940
":render3_lib",
4041
"//packages/platform-browser",

packages/core/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/core/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages:types",
1312
"//packages/core",

packages/forms/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@angular//:index.bzl", "ng_module")
4-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ng_module")
54

65
ng_module(
76
name = "forms",
@@ -12,7 +11,6 @@ ng_module(
1211
],
1312
),
1413
module_name = "@angular/forms",
15-
tsconfig = "//packages:tsconfig",
1614
deps = [
1715
"//packages/core",
1816
"//packages/platform-browser",

packages/forms/test/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
1+
load("//tools:defaults.bzl", "ts_library")
2+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
23
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
34

45
ts_library(
56
name = "test_lib",
67
testonly = 1,
78
srcs = glob(["**/*.ts"]),
8-
tsconfig = "//packages:tsconfig",
99
deps = [
1010
"//packages/core",
1111
"//packages/core/testing",

packages/http/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "http",
@@ -11,7 +11,6 @@ ts_library(
1111
],
1212
),
1313
module_name = "@angular/http",
14-
tsconfig = "//packages:tsconfig",
1514
deps = [
1615
"//packages/core",
1716
"//packages/platform-browser",

packages/http/test/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")
1+
load("//tools:defaults.bzl", "ts_library")
2+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
23
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
34

45
ts_library(
56
name = "test_lib",
67
testonly = 1,
78
srcs = glob(["**/*.ts"]),
8-
tsconfig = "//packages:tsconfig",
99
deps = [
1010
"//packages/core",
1111
"//packages/core/testing",

packages/http/testing/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
3+
load("//tools:defaults.bzl", "ts_library")
44

55
ts_library(
66
name = "testing",
77
testonly = 1,
88
srcs = glob(["**/*.ts"]),
99
module_name = "@angular/http/testing",
10-
tsconfig = "//packages:tsconfig",
1110
deps = [
1211
"//packages/core",
1312
"//packages/http",

0 commit comments

Comments
 (0)