prunify 0.1.6 → 0.1.8

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
@@ -89,15 +89,22 @@ npx prunify --ci
89
89
 
90
90
  Summary
91
91
 
92
- ┌─────────────────────────────┬───────┬──────────────────┐
93
- Check │ Found │ Output File │
94
- ├─────────────────────────────┼───────┼──────────────────┤
95
- Dead Code (files + exports) │ 7 │ dead-code.txt │
96
- Circular Dependencies 2 │ circular.txt │
97
- Duplicate Clusters │ 3 │ dupes.md │
98
- │ Unused Packages │ 4 │ deps.md │
99
- │ Unused Assets │ 5 │ assets.md │
100
- └─────────────────────────────┴───────┴──────────────────┘
92
+ ========================================
93
+ DEAD CODE REPORT
94
+ Safe to delete : 3
95
+ Transitively dead : 1
96
+ Dead exports : 3
97
+ Recoverable : ~12.4 KB
98
+ ========================================
99
+
100
+ ┌───────────────────────────┬───────┬──────────────────┐
101
+ │ Check │ Found │ Output File │
102
+ ├───────────────────────────┼───────┼──────────────────┤
103
+ │ Circular Dependencies │ 2 │ circular.txt │
104
+ │ Duplicate Clusters │ 3 │ dupes.md │
105
+ │ Unused Packages │ 4 │ deps.md │
106
+ │ Unused Assets │ 5 │ assets.md │
107
+ └───────────────────────────┴───────┴──────────────────┘
101
108
  ```
102
109
 
103
110
  ---
@@ -168,6 +175,7 @@ All reports are written to `prunify-reports/` (auto-added to `.gitignore`).
168
175
 
169
176
  | File | Contents |
170
177
  |------|----------|
178
+ | `ai_prompt.tsx` | **Agent handoff:** exports `PRUNIFY_CLEANUP_AGENT_PROMPT` — paste into Cursor/Copilot with the other reports attached; includes safety rules and cleanup order. Regenerated every run. |
171
179
  | `dead-code.txt` | Header with tool version + time, then **Safe to delete**, **Transitively dead**, and **Dead exports** sections (sizes and optional chains). Used by `--delete` when re-running deletes. |
172
180
  | `dupes.md` | Duplicate function clusters with AI-ready refactor prompts |
173
181
  | `circular.txt` | Circular dependency chains (relative paths; header with tool version + time) |
@@ -184,7 +192,7 @@ prunify builds a directed import graph (with `tsconfig.json` path aliases) and a
184
192
 
185
193
  1. **Safe to delete** — No other project file imports this file, and it is not treated as an app entry (e.g. Next.js `pages/` / `app/` routes) or a known framework/config file (`next.config.*`, `middleware.*`, `tailwind.config.*`, etc.).
186
194
  2. **Transitively dead** — The file is only imported by files that are already dead; removing the safe-to-delete roots would leave it orphaned.
187
- 3. **Dead exports** — The file is still used, but specific named exports are never imported by name elsewhere (namespace imports count as “all exports used”).
195
+ 3. **Dead exports** — The file is still used, but specific named exports are never imported by name elsewhere (namespace imports count as “all exports used”). Files under **`pages/`** / **`src/pages/`**, route trees like **`src/routes/`**, **`src/views/`**, **`src/screens/`**, and Next.js App Router entry files (**`page.tsx`**, **`layout.tsx`**, **`route.ts`**, etc. under **`app/`** / **`src/app/`**) are **excluded** — the framework consumes those exports without normal `import` edges.
188
196
 
189
197
  **Why not “reachable from entry” only?** A pure reachability scan from entry points can mark heavily shared modules as dead if any link in the chain fails to resolve. The importer-based model matches the usual meaning of “nothing uses this file.”
190
198