repo-dive 0.18.3 → 0.19.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 +16 -5
- package/dist/cli.js +18448 -29682
- package/dist/config.d.ts +42 -0
- package/dist/config.js +21 -0
- package/dist/dashboard/assets/index-BP8l3qEj.js +10 -0
- package/dist/dashboard/index.html +1 -1
- package/package.json +15 -13
- package/dist/dashboard/assets/index-CWo1eWlr.js +0 -10
package/README.md
CHANGED
|
@@ -71,15 +71,15 @@ Collectors so far:
|
|
|
71
71
|
- **directives** — `eslint-disable` and `oxlint-disable` comments by linter and rule (block disables tracked as gray areas) and `@ts-ignore`/`@ts-expect-error`/`@ts-nocheck`
|
|
72
72
|
- **dependencies** — resolved package totals from lockfiles, per package manager (pnpm, npm, yarn classic and yarn berry), plus direct/dev/optional dependencies and manifest counts read straight from `package.json` files; version-aware, monorepo-aware and extensible to more managers
|
|
73
73
|
- **todo-comments** — TODO/FIXME/HACK/XXX counts
|
|
74
|
-
- **languages** — lines and file count per language across a commit's source files (
|
|
75
|
-
- **survival** — `git blame` line survival by
|
|
76
|
-
- **file-survival** — file survival by
|
|
74
|
+
- **languages** — lines and file count per language across a commit's source files (test data, assets, generated and vendored files excluded)
|
|
75
|
+
- **survival** — `git blame` line survival by file, author and age cohort (sampled monthly)
|
|
76
|
+
- **file-survival** — file survival by file, creator and creation cohort, for every tracked file, renames followed (sampled monthly)
|
|
77
77
|
|
|
78
78
|
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.
|
|
79
79
|
`scan` warns when the catalog is missing from those; `repo-dive ignore` adds it to every one that needs it, writing the entry in the shape the file is already written in and skipping the files whose tool learns about the catalog elsewhere.
|
|
80
80
|
|
|
81
81
|
`index` normalizes raw snapshots into `.repo-dive/index/metrics.sqlite` — a facts-by-categories cube, rebuildable at any time — plus `dashboard.json`.
|
|
82
|
-
`dashboard` then serves a local React app with interactive charts: languages over time, file counts 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.
|
|
82
|
+
`dashboard` then serves a local React app with interactive charts: languages over time, file counts over time, a split of both by file purpose (production, tests, docs, …), 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.
|
|
83
83
|
|
|
84
84
|
## Configuration
|
|
85
85
|
|
|
@@ -108,6 +108,16 @@ export default defineConfig({
|
|
|
108
108
|
// First day of the week in calendar-shaped charts (default "monday").
|
|
109
109
|
weekStartsOn: "monday",
|
|
110
110
|
},
|
|
111
|
+
filePurposes: {
|
|
112
|
+
// What files are for, ahead of the built-in rules. A custom purpose says whether its lines count.
|
|
113
|
+
rules: [
|
|
114
|
+
{ paths: ["utils/**"], purpose: "tooling" },
|
|
115
|
+
{
|
|
116
|
+
paths: ["**/*.proto"],
|
|
117
|
+
purpose: { type: "custom", name: "Schemas", source: true },
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
111
121
|
catalog: {
|
|
112
122
|
// Where snapshots, caches and the cube live (default ".repo-dive").
|
|
113
123
|
dir: ".repo-dive",
|
|
@@ -119,8 +129,9 @@ export default defineConfig({
|
|
|
119
129
|
`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.
|
|
120
130
|
A group can also carry a `displayName`, a profile `url` and a `kind` (`human`/`bot`/`ai`, otherwise auto-derived).
|
|
121
131
|
The dashboard badges bots and AI agents, listing them apart from humans.
|
|
132
|
+
`filePurposes` refines how files sort into Production, Tests, Docs, Examples, Tooling, AI instructions, Test data, Assets, Generated & vendored and Other, and `skipBuiltInRules: true` starts that from scratch; "Lines of code" counts the first six and "Number of files" counts all of them.
|
|
122
133
|
`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.
|
|
123
|
-
Apart from `catalog`, which every command needs, the config is read by `index`.
|
|
134
|
+
Apart from `catalog`, which every command needs, and `filePurposes`, which `scan` needs too, the config is read by `index`.
|
|
124
135
|
See [docs/specs/07-config.md](docs/specs/07-config.md) for details.
|
|
125
136
|
|
|
126
137
|
## GitHub Action
|