Skip to content

Commit a0695ca

Browse files
build: set up ts-circular-deps check to prevent new circular deps (#18899)
1 parent 5354fe6 commit a0695ca

File tree

6 files changed

+89
-1
lines changed

6 files changed

+89
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ jobs:
292292
- run: yarn ownerslint
293293
- run: yarn stylelint
294294
- run: yarn tslint
295+
- run: yarn -s ts-circular-deps:check
295296

296297
- *save_cache
297298

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@
313313
/.github/** @angular/dev-infra-components @jelbourn
314314
/.vscode/** @angular/dev-infra-components @mmalerba
315315
/src/* @jelbourn
316+
/goldens/ts-circular-deps.json @angular/dev-infra-components

goldens/ts-circular-deps.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[
2+
[
3+
"src/cdk-experimental/dialog/dialog-config.ts",
4+
"src/cdk-experimental/dialog/dialog-container.ts"
5+
],
6+
[
7+
"src/cdk-experimental/popover-edit/edit-event-dispatcher.ts",
8+
"src/cdk-experimental/popover-edit/edit-ref.ts"
9+
],
10+
[
11+
"src/cdk/drag-drop/drag-ref.ts",
12+
"src/cdk/drag-drop/drop-list-ref.ts"
13+
],
14+
[
15+
"src/cdk/drag-drop/directives/drag.ts",
16+
"src/cdk/drag-drop/drag-events.ts"
17+
],
18+
[
19+
"src/cdk/drag-drop/directives/drop-list.ts",
20+
"src/cdk/drag-drop/directives/drag.ts",
21+
"src/cdk/drag-drop/drag-events.ts"
22+
],
23+
[
24+
"src/cdk/drag-drop/directives/drop-list.ts",
25+
"src/cdk/drag-drop/directives/drag.ts"
26+
],
27+
[
28+
"src/cdk/overlay/keyboard/overlay-keyboard-dispatcher.ts",
29+
"src/cdk/overlay/overlay-ref.ts"
30+
],
31+
[
32+
"src/cdk/schematics/testing/index.ts",
33+
"src/cdk/schematics/testing/test-case-setup.ts"
34+
],
35+
[
36+
"src/cdk/scrolling/scroll-dispatcher.ts",
37+
"src/cdk/scrolling/scrollable.ts"
38+
],
39+
[
40+
"src/cdk/scrolling/virtual-scroll-viewport.ts",
41+
"src/cdk/scrolling/virtual-for-of.ts"
42+
],
43+
[
44+
"src/cdk/scrolling/virtual-scroll-strategy.ts",
45+
"src/cdk/scrolling/virtual-scroll-viewport.ts"
46+
],
47+
[
48+
"src/cdk/testing/private/e2e/actions.ts",
49+
"src/cdk/testing/private/e2e/query.ts"
50+
],
51+
[
52+
"src/material/core/ripple/ripple-ref.ts",
53+
"src/material/core/ripple/ripple-renderer.ts"
54+
],
55+
[
56+
"src/material/datepicker/datepicker.ts",
57+
"src/material/datepicker/datepicker-input.ts"
58+
],
59+
[
60+
"src/material/grid-list/grid-list.ts",
61+
"src/material/grid-list/tile-styler.ts"
62+
]
63+
]

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
"ownerslint": "ts-node --project scripts/ scripts/ownerslint.ts",
4242
"tslint": "tslint -c tslint.json --project ./tsconfig.json",
4343
"stylelint": "stylelint \"src/**/*.+(css|scss)\" --config .stylelintrc.json --syntax scss",
44-
"resync-caretaker-app": "ts-node --project scripts scripts/caretaking/resync-caretaker-app-prs.ts"
44+
"resync-caretaker-app": "ts-node --project scripts scripts/caretaking/resync-caretaker-app-prs.ts",
45+
"ts-circular-deps:check": "yarn -s ts-circular-deps check --config ./src/circular-deps-test.conf.js",
46+
"ts-circular-deps:approve": "yarn -s ts-circular-deps approve --config ./src/circular-deps-test.conf.js"
4547
},
4648
"version": "9.2.0",
4749
"dependencies": {
@@ -67,6 +69,7 @@
6769
"@angular-devkit/schematics": "^9.0.7",
6870
"@angular/bazel": "^9.1.0",
6971
"@angular/compiler-cli": "^9.1.0",
72+
"@angular/dev-infra-private": "angular/dev-infra-private-builds#cdf6637",
7073
"@angular/platform-browser-dynamic": "^9.1.0",
7174
"@angular/platform-server": "^9.1.0",
7275
"@angular/router": "^9.1.0",

src/circular-deps-test.conf.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
module.exports = {
9+
baseDir: '../',
10+
goldenFile: '../goldens/ts-circular-deps.json',
11+
// The test should not capture deprecated packages such as `http`, or the `webworker` platform.
12+
glob: `./**/*.ts`,
13+
// Command that will be displayed if the golden needs to be updated.
14+
approveCommand: 'yarn ts-circular-deps:approve',
15+
resolveModule: () => {}
16+
};

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
resolved "https://registry.yarnpkg.com/@angular/core/-/core-9.1.0.tgz#9dfc386bd1461e0fd4786031fd245da04371421c"
7070
integrity sha512-RVlyegdIAij0P1wLY5ObIdsBAzvmHkHfElnmfiNKhaDftP6U/3zRtaKDu0bq0jvn1WCQ8zXxFQ8AWyKZwyFS+w==
7171

72+
"@angular/dev-infra-private@angular/dev-infra-private-builds#cdf6637":
73+
version "0.0.0"
74+
resolved "https://codeload.github.com/angular/dev-infra-private-builds/tar.gz/cdf6637ad14278a32f1b644de5abb4a58002478b"
75+
7276
"@angular/elements@^9.1.0":
7377
version "9.1.0"
7478
resolved "https://registry.yarnpkg.com/@angular/elements/-/elements-9.1.0.tgz#fc18691306ca7d1e1257c5817b6ca04901988eff"

0 commit comments

Comments
 (0)