pruneplan 0.1.3 → 0.1.4
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 +2 -0
- package/bin/pruneplan.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ Use `--json` to print a machine-readable report, including warnings and Knip ver
|
|
|
36
36
|
npx pruneplan --json
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
The JSON report is written to stdout without progress text and starts with `schemaVersion: 1`. Consumers can use this field to check the report format before reading `knip`, `candidates`, and `warnings`. Any errors are written to stderr.
|
|
40
|
+
|
|
39
41
|
## Review and safety
|
|
40
42
|
|
|
41
43
|
- The default command is preview-only and does not modify files.
|
package/bin/pruneplan.js
CHANGED
|
@@ -228,11 +228,11 @@ async function main() {
|
|
|
228
228
|
const knip = await findKnip(directory);
|
|
229
229
|
knip.version = await getKnipVersion(directory);
|
|
230
230
|
|
|
231
|
-
stdout.write(`Scanning ${path.relative(process.cwd(), directory) || '.'} with Knip…\n`);
|
|
231
|
+
if (!options.json) stdout.write(`Scanning ${path.relative(process.cwd(), directory) || '.'} with Knip…\n`);
|
|
232
232
|
const report = await scanProject(directory, knip);
|
|
233
233
|
const plan = collectPlan(report);
|
|
234
234
|
if (options.json) {
|
|
235
|
-
stdout.write(`${JSON.stringify({ knip: { version: knip.version, source: knip.source }, ...plan }, null, 2)}\n`);
|
|
235
|
+
stdout.write(`${JSON.stringify({ schemaVersion: 1, knip: { version: knip.version, source: knip.source }, ...plan }, null, 2)}\n`);
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
238
|
displayPlan(plan, manager, knip);
|