pruny 1.44.2 → 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 +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18050,6 +18050,7 @@ Analyzing cascading impact...`));
|
|
|
18050
18050
|
}
|
|
18051
18051
|
const selectedList = options.cleanup ? options.cleanup.split(",").map((s) => s.trim()) : [selected];
|
|
18052
18052
|
let fixedSomething = false;
|
|
18053
|
+
let fixedCode = false;
|
|
18053
18054
|
if (selectedList.includes("broken-links")) {
|
|
18054
18055
|
if (result.brokenLinks && result.brokenLinks.total > 0) {
|
|
18055
18056
|
console.log(source_default.yellow.bold(`
|
|
@@ -18189,6 +18190,7 @@ Analyzing cascading impact...`));
|
|
|
18189
18190
|
actuallyDeleted.add(path2);
|
|
18190
18191
|
console.log(source_default.red(` Deleted: ${relative5(config.dir, path2)}`));
|
|
18191
18192
|
fixedSomething = true;
|
|
18193
|
+
fixedCode = true;
|
|
18192
18194
|
} else {
|
|
18193
18195
|
console.log(source_default.yellow(` ⚠ Path not found, skipping: ${relative5(config.dir, path2)}`));
|
|
18194
18196
|
}
|
|
@@ -18205,6 +18207,7 @@ Analyzing cascading impact...`));
|
|
|
18205
18207
|
actuallyFixed.add(absPath);
|
|
18206
18208
|
console.log(source_default.green(` Fixed: Removed ${rem.name} from ${relative5(config.dir, absPath)} (${rem.label})`));
|
|
18207
18209
|
fixedSomething = true;
|
|
18210
|
+
fixedCode = true;
|
|
18208
18211
|
}
|
|
18209
18212
|
}
|
|
18210
18213
|
}
|
|
@@ -18233,6 +18236,7 @@ Analyzing cascading impact...`));
|
|
|
18233
18236
|
rmSync(fullPath, { force: true });
|
|
18234
18237
|
console.log(source_default.red(` Deleted: ${file.path}`));
|
|
18235
18238
|
fixedSomething = true;
|
|
18239
|
+
fixedCode = true;
|
|
18236
18240
|
} catch (_err) {
|
|
18237
18241
|
console.log(source_default.yellow(` Failed to delete: ${file.path}`));
|
|
18238
18242
|
}
|
|
@@ -18246,7 +18250,9 @@ Analyzing cascading impact...`));
|
|
|
18246
18250
|
}
|
|
18247
18251
|
if (selectedList.includes("exports")) {
|
|
18248
18252
|
if (result.unusedExports && result.unusedExports.exports.length > 0) {
|
|
18249
|
-
|
|
18253
|
+
const exportsFixed = await fixUnusedExports(result, config);
|
|
18254
|
+
fixedSomething = exportsFixed || fixedSomething;
|
|
18255
|
+
fixedCode = exportsFixed || fixedCode;
|
|
18250
18256
|
} else {
|
|
18251
18257
|
console.log(source_default.green(`
|
|
18252
18258
|
✅ No unused exports found!`));
|
|
@@ -18278,6 +18284,7 @@ Analyzing cascading impact...`));
|
|
|
18278
18284
|
console.log(source_default.green(` Fixed: ${method.name} in ${file}`));
|
|
18279
18285
|
fixedCount++;
|
|
18280
18286
|
fixedSomething = true;
|
|
18287
|
+
fixedCode = true;
|
|
18281
18288
|
}
|
|
18282
18289
|
}
|
|
18283
18290
|
}
|
|
@@ -18293,7 +18300,7 @@ Analyzing cascading impact...`));
|
|
|
18293
18300
|
✅ No unused services found!`));
|
|
18294
18301
|
}
|
|
18295
18302
|
}
|
|
18296
|
-
if (
|
|
18303
|
+
if (fixedCode) {
|
|
18297
18304
|
console.log(source_default.cyan.bold(`
|
|
18298
18305
|
\uD83D\uDD04 Checking for cascading dead code (newly unused implementation)...`));
|
|
18299
18306
|
const secondPass = await scanUnusedExports(config);
|