.PHONY: run build web-build web-test web-smoke test tidy infra-up infra-down health mac-core mac-client

run: ## 本地运行服务
	cd server && go run .

build: ## 编译二进制
	cd server && go build -o ../dist/everypublish-server .

web-build: ## 构建网页端
	cd apps/web && npm run build

web-test: ## 网页端类型检查
	cd apps/web && npx tsc --noEmit

web-smoke: ## 网页端 API/Browser WS smoke（需先启动 Web-only server）
	cd apps/web && npm test

test: ## 单测
	cd server && go test ./...
	cd server && go vet ./...
	cd apps/web && npx tsc --noEmit

tidy: ## 整理依赖
	cd server && go mod tidy

infra-up: ## 启动 MySQL/Redis（Docker）
	docker compose -f server/docker-compose.yml up -d

infra-down: ## 停止 MySQL/Redis
	docker compose -f server/docker-compose.yml down

health: ## 健康检查
	curl -s http://127.0.0.1:8090/health

mac-core: ## 构建 macOS arm64 agent-core
	@echo "macOS 客户端已暂停；该目标仅保留历史兼容，不属于 V1 验收"
	cd client/core && GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -trimpath -ldflags '-s -w' -o ../dist/agent-core .

mac-client: ## 构建 macOS arm64 SwiftUI 原生 DMG
	@echo "macOS 客户端已暂停；该目标不属于 V1 验收"
