You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: remove dead code and fold duplicated logic across the stack
Whole-repo over-engineering pass (~-926 lines, 52 files).
Backend:
- drop redundant selection_enabled column (modules JSON is now the single
source of truth); add migration 0011, derive the API field from modules
- fold the fixed-window rateLimit middleware into the shared sliding-window
checkRateLimit
- dedup attachDb into requireDb; inline warmCatalogAfterMutation
- delete empty db/client.ts and the unused middleware barrel
Schemas:
- delete unused Allergen/Membership/ExtrasType/PublicationState/AnalyticsPeriod
enums and ~30 dead type aliases and response schemas
- drop the dead legacy.selectionEnabled fallback from normalizeModulesConfig
Web:
- collapse the never-wired dual-display path (getContentDisplayText/.secondary/
nameSecondary) down to getLocalizedContentValue
- delete generateColorVariables/hexToHSL, the stores barrel, unused selector
hooks, MENU_ICON_LABELS and the LOCALE_SHORT_CODES map
- share one formatPrice and one sanitizeRichText helper
- replace the chatActionsStore.dispatch switch with direct setters
Chat worker:
- remove the variant/extra pipeline that D1 never populated, its types and
queries; align the get_item_detail tool description
- drop the dev-only /chat/debug endpoint and the buildWorkersAIPrompt wrapper
constrow=db.raw.prepare('SELECT name, payoff, ai_chat_enabled, ai_voice_enabled, selection_enabled FROM settings WHERE id = 1').get()asSettingsRow;
48
+
constrow=db.raw.prepare('SELECT name, payoff, ai_chat_enabled, ai_voice_enabled, modules FROM settings WHERE id = 1').get()asSettingsRow&{modules: string};
0 commit comments