Files
EvoBGP/scripts/check-openapi-gen.sh
T
DenozordecandCursor 37f28dfcfd
CI / changes (push) Successful in 5s
CI / commitlint (push) Skipped
CI / openapi (push) Successful in 57s
CI / web (push) Successful in 55s
CI / go (push) Successful in 1m14s
CI / bird2 (push) Successful in 14s
CI / release (push) Successful in 4m7s
chore(tsconfig): remove baseUrl from TypeScript configuration files
Removed the "baseUrl" property from tsconfig.base.json, apps/web/tsconfig.json, and packages/ui/tsconfig.json to streamline path resolution. Updated check-openapi-gen.sh to use 'sh' instead of 'bash' for improved compatibility and adjusted the script's error handling.

Co-authored-by: Cursor <[email protected]>
2026-07-31 12:44:31 +07:00

15 lines
522 B
Bash

#!/usr/bin/env sh
# Fail if apps/web/src/types/api.gen.ts is stale vs docs/openapi.yaml.
set -eu
ROOT="$(CDPATH= 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"