Skip to content

Commit bca1ac9

Browse files
committed
build: migrate all cross-package targets to use first-party links
Instead of e.g. depending on `src/cdk/testing`, we should use the first-party linked package so that npm-module imports like `@angular/cdk` still work. This is the new approach for `rules_js`. It's notably slower, but with the simplicity gained, it's an acceptable trade-off we are taking.
1 parent 468f180 commit bca1ac9

File tree

243 files changed

+706
-1311
lines changed

Some content is hidden

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

243 files changed

+706
-1311
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-1406867100
5-
integration/package.json=122088
5+
integration/package.json=-620011313
66
package.json=1314863161
77
patches/@angular__compiler-cli.patch=-65319555
8-
pnpm-lock.yaml=-577830100
8+
pnpm-lock.yaml=-2045227594
99
pnpm-workspace.yaml=334858811
10-
src/cdk-experimental/package.json=2063150503
10+
src/cdk-experimental/package.json=237487315
1111
src/cdk/package.json=-908433069
12-
src/components-examples/package.json=560048349
12+
src/components-examples/package.json=-2087309525
1313
src/dev-app/package.json=624475908
1414
src/e2e-app/package.json=-1971485006
1515
src/google-maps/package.json=-886415500
1616
src/material-date-fns-adapter/package.json=-332076964
17-
src/material-experimental/package.json=592784609
17+
src/material-experimental/package.json=-1707816737
1818
src/material-luxon-adapter/package.json=-199007660
1919
src/material-moment-adapter/package.json=-1407689629
2020
src/material/package.json=-1237533685

pnpm-lock.yaml

+56-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cdk-experimental/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_TARGETS")
22
load("//tools:defaults.bzl", "ng_package")
33
load("//tools:defaults2.bzl", "ts_project")
44
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
5-
load("@npm2//defs:bzl", "npm_link_all_packages")
5+
load("@npm2//:defs.bzl", "npm_link_all_packages")
66

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

src/cdk-experimental/column-resize/BUILD.bazel

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ ng_project(
1212
"//:node_modules/@angular/common",
1313
"//:node_modules/@angular/core",
1414
"//:node_modules/rxjs",
15+
"//src/cdk-experimental:node_modules/@angular/cdk",
1516
"//src/cdk-experimental/popover-edit",
16-
"//src/cdk/bidi",
17-
"//src/cdk/coercion",
18-
"//src/cdk/keycodes",
19-
"//src/cdk/overlay",
20-
"//src/cdk/portal",
21-
"//src/cdk/table",
2217
],
2318
)

src/cdk-experimental/combobox/BUILD.bazel

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ ng_project(
1313
"//:node_modules/@angular/common",
1414
"//:node_modules/@angular/core",
1515
"//src:dev_mode_types",
16-
"//src/cdk/a11y",
17-
"//src/cdk/bidi",
18-
"//src/cdk/collections",
19-
"//src/cdk/overlay",
16+
"//src/cdk-experimental:node_modules/@angular/cdk",
2017
],
2118
)
2219

@@ -31,8 +28,7 @@ ts_project(
3128
":combobox",
3229
"//:node_modules/@angular/core",
3330
"//:node_modules/@angular/platform-browser",
34-
"//src/cdk/keycodes",
35-
"//src/cdk/testing/private",
31+
"//src/cdk-experimental:node_modules/@angular/cdk",
3632
],
3733
)
3834

src/cdk-experimental/listbox/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ ng_project(
1010
),
1111
deps = [
1212
"//:node_modules/@angular/core",
13+
"//src/cdk-experimental:node_modules/@angular/cdk",
1314
"//src/cdk-experimental/ui-patterns",
14-
"//src/cdk/a11y",
15-
"//src/cdk/bidi",
1615
],
1716
)

src/cdk-experimental/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"@angular/cdk": "0.0.0-PLACEHOLDER",
1616
"@angular/core": "0.0.0-NG"
1717
},
18+
"devDependencies": {
19+
"@angular/cdk": "workspace:*"
20+
},
1821
"dependencies": {
1922
"tslib": "^2.3.0"
2023
},

src/cdk-experimental/popover-edit/BUILD.bazel

+2-12
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ ng_project(
1414
"//:node_modules/@angular/core",
1515
"//:node_modules/@angular/forms",
1616
"//:node_modules/rxjs",
17-
"//src/cdk/a11y",
18-
"//src/cdk/bidi",
19-
"//src/cdk/keycodes",
20-
"//src/cdk/overlay",
21-
"//src/cdk/portal",
22-
"//src/cdk/scrolling",
17+
"//src/cdk-experimental:node_modules/@angular/cdk",
2318
],
2419
)
2520

@@ -36,12 +31,7 @@ ts_project(
3631
"//:node_modules/@angular/core",
3732
"//:node_modules/@angular/forms",
3833
"//:node_modules/rxjs",
39-
"//src/cdk/bidi",
40-
"//src/cdk/collections",
41-
"//src/cdk/keycodes",
42-
"//src/cdk/overlay",
43-
"//src/cdk/table",
44-
"//src/cdk/testing/private",
34+
"//src/cdk-experimental:node_modules/@angular/cdk",
4535
],
4636
)
4737

src/cdk-experimental/scrolling/BUILD.bazel

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ ng_project(
1414
"//:node_modules/@angular/core",
1515
"//:node_modules/rxjs",
1616
"//src:dev_mode_types",
17-
"//src/cdk/coercion",
18-
"//src/cdk/collections",
19-
"//src/cdk/scrolling",
17+
"//src/cdk-experimental:node_modules/@angular/cdk",
2018
],
2119
)
2220

@@ -30,7 +28,7 @@ ts_project(
3028
deps = [
3129
":scrolling",
3230
"//:node_modules/@angular/core",
33-
"//src/cdk/scrolling",
31+
"//src/cdk-experimental:node_modules/@angular/cdk",
3432
],
3533
)
3634

src/cdk-experimental/selection/BUILD.bazel

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ ng_project(
1515
"//:node_modules/@angular/forms",
1616
"//:node_modules/rxjs",
1717
"//src:dev_mode_types",
18-
"//src/cdk/coercion",
19-
"//src/cdk/collections",
20-
"//src/cdk/table",
18+
"//src/cdk-experimental:node_modules/@angular/cdk",
2119
],
2220
)
2321

@@ -32,7 +30,7 @@ ts_project(
3230
":selection",
3331
"//:node_modules/@angular/common",
3432
"//:node_modules/@angular/core",
35-
"//src/cdk/table",
33+
"//src/cdk-experimental:node_modules/@angular/cdk",
3634
"//src/cdk/testing/private",
3735
],
3836
)

src/cdk-experimental/table-scroll-container/BUILD.bazel

+2-7
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ ng_project(
1616
"//:node_modules/@angular/common",
1717
"//:node_modules/@angular/core",
1818
"//:node_modules/rxjs",
19-
"//src/cdk/a11y",
20-
"//src/cdk/bidi",
21-
"//src/cdk/platform",
22-
"//src/cdk/table",
19+
"//src/cdk-experimental:node_modules/@angular/cdk",
2320
],
2421
)
2522

@@ -34,9 +31,7 @@ ts_project(
3431
":table-scroll-container",
3532
"//:node_modules/@angular/core",
3633
"//:node_modules/rxjs",
37-
"//src/cdk/collections",
38-
"//src/cdk/platform",
39-
"//src/cdk/table",
34+
"//src/cdk-experimental:node_modules/@angular/cdk",
4035
],
4136
)
4237

src/cdk-experimental/ui-patterns/listbox/BUILD.bazel

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ ts_project(
2727
deps = [
2828
":listbox",
2929
"//:node_modules/@angular/core",
30-
"//src/cdk/keycodes",
31-
"//src/cdk/testing/private",
30+
"//src/cdk-experimental:node_modules/@angular/cdk",
3231
],
3332
)
3433

src/cdk/config.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CDK_ENTRYPOINTS = [
2424
"text-field",
2525
"tree",
2626
"testing",
27+
"testing/private",
2728
"testing/testbed",
2829
"testing/selenium-webdriver",
2930
"private",

src/cdk/schematics/BUILD.bazel

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
2-
load("//tools:defaults.bzl", "jasmine_node_test")
3-
load("//tools:defaults2.bzl", "npm_package", "ts_project")
2+
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
43
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
54

65
package(default_visibility = ["//visibility:public"])
@@ -91,10 +90,10 @@ ts_project(
9190
],
9291
)
9392

94-
jasmine_node_test(
93+
jasmine_test(
9594
name = "unit_tests",
96-
srcs = [":unit_test_sources_legacy"],
9795
data = [
9896
":schematics_assets",
97+
":unit_test_sources",
9998
],
10099
)

src/cdk/testing/private/BUILD.bazel

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package(default_visibility = ["//visibility:public"])
44

55
ts_project(
66
name = "private",
7-
testonly = True,
87
srcs = glob(
98
["**/*.ts"],
109
exclude = ["**/*.spec.ts"],
@@ -15,3 +14,8 @@ ts_project(
1514
"//src/cdk/testing/testbed",
1615
],
1716
)
17+
18+
filegroup(
19+
name = "source-files",
20+
srcs = glob(["**/*.ts"]),
21+
)

src/components-examples/BUILD.bazel

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ load("//tools/package-docs-content:index.bzl", "package_docs_content")
44
load(":config.bzl", "ALL_EXAMPLES")
55
load("//tools:defaults2.bzl", "ng_project")
66
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
7+
load("@npm2//:defs.bzl", "npm_link_all_packages")
78

89
package(default_visibility = ["//visibility:public"])
910

11+
npm_link_all_packages()
12+
1013
ng_project(
1114
name = "components-examples",
1215
srcs = glob(
@@ -15,6 +18,7 @@ ng_project(
1518
) + [":example-module.ts"],
1619
deps = [
1720
"//:node_modules/@angular/core",
21+
"//src/components-examples:node_modules/@angular/cdk",
1822
] + ALL_EXAMPLES,
1923
)
2024

@@ -59,12 +63,16 @@ package_docs_content(
5963

6064
ng_package(
6165
name = "npm_package",
66+
package_name = "@angular/components-examples",
6267
srcs = ["package.json"],
6368
# this is a workaround to store a tree artifact in the ng_package.
6469
# ng_package does not properly handle tree artifacts currently so we escalate to nested_packages
6570
nested_packages = [":docs-content"],
6671
tags = ["docs-package"],
67-
deps = [":components-examples_legacy"] + [get_legacy_label(t) for t in ALL_EXAMPLES],
72+
deps = [
73+
":components-examples_legacy",
74+
"//src/components-examples/private:private_legacy",
75+
] + [get_legacy_label(t) for t in ALL_EXAMPLES],
6876
)
6977

7078
genrule(

src/components-examples/cdk-experimental/listbox/BUILD.bazel

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ ng_project(
1212
deps = [
1313
"//:node_modules/@angular/core",
1414
"//:node_modules/@angular/forms",
15-
"//src/cdk-experimental/listbox",
16-
"//src/material/checkbox",
17-
"//src/material/form-field",
18-
"//src/material/select",
15+
"//src/components-examples:node_modules/@angular/cdk",
16+
"//src/components-examples:node_modules/@angular/cdk-experimental",
17+
"//src/components-examples:node_modules/@angular/material",
1918
],
2019
)
2120

src/components-examples/cdk-experimental/popover-edit/BUILD.bazel

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ ng_project(
1313
"//:node_modules/@angular/core",
1414
"//:node_modules/@angular/forms",
1515
"//:node_modules/rxjs",
16-
"//src/cdk-experimental/popover-edit",
17-
"//src/cdk/collections",
18-
"//src/cdk/table",
16+
"//src/components-examples:node_modules/@angular/cdk",
17+
"//src/components-examples:node_modules/@angular/cdk-experimental",
1918
],
2019
)
2120

src/components-examples/cdk-experimental/selection/BUILD.bazel

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ ng_project(
1313
"//:node_modules/@angular/common",
1414
"//:node_modules/@angular/core",
1515
"//:node_modules/@angular/forms",
16-
"//src/cdk-experimental/selection",
17-
"//src/cdk/collections",
18-
"//src/cdk/table",
19-
"//src/material/checkbox",
16+
"//src/components-examples:node_modules/@angular/cdk",
17+
"//src/components-examples:node_modules/@angular/cdk-experimental",
18+
"//src/components-examples:node_modules/@angular/material",
2019
],
2120
)
2221

0 commit comments

Comments
 (0)