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 CHANGED
@@ -1,14 +1,16 @@
1
1
  # repo-dive
2
2
 
3
- Dive into a git repository's history: per-commit snapshots, an indexed metrics catalog and an interactive dashboard.
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
- > **Still 0.x.**
6
- > The pipeline works end to end and has been run against repositories with tens of thousands of commits, but interfaces, the catalog format and the collector roster still move between minor versions — pin the version if you script against it.
7
- > Renamed from `repo-insighter` in 0.4.0.
5
+ [![npm version](https://img.shields.io/npm/v/repo-dive?logo=npm&color=3c7ef6&labelColor=333)](https://www.npmjs.com/package/repo-dive)
6
+ [![npm downloads](https://img.shields.io/npm/dm/repo-dive?logo=npm&color=3c7ef6&labelColor=333)](https://www.npmjs.com/package/repo-dive)
7
+ [![License](https://img.shields.io/badge/license-BSD--3--Clause-3c7ef6?logo=opensourceinitiative&logoColor=white&labelColor=333)](LICENSE.md)
8
+ [![Effect](https://img.shields.io/badge/Effect-v4-3c7ef6?logo=effect&logoColor=white&labelColor=333)](https://effect.website)
9
+ [![MCP](https://img.shields.io/badge/MCP-ready-3c7ef6?logo=modelcontextprotocol&logoColor=white&labelColor=333)](#ai-agents-mcp)
8
10
 
9
11
  ## What it does
10
12
 
11
- Point it at any git repository and get an explorable catalog of insights derived from its history:
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** — total resolved packages from package-manager lockfiles, per package manager (pnpm, npm and yarn classic and berry; version-aware and monorepo-aware, extensible to more managers), plus direct/dev/optional dependencies and the number of manifests read straight from `package.json` files
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** — tokei language/LOC breakdown (sampled monthly; markdown counted whole)
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
- `index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` (a facts-by-categories cube, rebuildable at any time) plus `dashboard.json`, and `dashboard` 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.
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; a group can also carry a `displayName`, a profile `url` and a `kind` (`human`/`bot`/`ai`, otherwise auto-derived — the dashboard badges bots and AI agents and lists them apart from humans).
94
- The config is read by `index`.
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