.PHONY: build check-examples check-generated check-resources generate generate-resources lint test test-package typecheck verify

API_DIR ?= ../api

generate:
	uv run python scripts/generate.py --api-dir $(API_DIR)
	$(MAKE) generate-resources

generate-resources:
	uv run python scripts/generate_models.py
	uv run python scripts/generate_services.py
	uv run python scripts/generate_sync.py

check-resources:
	uv run python scripts/generate_models.py --check
	uv run python scripts/generate_services.py --check
	uv run python scripts/generate_sync.py --check

check-generated:
	uv run python scripts/generate.py --api-dir $(API_DIR) --check
	$(MAKE) check-resources

lint:
	uv run ruff check src/tarka scripts tests examples
	uv run ruff format --check src/tarka scripts tests examples
	$(MAKE) check-resources

check-examples:
	uv run ruff check examples
	uv run ruff format --check examples
	uv run python -m compileall -q examples

typecheck:
	uv run mypy

test:
	uv run pytest

build:
	uv build

test-package:
	uv run python scripts/test_package.py

verify: lint check-examples typecheck test build test-package
