pruny 1.7.1 → 1.8.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 +12 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9351,8 +9351,15 @@ async function scanUnusedExports(config) {
9351
9351
  let allExportsCount = 0;
9352
9352
  const inlineExportRegex = /^export\s+(?:async\s+)?(?:const|let|var|function|type|interface|enum|class)\s+([a-zA-Z0-9_$]+)/gm;
9353
9353
  const blockExportRegex = /^export\s*\{([^}]+)\}/gm;
9354
+ console.log(`\uD83D\uDCDD Scanning ${allFiles.length} files for exports...`);
9355
+ let processedFiles = 0;
9354
9356
  for (const file of allFiles) {
9355
9357
  try {
9358
+ processedFiles++;
9359
+ if (processedFiles % 50 === 0) {
9360
+ const percent = Math.round(processedFiles / allFiles.length * 100);
9361
+ process.stdout.write(`\r Progress: ${processedFiles}/${allFiles.length} files (${percent}%)...`);
9362
+ }
9356
9363
  const content = readFileSync3(join3(cwd, file), "utf-8");
9357
9364
  totalContents.set(file, content);
9358
9365
  const lines = content.split(`
@@ -9381,6 +9388,9 @@ async function scanUnusedExports(config) {
9381
9388
  }
9382
9389
  } catch {}
9383
9390
  }
9391
+ if (processedFiles > 0) {
9392
+ process.stdout.write("\r" + " ".repeat(60) + "\r");
9393
+ }
9384
9394
  function addExport(file, name, line) {
9385
9395
  if (name && !IGNORED_EXPORT_NAMES.has(name)) {
9386
9396
  if (!exportMap.has(file))
@@ -9391,6 +9401,7 @@ async function scanUnusedExports(config) {
9391
9401
  return false;
9392
9402
  }
9393
9403
  const unusedExports = [];
9404
+ console.log(`\uD83D\uDD0D Checking usage of ${allExportsCount} exports...`);
9394
9405
  for (const [file, exports] of exportMap.entries()) {
9395
9406
  for (const exp of exports) {
9396
9407
  let isUsed = false;
@@ -9689,7 +9700,7 @@ var DEFAULT_CONFIG = {
9689
9700
  dir: "./",
9690
9701
  ignore: {
9691
9702
  routes: [],
9692
- folders: ["node_modules", ".next", "dist", ".git", "coverage", ".turbo"],
9703
+ folders: ["node_modules", ".next", "dist", ".git", "coverage", ".turbo", "build", "out", ".cache", ".vercel", ".contentlayer", ".docusaurus", "target", "vendor"],
9693
9704
  files: [
9694
9705
  "*.test.ts",
9695
9706
  "*.spec.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [