# Development and release tasks. Uses uv for running commands in the project venv.
# Run from the project root.

.PHONY: help install-deps test docs serve-docs build check format typecheck

help:
	@echo "django-allresponses - common targets:"
	@echo "  make install-deps - install with dev deps (zensical, ty)"
	@echo "  make test         - run Django test runner"
	@echo "  make docs         - build docs into docs/ (needs install-deps)"
	@echo "  make serve-docs   - serve docs in browser (needs install-deps)"
	@echo "  make build        - build wheel (hatch)"
	@echo "  make check        - run ruff linter"
	@echo "  make format       - run ruff format"
	@echo "  make typecheck    - run ty type checker (needs install-deps)"

install-deps:
	uv sync --extra dev

test:
	uv run manage.py test

docs:
	uv run zensical build -f mkdocs.yml
	@echo "Docs written to site/. Open site/index.html or run: make serve-docs"

serve-docs:
	uv run zensical serve -f mkdocs.yml -a 127.0.0.1:8080

build:
	uv run hatch build

check:
	uv run ruff check .

format:
	uv run ruff format .

typecheck:
	uv run ty check .
