Skip to content

Commit 5d731d3

Browse files
devversionjelbourn
authored andcommitted
fix(ng-update): material update fails due to circular dependency (#16538)
Currently running `ng update` for both Material and CDK fails because there is a circular dependency in the CDK schematics that cause the update-tool exports to be not available to the Material ng-update schematic. Without putting to much effort into ensuring no circular dependencies, this commit also sets up Madge to avoid such issues in the future.
1 parent af3e977 commit 5d731d3

File tree

5 files changed

+447
-15
lines changed

5 files changed

+447
-15
lines changed

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ jobs:
312312
- run: yarn gulp ci:build-release-packages
313313
- run: yarn check-release-output
314314

315+
# TODO(devversion): replace this with bazel tests that run Madge. This is
316+
# cumbersome and doesn't guarantee no circular deps for other entry-points.
317+
- run: yarn madge --circular dist/releases/cdk/schematics/index.js
318+
315319
# Store the release output in the workspace storage. This means that other jobs
316320
# in the same workflow can attach the release output to their job.
317321
- persist_to_workspace:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
"karma-parallel": "^0.3.0",
125125
"karma-sauce-launcher": "^2.0.2",
126126
"karma-sourcemap-loader": "^0.3.7",
127+
"madge": "^3.4.4",
127128
"magic-string": "^0.22.4",
128129
"marked": "^0.6.2",
129130
"merge2": "^1.2.3",

src/cdk/schematics/ng-update/upgrade-rules/input-names-rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {findInputsOnElementWithAttr, findInputsOnElementWithTag} from '../..';
9+
import {findInputsOnElementWithAttr, findInputsOnElementWithTag} from '../html-parsing/angular';
1010
import {ResolvedResource} from '../../update-tool/component-resource-collector';
1111
import {MigrationRule} from '../../update-tool/migration-rule';
1212

src/cdk/schematics/ng-update/upgrade-rules/misc-template-rule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {TargetVersion} from '../..';
9+
import {TargetVersion} from '../../update-tool/target-version';
1010
import {ResolvedResource} from '../../update-tool/component-resource-collector';
1111
import {MigrationRule} from '../../update-tool/migration-rule';
1212
import {findAllSubstringIndices} from '../typescript/literal';

0 commit comments

Comments
 (0)