hellth-hub/apps/admin/lib/hellth-data.ts
Sebastian Mayer 8ed7c083c4
Some checks failed
CI / Lint, Typecheck, Test, Build (push) Has been cancelled
Refactor: God-Router + Frontend-Lib in Domain-Module aufgeteilt
Router-Split (packages/api/src/trpc/routers/health/):
- health.ts (2061 Zeilen Monolith) entfernt und in 6 Sub-Router aufgeteilt:
  - dashboard.ts (overview, profile, goals, point settings)
  - foods.ts (foods, nutrition, OpenFoodFacts, food preferences)
  - recipes.ts (recipes, submissions, reviews, activity feed)
  - stores.ts (stores, change-requests, shopping lists)
  - tracking.ts (meals, drinks, weight, mealPlans, activities, leaderboard)
  - community.ts (club, wearables, coach, stats)
- index.ts mergt alle Sub-Router via mergeRouters, sodass Frontend-Aufrufe
  (trpc.health.listFoods etc.) unveraendert weiterfunktionieren.
- t.mergeRouters in init.ts exportiert.

Frontend-Lib-Split (apps/admin/lib/hellth/):
- hellth-data.ts (1149 Zeilen Monolith) in 5 Domain-Module aufgeteilt:
  - types.ts (alle TypeScript-Types)
  - constants.ts (Seeds, Defaults, todayKey, uid)
  - nutrition.ts (calcRecipe, classifyRecipe, parseNutritionLabel, ...)
  - storage.ts (load/save HellthData, ClubData, hasCompletedHealthProfile)
  - stats.ts (Budget, Stats, Coach, Shopping, Weight-Projection)
- hellth-data.ts wird zum reinen Re-Export-Index, damit bestehende
  Imports `from "@/lib/hellth-data"` unveraendert weiterfunktionieren.

Funktional identisch zum Original - reine Code-Reorganisation.
Verifiziert: 28 API-Tests + 10 Admin-Tests gruen, Typecheck (3 Packages)
gruen, Admin-Build (26 Pages) gruen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 01:09:53 +02:00

9 lines
362 B
TypeScript

// Re-Export-Index fuer die hellth-Lib. Aus historischen Gruenden importieren die
// Pages aus "@/lib/hellth-data"; dieser Stub leitet alles an die Domain-Module
// unter lib/hellth/ weiter.
export * from "./hellth/types";
export * from "./hellth/constants";
export * from "./hellth/nutrition";
export * from "./hellth/storage";
export * from "./hellth/stats";