pmat 3.11.0

PMAT - Zero-config AI context generation and code quality toolkit (CLI, MCP, HTTP)
.PHONY: help build test coverage quality wasm-full clean

help:
	@echo "WASM Project: {{project_name}}"
	@echo "=============================="
	@echo "make build          - Build WASM binary"
	@echo "make test           - Run tests"
	@echo "make coverage       - Generate coverage report"
	@echo "make quality        - Run quality gates"
	@echo "make wasm-full      - Complete WASM pipeline"
	@echo "make clean          - Clean build artifacts"

build:
	@echo "๐Ÿ”จ Building WASM binary..."
	cargo build --target wasm32-unknown-unknown --release
	@echo "โœ“ Build complete"

test:
	@echo "๐Ÿงช Running tests..."
	cargo test --all-features
	@echo "โœ“ Tests passed"

coverage:
	@echo "๐Ÿ“Š Generating coverage report..."
	cargo llvm-cov --lib --lcov --output-path target/lcov.info
	cargo llvm-cov report --html --output-dir target/coverage/html
	cargo llvm-cov report --summary-only
	@echo "๐Ÿ’ก HTML report: target/coverage/html/index.html"

quality: test
	@echo "๐Ÿ”ฌ Running quality gates..."
	cargo fmt --check
	cargo clippy --all-targets -- -D warnings
	@if command -v pmat &> /dev/null; then \
		pmat analyze complexity --max-cyclomatic 10 --path $(CURDIR); \
		pmat analyze satd --strict --path $(CURDIR); \
	else \
		echo "โš ๏ธ  PMAT not installed - skipping complexity/SATD checks"; \
	fi
	@echo "โœ“ Quality gates passed"

wasm-full: build
	@echo "๐Ÿš€ Creating optimized WASM build..."
	@mkdir -p pkg
	wasm-bindgen target/wasm32-unknown-unknown/release/{{project_name}}.wasm \
		--out-dir pkg --target web
	@echo "โœจ WASM build complete: pkg/{{project_name}}_bg.wasm"
	@ls -lh pkg/

clean:
	@echo "๐Ÿงน Cleaning build artifacts..."
	cargo clean
	rm -rf pkg target/coverage
	@echo "โœ“ Clean complete"