chore(Makefile): restructure Makefile to add new targets and improve clarity of commands
This commit is contained in:
45
Makefile
45
Makefile
@@ -1,10 +1,41 @@
|
||||
all: clean format build
|
||||
# -------- Config --------
|
||||
SHELL := /bin/sh
|
||||
|
||||
format:
|
||||
biome format --write .
|
||||
ZOLA ?= zola
|
||||
BIOME ?= npx biome
|
||||
|
||||
build:
|
||||
zola build
|
||||
BUILD_DIR := public
|
||||
|
||||
# -------- Targets --------
|
||||
.PHONY: help serve build clean format lint fix fix-unsafe check ci
|
||||
|
||||
help: ## Show this help
|
||||
@awk 'BEGIN{FS":.*##"; printf "\nTargets:\n"} /^[a-zA-Z0-9_.-]+:.*##/{printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST); echo
|
||||
|
||||
serve: ## Run Zola dev server (http://127.0.0.1:1111)
|
||||
$(ZOLA) serve
|
||||
|
||||
build: ## Build site into ./public
|
||||
$(ZOLA) build
|
||||
|
||||
clean: ## Remove ./public
|
||||
rm -rf "$(BUILD_DIR)"
|
||||
|
||||
format: ## Format JS/JSON/CSS with Biome (no linting)
|
||||
$(BIOME) format --write .
|
||||
|
||||
lint: ## Lint with Biome (no writes)
|
||||
$(BIOME) ci .
|
||||
|
||||
fix: ## Lint+auto-fix safe changes with Biome
|
||||
$(BIOME) check --write .
|
||||
|
||||
fix-unsafe: ## Lint+auto-fix incl. unsafe (e.g., template literals)
|
||||
$(BIOME) check --write --unsafe .
|
||||
|
||||
check: ## Zola link/content checks
|
||||
$(ZOLA) check
|
||||
|
||||
ci: ## CI-friendly: lint (Biome) + Zola checks
|
||||
$(BIOME) ci . && $(ZOLA) check
|
||||
|
||||
clean:
|
||||
rm -rf public/
|
||||
|
Reference in New Issue
Block a user