#!/bin/bash

# Simple script to check and format TypeScript files
echo "🎨 Running Prettier on TypeScript files..."

# Check if prettier is available
if ! command -v ./node_modules/.bin/prettier &> /dev/null; then
    echo "❌ Prettier not found. Please install it with: bun add -d prettier"
    exit 1
fi

# Format TypeScript and JSON files
./node_modules/.bin/prettier --write \
    "apps/**/*.{ts,json}" \
    "libs/**/*.{ts,json}" \
    "*.json" \
    --ignore-path .prettierignore

echo "✅ Prettier formatting complete!"
