name: Prettier Check

on:
  pull_request:
    paths:
      - 'src/cook-web/**'
  push:
    branches:
      - main
    paths:
      - 'src/cook-web/**'

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - name: Setup Node.js (match Cook Web engines)
        uses: actions/setup-node@v4
        with:
          node-version: '22.16.0'

      - name: Install dependencies
        run: |
          cd src/cook-web
          npm ci

      - name: Check Prettier formatting
        run: |
          cd src/cook-web
          npm run format:check
