#!/bin/bash # 🎯 Automated Frontend Type Generation # This script ensures frontend types are always in sync with backend OpenAPI spec set -e echo "🔄 Generating OpenAPI spec from backend..." cd "$(dirname "$0")/.." pnpm openapi:gen echo "🔄 Generating frontend types from OpenAPI spec..." npx openapi-typescript apps/bff/openapi/openapi.json -o apps/portal/src/lib/api/__generated__/types.ts echo "✅ Frontend types updated successfully!" echo "📝 Updated: apps/portal/src/lib/api/__generated__/types.ts"