UNPKG

git-contributor-stats

Version:

CLI to compute contributor and repository statistics from a Git repository (commits, lines added/deleted, frequency, heatmap, bus-factor), with filters and multiple output formats.

60 lines 1.87 kB
import type { ContributorsMeta } from '../analytics/aggregator.ts'; import { type AliasConfig } from '../analytics/aliases.ts'; import type { ContributorsMapEntry, TopContributor, TopStatsSummary } from '../analytics/analyzer.ts'; export interface ContributorStatsOptions { repo?: string; branch?: string; paths?: string | string[]; since?: string; until?: string; author?: string; includeMerges?: boolean; groupBy?: 'email' | 'name'; labelBy?: 'email' | 'name'; sortBy?: 'changes' | 'commits' | 'additions' | 'deletions'; top?: number; similarity?: number; aliasFile?: string; aliasConfig?: AliasConfig; countLines?: boolean; verbose?: boolean; } export interface CommitFrequencyBreakdown { monthly: Record<string, number>; weekly: Record<string, number>; } export interface BusFactorInfo { busFactor: number; candidates: string[]; details?: Record<string, unknown>; filesSingleOwner?: { file: string; owner: string; changes: number; }[]; } export interface ContributorStatsResult { meta: { generatedAt: string; repo: string; branch: string | null; since: string | null; until: string | null; }; totalCommits: number; totalLines: number; contributors: Record<string, ContributorsMapEntry>; topContributors: TopContributor[]; topStats: TopStatsSummary; commitFrequency: CommitFrequencyBreakdown; heatmap: number[][]; heatmapContributors: Record<string, Record<string, number>>; busFactor: BusFactorInfo; basic: { meta: ContributorsMeta; groupBy: 'email' | 'name'; labelBy: 'email' | 'name'; }; } export declare function getContributorStats(opts?: ContributorStatsOptions): Promise<ContributorStatsResult>; //# sourceMappingURL=stats.d.ts.map