pruny 1.2.7 → 1.2.9

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pruny
2
2
 
3
- Find and remove unused Next.js API routes. 🪓
3
+ Find and remove unused Next.js API routes & Nest.js Controllers. 🪓
4
4
 
5
5
  ## Install
6
6
 
@@ -19,7 +19,7 @@ pruny
19
19
  # Scan specific folder
20
20
  pruny --dir ./src
21
21
 
22
- # Delete unused routes
22
+ # Delete unused routes/controllers
23
23
  pruny --fix
24
24
 
25
25
  # Output as JSON
@@ -50,7 +50,7 @@ Create `pruny.config.json` (optional):
50
50
  "ignore": {
51
51
  "routes": ["/api/webhooks/**", "/api/cron/**"],
52
52
  "folders": ["node_modules", ".next", "dist"],
53
- "files": ["*.test.ts"]
53
+ "files": ["*.test.ts", "*.spec.ts"]
54
54
  },
55
55
  "extensions": [".ts", ".tsx", ".js", ".jsx"]
56
56
  }
@@ -58,7 +58,7 @@ Create `pruny.config.json` (optional):
58
58
 
59
59
  ## Features
60
60
 
61
- - 🔍 Detects unused Next.js API routes
61
+ - 🔍 Detects unused Next.js API routes & Nest.js Controller methods
62
62
  - 🗑️ `--fix` flag to delete unused routes
63
63
  - ⚡ Auto-detects `vercel.json` cron routes
64
64
  - 📁 Default ignores: `node_modules`, `.next`, `dist`, `.git`
@@ -66,10 +66,11 @@ Create `pruny.config.json` (optional):
66
66
 
67
67
  ## How it works
68
68
 
69
- 1. Finds all `app/api/**/route.ts` files
70
- 2. Scans codebase for `fetch('/api/...')` patterns
71
- 3. Reports routes with no references
72
- 4. `--fix` deletes the route folder
69
+ 1. **Next.js**: Finds all `app/api/**/route.ts` files.
70
+ 2. **Nest.js**: Finds all `*.controller.ts` files and extracts mapped routes (e.g., `@Get('users')`).
71
+ 3. Scans codebase for client-side usages (e.g., `fetch`, `axios`, or string literals matching the route).
72
+ 4. Reports routes with no detected references.
73
+ 5. `--fix` deletes the unused route file or method.
73
74
 
74
75
  ## License
75
76
 
package/dist/index.js CHANGED
@@ -9315,6 +9315,9 @@ var IGNORED_EXPORT_NAMES = new Set([
9315
9315
  "preferredRegion",
9316
9316
  "metadata",
9317
9317
  "viewport",
9318
+ "dynamicParams",
9319
+ "maxDuration",
9320
+ "generateViewport",
9318
9321
  "GET",
9319
9322
  "POST",
9320
9323
  "PUT",
@@ -9761,7 +9764,7 @@ Config:`));
9761
9764
  Unused: result.unusedFiles.unused
9762
9765
  });
9763
9766
  }
9764
- if (result.unusedExports && result.unusedExports.exports.length > 0) {
9767
+ if (result.unusedExports) {
9765
9768
  summary.push({
9766
9769
  Category: "Exported Items",
9767
9770
  Total: result.unusedExports.total,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pruny",
3
- "version": "1.2.7",
4
- "description": "Find and remove unused Next.js API routes",
3
+ "version": "1.2.9",
4
+ "description": "Find and remove unused Next.js API routes & Nest.js Controllers",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",