repo-dive 0.4.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.
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Public configuration surface for repo-dive.
3
+ *
4
+ * Drop a `repo-dive.config.ts` (or `.mjs`/`.js`) at the root of the
5
+ * repository you analyze and export a `defineConfig(...)` call as the default
6
+ * export. Everything keeps working with zero config; this only refines it.
7
+ *
8
+ * ```ts
9
+ * import { defineConfig } from "repo-dive/config";
10
+ *
11
+ * export default defineConfig({
12
+ * contributors: {
13
+ * aliases: [
14
+ * // Shorthand: emails only, the first is canonical.
15
+ * ["alice@work.example", "alice@personal.example"],
16
+ * // Rich form: a display name, a profile link and a kind.
17
+ * {
18
+ * emails: ["bob@work.example", "bob@personal.example"],
19
+ * displayName: "Bob",
20
+ * url: "https://github.com/bob",
21
+ * },
22
+ * ],
23
+ * maxInCharts: 10,
24
+ * },
25
+ * });
26
+ * ```
27
+ */
28
+ /**
29
+ * What sort of contributor an identity is. `kind` is optional in the config; a
30
+ * missing value is derived from the commit author's name/email (automation bots
31
+ * and known AI coding agents are recognized) and otherwise defaults to `human`.
32
+ */
33
+ export type ContributorKind = "human" | "bot" | "ai";
34
+ /**
35
+ * One alias group in its rich form: the email identities of a single
36
+ * contributor plus optional presentation. `emails` entries are matched against
37
+ * each commit author's email — either its raw value or its prettified
38
+ * GitHub-noreply handle (so `"alice"` matches
39
+ * `1234+alice@users.noreply.github.com`). The **first entry is canonical**.
40
+ */
41
+ export type ContributorAliasGroup = {
42
+ readonly emails: readonly string[];
43
+ /** Overrides the display name shown in charts and the contributors table. */
44
+ readonly displayName?: string;
45
+ /** Profile URL (e.g. a GitHub page) the contributor's name links to. */
46
+ readonly url?: string;
47
+ /** Overrides the auto-derived {@link ContributorKind}. */
48
+ readonly kind?: ContributorKind;
49
+ };
50
+ export type ContributorsConfig = {
51
+ /**
52
+ * Alias groups for people who appear under multiple identities (work +
53
+ * personal email, GitHub noreply, name variants). Each group is either a
54
+ * plain array of emails (the first is canonical) or a
55
+ * {@link ContributorAliasGroup} object that additionally sets a
56
+ * `displayName`, `url` and `kind`. They are merged when building the cube and
57
+ * dashboard data.
58
+ */
59
+ readonly aliases?: ReadonlyArray<readonly string[] | ContributorAliasGroup>;
60
+ /**
61
+ * How many contributors the per-contributor charts keep before folding the
62
+ * rest into "Other". Defaults to 10.
63
+ */
64
+ readonly maxInCharts?: number;
65
+ };
66
+ export type RepoDiveConfig = {
67
+ readonly contributors?: ContributorsConfig;
68
+ };
69
+ /**
70
+ * Identity helper that gives `repo-dive.config.ts` full type-checking and
71
+ * editor IntelliSense. It returns its argument unchanged.
72
+ */
73
+ export declare const defineConfig: (config: RepoDiveConfig) => RepoDiveConfig;
package/dist/config.js ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Public configuration surface for repo-dive.
3
+ *
4
+ * Drop a `repo-dive.config.ts` (or `.mjs`/`.js`) at the root of the
5
+ * repository you analyze and export a `defineConfig(...)` call as the default
6
+ * export. Everything keeps working with zero config; this only refines it.
7
+ *
8
+ * ```ts
9
+ * import { defineConfig } from "repo-dive/config";
10
+ *
11
+ * export default defineConfig({
12
+ * contributors: {
13
+ * aliases: [
14
+ * // Shorthand: emails only, the first is canonical.
15
+ * ["alice@work.example", "alice@personal.example"],
16
+ * // Rich form: a display name, a profile link and a kind.
17
+ * {
18
+ * emails: ["bob@work.example", "bob@personal.example"],
19
+ * displayName: "Bob",
20
+ * url: "https://github.com/bob",
21
+ * },
22
+ * ],
23
+ * maxInCharts: 10,
24
+ * },
25
+ * });
26
+ * ```
27
+ */
28
+ /**
29
+ * Identity helper that gives `repo-dive.config.ts` full type-checking and
30
+ * editor IntelliSense. It returns its argument unchanged.
31
+ */
32
+ export const defineConfig = (config) => config;