Skip to content

Commit ff5acbb

Browse files
andrewseguinmistrykaran91
authored andcommitted
refactor: create individual BUILD files in core (angular#30787)
1 parent 6d8ec4f commit ff5acbb

File tree

67 files changed

+2902
-1038
lines changed

Some content is hidden

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

67 files changed

+2902
-1038
lines changed

src/e2e-app/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
2+
load("@npm2//:defs.bzl", "npm_link_all_packages")
13
load("//tools:defaults.bzl", "http_server", "sass_binary")
24
load("//tools:defaults2.bzl", "ng_project")
3-
load("@npm2//:defs.bzl", "npm_link_all_packages")
4-
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
55

66
package(default_visibility = ["//visibility:public"])
77

@@ -56,7 +56,6 @@ sass_binary(
5656
deps = [
5757
"//src/material:sass_lib",
5858
"//src/material-experimental:sass_lib",
59-
"//src/material/core:theming_scss_lib",
6059
],
6160
)
6261

src/material/BUILD.bazel

Lines changed: 133 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
load(
22
"//src/material:config.bzl",
33
"MATERIAL_ENTRYPOINTS",
4-
"MATERIAL_SCSS_LIBS",
54
"MATERIAL_TARGETS",
65
"MATERIAL_TESTING_TARGETS",
76
)
@@ -35,8 +34,72 @@ sass_library(
3534
"_index.scss",
3635
],
3736
deps = [
38-
"//src/material/core:core_scss_lib",
39-
"//src/material/core:theming_scss_lib",
37+
"//src/material/autocomplete:theme",
38+
"//src/material/badge:theme",
39+
"//src/material/bottom-sheet:theme",
40+
"//src/material/button:fab_theme",
41+
"//src/material/button:icon_button_theme",
42+
"//src/material/button:theme",
43+
"//src/material/button-toggle:theme",
44+
"//src/material/card:theme",
45+
"//src/material/checkbox:theme",
46+
"//src/material/chips:theme",
47+
"//src/material/core:core_sass",
48+
"//src/material/core:ripple_sass",
49+
"//src/material/core:ripple_sass_theme",
50+
"//src/material/core:theme_sass",
51+
"//src/material/core/color",
52+
"//src/material/core/density/private:all_density",
53+
"//src/material/core/focus-indicators",
54+
"//src/material/core/m2:m2_sass",
55+
"//src/material/core/option:theme",
56+
"//src/material/core/selection/pseudo-checkbox:_pseudo_checkbox_common",
57+
"//src/material/core/selection/pseudo-checkbox:sass_theme",
58+
"//src/material/core/style:_validation",
59+
"//src/material/core/style:elevation",
60+
"//src/material/core/style:private",
61+
"//src/material/core/style:sass_utils",
62+
"//src/material/core/style:variables",
63+
"//src/material/core/style:vendor_prefixes",
64+
"//src/material/core/theming",
65+
"//src/material/core/theming:_color_api_backwards_compatibility",
66+
"//src/material/core/theming:_definition",
67+
"//src/material/core/theming:_inspection",
68+
"//src/material/core/theming:_palettes",
69+
"//src/material/core/theming:core_all_theme",
70+
"//src/material/core/tokens:m3_system",
71+
"//src/material/core/tokens/m2",
72+
"//src/material/core/typography",
73+
"//src/material/core/typography:all_typography",
74+
"//src/material/core/typography:utils",
75+
"//src/material/datepicker:theme",
76+
"//src/material/dialog:dialog_legacy_padding",
77+
"//src/material/dialog:theme",
78+
"//src/material/divider:theme",
79+
"//src/material/expansion:theme",
80+
"//src/material/form-field:theme",
81+
"//src/material/grid-list:theme",
82+
"//src/material/icon:theme",
83+
"//src/material/input:theme",
84+
"//src/material/list:theme",
85+
"//src/material/menu:theme",
86+
"//src/material/paginator:theme",
87+
"//src/material/progress-bar:theme",
88+
"//src/material/progress-spinner:theme",
89+
"//src/material/radio:theme",
90+
"//src/material/select:theme",
91+
"//src/material/sidenav:theme",
92+
"//src/material/slide-toggle:theme",
93+
"//src/material/slider:theme",
94+
"//src/material/snack-bar:theme",
95+
"//src/material/sort:theme",
96+
"//src/material/stepper:theme",
97+
"//src/material/table:theme",
98+
"//src/material/tabs:theme",
99+
"//src/material/timepicker:theme",
100+
"//src/material/toolbar:theme",
101+
"//src/material/tooltip:theme",
102+
"//src/material/tree:theme",
40103
],
41104
)
42105

@@ -47,7 +110,56 @@ ng_package(
47110
srcs = [
48111
"package.json",
49112
":sass_lib",
50-
"//src/material/core:theming_scss_lib",
113+
"//src/material/autocomplete:theme",
114+
"//src/material/badge:theme",
115+
"//src/material/bottom-sheet:theme",
116+
"//src/material/button:fab_theme",
117+
"//src/material/button:icon_button_theme",
118+
"//src/material/button:theme",
119+
"//src/material/button-toggle:theme",
120+
"//src/material/card:theme",
121+
"//src/material/checkbox:theme",
122+
"//src/material/chips:theme",
123+
"//src/material/core:core_sass",
124+
"//src/material/core:ripple_sass",
125+
"//src/material/core:ripple_sass_theme",
126+
"//src/material/core:theme_sass",
127+
"//src/material/core/color",
128+
"//src/material/core/density/private:all_density",
129+
"//src/material/core/focus-indicators",
130+
"//src/material/core/m2:m2_sass",
131+
"//src/material/core/option:theme",
132+
"//src/material/core/selection/pseudo-checkbox:_pseudo_checkbox_common",
133+
"//src/material/core/selection/pseudo-checkbox:sass_theme",
134+
"//src/material/core/style:_validation",
135+
"//src/material/core/style:elevation",
136+
"//src/material/core/style:private",
137+
"//src/material/core/style:sass_utils",
138+
"//src/material/core/style:variables",
139+
"//src/material/core/style:vendor_prefixes",
140+
"//src/material/core/theming",
141+
"//src/material/core/theming:_color_api_backwards_compatibility",
142+
"//src/material/core/theming:_definition",
143+
"//src/material/core/theming:_inspection",
144+
"//src/material/core/theming:_palettes",
145+
"//src/material/core/theming:core_all_theme",
146+
"//src/material/core/tokens:m3_system",
147+
"//src/material/core/tokens/m2",
148+
"//src/material/core/typography",
149+
"//src/material/core/typography:all_typography",
150+
"//src/material/core/typography:utils",
151+
"//src/material/datepicker:theme",
152+
"//src/material/dialog:dialog_legacy_padding",
153+
"//src/material/dialog:theme",
154+
"//src/material/divider:theme",
155+
"//src/material/expansion:theme",
156+
"//src/material/form-field:theme",
157+
"//src/material/grid-list:theme",
158+
"//src/material/icon:theme",
159+
"//src/material/input:theme",
160+
"//src/material/list:theme",
161+
"//src/material/menu:theme",
162+
"//src/material/paginator:theme",
51163
"//src/material/prebuilt-themes:azure-blue",
52164
"//src/material/prebuilt-themes:cyan-orange",
53165
"//src/material/prebuilt-themes:deeppurple-amber",
@@ -56,7 +168,23 @@ ng_package(
56168
"//src/material/prebuilt-themes:pink-bluegrey",
57169
"//src/material/prebuilt-themes:purple-green",
58170
"//src/material/prebuilt-themes:rose-red",
59-
] + MATERIAL_SCSS_LIBS,
171+
"//src/material/progress-bar:theme",
172+
"//src/material/progress-spinner:theme",
173+
"//src/material/radio:theme",
174+
"//src/material/select:theme",
175+
"//src/material/sidenav:theme",
176+
"//src/material/slide-toggle:theme",
177+
"//src/material/slider:theme",
178+
"//src/material/snack-bar:theme",
179+
"//src/material/sort:theme",
180+
"//src/material/stepper:theme",
181+
"//src/material/table:theme",
182+
"//src/material/tabs:theme",
183+
"//src/material/timepicker:theme",
184+
"//src/material/toolbar:theme",
185+
"//src/material/tooltip:theme",
186+
"//src/material/tree:theme",
187+
],
60188
nested_packages = ["//src/material/schematics:npm_package"],
61189
tags = ["release-package"],
62190
deps = [get_legacy_label(t) for t in MATERIAL_TARGETS + MATERIAL_TESTING_TARGETS],

src/material/autocomplete/BUILD.bazel

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,46 @@ load("//tools:defaults2.bzl", "ng_project", "ts_project")
1010

1111
package(default_visibility = ["//visibility:public"])
1212

13+
sass_library(
14+
name = "theme",
15+
srcs = [
16+
"_autocomplete-theme.scss",
17+
],
18+
deps = [
19+
"//src/material/core/style:sass_utils",
20+
"//src/material/core/theming",
21+
"//src/material/core/theming:_inspection",
22+
"//src/material/core/theming:_validation",
23+
"//src/material/core/tokens:token_utils",
24+
"//src/material/core/tokens/m2/mat",
25+
"//src/material/core/typography",
26+
],
27+
)
28+
29+
sass_binary(
30+
name = "css",
31+
src = "autocomplete.scss",
32+
deps = [
33+
"//src/cdk:sass_lib",
34+
"//src/material/core/tokens:token_utils",
35+
"//src/material/core/tokens/m2/mat",
36+
],
37+
)
38+
1339
ng_project(
1440
name = "autocomplete",
15-
srcs = glob(
16-
["**/*.ts"],
17-
exclude = [
18-
"**/*.spec.ts",
19-
],
20-
),
41+
srcs = [
42+
"autocomplete.ts",
43+
"autocomplete-origin.ts",
44+
"autocomplete-trigger.ts",
45+
"index.ts",
46+
"module.ts",
47+
"public-api.ts",
48+
],
2149
assets = [
22-
":autocomplete_scss",
23-
] + glob(["**/*.html"]),
50+
"autocomplete.html",
51+
":css",
52+
],
2453
deps = [
2554
"//:node_modules/@angular/common",
2655
"//:node_modules/@angular/core",
@@ -32,23 +61,6 @@ ng_project(
3261
],
3362
)
3463

35-
sass_library(
36-
name = "autocomplete_scss_lib",
37-
srcs = glob(["**/_*.scss"]),
38-
deps = [
39-
"//src/material/core:core_scss_lib",
40-
],
41-
)
42-
43-
sass_binary(
44-
name = "autocomplete_scss",
45-
src = "autocomplete.scss",
46-
deps = [
47-
"//src/cdk:sass_lib",
48-
"//src/material/core:core_scss_lib",
49-
],
50-
)
51-
5264
ts_project(
5365
name = "autocomplete_tests_lib",
5466
testonly = True,
@@ -85,7 +97,7 @@ markdown_to_html(
8597

8698
extract_tokens(
8799
name = "tokens",
88-
srcs = [":autocomplete_scss_lib"],
100+
srcs = [":theme"],
89101
)
90102

91103
filegroup(

src/material/badge/BUILD.bazel

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,49 @@ load("//tools:defaults2.bzl", "ng_project", "ts_project")
1010

1111
package(default_visibility = ["//visibility:public"])
1212

13-
ng_project(
14-
name = "badge",
15-
srcs = glob(
16-
["**/*.ts"],
17-
exclude = ["**/*.spec.ts"],
18-
),
19-
assets = [
20-
":badge_scss",
21-
] + glob(["**/*.html"]),
13+
sass_library(
14+
name = "theme",
15+
srcs = [
16+
"_badge-theme.scss",
17+
],
2218
deps = [
23-
"//:node_modules/@angular/animations",
24-
"//:node_modules/@angular/common",
25-
"//:node_modules/@angular/core",
26-
"//:node_modules/@angular/platform-browser",
27-
"//src:dev_mode_types",
28-
"//src/material:node_modules/@angular/cdk",
29-
"//src/material/core",
19+
"//src/material/core/style:sass_utils",
20+
"//src/material/core/theming",
21+
"//src/material/core/theming:_inspection",
22+
"//src/material/core/theming:_validation",
23+
"//src/material/core/tokens:token_utils",
24+
"//src/material/core/tokens/m2/mat",
25+
"//src/material/core/typography",
3026
],
3127
)
3228

3329
sass_binary(
34-
name = "badge_scss",
30+
name = "badge_css",
3531
src = "badge.scss",
3632
deps = [
3733
"//src/cdk:sass_lib",
38-
"//src/material/core:core_scss_lib",
34+
"//src/material/core/tokens:token_utils",
35+
"//src/material/core/tokens/m2/mat",
3936
],
4037
)
4138

42-
sass_library(
43-
name = "badge_scss_lib",
44-
srcs = glob(["**/_*.scss"]),
39+
ng_project(
40+
name = "badge",
41+
srcs = [
42+
"badge.ts",
43+
"badge-module.ts",
44+
"index.ts",
45+
"public-api.ts",
46+
],
47+
assets = [":badge_css"],
4548
deps = [
46-
"//src/cdk:sass_lib",
47-
"//src/material/core:core_scss_lib",
49+
"//:node_modules/@angular/animations",
50+
"//:node_modules/@angular/common",
51+
"//:node_modules/@angular/core",
52+
"//:node_modules/@angular/platform-browser",
53+
"//src:dev_mode_types",
54+
"//src/material:node_modules/@angular/cdk",
55+
"//src/material/core",
4856
],
4957
)
5058

@@ -75,7 +83,7 @@ markdown_to_html(
7583

7684
extract_tokens(
7785
name = "tokens",
78-
srcs = [":badge_scss_lib"],
86+
srcs = [":theme"],
7987
)
8088

8189
filegroup(

0 commit comments

Comments
 (0)