Files
EvoBGP/scripts/check-openapi-gen.sh
T
DenozordecandCursor 13e3d21ce2 feat(web): add OpenAPI TypeScript codegen and CI freshness check
Генерируем api.gen.ts из docs/openapi.yaml (openapi-typescript), добавляем scripts/check-openapi-gen.sh в CI. Закрываем решение по X-Tenant-Id как unimplemented; обновляем docs/README под React/ReUI и apps/web.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-31 12:19:02 +07:00

15 lines
523 B
Bash

#!/usr/bin/env bash
# Fail if apps/web/src/types/api.gen.ts is stale vs docs/openapi.yaml.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT/apps/web"
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
pnpm exec openapi-typescript ../../docs/openapi.yaml -o "$tmp"
if ! diff -q src/types/api.gen.ts "$tmp" >/dev/null; then
echo "api.gen.ts is stale — run: pnpm --filter @evobgp/web run openapi:gen" >&2
diff -u src/types/api.gen.ts "$tmp" | head -n 80 >&2 || true
exit 1
fi
echo "api.gen.ts is up to date"