Skip to content

Commit c810ac7

Browse files
devversionkara
authored andcommitted
build: sort module resolution warnings in ts-circular-deps tool (angular#36361)
For better overview of modules that cannot be resolved in the `ts-circular-deps` tool, the warnings are now sorted. Additionally, an empty line between fixed and new circular dependencies is now printed. That should slightly help with distinguishing. PR Close angular#36361
1 parent c24ad56 commit c810ac7

File tree

1 file changed

+6
-3
lines changed
  • dev-infra/ts-circular-dependencies

1 file changed

+6
-3
lines changed

dev-infra/ts-circular-dependencies/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ export function main(
8585
// from the View Engine compiler (i.e. factories, summaries) cannot be resolved.
8686
if (printWarnings && warningsCount !== 0) {
8787
console.info(chalk.yellow('⚠ The following imports could not be resolved:'));
88-
analyzer.unresolvedModules.forEach(specifier => console.info(` • ${specifier}`));
88+
Array.from(analyzer.unresolvedModules)
89+
.sort()
90+
.forEach(specifier => console.info(` • ${specifier}`));
8991
analyzer.unresolvedFiles.forEach((value, key) => {
9092
console.info(` • ${getRelativePath(baseDir, key)}`);
91-
value.forEach(specifier => console.info(` ${specifier}`));
93+
value.sort().forEach(specifier => console.info(` ${specifier}`));
9294
});
9395
} else {
9496
console.info(chalk.yellow(`⚠ ${warningsCount} imports could not be resolved.`));
@@ -108,12 +110,13 @@ export function main(
108110
if (newCircularDeps.length !== 0) {
109111
console.error(chalk.yellow(` New circular dependencies which are not allowed:`));
110112
newCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
113+
console.error();
111114
}
112115
if (fixedCircularDeps.length !== 0) {
113116
console.error(
114117
chalk.yellow(` Fixed circular dependencies that need to be removed from the golden:`));
115118
fixedCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
116-
console.info();
119+
console.error();
117120
if (approveCommand) {
118121
console.info(chalk.yellow(` Please approve the new golden with: ${approveCommand}`));
119122
} else {

0 commit comments

Comments
 (0)