-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathMakefile
More file actions
188 lines (158 loc) · 6.25 KB
/
Makefile
File metadata and controls
188 lines (158 loc) · 6.25 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
.PHONY: help setup setup-symlinks install build build-desktop build-android build-ios clean run dev doctor doctor-q docker-up docker-down docker-nuke docker-status thunderbot-pull thunderbot-push thunderbot-customize
# Color definitions
BLUE := \033[0;34m
GREEN := \033[0;32m
YELLOW := \033[0;33m
NC := \033[0m # No Color
# Default target
help:
@echo "Available commands:"
@echo " make setup - Install frontend and backend dependencies"
@echo " make install - Install frontend dependencies"
@echo " make run - Start both backend and frontend development servers"
@echo " make dev - Alias for 'make run'"
@echo " make build - Build frontend for production"
@echo " make build-desktop - Build Tauri desktop app"
@echo " make build-android - Build Tauri Android app"
@echo " make build-ios - Build Tauri iOS app"
@echo " make clean - Clean build artifacts"
@echo " make format - Format frontend, backend (JS/TS), and Rust code"
@echo " make format-check - Check formatting for frontend, backend, and Rust code"
@echo " make doctor - Verify all dev tools and env files are configured"
@echo " make docker-up - Start docker containers (PowerSync, Mongo, etc.)"
@echo " make docker-down - Stop docker containers"
@echo " make docker-nuke - Destroy all docker data and recreate from scratch"
@echo " make docker-status - Show docker container status"
@echo " make thunderbot-pull - Pull latest skills from thunderbot"
@echo " make thunderbot-push - Push skill changes back to thunderbot"
@echo " make thunderbot-customize - Fork a thunderbot command for local edits (FILE=name.md)"
@echo " make setup-symlinks - Create agent symlinks for Claude Code"
# Create agent symlinks for Claude Code
setup-symlinks:
@mkdir -p .claude/commands .claude/agents
@for f in .thunderbot/thunder*.md; do ln -sf "../../$$f" ".claude/commands/$$(basename $$f)"; done
@ln -sfn ../../.thunderbot/thunderbot .claude/commands/thunderbot
@ln -sf ../../.thunderbot/thunderbot.md .claude/agents/thunderbot.md
@echo "$(GREEN)✓ Agent symlinks configured$(NC)"
# Setup project - install frontend and backend dependencies
setup: setup-symlinks
@echo "$(BLUE)→ Installing frontend dependencies...$(NC)"
bun install
@echo "$(BLUE)→ Installing backend dependencies...$(NC)"
cd backend && bun install
@echo "$(GREEN)✓ Setup complete!$(NC)"
# Install dependencies
install:
bun install
# Build frontend
build:
bun run build
# Build desktop app
build-desktop:
bun install
bun tauri build
# Build desktop app with specific target
build-desktop-target:
bun install
bun tauri build --target $(TARGET)
# Build desktop app with bundles and target
build-desktop-full:
bun install
bun tauri build --bundles $(BUNDLES) --target $(TARGET)
# Build Android app
build-android:
bun install
bun tauri android build
# Build iOS app
build-ios:
bun install
bun tauri ios build --export-method app-store-connect
# Clean build artifacts
clean:
- rm -rf dist src-tauri/target node_modules
- (cd src-tauri && cargo clean)
# Linting
lint:
bun run lint
lint-fix:
bun run lint:fix
# Formatting
format:
@echo "$(BLUE)→ Formatting frontend code...$(NC)"
bun run format
@echo "$(BLUE)→ Formatting backend code...$(NC)"
cd backend && bun run format
@echo "$(BLUE)→ Formatting Rust code...$(NC)"
bun run format:rust
@echo "$(GREEN)✓ Formatting complete!$(NC)"
format-check:
@echo "$(BLUE)→ Checking frontend formatting...$(NC)"
bun run format-check
@echo "$(BLUE)→ Checking backend formatting...$(NC)"
cd backend && bun run format-check
@echo "$(BLUE)→ Checking Rust formatting...$(NC)"
bun run format:rust-check
@echo "$(GREEN)✓ Format check complete!$(NC)"
# Type checking
type-check:
bun run type-check
# Run tests
test:
@echo "$(BLUE)→ Running frontend tests...$(NC)"
@bun test || echo "$(YELLOW) No frontend tests found$(NC)"
@echo "$(BLUE)→ Running backend tests...$(NC)"
@cd backend && bun test
# Run all checks
check:
bun run check
# Start development servers (backend and frontend)
run:
@echo "$(BLUE)→ Starting backend and frontend development servers...$(NC)"
@echo "$(YELLOW) Backend will run on http://localhost:8000$(NC)"
@echo "$(YELLOW) Frontend will run on http://localhost:5173$(NC)"
@echo "$(YELLOW) Press Ctrl+C to stop both servers$(NC)"
@echo ""
@# Kill any existing processes on the ports first
@-lsof -ti:8000 | xargs kill -9 2>/dev/null || true
@-lsof -ti:5173 | xargs kill -9 2>/dev/null || true
@# Start backend in background and frontend in foreground
cd backend && bun run dev & \
BACKEND_PID=$$!; \
echo "$(GREEN)✓ Backend started (PID: $$BACKEND_PID)$(NC)"; \
sleep 2; \
bun run dev || (kill $$BACKEND_PID 2>/dev/null && exit 1)
# Alias for run
dev: run
# Environment doctor (use `make doctor-q` for quiet mode — only shows issues)
doctor:
@bash scripts/thunderdoctor.sh
doctor-q:
@bash scripts/thunderdoctor.sh --quiet
# Docker management
docker-up:
@echo "$(BLUE)→ Starting docker containers...$(NC)"
docker compose -f powersync-service/docker-compose.yml up -d
@echo "$(GREEN)✓ Docker containers started!$(NC)"
docker-down:
@echo "$(BLUE)→ Stopping docker containers...$(NC)"
docker compose -f powersync-service/docker-compose.yml down
@echo "$(GREEN)✓ Docker containers stopped!$(NC)"
docker-nuke:
@bash scripts/docker-nuke.sh
docker-status:
@bash scripts/docker-status.sh
# Thunderbot skill sync
thunderbot-pull:
@echo "$(BLUE)→ Pulling latest skills from thunderbot...$(NC)"
git subtree pull --prefix=.thunderbot thunderbot main --squash
@$(MAKE) setup-symlinks
@echo "$(GREEN)✓ Skills updated!$(NC)"
thunderbot-push:
@echo "$(BLUE)→ Pushing skill changes to thunderbot...$(NC)"
git subtree push --prefix=.thunderbot thunderbot main
@echo "$(GREEN)✓ Skills pushed!$(NC)"
thunderbot-customize:
@if [ -z "$(FILE)" ]; then echo "Usage: make thunderbot-customize FILE=thunderfix.md"; exit 1; fi
@if [ ! -L ".claude/commands/$(FILE)" ]; then echo "$(YELLOW).claude/commands/$(FILE) is not a symlink — already customized or doesn't exist$(NC)"; exit 1; fi
@rm ".claude/commands/$(FILE)" && cp ".thunderbot/$(FILE)" ".claude/commands/$(FILE)"
@echo "$(GREEN)✓ .claude/commands/$(FILE) is now a local copy — edit freely$(NC)"