Clean up code found in the audit

- Replace every em-dash in src and server/src with a colon, comma or hyphen
- Give every relative import its file extension (.jsx imports of .tsx fixed)
- Delete old-historyMock.ts, unused exports, unused CSS utilities, the
  unused @ alias and the fallback option nothing passed
- One copy each of initials, capitalize, byName and the server's marks()
- Move the organization, chapter and event hooks from src/data to src/lib
- Schema sync always throws on a mismatch (strict was never turned off)
- Replace the placeholder README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:02:03 -05:00
parent 4066e9ec61
commit 5274e09571
75 changed files with 282 additions and 688 deletions

View file

@ -1,11 +1,11 @@
/**
* The four detail endpoints, typed.
*
* Adding a fifth is a type and a one-line hook — useRecord owns
* Adding a fifth is a type and a one-line hook, useRecord owns
* the fetching, the caching and the 404.
*
* An id that is missing — or the literal string "undefined", which
* is what a template literal makes of a missing route param — never
* An id that is missing, or the literal string "undefined", which
* is what a template literal makes of a missing route param, never
* reaches the network. detailPath returns null and the hook reports
* notFound, which is what the visitor should see anyway, and
* hrefs.ts has already logged the component that produced it.
@ -145,8 +145,6 @@ export type EventListItem = Omit<EventRecord, 'blocks' | 'people' | 'awards'>
/** An event_scopes row, as GET /events sends it beside the list. */
export type EventScope = { id: string; name: string; sort_order: number }
export type EventsResponse = { scopes: EventScope[]; events: EventListItem[] }
export const useEvent = (id?: string): Resource<EventRecord> =>
useRecord<EventRecord>(detailPath('/events', id), 'event')
@ -251,14 +249,12 @@ export type OrganizationListItem = Omit<OrganizationRecord, 'teams' | 'awards' |
sort_order: number
}
export type OrganizationsResponse = { organizations: OrganizationListItem[] }
export const useOrganization = (id?: string): Resource<OrganizationRecord> =>
useRecord<OrganizationRecord>(detailPath('/organizations', id), 'organization')
/* ── Teams ───────────────────────────────────────────────────── */
/** No members here on purpose — PeopleTiles fetches
/** No members here on purpose, PeopleTiles fetches
* /teams/:id/people itself. See the note in content.js. */
export type TeamRecord = {
id: string