implemented
This commit is contained in:
parent
a31bd8246c
commit
d3638e2e69
18 changed files with 1643 additions and 120 deletions
32
Makefile
32
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
.PHONY: install-backend install-frontend install backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck
|
||||
.PHONY: install-backend install-frontend install backend frontend db db-stop db-ready db-seed dev test test-backend test-frontend test-e2e typecheck generate-types generate-types-standalone check-types-fresh check-constants
|
||||
|
||||
-include .env
|
||||
export
|
||||
|
|
@ -54,7 +54,33 @@ test-frontend:
|
|||
test-e2e: db-clean db-ready
|
||||
./scripts/e2e.sh
|
||||
|
||||
test: test-backend test-frontend test-e2e
|
||||
test: check-constants check-types-fresh test-backend test-frontend test-e2e
|
||||
|
||||
typecheck:
|
||||
typecheck: generate-types-standalone
|
||||
cd backend && uv run mypy .
|
||||
cd frontend && npx tsc --noEmit
|
||||
|
||||
generate-types:
|
||||
cd frontend && npm run generate-api-types
|
||||
|
||||
generate-types-standalone: db-seed
|
||||
@echo "Starting backend for type generation..."
|
||||
@cd backend && uv run uvicorn main:app --port 8000 --log-level warning & \
|
||||
BACKEND_PID=$$!; \
|
||||
sleep 3; \
|
||||
cd frontend && npm run generate-api-types; \
|
||||
EXIT_CODE=$$?; \
|
||||
kill $$BACKEND_PID 2>/dev/null || true; \
|
||||
exit $$EXIT_CODE
|
||||
|
||||
check-types-fresh: generate-types-standalone
|
||||
@if git diff --quiet frontend/app/generated/api.ts 2>/dev/null; then \
|
||||
echo "✓ Generated types are up to date"; \
|
||||
else \
|
||||
echo "✗ Generated types are stale. Run 'make generate-types-standalone' and commit."; \
|
||||
git diff frontend/app/generated/api.ts; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
check-constants:
|
||||
@cd backend && uv run python validate_constants.py
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue