fix: resolve all 228 TypeScript errors across the project

- Exclude admin-web and supabase/functions from root tsconfig (185 errors)
- Add missing constant exports: FONT_FAMILY_SANS_BOLD/SEMIBOLD, BRAND_DANGER (9 errors)
- Fix React Query API destructuring in admin screens: data/isLoading aliases (12 errors)
- Add getWorkoutsByCategory to data layer, fix category screen types (5 errors)
- Add type assertions for Supabase never types in adminService and sync.ts (13 errors)
- Add missing vitest imports (vi, beforeEach) and replace removed PRIMARY_DARK (5 errors)
- Fix seed.ts to use program.weeks[].workouts[] instead of missing props (4 errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Millian Lamiaux
2026-04-06 17:53:02 +02:00
parent edcd857c70
commit 4458044d0e
16 changed files with 301 additions and 321 deletions

View File

@@ -158,7 +158,6 @@ async function seedPrograms() {
description: p.description,
weeks: p.weeks,
workouts_per_week: p.workoutsPerWeek,
level: p.level,
}))
const { error } = await supabase.from('programs').upsert(programs)
@@ -166,22 +165,17 @@ async function seedPrograms() {
// Seed program-workout relationships
let programWorkouts: { program_id: string; workout_id: string; week_number: number; day_number: number }[] = []
Object.values(PROGRAMS).forEach(program => {
let week = 1
let day = 1
program.workoutIds.forEach((workoutId, index) => {
programWorkouts.push({
program_id: program.id,
workout_id: workoutId,
week_number: week,
day_number: day,
program.weeks.forEach((week) => {
week.workouts.forEach((workout, dayIndex) => {
programWorkouts.push({
program_id: program.id,
workout_id: workout.id,
week_number: week.weekNumber,
day_number: dayIndex + 1,
})
})
day++
if (day > program.workoutsPerWeek) {
day = 1
week++
}
})
})