.PHONY: test build publish site-build site-dev site-deploy site-deploy-preview

test:
	PYTHONPATH=src uv run pytest tests/ -v

build:
	rm -rf dist
	uvx --from build pyproject-build --installer uv

publish: build
	uvx twine upload dist/*

site-build:
	uv run scripts/build_site.py
	cd website && npm install --silent
	cd website && node build-validator.js
	cd website && uv run zensical build

# Live-reload dev server for content and template editing.
# To test with the API: make site-build && cd website && npx wrangler pages dev site
site-dev:
	uv run scripts/build_site.py
	cd website && uv run zensical serve -a localhost:8005

site-deploy: site-build
	cd website && npx wrangler pages deploy site --project-name structuredworkoutformat

site-deploy-preview: site-build
	cd website && npx wrangler pages deploy site --project-name structuredworkoutformat --branch preview
