build: sort module resolution warnings in ts-circular-deps tool (#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 #36361
This commit is contained in:
parent
c24ad560fa
commit
c810ac7153
|
@ -85,10 +85,12 @@ export function main(
|
||||||
// from the View Engine compiler (i.e. factories, summaries) cannot be resolved.
|
// from the View Engine compiler (i.e. factories, summaries) cannot be resolved.
|
||||||
if (printWarnings && warningsCount !== 0) {
|
if (printWarnings && warningsCount !== 0) {
|
||||||
console.info(chalk.yellow('⚠ The following imports could not be resolved:'));
|
console.info(chalk.yellow('⚠ The following imports could not be resolved:'));
|
||||||
analyzer.unresolvedModules.forEach(specifier => console.info(` • ${specifier}`));
|
Array.from(analyzer.unresolvedModules)
|
||||||
|
.sort()
|
||||||
|
.forEach(specifier => console.info(` • ${specifier}`));
|
||||||
analyzer.unresolvedFiles.forEach((value, key) => {
|
analyzer.unresolvedFiles.forEach((value, key) => {
|
||||||
console.info(` • ${getRelativePath(baseDir, key)}`);
|
console.info(` • ${getRelativePath(baseDir, key)}`);
|
||||||
value.forEach(specifier => console.info(` ${specifier}`));
|
value.sort().forEach(specifier => console.info(` ${specifier}`));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.info(chalk.yellow(`⚠ ${warningsCount} imports could not be resolved.`));
|
console.info(chalk.yellow(`⚠ ${warningsCount} imports could not be resolved.`));
|
||||||
|
@ -108,12 +110,13 @@ export function main(
|
||||||
if (newCircularDeps.length !== 0) {
|
if (newCircularDeps.length !== 0) {
|
||||||
console.error(chalk.yellow(` New circular dependencies which are not allowed:`));
|
console.error(chalk.yellow(` New circular dependencies which are not allowed:`));
|
||||||
newCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
|
newCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
|
||||||
|
console.error();
|
||||||
}
|
}
|
||||||
if (fixedCircularDeps.length !== 0) {
|
if (fixedCircularDeps.length !== 0) {
|
||||||
console.error(
|
console.error(
|
||||||
chalk.yellow(` Fixed circular dependencies that need to be removed from the golden:`));
|
chalk.yellow(` Fixed circular dependencies that need to be removed from the golden:`));
|
||||||
fixedCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
|
fixedCircularDeps.forEach(c => console.error(` • ${convertReferenceChainToString(c)}`));
|
||||||
console.info();
|
console.error();
|
||||||
if (approveCommand) {
|
if (approveCommand) {
|
||||||
console.info(chalk.yellow(` Please approve the new golden with: ${approveCommand}`));
|
console.info(chalk.yellow(` Please approve the new golden with: ${approveCommand}`));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue