chore: initial scaffold + design spec + implementation plan
Skeleton for Osteo Report MVP. Build passes, 7 smoke tests green, real Horse.svg + Horse_head.svg in public/species/equine/. Zod schemas are the contract; store/anatomy/pdf modules are typed stubs throwing "not implemented" awaiting implementation. Spec: docs/superpowers/specs/2026-05-18-osteo-report-mvp-design.md Plan: docs/superpowers/plans/2026-05-18-osteo-report-mvp.md (23 phases, ~70 TDD tasks) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
12a3e48fdf
commit
8ca36b5ccd
104 files changed
+12448
No files matched your search
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Asserts a condition is truthy; throws with the given message otherwise.
|
||||
* Use to enforce invariants at runtime boundaries.
|
||||
*/
|
||||
export function assert(condition: unknown, message: string): asserts condition {
|
||||
if (!condition) {
|
||||
throw new Error(`Assertion failed: ${message}`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks a code path as unreachable for exhaustive switch coverage.
|
||||
* TypeScript will error at compile time if the path is reachable.
|
||||
*/
|
||||
export function assertNever(value: never, message?: string): never {
|
||||
throw new Error(message ?? `Unexpected value: ${JSON.stringify(value)}`)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Returns today's date as an ISO date string (YYYY-MM-DD).
|
||||
*/
|
||||
export function todayIso(): string {
|
||||
return new Date().toISOString().slice(0, 10)
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats an ISO date string as a French locale date (e.g. "18 mai 2026").
|
||||
*/
|
||||
export function formatDateFr(_isoDate: string): string {
|
||||
throw new Error('not implemented')
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current instant as an ISO timestamp string.
|
||||
*/
|
||||
export function nowIso(): string {
|
||||
return new Date().toISOString()
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Generates a collision-resistant unique id using crypto.randomUUID().
|
||||
* Falls back to a timestamp-based id in environments without crypto.
|
||||
*/
|
||||
export function generateId(): string {
|
||||
if (
|
||||
typeof crypto !== 'undefined' &&
|
||||
typeof crypto.randomUUID === 'function'
|
||||
) {
|
||||
return crypto.randomUUID()
|
||||
}
|
||||
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
||||
}
|
||||
Reference in new issue
Block a user