.PHONY: all admin test build e2e clean

all: admin build

# Build the admin UI into internal/adminui/dist, which the Go binary embeds.
admin:
	cd admin && npm ci && npm run build

build:
	go build -o parsimony ./cmd/parsimony

test:
	go test ./...
	cd admin && npm test

# End-to-end test: parsimony behind a real Postfix, both in Docker (needs a running Docker daemon).
# Set E2E_PARSIMONY_IMAGE to reuse an image instead of building one.
e2e:
	go test -tags e2e -count=1 -timeout 15m -v ./e2e

clean:
	rm -f parsimony
	node admin/scripts/clean.mjs
