pruny 1.44.1 → 1.44.3
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 +12 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17637,13 +17637,9 @@ program2.action(async (options) => {
|
|
|
17637
17637
|
printDetailedReport(result);
|
|
17638
17638
|
}
|
|
17639
17639
|
} else if (hasUnusedItems(result)) {
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
const fixResult = await handleFixes(result, currentConfig, options, false);
|
|
17644
|
-
if (fixResult === "exit" || fixResult === "done") {
|
|
17645
|
-
printSummaryTable(result, appLabel);
|
|
17646
|
-
}
|
|
17640
|
+
printDetailedReport(result);
|
|
17641
|
+
console.log(source_default.dim(`\uD83D\uDCA1 Run with --fix to clean up.
|
|
17642
|
+
`));
|
|
17647
17643
|
} else if (options.verbose) {
|
|
17648
17644
|
printDetailedReport(result);
|
|
17649
17645
|
}
|
|
@@ -18054,6 +18050,7 @@ Analyzing cascading impact...`));
|
|
|
18054
18050
|
}
|
|
18055
18051
|
const selectedList = options.cleanup ? options.cleanup.split(",").map((s) => s.trim()) : [selected];
|
|
18056
18052
|
let fixedSomething = false;
|
|
18053
|
+
let fixedCode = false;
|
|
18057
18054
|
if (selectedList.includes("broken-links")) {
|
|
18058
18055
|
if (result.brokenLinks && result.brokenLinks.total > 0) {
|
|
18059
18056
|
console.log(source_default.yellow.bold(`
|
|
@@ -18193,6 +18190,7 @@ Analyzing cascading impact...`));
|
|
|
18193
18190
|
actuallyDeleted.add(path2);
|
|
18194
18191
|
console.log(source_default.red(` Deleted: ${relative5(config.dir, path2)}`));
|
|
18195
18192
|
fixedSomething = true;
|
|
18193
|
+
fixedCode = true;
|
|
18196
18194
|
} else {
|
|
18197
18195
|
console.log(source_default.yellow(` ⚠ Path not found, skipping: ${relative5(config.dir, path2)}`));
|
|
18198
18196
|
}
|
|
@@ -18209,6 +18207,7 @@ Analyzing cascading impact...`));
|
|
|
18209
18207
|
actuallyFixed.add(absPath);
|
|
18210
18208
|
console.log(source_default.green(` Fixed: Removed ${rem.name} from ${relative5(config.dir, absPath)} (${rem.label})`));
|
|
18211
18209
|
fixedSomething = true;
|
|
18210
|
+
fixedCode = true;
|
|
18212
18211
|
}
|
|
18213
18212
|
}
|
|
18214
18213
|
}
|
|
@@ -18237,6 +18236,7 @@ Analyzing cascading impact...`));
|
|
|
18237
18236
|
rmSync(fullPath, { force: true });
|
|
18238
18237
|
console.log(source_default.red(` Deleted: ${file.path}`));
|
|
18239
18238
|
fixedSomething = true;
|
|
18239
|
+
fixedCode = true;
|
|
18240
18240
|
} catch (_err) {
|
|
18241
18241
|
console.log(source_default.yellow(` Failed to delete: ${file.path}`));
|
|
18242
18242
|
}
|
|
@@ -18250,7 +18250,9 @@ Analyzing cascading impact...`));
|
|
|
18250
18250
|
}
|
|
18251
18251
|
if (selectedList.includes("exports")) {
|
|
18252
18252
|
if (result.unusedExports && result.unusedExports.exports.length > 0) {
|
|
18253
|
-
|
|
18253
|
+
const exportsFixed = await fixUnusedExports(result, config);
|
|
18254
|
+
fixedSomething = exportsFixed || fixedSomething;
|
|
18255
|
+
fixedCode = exportsFixed || fixedCode;
|
|
18254
18256
|
} else {
|
|
18255
18257
|
console.log(source_default.green(`
|
|
18256
18258
|
✅ No unused exports found!`));
|
|
@@ -18282,6 +18284,7 @@ Analyzing cascading impact...`));
|
|
|
18282
18284
|
console.log(source_default.green(` Fixed: ${method.name} in ${file}`));
|
|
18283
18285
|
fixedCount++;
|
|
18284
18286
|
fixedSomething = true;
|
|
18287
|
+
fixedCode = true;
|
|
18285
18288
|
}
|
|
18286
18289
|
}
|
|
18287
18290
|
}
|
|
@@ -18297,7 +18300,7 @@ Analyzing cascading impact...`));
|
|
|
18297
18300
|
✅ No unused services found!`));
|
|
18298
18301
|
}
|
|
18299
18302
|
}
|
|
18300
|
-
if (
|
|
18303
|
+
if (fixedCode) {
|
|
18301
18304
|
console.log(source_default.cyan.bold(`
|
|
18302
18305
|
\uD83D\uDD04 Checking for cascading dead code (newly unused implementation)...`));
|
|
18303
18306
|
const secondPass = await scanUnusedExports(config);
|