.PHONY: tw-build tw-watch htmx-copy flags-copy assets server test db-reset fmt

tw-build:
	npm run tw:build

tw-watch:
	npm run tw:watch

htmx-copy:
	mkdir -p web/static/vendor && cp node_modules/htmx.org/dist/htmx.min.js web/static/vendor/htmx.min.js

flags-copy:
	mkdir -p web/static/vendor/flags && cp assets/flags/*.svg web/static/vendor/flags/

assets: htmx-copy flags-copy tw-build

server:
	go run ./cmd/server

test:
	go test ./...

db-reset:
	rm -f ./data/app.db ./data/app.sqlite3

fmt:
	gofmt -w $$(find ./cmd ./internal -type f -name '*.go')
