pruny 1.44.8 → 1.45.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.
Files changed (2) hide show
  1. package/dist/index.js +16 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14203,6 +14203,11 @@ function makeCodePattern(name) {
14203
14203
  function escapeRegExp(string) {
14204
14204
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
14205
14205
  }
14206
+ function stripComments(content) {
14207
+ let result = content.replace(/\/\*[\s\S]*?\*\//g, "");
14208
+ result = result.replace(/\/\/[^\n]*/g, "");
14209
+ return result;
14210
+ }
14206
14211
  function matchesFilter(path2, filter2) {
14207
14212
  const lowerPath = path2.toLowerCase();
14208
14213
  const appName = getAppName(path2).toLowerCase();
@@ -14393,7 +14398,8 @@ async function scanUnusedFiles(config) {
14393
14398
  const currentFile = queue.shift();
14394
14399
  const currentDir = dirname2(currentFile);
14395
14400
  try {
14396
- const content = readFileSync3(currentFile, "utf-8");
14401
+ const rawContent = readFileSync3(currentFile, "utf-8");
14402
+ const content = stripComments(rawContent);
14397
14403
  let match2;
14398
14404
  importRegex.lastIndex = 0;
14399
14405
  while ((match2 = importRegex.exec(content)) !== null) {
@@ -17947,6 +17953,7 @@ Analyzing cascading impact...`));
17947
17953
  const title = count > 0 ? `\uD83D\uDD17 Broken Internal Links (${count})` : `✅ Internal Links (0) - All good!`;
17948
17954
  choices.push({ title, value: "broken-links" });
17949
17955
  }
17956
+ choices.push({ title: source_default.blue("\uD83D\uDD04 Rescan"), value: "rescan" });
17950
17957
  if (showBack) {
17951
17958
  choices.push({ title: source_default.cyan("← Back"), value: "back" });
17952
17959
  }
@@ -17980,6 +17987,14 @@ Analyzing cascading impact...`));
17980
17987
  if (selected === "back") {
17981
17988
  return "back";
17982
17989
  }
17990
+ if (selected === "rescan") {
17991
+ console.log(source_default.blue(`
17992
+ \uD83D\uDD04 Rescanning...
17993
+ `));
17994
+ const fresh = await scan(config);
17995
+ Object.assign(result, fresh);
17996
+ continue;
17997
+ }
17983
17998
  let action = "delete";
17984
17999
  if (!options.cleanup && !process.env.AUTO_FIX_EXPORTS) {
17985
18000
  const actionResponse = await import_prompts.default({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.44.8",
3
+ "version": "1.45.0",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [