Files
khosra/Makefile
T
Claude Opus 5andbdeshi 36194a16d8 point the editor preview at the demo, and shorten the skill name
Four small things from one sitting, none of which would be reverted without the
others:

- .claude/launch.json describes the only dev server this repo has: make demo on
  localhost:8080. Deliberately not autoPort — examples/demo-site declares
  base: http://localhost:8080, so canonical, hreflang, OpenGraph and sitemap URLs
  are built from that port, and a reassigned one would make the absolute URLs on
  the page wrong while still rendering fine.
- The skill is .claude/skills/feature-loop/, without the khosra- prefix. ADR-0054
  records it, because ADR-0030 had named the prefixed form while settling the
  project name and decisions.md is append-only.
- Makefile .PHONY was missing quiet and surface, added two commits ago. A file of
  either name in the repo root would have silently shadowed the target.
- A latent row: the root listing's title reads "A Khosra Demo · A Khosra Demo",
  because base.html joins page title and site title unconditionally and at the
  root they are the same string. Found by looking at the served page — no test
  asserts a title. Theme layer, one if, and it waits for Phase G4.
2026-08-01 02:46:30 +06:00

52 lines
1.7 KiB
Makefile

# Convenience only. `go build`, `go test` and ./scripts/verify.sh are the ground truth — nothing here
# is required to work on khosra, and the gate never invokes make.
SITE ?= $(KHOSRA_SITE)
ADDR ?= localhost:8080
BIN := ./khosra
.PHONY: help build run check new demo test verify quiet surface fmt tidy clean
help: ## list targets
@grep -hE '^[a-z]+:.*##' $(MAKEFILE_LIST) | sed 's/:[^#]*## /|/' | column -t -s '|'
build: ## compile the binary
go build -o $(BIN) ./cmd/khosra
run: build ## serve a site root: make run SITE=/path/to/site
@test -n "$(SITE)" || { echo "set SITE=/path/to/site, or export KHOSRA_SITE"; exit 1; }
$(BIN) -site "$(SITE)" -addr "$(ADDR)"
check: build ## validate a site root's content: make check SITE=/path/to/site
@test -n "$(SITE)" || { echo "set SITE=/path/to/site, or export KHOSRA_SITE"; exit 1; }
$(BIN) check -site "$(SITE)"
new: build ## scaffold a bundle: make new KEY=posts/hello-world SITE=/path/to/site
@test -n "$(SITE)" || { echo "set SITE=/path/to/site, or export KHOSRA_SITE"; exit 1; }
@test -n "$(KEY)" || { echo "set KEY=posts/hello-world"; exit 1; }
$(BIN) new -site "$(SITE)" "$(KEY)"
demo: build ## serve the demo site in examples/, which exercises every feature
$(BIN) -site examples/demo-site -addr "$(ADDR)"
test: ## run tests with the race detector
go test -race ./...
verify: ## everything the harness enforces; must be green before a commit
./scripts/verify.sh
quiet: ## the same gates, printing only what needs acting on
./scripts/verify.sh --quiet
surface: ## regenerate docs/surface.md, the compressed map of the code
./scripts/surface.sh --write
fmt: ## format all Go source
gofmt -w .
tidy: ## tidy go.mod
go mod tidy
clean: ## remove build output
rm -f $(BIN)