Skip to content

Commit 3f1863b

Browse files
redxzetaAgent
andauthored
feat: add reusable fork type catalog (#38)
Co-authored-by: Agent <agent@debian.local>
1 parent 12f080c commit 3f1863b

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

apps/web/src/lib/forkTypes.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { describe, expect, it } from "vitest";
2+
3+
import { FORK_TYPES, getForkType } from "./forkTypes";
4+
5+
describe("forkTypes", () => {
6+
it("includes git as the only functional integration by default", () => {
7+
const functional = FORK_TYPES.filter((entry) => entry.isFunctionalIntegration);
8+
const nonGit = FORK_TYPES.filter((entry) => entry.id !== "git-fork");
9+
10+
expect(functional.map((entry) => entry.id)).toEqual(["git-fork"]);
11+
expect(nonGit.every((entry) => !entry.isFunctionalIntegration)).toBe(true);
12+
});
13+
14+
it("exposes at least four parody-only fork types", () => {
15+
const parody = FORK_TYPES.filter((entry) => !entry.isFunctionalIntegration);
16+
expect(parody.length).toBeGreaterThanOrEqual(4);
17+
});
18+
19+
it("keeps entries complete and stable enough for lookup", () => {
20+
expect(getForkType("git-fork")?.displayName).toBe("Git Fork");
21+
expect(getForkType("spork")?.icon).toBe("🥄");
22+
expect(getForkType("spork")?.isFunctionalIntegration).toBe(false);
23+
});
24+
});

apps/web/src/lib/forkTypes.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// FILE: forkTypes.ts
2+
// Purpose: Reusable fork-type catalog for parody and Git-functional distinctions.
3+
// Layer: Shared UI/data model
4+
// Exports: Fork type metadata consumed by fork-related surfaces and future copy.
5+
6+
export interface ForkTypeEntry {
7+
readonly id: string;
8+
readonly displayName: string;
9+
readonly description: string;
10+
readonly icon: string;
11+
readonly isFunctionalIntegration: boolean;
12+
}
13+
14+
export const FORK_TYPES: readonly ForkTypeEntry[] = [
15+
{
16+
id: "git-fork",
17+
displayName: "Git Fork",
18+
description: "Functional repository-derived code branching workflow with full sync support.",
19+
icon: "🍴",
20+
isFunctionalIntegration: true,
21+
},
22+
{
23+
id: "dinner-fork",
24+
displayName: "Dinner Fork",
25+
description: "Shared dish split for social rituals, not code synchronization.",
26+
icon: "🍴",
27+
isFunctionalIntegration: false,
28+
},
29+
{
30+
id: "tuning-fork",
31+
displayName: "Tuning Fork",
32+
description: "Conceptual fork where two ideas vibrate in agreement or drift apart.",
33+
icon: "🎵",
34+
isFunctionalIntegration: false,
35+
},
36+
{
37+
id: "pitchfork",
38+
displayName: "Pitchfork",
39+
description: "Provocative fork of support; sharp edges, no git remotes.",
40+
icon: "🔥",
41+
isFunctionalIntegration: false,
42+
},
43+
{
44+
id: "spork",
45+
displayName: "Spork",
46+
description: "Pragmatic hybrid fork for improv tasks that still isn’t a repo clone.",
47+
icon: "🥄",
48+
isFunctionalIntegration: false,
49+
},
50+
{
51+
id: "chess-fork",
52+
displayName: "Chess Fork",
53+
description: "A tactical forking moment where one move attacks multiple priorities.",
54+
icon: "♟️",
55+
isFunctionalIntegration: false,
56+
},
57+
] as const;
58+
59+
export type ForkTypeId = (typeof FORK_TYPES)[number]["id"];
60+
61+
export function getForkType(entryId: ForkTypeId): ForkTypeEntry | undefined {
62+
return FORK_TYPES.find((entry) => entry.id === entryId);
63+
}

0 commit comments

Comments
 (0)