.PHONY: help install dev build lint format check test typecheck ci clean

help: ## Show this help
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "  \033[36m%-20s\033[0m %s\n", $$1, $$2}'

install: ## Install dependencies
	bun install

dev: ## Start dev server
	bun run dev

build: ## Build for production
	bun run build

lint: ## Lint with biome
	bunx biome lint .

format: ## Format with biome (writes)
	bunx biome format --write .

check: ## Full check: lint + format + typecheck
	bunx biome check --write .
	bunx tsc --noEmit

typecheck: ## TypeScript type check
	bunx tsc --noEmit

test: ## Run tests
	bun test

ci: ## Full CI pipeline (lint + typecheck + test + build)
	bunx biome check .
	bunx tsc --noEmit
	bun test
	bun run build

clean: ## Remove build artifacts
	rm -rf dist node_modules/.vite