pruny 1.41.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +84 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17627,32 +17627,96 @@ function printSummaryTable(result, context) {
|
|
|
17627
17627
|
}
|
|
17628
17628
|
}
|
|
17629
17629
|
printTable(summary);
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17630
|
+
printUnusedItemsList(result);
|
|
17631
|
+
}
|
|
17632
|
+
function printUnusedItemsList(result) {
|
|
17633
|
+
const sections = [];
|
|
17634
|
+
const unusedRoutes = result.routes.filter((r) => !r.used);
|
|
17635
|
+
if (unusedRoutes.length > 0) {
|
|
17636
|
+
sections.push({
|
|
17637
|
+
label: "API Routes",
|
|
17638
|
+
items: unusedRoutes.map((r) => {
|
|
17639
|
+
const methods = r.methods.length > 0 ? ` (${r.methods.join(", ")})` : "";
|
|
17640
|
+
return `${r.path}${methods}`;
|
|
17641
|
+
})
|
|
17642
|
+
});
|
|
17643
|
+
}
|
|
17644
|
+
const partialRoutes = result.routes.filter((r) => r.used && r.unusedMethods.length > 0);
|
|
17645
|
+
if (partialRoutes.length > 0) {
|
|
17646
|
+
const items = [];
|
|
17647
|
+
for (const r of partialRoutes) {
|
|
17648
|
+
items.push(`${r.path} → unused: ${r.unusedMethods.join(", ")}`);
|
|
17639
17649
|
}
|
|
17640
|
-
|
|
17641
|
-
|
|
17650
|
+
sections.push({ label: "Partially Unused Routes", items });
|
|
17651
|
+
}
|
|
17652
|
+
if (result.publicAssets) {
|
|
17653
|
+
const unusedAssets = result.publicAssets.assets.filter((a) => !a.used);
|
|
17654
|
+
if (unusedAssets.length > 0) {
|
|
17655
|
+
sections.push({
|
|
17656
|
+
label: "Public Files",
|
|
17657
|
+
items: unusedAssets.map((a) => a.relativePath)
|
|
17658
|
+
});
|
|
17659
|
+
}
|
|
17660
|
+
}
|
|
17661
|
+
if (result.unusedFiles && result.unusedFiles.files.length > 0) {
|
|
17662
|
+
sections.push({
|
|
17663
|
+
label: "Code Files",
|
|
17664
|
+
items: result.unusedFiles.files.map((f) => f.path)
|
|
17665
|
+
});
|
|
17666
|
+
}
|
|
17667
|
+
if (result.unusedExports && result.unusedExports.exports.length > 0) {
|
|
17668
|
+
sections.push({
|
|
17669
|
+
label: "Named Exports",
|
|
17670
|
+
items: result.unusedExports.exports.map((e) => `${e.name} ${e.file}:${e.line}`)
|
|
17671
|
+
});
|
|
17672
|
+
}
|
|
17673
|
+
if (result.unusedServices && result.unusedServices.methods.length > 0) {
|
|
17674
|
+
sections.push({
|
|
17675
|
+
label: "NestJS Services",
|
|
17676
|
+
items: result.unusedServices.methods.map((m) => `${m.name} (${m.serviceClassName}) ${m.file}:${m.line}`)
|
|
17677
|
+
});
|
|
17678
|
+
}
|
|
17679
|
+
if (result.missingAssets && result.missingAssets.total > 0) {
|
|
17680
|
+
sections.push({
|
|
17681
|
+
label: "Missing Assets",
|
|
17682
|
+
items: result.missingAssets.assets.map((a) => {
|
|
17683
|
+
const refs = a.references.map((r) => ` → ${r}`).join(`
|
|
17684
|
+
`);
|
|
17685
|
+
return `${a.path}
|
|
17686
|
+
${refs}`;
|
|
17687
|
+
})
|
|
17688
|
+
});
|
|
17642
17689
|
}
|
|
17643
17690
|
if (result.brokenLinks && result.brokenLinks.total > 0) {
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17691
|
+
sections.push({
|
|
17692
|
+
label: "Broken Internal Links",
|
|
17693
|
+
items: result.brokenLinks.links.map((l) => {
|
|
17694
|
+
const refs = l.references.map((r) => ` → ${r}`).join(`
|
|
17695
|
+
`);
|
|
17696
|
+
return `${l.path}
|
|
17697
|
+
${refs}`;
|
|
17698
|
+
})
|
|
17699
|
+
});
|
|
17700
|
+
}
|
|
17701
|
+
if (sections.length === 0)
|
|
17702
|
+
return;
|
|
17703
|
+
const totalItems = sections.reduce((sum, s) => sum + s.items.length, 0);
|
|
17704
|
+
console.log(source_default.red.bold(`
|
|
17705
|
+
Unused Items (${totalItems})`));
|
|
17706
|
+
console.log(source_default.dim("─".repeat(40)));
|
|
17707
|
+
for (const section of sections) {
|
|
17708
|
+
console.log(source_default.yellow(`
|
|
17709
|
+
${section.label} (${section.items.length}):`));
|
|
17710
|
+
for (const item of section.items) {
|
|
17711
|
+
const lines = item.split(`
|
|
17712
|
+
`);
|
|
17713
|
+
console.log(source_default.red(` ${lines[0]}`));
|
|
17714
|
+
for (let i = 1;i < lines.length; i++) {
|
|
17715
|
+
console.log(source_default.dim(` ${lines[i]}`));
|
|
17651
17716
|
}
|
|
17652
17717
|
}
|
|
17653
|
-
console.log(source_default.yellow(`
|
|
17654
|
-
These links point to pages/routes that don't exist. Create the pages or fix the links.`));
|
|
17655
17718
|
}
|
|
17719
|
+
console.log("");
|
|
17656
17720
|
}
|
|
17657
17721
|
function printConsolidatedTable(allResults) {
|
|
17658
17722
|
console.log(source_default.bold(`\uD83D\uDCCA Monorepo Summary
|