
# ⚡ Fuse Makefile

.PHONY: backend frontend build start

backend: ## Run the backend server with reload
	uv run fuse start --reload

frontend: ## Run the frontend development server
	cd ui && npm run dev

build: ## Build the frontend production assets
	cd ui && npm run build

dist: build ## Package the project for distribution
	uv build

start: ## Start the production Fuse server
	uv run fuse start

release: ## Bump version, tag, and push with automatic version suggestion
	@CUR_VERSION=$$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml); \
	NEXT_VERSION=$$(echo $$CUR_VERSION | awk -F. '{print $$1"."$$2"."$$3+1}'); \
	read -p "Enter version [$$NEXT_VERSION]: " VERSION; \
	VERSION=$${VERSION:-$$NEXT_VERSION}; \
	echo "Releasing $$VERSION..."; \
	sed -i '' "s/^version = \".*\"/version = \"$$VERSION\"/" pyproject.toml; \
	git add . ; \
	git commit -m "chore: release $$VERSION"; \
	git tag v$$VERSION; \
	git push origin main; \
	git push origin v$$VERSION
