# CoolerControl Makefile
.DEFAULT_GOAL := build

.PHONY: build dist dev dev-run offline test check ci-test clean install uninstall

dist:
	@npm ci --prefer-offline
	@npm run build

build: dist

dev:
	@npm run dev

# fast inner loop: vite build only, no type-check. The daemon's sync-app takes dist/
dev-run:
	@npm ci --prefer-offline
	@npm run build-only

offline:
	@npm run build --offline

test: build
	@npm run test:unit
	@npm run check-browser-floor

# one-shot type-check + unit tests, no build, used by the root pr-check gate
check:
	@test -d node_modules || npm ci --prefer-offline
	@npm run type-check
	@npm run test:unit -- run

ci-test: build
	@npm run test:unit
	@npm run check-browser-floor

clean:
	@-$(RM) -rf dist

install:
	#@$(MAKE) -C src-tauri $@

uninstall:
	#@$(MAKE) -C src-tauri $@
