Assist_Design/scripts/generate-frontend-types.sh

17 lines
519 B
Bash
Executable File

#!/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"