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 <[email protected]>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user