-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
145 lines (99 loc) · 6.85 KB
/
Copy pathMakefile
File metadata and controls
145 lines (99 loc) · 6.85 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.PHONY: dev build build-mac build-mac-arm build-linux \
test vet check lint frontend-test frontend-lint frontend-build frontend-install \
harness-check verify website-dev website-build website-check \
pulsar-up pulsar-bootstrap pulsar-smoke pulsar-seed \
pulsar-go-smoke pulsar-token-up pulsar-token-bootstrap \
pulsar-token-smoke pulsar-token-seed pulsar-token-go-smoke pulsar-token-down \
pulsar-token-clean generate clean help
HUGO ?= hugo
WEBSITE_BASE_URL ?= https://example.test/topicconsole/
# ── Dev ────────────────────────────────────────────────────────────────────────
dev: ## Start development server with hot reload
wails dev
# ── Build ──────────────────────────────────────────────────────────────────────
build: ## Build for current platform
./scripts/wails-build.sh
@if [ "$$(uname)" = "Darwin" ] && [ -d build/bin/TopicConsole.app ]; then \
codesign --force --deep -s - build/bin/TopicConsole.app; \
echo "✓ ad-hoc signed: build/bin/TopicConsole.app"; \
fi
build-mac: ## Build for macOS Intel (darwin/amd64)
./scripts/wails-build.sh -platform darwin/amd64
codesign --force --deep -s - build/bin/TopicConsole.app
build-mac-arm: ## Build for macOS Apple Silicon (darwin/arm64)
./scripts/wails-build.sh -platform darwin/arm64
codesign --force --deep -s - build/bin/TopicConsole.app
build-linux: ## Build for Linux amd64
./scripts/wails-build.sh -platform linux/amd64 -tags webkit2_41
# ── Test & Lint ────────────────────────────────────────────────────────────────
test: ## Run Go tests
go test ./...
vet: ## Run go vet
go vet ./...
check: vet test ## Run go vet + tests
frontend-lint: ## Run frontend ESLint
cd frontend && npm run lint
frontend-test: ## Run frontend unit tests
cd frontend && npm test
lint: vet frontend-lint ## Run all linters (go vet + eslint)
harness-check: ## Validate discoverable Trellis context structure
./scripts/check-harness.sh
verify: harness-check check frontend-test frontend-lint frontend-build ## Run full local verification
# ── Website ───────────────────────────────────────────────────────────────────
website-dev: ## Start the Hugo website development server
cd website && $(HUGO) server --buildDrafts --disableFastRender
website-build: ## Build the production website
cd website && $(HUGO) --gc --minify --cleanDestinationDir --baseURL "$(WEBSITE_BASE_URL)"
website-check: website-build ## Build and validate website output and SEO
python3 scripts/check-website.py --site-dir website/public
# ── Pulsar local integration ──────────────────────────────────────────────────
pulsar-up: ## Start local Pulsar standalone with Docker
./scripts/pulsar-local.sh up
pulsar-bootstrap: ## Create local Pulsar tenant/namespace/topic
./scripts/pulsar-local.sh bootstrap
pulsar-smoke: ## Produce and consume one message on local Pulsar
./scripts/pulsar-local.sh smoke
pulsar-seed: ## Create persistent demo data for local Pulsar UI testing
./scripts/pulsar-local.sh seed
pulsar-go-smoke: pulsar-bootstrap ## Run Go Pulsar client integration smoke test
TOPICCONSOLE_PULSAR_INTEGRATION=1 \
TOPICCONSOLE_PULSAR_ADMIN_URL=$${TOPICCONSOLE_PULSAR_ADMIN_URL:-http://localhost:18081} \
go test . ./internal/pulsarconn ./internal/pulsaradmin ./internal/pulsarmeta ./internal/pulsarproduce ./internal/search ./internal/stream -run 'TestLocalPulsar.*Smoke' -count=1
pulsar-token-up: ## Start local token-auth Pulsar standalone with Docker
./scripts/pulsar-token-local.sh up
pulsar-token-bootstrap: ## Create local token-auth Pulsar tenant/namespace/topic
./scripts/pulsar-token-local.sh bootstrap
pulsar-token-smoke: ## Produce and consume one message on token-auth local Pulsar
./scripts/pulsar-token-local.sh smoke
pulsar-token-seed: ## Create persistent demo data for token-auth local Pulsar UI testing
./scripts/pulsar-token-local.sh seed
pulsar-token-go-smoke: pulsar-token-seed ## Run Go integration smoke test against token-auth local Pulsar
TOPICCONSOLE_PULSAR_INTEGRATION=1 \
TOPICCONSOLE_PULSAR_URL=$${TOPICCONSOLE_PULSAR_URL:-pulsar://localhost:16650} \
TOPICCONSOLE_PULSAR_ADMIN_URL=$${TOPICCONSOLE_PULSAR_ADMIN_URL:-http://localhost:18082} \
TOPICCONSOLE_PULSAR_TOKEN="$$(./scripts/pulsar-token-local.sh token)" \
go test . ./internal/discovery ./internal/pulsarconn ./internal/pulsaradmin ./internal/pulsarmeta ./internal/pulsarproduce ./internal/search ./internal/stream -run 'TestLocalPulsar.*Smoke' -count=1
pulsar-down: ## Stop local Pulsar standalone
./scripts/pulsar-local.sh down
pulsar-clean: ## Stop local Pulsar standalone and remove its data volume
./scripts/pulsar-local.sh clean
pulsar-token-down: ## Stop local token-auth Pulsar standalone
./scripts/pulsar-token-local.sh down
pulsar-token-clean: ## Stop local token-auth Pulsar standalone and remove its data volume/token dir
./scripts/pulsar-token-local.sh clean
# ── Frontend ───────────────────────────────────────────────────────────────────
frontend-install: ## Install frontend npm dependencies
cd frontend && npm install
frontend-build: ## Build frontend only (tsc + vite)
cd frontend && npm run build
# ── Wails ──────────────────────────────────────────────────────────────────────
generate: ## Regenerate Wails bindings after changing app.go
wails generate module
# ── Cleanup ────────────────────────────────────────────────────────────────────
clean: ## Remove build artifacts (build/bin)
rm -rf build/bin
# ── Help ───────────────────────────────────────────────────────────────────────
help: ## Show this help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help