Type src/ against API and database shapes, fixing implicit anys

Adds .d.ts declarations beside the untyped JS modules imported from
TS (api.js, navConfig.js, adminSchema.js, adminNav.js, src/data/*),
with shapes taken from the server routes and migrations. get/post/
patch/del now return unknown unless the caller names the response.

Fixes found along the way:
- website/email/instagram are bare strings from splitLinks, not Link
  objects; OrganizationDetail's website and email pills rendered with
  no href or label and now link correctly.
- The chapter map falls back to FALLBACK_COLOR for a region with no
  colour instead of painting its tiles black.

Adds defineSection() so each page manifest entry's props are checked
against its own Component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-25 04:13:46 -05:00
parent 5286cae9ca
commit 2428f4412a
39 changed files with 1318 additions and 343 deletions

View file

@ -1,5 +1,5 @@
import PageShell from "../components/PageShell.tsx";
import { useSectionManifest } from "../lib/sections.tsx";
import { defineSection, useSectionManifest } from "../lib/sections.tsx";
import OrgListMap, { OrgMapToggle } from "./sections/OrgList-Map.tsx";
import OrgListVertical from "./sections/OrgList-Vertical.tsx";
import OrgListCards from "./sections/OrgList-Card.tsx";
@ -13,7 +13,7 @@ import OrgListCards from "./sections/OrgList-Card.tsx";
═══════════════════════════════════════════════════════════════ */
const SECTIONS = [
{
defineSection({
id: "chapters",
title: "Local Chapters",
blurb:
@ -22,8 +22,8 @@ const SECTIONS = [
background: "#eef9fb",
Component: OrgListMap,
views: { options: ["map", "grid"], default: "map", Toggle: OrgMapToggle },
},
{
}),
defineSection({
id: "regions",
title: "Unity Regions",
blurb:
@ -40,8 +40,8 @@ const SECTIONS = [
{ key: "international", title: "International Unity Regions" },
],
},
},
{
}),
defineSection({
id: "partners",
title: "Partner Organizations",
blurb:
@ -54,7 +54,7 @@ const SECTIONS = [
pageLabel: "Partner page",
empty: "· Partner organizations coming soon ·",
},
},
}),
];
export default function CommunityPage() {