pruneguard 0.6.1 → 0.6.3
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 +64 -1
- package/package.json +9 -9
- package/report_schema.json +14 -0
- package/review_report_schema.json +14 -0
package/README.md
CHANGED
|
@@ -5,12 +5,59 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/pruneguard)
|
|
6
6
|
[](https://github.com/ferc/pruneguard/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
+
Built on [oxc](https://oxc.rs), pruneguard scans a 5,000+ file repository in under 6 seconds cold, and delivers sub-millisecond responses with the warm daemon. That is 10-50x faster than JS-based alternatives -- fast enough for an AI agent to call on every single code change.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Use with AI agents
|
|
13
|
+
|
|
14
|
+
pruneguard was designed for AI agents: every command produces structured JSON, findings carry confidence scores, and remediation plans contain step-by-step instructions agents can execute directly. Because it runs in milliseconds, your agent can call it after every code change -- something that is impractical with slower JS-based tools.
|
|
15
|
+
|
|
16
|
+
### Prompt: find and remove dead code
|
|
17
|
+
|
|
18
|
+
Copy-paste this into your agent configuration (`CLAUDE.md`, `.cursorrules`, Copilot instructions, etc.):
|
|
19
|
+
|
|
20
|
+
````markdown
|
|
21
|
+
When asked to clean up dead code, or after making significant refactoring
|
|
22
|
+
changes, run `npx pruneguard --format json scan` to detect unused exports,
|
|
23
|
+
dead files, and phantom dependencies. For each finding with high confidence,
|
|
24
|
+
run `npx pruneguard --format json safe-delete <target>` to confirm it is safe
|
|
25
|
+
to remove. Only delete targets that pruneguard marks as safe. Follow the
|
|
26
|
+
deletionOrder array when removing multiple files. After all deletions, re-run
|
|
27
|
+
the scan with --no-cache to verify no new issues were introduced. Do not
|
|
28
|
+
delete anything with low confidence without asking the user first.
|
|
29
|
+
````
|
|
30
|
+
|
|
31
|
+
### Prompt: set up pruneguard and guard against new dead code
|
|
32
|
+
|
|
33
|
+
````markdown
|
|
34
|
+
Add pruneguard as a dev dependency and configure it to catch dead code on
|
|
35
|
+
every change:
|
|
36
|
+
|
|
37
|
+
1. Run `npm install -D pruneguard` (or the equivalent for the project's
|
|
38
|
+
package manager).
|
|
39
|
+
2. Add these scripts to package.json:
|
|
40
|
+
- "review": "pruneguard --changed-since origin/main"
|
|
41
|
+
- "scan": "pruneguard scan"
|
|
42
|
+
- "prune:check": "pruneguard --changed-since origin/main --format json"
|
|
43
|
+
3. Run `npx pruneguard init` to generate pruneguard.json with schema
|
|
44
|
+
reference.
|
|
45
|
+
4. If the project uses CI (GitHub Actions), add a step that runs
|
|
46
|
+
`npx pruneguard --changed-since origin/main --format json` on pull
|
|
47
|
+
requests to block PRs that introduce new dead code.
|
|
48
|
+
|
|
49
|
+
pruneguard is a compiled Rust binary -- scanning takes milliseconds with the
|
|
50
|
+
warm daemon, so it adds no meaningful overhead to the development workflow or
|
|
51
|
+
CI pipeline.
|
|
52
|
+
````
|
|
53
|
+
|
|
8
54
|
---
|
|
9
55
|
|
|
10
56
|
## Install
|
|
11
57
|
|
|
12
58
|
```sh
|
|
13
|
-
|
|
59
|
+
npx pruneguard # zero-install, scan your repo right now
|
|
60
|
+
npm install -D pruneguard # or add it as a dev dependency
|
|
14
61
|
```
|
|
15
62
|
|
|
16
63
|
The package automatically installs the correct platform-specific native binary. No Rust toolchain, no compilation, no native addons -- just `npm install` and go.
|
|
@@ -381,6 +428,22 @@ Override with `"frameworks": { "next": "off" }` in config.
|
|
|
381
428
|
|
|
382
429
|
---
|
|
383
430
|
|
|
431
|
+
## Performance
|
|
432
|
+
|
|
433
|
+
pruneguard is a compiled Rust binary powered by [oxc](https://oxc.rs) for parsing and module resolution. No V8 or Node.js runtime is on the hot path.
|
|
434
|
+
|
|
435
|
+
| Scenario | Latency |
|
|
436
|
+
|---|---|
|
|
437
|
+
| Warm daemon (`review`, `impact`, `explain`) on a small repo | < 10 ms |
|
|
438
|
+
| Warm daemon on a medium repo (1,000-2,000 files) | < 50 ms |
|
|
439
|
+
| Warm daemon on a large repo (5,000+ files) | < 150 ms |
|
|
440
|
+
| Cold one-shot scan, medium repo | < 2 s |
|
|
441
|
+
| Cold one-shot scan, 5,000+ file repo | < 6 s |
|
|
442
|
+
|
|
443
|
+
JS-based alternatives typically take 30-60 seconds on the same large repositories -- making them too slow for an AI agent to call on every code change or for a tight inner development loop. pruneguard's speed means you can treat dead-code detection as a routine check rather than a scheduled chore.
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
384
447
|
## Requirements
|
|
385
448
|
|
|
386
449
|
- Node.js >= 18
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pruneguard",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Repo truth engine for JS/TS monorepos",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@pruneguard/cli-darwin-arm64": "0.6.
|
|
49
|
-
"@pruneguard/cli-darwin-x64": "0.6.
|
|
50
|
-
"@pruneguard/cli-linux-arm64-gnu": "0.6.
|
|
51
|
-
"@pruneguard/cli-linux-arm64-musl": "0.6.
|
|
52
|
-
"@pruneguard/cli-linux-x64-gnu": "0.6.
|
|
53
|
-
"@pruneguard/cli-linux-x64-musl": "0.6.
|
|
54
|
-
"@pruneguard/cli-win32-arm64-msvc": "0.6.
|
|
55
|
-
"@pruneguard/cli-win32-x64-msvc": "0.6.
|
|
48
|
+
"@pruneguard/cli-darwin-arm64": "0.6.3",
|
|
49
|
+
"@pruneguard/cli-darwin-x64": "0.6.3",
|
|
50
|
+
"@pruneguard/cli-linux-arm64-gnu": "0.6.3",
|
|
51
|
+
"@pruneguard/cli-linux-arm64-musl": "0.6.3",
|
|
52
|
+
"@pruneguard/cli-linux-x64-gnu": "0.6.3",
|
|
53
|
+
"@pruneguard/cli-linux-x64-musl": "0.6.3",
|
|
54
|
+
"@pruneguard/cli-win32-arm64-msvc": "0.6.3",
|
|
55
|
+
"@pruneguard/cli-win32-x64-msvc": "0.6.3"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=18.0.0"
|
package/report_schema.json
CHANGED
|
@@ -646,6 +646,20 @@
|
|
|
646
646
|
"enum": [
|
|
647
647
|
"duplicate-export"
|
|
648
648
|
]
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"description": "A dependency is imported in source code but not declared in package.json.",
|
|
652
|
+
"type": "string",
|
|
653
|
+
"enum": [
|
|
654
|
+
"unlisted-dependency"
|
|
655
|
+
]
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"description": "An exported type (interface or type alias) is unused.",
|
|
659
|
+
"type": "string",
|
|
660
|
+
"enum": [
|
|
661
|
+
"unused-type"
|
|
662
|
+
]
|
|
649
663
|
}
|
|
650
664
|
]
|
|
651
665
|
},
|
|
@@ -350,6 +350,20 @@
|
|
|
350
350
|
"enum": [
|
|
351
351
|
"duplicate-export"
|
|
352
352
|
]
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"description": "A dependency is imported in source code but not declared in package.json.",
|
|
356
|
+
"type": "string",
|
|
357
|
+
"enum": [
|
|
358
|
+
"unlisted-dependency"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"description": "An exported type (interface or type alias) is unused.",
|
|
363
|
+
"type": "string",
|
|
364
|
+
"enum": [
|
|
365
|
+
"unused-type"
|
|
366
|
+
]
|
|
353
367
|
}
|
|
354
368
|
]
|
|
355
369
|
},
|