pruny 1.2.8 → 1.2.10
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 +9 -8
- package/dist/index.js +8 -0
- package/package.json +2 -2
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.
|
|
71
|
-
3.
|
|
72
|
-
4.
|
|
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,14 @@ var IGNORED_EXPORT_NAMES = new Set([
|
|
|
9315
9315
|
"preferredRegion",
|
|
9316
9316
|
"metadata",
|
|
9317
9317
|
"viewport",
|
|
9318
|
+
"dynamicParams",
|
|
9319
|
+
"maxDuration",
|
|
9320
|
+
"generateViewport",
|
|
9321
|
+
"generateSitemaps",
|
|
9322
|
+
"generateImageMetadata",
|
|
9323
|
+
"alt",
|
|
9324
|
+
"size",
|
|
9325
|
+
"contentType",
|
|
9318
9326
|
"GET",
|
|
9319
9327
|
"POST",
|
|
9320
9328
|
"PUT",
|
package/package.json
CHANGED