CI & Build / Python lint (push) Successful in 9s
CI & Build / Plugin hooks (push) Successful in 22s
CI & Build / TypeScript typecheck (push) Successful in 1m0s
CI & Build / integration (push) Successful in 1m55s
CI & Build / Python tests (push) Successful in 2m20s
CI & Build / Build & push image (push) Successful in 1m7s
Components, stores, api clients, router, types and shared CSS now state what each piece is and why, without the milestone that introduced it. diff.ts names its consumers instead of the copy history; stores/notes and tasks state their current scope instead of the cleanup that set it; theme.css states the token practice instead of the sweep that established it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
/** Project inception: what a project was decided to inherit. */
|
|
import { apiGet, apiPost } from "@/api/client";
|
|
import type { ProjectPlatform } from "@/api/platforms";
|
|
|
|
export interface InceptionChoices {
|
|
design_system_id: number | null;
|
|
seed_systems: boolean;
|
|
/** Platform slugs. null = not answered; a list is the
|
|
* whole answer — members left out of it are recorded as "not this".
|
|
* Absent on records decided before the question existed. */
|
|
platforms?: string[] | null;
|
|
}
|
|
|
|
export interface InceptionRecord {
|
|
decided_at: string;
|
|
decided_by: number | null;
|
|
via: "mcp" | "ui" | "legacy";
|
|
choices: InceptionChoices;
|
|
}
|
|
|
|
export interface InceptionDefaults {
|
|
design_system_id: number | null;
|
|
design_systems: { id: number; title: string }[];
|
|
systems: number;
|
|
platforms: { slug: string; name: string }[];
|
|
/** What detection (or an earlier answer) already says about the project. */
|
|
project_platforms: ProjectPlatform[];
|
|
}
|
|
|
|
export interface InceptionDecision {
|
|
project_id: number;
|
|
inception: InceptionRecord;
|
|
effects: {
|
|
design_system_id: number | null;
|
|
systems_seeded: string[];
|
|
/** The project's answers after the decision; null when left unstated. */
|
|
platforms: ProjectPlatform[] | null;
|
|
};
|
|
}
|
|
|
|
export const emptyChoices = (): InceptionChoices => ({
|
|
design_system_id: null, seed_systems: false, platforms: null,
|
|
});
|
|
|
|
export const fetchInceptionDefaults = (projectId: number) =>
|
|
apiGet<InceptionDefaults>(`/api/projects/${projectId}/inception/defaults`);
|
|
|
|
export const decideInception = (projectId: number, choices: InceptionChoices) =>
|
|
apiPost<InceptionDecision>(`/api/projects/${projectId}/inception`, { choices });
|