pruny 1.41.0 → 1.42.1
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 +87 -21
- package/dist/workers/file-processor.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14449,7 +14449,9 @@ var IGNORED_EXPORT_NAMES = new Set([
|
|
|
14449
14449
|
"default",
|
|
14450
14450
|
"handler",
|
|
14451
14451
|
"main",
|
|
14452
|
-
"lambdaHandler"
|
|
14452
|
+
"lambdaHandler",
|
|
14453
|
+
"middleware",
|
|
14454
|
+
"proxy"
|
|
14453
14455
|
]);
|
|
14454
14456
|
var FRAMEWORK_METHOD_DECORATORS = new Set([
|
|
14455
14457
|
"@Cron",
|
|
@@ -17627,32 +17629,96 @@ function printSummaryTable(result, context) {
|
|
|
17627
17629
|
}
|
|
17628
17630
|
}
|
|
17629
17631
|
printTable(summary);
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17632
|
+
printUnusedItemsList(result);
|
|
17633
|
+
}
|
|
17634
|
+
function printUnusedItemsList(result) {
|
|
17635
|
+
const sections = [];
|
|
17636
|
+
const unusedRoutes = result.routes.filter((r) => !r.used);
|
|
17637
|
+
if (unusedRoutes.length > 0) {
|
|
17638
|
+
sections.push({
|
|
17639
|
+
label: "API Routes",
|
|
17640
|
+
items: unusedRoutes.map((r) => {
|
|
17641
|
+
const methods = r.methods.length > 0 ? ` (${r.methods.join(", ")})` : "";
|
|
17642
|
+
return `${r.path}${methods}`;
|
|
17643
|
+
})
|
|
17644
|
+
});
|
|
17645
|
+
}
|
|
17646
|
+
const partialRoutes = result.routes.filter((r) => r.used && r.unusedMethods.length > 0);
|
|
17647
|
+
if (partialRoutes.length > 0) {
|
|
17648
|
+
const items = [];
|
|
17649
|
+
for (const r of partialRoutes) {
|
|
17650
|
+
items.push(`${r.path} → unused: ${r.unusedMethods.join(", ")}`);
|
|
17639
17651
|
}
|
|
17640
|
-
|
|
17641
|
-
|
|
17652
|
+
sections.push({ label: "Partially Unused Routes", items });
|
|
17653
|
+
}
|
|
17654
|
+
if (result.publicAssets) {
|
|
17655
|
+
const unusedAssets = result.publicAssets.assets.filter((a) => !a.used);
|
|
17656
|
+
if (unusedAssets.length > 0) {
|
|
17657
|
+
sections.push({
|
|
17658
|
+
label: "Public Files",
|
|
17659
|
+
items: unusedAssets.map((a) => a.relativePath)
|
|
17660
|
+
});
|
|
17661
|
+
}
|
|
17662
|
+
}
|
|
17663
|
+
if (result.unusedFiles && result.unusedFiles.files.length > 0) {
|
|
17664
|
+
sections.push({
|
|
17665
|
+
label: "Code Files",
|
|
17666
|
+
items: result.unusedFiles.files.map((f) => f.path)
|
|
17667
|
+
});
|
|
17668
|
+
}
|
|
17669
|
+
if (result.unusedExports && result.unusedExports.exports.length > 0) {
|
|
17670
|
+
sections.push({
|
|
17671
|
+
label: "Named Exports",
|
|
17672
|
+
items: result.unusedExports.exports.map((e) => `${e.name} ${e.file}:${e.line}`)
|
|
17673
|
+
});
|
|
17674
|
+
}
|
|
17675
|
+
if (result.unusedServices && result.unusedServices.methods.length > 0) {
|
|
17676
|
+
sections.push({
|
|
17677
|
+
label: "NestJS Services",
|
|
17678
|
+
items: result.unusedServices.methods.map((m) => `${m.name} (${m.serviceClassName}) ${m.file}:${m.line}`)
|
|
17679
|
+
});
|
|
17680
|
+
}
|
|
17681
|
+
if (result.missingAssets && result.missingAssets.total > 0) {
|
|
17682
|
+
sections.push({
|
|
17683
|
+
label: "Missing Assets",
|
|
17684
|
+
items: result.missingAssets.assets.map((a) => {
|
|
17685
|
+
const refs = a.references.map((r) => ` → ${r}`).join(`
|
|
17686
|
+
`);
|
|
17687
|
+
return `${a.path}
|
|
17688
|
+
${refs}`;
|
|
17689
|
+
})
|
|
17690
|
+
});
|
|
17642
17691
|
}
|
|
17643
17692
|
if (result.brokenLinks && result.brokenLinks.total > 0) {
|
|
17644
|
-
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17693
|
+
sections.push({
|
|
17694
|
+
label: "Broken Internal Links",
|
|
17695
|
+
items: result.brokenLinks.links.map((l) => {
|
|
17696
|
+
const refs = l.references.map((r) => ` → ${r}`).join(`
|
|
17697
|
+
`);
|
|
17698
|
+
return `${l.path}
|
|
17699
|
+
${refs}`;
|
|
17700
|
+
})
|
|
17701
|
+
});
|
|
17702
|
+
}
|
|
17703
|
+
if (sections.length === 0)
|
|
17704
|
+
return;
|
|
17705
|
+
const totalItems = sections.reduce((sum, s) => sum + s.items.length, 0);
|
|
17706
|
+
console.log(source_default.red.bold(`
|
|
17707
|
+
Unused Items (${totalItems})`));
|
|
17708
|
+
console.log(source_default.dim("─".repeat(40)));
|
|
17709
|
+
for (const section of sections) {
|
|
17710
|
+
console.log(source_default.yellow(`
|
|
17711
|
+
${section.label} (${section.items.length}):`));
|
|
17712
|
+
for (const item of section.items) {
|
|
17713
|
+
const lines = item.split(`
|
|
17714
|
+
`);
|
|
17715
|
+
console.log(source_default.red(` ${lines[0]}`));
|
|
17716
|
+
for (let i = 1;i < lines.length; i++) {
|
|
17717
|
+
console.log(source_default.dim(` ${lines[i]}`));
|
|
17651
17718
|
}
|
|
17652
17719
|
}
|
|
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
17720
|
}
|
|
17721
|
+
console.log("");
|
|
17656
17722
|
}
|
|
17657
17723
|
function printConsolidatedTable(allResults) {
|
|
17658
17724
|
console.log(source_default.bold(`\uD83D\uDCCA Monorepo Summary
|