-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (63 loc) · 2.69 KB
/
Copy pathMakefile
File metadata and controls
76 lines (63 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
BINARY := light-kanban
DIST := dist
GO ?= go
NPM ?= npm
FRONTEND_DIR := frontend
WEBUI_DIST := internal/webui/dist
.PHONY: build test vet cross run run-lan clean frontend-install frontend-build dev-frontend check check-vendor
# Install frontend deps exactly from the lockfile (first run / after upgrades).
frontend-install:
cd $(FRONTEND_DIR) && $(NPM) ci
# Build the React frontend and stage it where go:embed picks it up.
frontend-build:
cd $(FRONTEND_DIR) && [ -d node_modules ] || $(NPM) ci
cd $(FRONTEND_DIR) && $(NPM) run build
rm -rf $(WEBUI_DIST)
cp -R $(FRONTEND_DIR)/dist $(WEBUI_DIST)
# Production binary with the embedded frontend.
build: frontend-build
$(GO) build -o $(DIST)/$(BINARY) ./cmd/light-kanban
# Tests exercise the Go seams (HTTP API + store); the committed webui/dist
# keeps them green on a fresh clone without npm.
test:
$(GO) test ./...
vet:
$(GO) vet ./...
# Cross-compiled release artifacts (linux / darwin amd64+arm64; windows
# keeps the plain name light-kanban.exe that the docs reference).
cross: frontend-build
GOOS=linux GOARCH=amd64 $(GO) build -o $(DIST)/light-kanban-linux-amd64 ./cmd/light-kanban
GOOS=darwin GOARCH=amd64 $(GO) build -o $(DIST)/light-kanban-darwin-amd64 ./cmd/light-kanban
GOOS=darwin GOARCH=arm64 $(GO) build -o $(DIST)/light-kanban-darwin-arm64 ./cmd/light-kanban
GOOS=windows GOARCH=amd64 $(GO) build -o $(DIST)/light-kanban.exe ./cmd/light-kanban
# Integrity guard for the vendored light-kanban-worker Skill snapshot
# (skills/light-kanban-worker/): every file must match skills/manifest.json
# (SHA-256 pinned from the upstream LightDevCoder/skills release tag).
# The script also carries a --self-test with positive/negative fixtures.
check-vendor:
node scripts/verify-vendored-skill.cjs
node scripts/verify-vendored-skill.cjs --self-test
# Pre-commit gate (v1.0.4): rebuild the frontend, run its unit tests
# (vitest — product tour logic), verify the committed embedded dist matches
# the source, and run every Go check. v1.0.5 adds the vendored-Skill
# integrity guard.
# CI (.github/workflows/ci.yml) runs the same steps.
check: frontend-build
cd $(FRONTEND_DIR) && $(NPM) test
test -z "$$(gofmt -l cmd internal scripts)"
$(GO) vet ./...
$(GO) test ./...
git diff --exit-code -- $(WEBUI_DIST)
$(MAKE) check-vendor
# Run with the program's own default: loopback-only (127.0.0.1:8641).
run:
$(GO) run ./cmd/light-kanban
# Explicit LAN opt-in for development — binds all interfaces so agents on
# other machines can connect. Never the default; use it deliberately.
run-lan:
$(GO) run ./cmd/light-kanban -addr :8641
# Frontend dev server (proxies /api to the Go backend on :8641).
dev-frontend:
cd $(FRONTEND_DIR) && $(NPM) run dev
clean:
rm -rf $(DIST)