Implements scripts/bus-factor.mjs — a standalone Node.js CLI that shells out to git log --numstat to collect per-file, per-author commit stats, then computes bus-factor scores (number of contributors with >10% ownership) for every source file in server/src/, client/src/, and db/migrations/. High-risk files (bus-factor=1) are surfaced prominently in the default report. A --json flag emits machine-readable output for CI. Pure analysis functions (parseGitLog, computeOwnership, scoreFiles, repoStats) are unit-tested with Vitest (19 tests, all passing). No new runtime dependencies — only Node.js built-ins and git are required. Run via: node scripts/bus-factor.mjs [--json] [--min-commits N] [--top N] Nightshift-Task: bus-factor Nightshift-Ref: https://github.com/marcus/nightshift
13 lines
218 B
JSON
13 lines
218 B
JSON
{
|
|
"name": "budget-scripts",
|
|
"version": "1.0.0",
|
|
"scripts": {
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"bus-factor": "node bus-factor.mjs"
|
|
},
|
|
"devDependencies": {
|
|
"vitest": "^4.1.0"
|
|
}
|
|
}
|