pruny 1.44.9 → 1.45.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 +11 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14992,7 +14992,8 @@ async function scanUnusedExports(config, routes = [], options = {}) {
|
|
|
14992
14992
|
const isGeneric = GENERIC_METHOD_NAMES.has(exp.name);
|
|
14993
14993
|
const hasSelfImport = new RegExp(`import.*\\b${escapeRegExp(exp.name)}\\b.*from`).test(content);
|
|
14994
14994
|
const hasSelfDecl = new RegExp(`(?:export\\s+)?(?:abstract\\s+)?(?:interface|class|enum)\\s+${escapeRegExp(exp.name)}\\b|` + `(?:export\\s+)?(?:async\\s+)?(?:function)\\s+${escapeRegExp(exp.name)}\\b|` + `(?:export\\s+)?(?:const|let|var|type)\\s+${escapeRegExp(exp.name)}\\s*[=<]`).test(content);
|
|
14995
|
-
|
|
14995
|
+
const hasDynamicImportRef = /import\s*\(/.test(content) && new RegExp(`\\.${escapeRegExp(exp.name)}\\b`).test(content);
|
|
14996
|
+
if (hasSelfDecl && !hasSelfImport && !hasDynamicImportRef)
|
|
14996
14997
|
continue;
|
|
14997
14998
|
if (!hasIgnoreRanges && !isGeneric) {
|
|
14998
14999
|
const jsxPattern = new RegExp(`<${exp.name}[\\s/>]`);
|
|
@@ -17953,6 +17954,7 @@ Analyzing cascading impact...`));
|
|
|
17953
17954
|
const title = count > 0 ? `\uD83D\uDD17 Broken Internal Links (${count})` : `✅ Internal Links (0) - All good!`;
|
|
17954
17955
|
choices.push({ title, value: "broken-links" });
|
|
17955
17956
|
}
|
|
17957
|
+
choices.push({ title: source_default.blue("\uD83D\uDD04 Rescan"), value: "rescan" });
|
|
17956
17958
|
if (showBack) {
|
|
17957
17959
|
choices.push({ title: source_default.cyan("← Back"), value: "back" });
|
|
17958
17960
|
}
|
|
@@ -17986,6 +17988,14 @@ Analyzing cascading impact...`));
|
|
|
17986
17988
|
if (selected === "back") {
|
|
17987
17989
|
return "back";
|
|
17988
17990
|
}
|
|
17991
|
+
if (selected === "rescan") {
|
|
17992
|
+
console.log(source_default.blue(`
|
|
17993
|
+
\uD83D\uDD04 Rescanning...
|
|
17994
|
+
`));
|
|
17995
|
+
const fresh = await scan(config);
|
|
17996
|
+
Object.assign(result, fresh);
|
|
17997
|
+
continue;
|
|
17998
|
+
}
|
|
17989
17999
|
let action = "delete";
|
|
17990
18000
|
if (!options.cleanup && !process.env.AUTO_FIX_EXPORTS) {
|
|
17991
18001
|
const actionResponse = await import_prompts.default({
|