#!/usr/bin/env bash # Verifica pre-push di pi-qmem: sintassi estensione (esbuild) + test gateway (pytest). # Uso: ./scripts/check.sh (richiede: npx esbuild, python3 con pytest + deps gateway) set -euo pipefail cd "$(dirname "$0")/.." echo "── 1/2 Estensione: transpile esbuild ──" npx --no-install esbuild extensions/index.ts --outfile=/tmp/qmem-check.mjs echo "✅ estensione OK" echo "── 2/2 Gateway: pytest ──" cd gateway if ! python3 -c "import pytest, fastapi, qdrant_client, httpx, pydantic" 2>/dev/null; then echo "⚠️ dipendenze mancanti: pip install -r requirements.txt -r requirements-dev.txt" exit 1 fi python3 -m pytest tests/ -q echo "✅ gateway OK"