-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (45 loc) · 1.69 KB
/
Makefile
File metadata and controls
59 lines (45 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Makefile to help automate key steps
.DEFAULT_GOAL := help
# Will likely fail on Windows, but Makefiles are in general not Windows
# compatible so we're not too worried
TEMP_FILE := $(shell mktemp)
# A helper script to get short descriptions of each target in the Makefile
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([\$$\(\)a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-30s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
.PHONY: help
help: ## print short description of each target
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
.PHONY: dev-backend
dev-backend: # Start the backend
@echo "Starting backend"
@cd backend && uv run fastapi dev "src/ref_backend/main.py" --reload
.PHONY: dev-frontend
dev-frontend: # Start the frontend
@echo "Starting frontend"
@cd frontend && npm run dev
.PHONY: generate-client
generate-client: # Generate the frontend client SDK
bash scripts/generate-client-sdk.sh
.PHONY: setup
setup: ## Setup the backend and frontend
$(MAKE) -C backend virtual-environment
@echo "==> Installing frontend dependencies"
cd frontend && npm install
@echo "==> Installing pre-commit hooks"
uvx pre-commit install --config .pre-commit-config.yaml
.PHONY: generate-metadata
generate-metadata: ## Generate diagnostic metadata YAML from provider registry
$(MAKE) -C backend generate-metadata
.PHONY: changelog-draft
changelog-draft: ## compile a draft of the next changelog
cd backend && uv run towncrier build --draft --config ../towncrier.toml
# Consistent alias with python-only projects
.PHONY: virtual-environment
virtual-environment: setup ## Install backend and frontend dependencies