dir-analysis-tool 3.4.0 → 3.5.0
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 +29 -6
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{shared-CikLbzoj.js → shared-CyXKu5cI.js} +1146 -1098
- package/package.json +5 -2
- package/report.schema.json +1117 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
3
|
<a href="https://www.npmjs.com/package/dir-analysis-tool">
|
|
4
|
-
<img src=".github/assets/dir-analysis-tool-banner.png" alt="dir-analysis-tool: fast, memory-bounded directory analysis for your terminal and CI" width="100%" />
|
|
4
|
+
<img src="https://raw.githubusercontent.com/KhaledSaeed18/dir-analysis-tool/main/.github/assets/dir-analysis-tool-banner.png" alt="dir-analysis-tool: fast, memory-bounded directory analysis for your terminal and CI" width="100%" />
|
|
5
5
|
</a>
|
|
6
6
|
|
|
7
7
|
<h1>dir-analysis-tool</h1>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<a href="https://www.npmjs.com/package/dir-analysis-tool"><img src="https://shieldcn.dev/npm/dw/dir-analysis-tool.svg" alt="npm downloads" /></a>
|
|
14
14
|
<a href="https://github.com/KhaledSaeed18/dir-analysis-tool/actions/workflows/ci.yml"><img src="https://shieldcn.dev/github/ci/KhaledSaeed18/dir-analysis-tool.svg" alt="CI status" /></a>
|
|
15
15
|
<a href="https://www.npmjs.com/package/dir-analysis-tool"><img src="https://shieldcn.dev/npm/types/dir-analysis-tool.svg" alt="TypeScript types" /></a>
|
|
16
|
-
<a href="LICENSE"><img src="https://shieldcn.dev/npm/license/dir-analysis-tool.svg?variant=secondary" alt="License: MIT" /></a>
|
|
16
|
+
<a href="https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/LICENSE"><img src="https://shieldcn.dev/npm/license/dir-analysis-tool.svg?variant=secondary" alt="License: MIT" /></a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
19
|
<p>
|
|
@@ -55,6 +55,7 @@ npx dir-analysis-tool
|
|
|
55
55
|
- [Agent skill](#agent-skill)
|
|
56
56
|
- [How it works](#how-it-works)
|
|
57
57
|
- [Exit codes](#exit-codes)
|
|
58
|
+
- [Stability](#stability)
|
|
58
59
|
- [Migrating from v2](#migrating-from-v2)
|
|
59
60
|
- [FAQ](#faq)
|
|
60
61
|
|
|
@@ -363,7 +364,7 @@ A GitHub Actions step that posts a report to the job summary and enforces a budg
|
|
|
363
364
|
|
|
364
365
|
Only the report goes to stdout. Progress, warnings, and status messages go to stderr, so `dat . --json > out.json` and pipes always get clean data.
|
|
365
366
|
|
|
366
|
-
JSON is versioned (`"schemaVersion": 3`). Sizes are raw bytes, dates are ISO 8601, and paths are relative to `root` with `/` separators on every platform.
|
|
367
|
+
JSON is versioned (`"schemaVersion": 3`). Sizes are raw bytes, dates are ISO 8601, and paths are relative to `root` with `/` separators on every platform. Every field is described by a JSON Schema that ships in the package as `dir-analysis-tool/report.schema.json` ([view it](https://unpkg.com/dir-analysis-tool@3/report.schema.json)), covering `analyze`, `compare`, `explain`, and compact output, and by the [types](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/src/types.ts). In short:
|
|
367
368
|
|
|
368
369
|
```jsonc
|
|
369
370
|
{
|
|
@@ -512,7 +513,7 @@ An official [Agent Skill](https://agentskills.io) lets coding agents such as Cla
|
|
|
512
513
|
npx skills add KhaledSaeed18/dir-analysis-tool --skill dir-analysis-tool
|
|
513
514
|
```
|
|
514
515
|
|
|
515
|
-
Then ask in your own words, for example "why is this repo so big?" or "fail CI if `dist` goes over 2 MB". See [skills/README.md](skills/README.md) for other ways to install it, tested agents, and the evals.
|
|
516
|
+
Then ask in your own words, for example "why is this repo so big?" or "fail CI if `dist` goes over 2 MB". See [skills/README.md](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/skills/README.md) for other ways to install it, tested agents, and the evals.
|
|
516
517
|
|
|
517
518
|
## How it works
|
|
518
519
|
|
|
@@ -549,6 +550,16 @@ The benchmark script reports scan and duplicate timings plus process peak RSS (n
|
|
|
549
550
|
| `2` | A budget failed |
|
|
550
551
|
| `130` | Interrupted (Ctrl+C) |
|
|
551
552
|
|
|
553
|
+
## Stability
|
|
554
|
+
|
|
555
|
+
dir-analysis-tool follows semantic versioning, and these hold for every 3.x release:
|
|
556
|
+
|
|
557
|
+
- **Commands, options and exit codes.** Commands, options, budget metrics, config keys and exit codes stay as they are. New ones may be added, and old spellings that still work keep working.
|
|
558
|
+
- **JSON.** `schemaVersion` stays `3`, and `dat explain --json` keeps `explainVersion: 1`. Fields are only added, never removed, renamed or given a new type, and [`report.schema.json`](https://unpkg.com/dir-analysis-tool@3/report.schema.json) describes every one. Validate against it, and allow fields you don't know.
|
|
559
|
+
- **Library.** Exports keep their names and signatures; options and result fields are only added.
|
|
560
|
+
- **What a number means.** A metric keeps its definition (`bytes` is the apparent size, `diskBytes` the allocated size, hard links count once). A release that fixes a wrong count is a patch, and the changelog says what changed.
|
|
561
|
+
- **Not covered.** The wording and layout of the pretty, Markdown and HTML reports, and of messages on stderr, are for people and may change. CSV keeps its columns and only adds new ones at the end. Scripts should read `--json`.
|
|
562
|
+
|
|
552
563
|
## Migrating from v2
|
|
553
564
|
|
|
554
565
|
v3 is a rewrite with a new output format. Most commands keep working unchanged.
|
|
@@ -577,8 +588,20 @@ v3 is a rewrite with a new output format. Most commands keep working unchanged.
|
|
|
577
588
|
|
|
578
589
|
## Contributing
|
|
579
590
|
|
|
580
|
-
Bug reports and pull requests are welcome.
|
|
591
|
+
Bug reports and pull requests are welcome. The most useful report is a result you believe is wrong: open a [wrong result issue](https://github.com/KhaledSaeed18/dir-analysis-tool/issues/new?template=wrong_result.yml) with the command, a small directory layout and the `--json` report. For a crash, an idea for a new report or a gap in these docs, [choose an issue form](https://github.com/KhaledSaeed18/dir-analysis-tool/issues/new/choose).
|
|
592
|
+
|
|
593
|
+
Development needs Node.js 22.18 or later and pnpm (the version is pinned in `package.json`), on macOS, Linux or Windows:
|
|
594
|
+
|
|
595
|
+
```bash
|
|
596
|
+
pnpm install
|
|
597
|
+
pnpm dev ~/Downloads -d # run the CLI from source
|
|
598
|
+
pnpm check # everything CI runs
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
[CONTRIBUTING.md](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/CONTRIBUTING.md) covers the setup, the product rules, commit messages and how releases work; [AGENTS.md](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/AGENTS.md) maps the code. Every `feat` or `fix` merged to `main` is released to npm.
|
|
602
|
+
|
|
603
|
+
Everyone taking part follows the [Code of Conduct](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/CODE_OF_CONDUCT.md). Report security vulnerabilities privately, as [SECURITY.md](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/SECURITY.md) describes, and accessibility barriers as [ACCESSIBILITY.md](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/ACCESSIBILITY.md) describes.
|
|
581
604
|
|
|
582
605
|
## License
|
|
583
606
|
|
|
584
|
-
[MIT](LICENSE), by [Khaled Saeed](https://github.com/KhaledSaeed18).
|
|
607
|
+
[MIT](https://github.com/KhaledSaeed18/dir-analysis-tool/blob/main/LICENSE), by [Khaled Saeed](https://github.com/KhaledSaeed18).
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as errorMessage, C as MAX_EXPLAIN_LIMIT, D as outsideRootError, E as isOutside,
|
|
2
|
+
import { $ as errorMessage, C as MAX_EXPLAIN_LIMIT, D as outsideRootError, E as isOutside, G as parseSize, H as formatBudgetActual, I as Excluder, L as joinRelative, M as analyze, O as compare, P as listDirectories, Q as errorCode, T as explainSkips, U as parseBudget, W as formatBytes, X as AbortError, Y as parsePointInTime, Z as DatError, a as renderComparisonCsv, c as renderAnalysis, d as escapeControlInLines, f as formatCount, h as supportsColor, i as renderAnalysisCsv, k as compactAnalysis, l as renderComparison, m as createStyle, n as renderSkipsExplanation, o as renderAnalysisMarkdown, p as stringifyJson, q as VERSION, r as renderAnalysisHtml, s as renderComparisonMarkdown, t as renderPathExplanation, u as escapeControl, v as loadConfig, w as explainPath } from "./shared-CyXKu5cI.js";
|
|
3
3
|
import { existsSync, watch } from "node:fs";
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { X as AbortError, B as BUDGET_METRICS, K as CATEGORIES, g as CONFIG_FILE_NAMES, N as DEFAULT_CONCURRENCY,
|
|
1
|
+
export { X as AbortError, B as BUDGET_METRICS, K as CATEGORIES, g as CONFIG_FILE_NAMES, N as DEFAULT_CONCURRENCY, F as DEFAULT_EXCLUDES, x as DEFAULT_EXPLAIN_LIMIT, A as DEFAULT_LARGE_FILE_THRESHOLD, j as DEFAULT_STALE_AGE, Z as DatError, S as EXPLAIN_VERSION, C as MAX_EXPLAIN_LIMIT, q as VERSION, M as analyze, y as buildJsonSchema, R as classify, k as compactAnalysis, O as compare, m as createStyle, V as evaluateBudgets, w as explainPath, T as explainSkips, z as extensionOf, _ as findConfigFile, W as formatBytes, P as listDirectories, v as loadConfig, U as parseBudget, J as parseDuration, Y as parsePointInTime, G as parseSize, c as renderAnalysis, i as renderAnalysisCsv, r as renderAnalysisHtml, o as renderAnalysisMarkdown, l as renderComparison, a as renderComparisonCsv, s as renderComparisonMarkdown, t as renderPathExplanation, n as renderSkipsExplanation, b as validateConfig } from "./shared-CyXKu5cI.js";
|