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:
parent
4066e9ec61
commit
5274e09571
75 changed files with 282 additions and 688 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/* ═══════════════════════════════════════════════════════════════
|
||||
HISTORY ROUTE — read-only, mounted under /api
|
||||
HISTORY ROUTE: read-only, mounted under /api
|
||||
|
||||
GET /history every published timeline entry
|
||||
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
queries doesn't grow with the number of entries.
|
||||
|
||||
· precision that outruns the date. An entry can hold '2012' with
|
||||
precision 'day' — the admin doesn't stop you. Trusting that
|
||||
precision 'day', the admin doesn't stop you. Trusting that
|
||||
pair would put the entry in a month node built from a month
|
||||
that isn't there, so precision is capped at what the string
|
||||
actually carries.
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
import { Hono } from "hono";
|
||||
import { marks } from "../shape.js";
|
||||
|
||||
const history = new Hono();
|
||||
|
||||
|
|
@ -38,7 +39,6 @@ const CACHE = "public, max-age=60, stale-while-revalidate=300";
|
|||
|
||||
const json = (c, body) => c.json(body, 200, { "Cache-Control": CACHE });
|
||||
|
||||
const marks = (n) => Array(n).fill("?").join(",");
|
||||
|
||||
/* 'YYYY' → year, 'YYYY-MM' → month, 'YYYY-MM-DD' → day. */
|
||||
function precisionOfString(date) {
|
||||
|
|
@ -115,7 +115,7 @@ history.get("/history", (c) => {
|
|||
)
|
||||
.all();
|
||||
|
||||
// How many entries exist but can't be placed. Worth knowing about —
|
||||
// How many entries exist but can't be placed. Worth knowing about,
|
||||
// an entry nobody gave a date to is invisible, and silence is how it
|
||||
// stays that way.
|
||||
const undated = db
|
||||
|
|
@ -153,7 +153,7 @@ function loadRosters(db, rows) {
|
|||
const teamIds = [...new Set(teamEntries.map((row) => row.ref_id))];
|
||||
|
||||
// v_org_leadership already decides who counts as current and
|
||||
// public — affiliation still open, marked public, person
|
||||
// public, affiliation still open, marked public, person
|
||||
// published. Restating those conditions here is how they drift.
|
||||
const members = db
|
||||
.prepare(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue