mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 23:41:08 +02:00
Four architectural improvements that reduce boilerplate, eliminate dead code, document the frozen schema boundary, and centralize the guest data seeding that was previously defined but never called. 1. Migrate remaining 10 modules to useLiveQueryWithDefault music (5), moodlit (2), places (2), storage (2), calc (2), planta (5), photos (3), contacts (1), inventory (4) — 26 hooks total. Each queries.ts now imports useLiveQueryWithDefault from @mana/local-store/svelte instead of raw liveQuery from dexie. Call sites that used manual $effect + subscribe() boilerplate replaced with $derived(ctx.value). Files touched: 10 queries.ts + 5 route/component call sites (contacts, places, photos, inventory, calc). 2. Remove dead Memoro Tag interface memoro/types.ts had a local Tag type (with isPinned, sortOrder) that diverged from the @mana/shared-tags Tag. No file imported it after the earlier migration — removed the interface and added a comment directing future readers to @mana/shared-tags. 3. Document frozen schema boundary in database.ts Updated the v1 comment to explicitly state it's frozen and explain why (Dexie only runs upgrades when the version number bumps). Lists the current additive versions: v2=body, v3=who, v4=news. News tables were already correctly extracted to v4 by concurrent work. 4. Centralize guest seed registry Created lib/data/seed-registry.ts that imports GUEST_SEED constants from 13 modules (habits, body, dreams, moodlit, contacts, calendar, chat, cards, skilltree, todo, notes, times, planta) and provides a single seedAllGuestData() function. Wired into manaStore.initialize() in local-store.ts so seeds actually get inserted on first visit. Previously every module defined and re-exported seed data but nothing ever consumed it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| nutriphi | ||
| photos | ||
| picture | ||
| planta | ||
| presi | ||
| questions | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||
| zitare/packages/content | ||