repo-dive 0.6.0 → 0.8.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 +37 -14
- package/dist/cli.js +1238 -765
- package/dist/config.d.ts +19 -0
- package/dist/config.js +3 -0
- package/dist/dashboard/assets/index-DsPwNuo-.js +9 -0
- package/dist/dashboard/assets/index-LsGxMZ0D.css +2 -0
- package/dist/dashboard/index.html +2 -2
- package/package.json +8 -2
- package/dist/dashboard/assets/index-BE4NtGWB.js +0 -9
- package/dist/dashboard/assets/index-C85j_Rw0.css +0 -2
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# repo-dive
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
_Dive into a git repo's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard_ <!-- markdownlint-disable-line MD036 -- a tagline, not a heading -->
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/repo-dive)
|
|
6
|
+
[](https://www.npmjs.com/package/repo-dive)
|
|
7
|
+
[](LICENSE.md)
|
|
8
|
+
[](https://effect.website)
|
|
9
|
+
[](#ai-agents-mcp)
|
|
8
10
|
|
|
9
11
|
## What it does
|
|
10
12
|
|
|
11
|
-
Point
|
|
13
|
+
Point `repo-dive` at any git repository and get an explorable catalog of insights derived from its history:
|
|
12
14
|
|
|
13
15
|
```sh
|
|
14
16
|
cd /path/to/your/repo
|
|
@@ -27,10 +29,10 @@ See [docs/specs](docs/specs/README.md) for the architecture and [docs/research/p
|
|
|
27
29
|
|
|
28
30
|
## Usage
|
|
29
31
|
|
|
30
|
-
Run from inside the repository you want to analyze (or pass `--repo /path/to/repo`)
|
|
32
|
+
Run from inside the repository you want to analyze (or pass `--repo /path/to/repo`).
|
|
33
|
+
Node 22.13 or newer is required.
|
|
31
34
|
|
|
32
35
|
```sh
|
|
33
|
-
cd /path/to/your/repo
|
|
34
36
|
npx repo-dive # the whole pipeline: scan + index + dashboard
|
|
35
37
|
npx repo-dive scan # collect snapshots into .repo-dive/
|
|
36
38
|
npx repo-dive index # roll up into the metrics cube + dashboard data
|
|
@@ -38,9 +40,10 @@ npx repo-dive dashboard # serve the interactive dashboard
|
|
|
38
40
|
npx repo-dive status # show catalog coverage
|
|
39
41
|
npx repo-dive collectors # list available collectors
|
|
40
42
|
npx repo-dive report # export one shareable self-contained HTML file
|
|
43
|
+
npx repo-dive mcp # serve the cube to AI agents (Model Context Protocol)
|
|
44
|
+
npx repo-dive gc # clean up the catalog interactively
|
|
45
|
+
npx repo-dive ignore # keep other tools out of the catalog
|
|
41
46
|
npx repo-dive query "SELECT metric, sum(value) FROM facts GROUP BY metric"
|
|
42
|
-
npx repo-dive mcp # serve the cube to AI agents (Model Context Protocol)
|
|
43
|
-
npx repo-dive gc # clean up the catalog interactively
|
|
44
47
|
```
|
|
45
48
|
|
|
46
49
|
`scan` walks the repository's history and runs collectors against every commit (or a sample, per collector), writing raw snapshots into a `.repo-dive/` catalog inside the analyzed repo.
|
|
@@ -52,12 +55,16 @@ Collectors so far:
|
|
|
52
55
|
- **churn** — lines added/deleted per commit, by file extension
|
|
53
56
|
- **file-types** — file count and bytes per extension at each commit's tree
|
|
54
57
|
- **directives** — eslint-disable comments by rule (block disables tracked as gray areas) and `@ts-ignore`/`@ts-expect-error`/`@ts-nocheck`
|
|
55
|
-
- **dependencies** —
|
|
58
|
+
- **dependencies** — resolved package totals from lockfiles, per package manager (pnpm, npm and yarn classic and berry), plus direct/dev/optional dependencies and manifest counts read straight from `package.json` files; version-aware, monorepo-aware and extensible to more managers
|
|
56
59
|
- **todo-comments** — TODO/FIXME/HACK/XXX counts
|
|
57
|
-
- **languages** —
|
|
60
|
+
- **languages** — lines and file count per language across a commit's source files (lockfiles, minified bundles and generated data excluded)
|
|
58
61
|
- **survival** — `git blame` line survival by extension, author and age cohort (sampled monthly)
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
The catalog hides itself from git, but other tools that walk the repository (prettier, markdownlint, cspell, docker builds) each read one ignore file at its root.
|
|
64
|
+
`scan` warns when the catalog is missing from those; `repo-dive ignore` adds it to every one of them.
|
|
65
|
+
|
|
66
|
+
`index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` — a facts-by-categories cube, rebuildable at any time — plus `dashboard.json`.
|
|
67
|
+
`dashboard` then serves a local React app with interactive charts: languages over time, a GitHub-style commit calendar, monthly commits with AI-assisted share, churn, lint-suppression trends, dependency counts over time, code survival by cohort and author, and more.
|
|
61
68
|
|
|
62
69
|
## Configuration
|
|
63
70
|
|
|
@@ -86,12 +93,18 @@ export default defineConfig({
|
|
|
86
93
|
// First day of the week in calendar-shaped charts (default "monday").
|
|
87
94
|
weekStartsOn: "monday",
|
|
88
95
|
},
|
|
96
|
+
catalog: {
|
|
97
|
+
// Where snapshots, caches and the cube live (default ".repo-dive").
|
|
98
|
+
dir: ".repo-dive",
|
|
99
|
+
},
|
|
89
100
|
});
|
|
90
101
|
```
|
|
91
102
|
|
|
92
103
|
`charts.weekStartsOn` sets the first day of the week in calendar-shaped charts such as the commit calendar (`"monday"` by default, `"sunday"` also supported).
|
|
93
|
-
`contributors.aliases` merges the multiple identities one person commits under (work + personal email, GitHub noreply, name variants) so attribution, the contributors table and code-survival-by-contributor count them once
|
|
94
|
-
|
|
104
|
+
`contributors.aliases` merges the multiple identities one person commits under (work + personal email, GitHub noreply, name variants) so attribution, the contributors table and code-survival-by-contributor count them once.
|
|
105
|
+
A group can also carry a `displayName`, a profile `url` and a `kind` — `human`/`bot`/`ai`, otherwise auto-derived, with the dashboard badging bots and AI agents and listing them apart from humans.
|
|
106
|
+
`catalog.dir` moves the catalog; point it outside the repository (e.g. `"../repo-dive-catalogs/my-repo"`) to leave the analyzed working tree untouched altogether, ignore files included.
|
|
107
|
+
Apart from `catalog`, which every command needs, the config is read by `index`.
|
|
95
108
|
See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
|
|
96
109
|
|
|
97
110
|
## AI agents (MCP)
|
|
@@ -139,9 +152,19 @@ pnpm lint
|
|
|
139
152
|
pnpm fix
|
|
140
153
|
```
|
|
141
154
|
|
|
155
|
+
To see how heavy the published package would be:
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
pnpm build && pnpm report-package-size
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
It prints the tarball and unpacked sizes with a per-file breakdown, comparing them against the previous measurement.
|
|
162
|
+
CI runs the same report on every push and adds it to the job summary, comparing against the latest `main`.
|
|
163
|
+
|
|
142
164
|
## Acknowledgements
|
|
143
165
|
|
|
144
166
|
Thanks to [@WillJack20](https://github.com/WillJack20) for suggesting the name **repo-dive**.
|
|
167
|
+
The project was published as [repo-insighter](https://www.npmjs.com/package/repo-insighter) before 0.4.0.
|
|
145
168
|
|
|
146
169
|
## License
|
|
147
170
|
|