Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
186 lines (147 loc) · 7.52 KB
/
Copy pathMakefile
File metadata and controls
186 lines (147 loc) · 7.52 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
# ============================================================================
# Claude Watch Platform — Makefile
# Monorepo: apps/bridge (Tauri + Rust + React) & apps/mobile (Expo RN iOS)
# ============================================================================
.DEFAULT_GOAL := help
BRIDGE_DIR := apps/bridge
MOBILE_DIR := apps/mobile
TAURI_DIR := $(BRIDGE_DIR)/src-tauri
# Colors
C_CYAN := \033[36m
C_GREEN := \033[32m
C_YELLOW := \033[33m
C_RESET := \033[0m
# ─── Help ──────────────────────────────────────────────────────────────────────
.PHONY: help
help: ## Show this help
@echo ""
@echo "$(C_CYAN)Claude Watch Platform$(C_RESET)"
@echo "$(C_CYAN)=====================$(C_RESET)"
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " $(C_GREEN)%-22s$(C_RESET) %s\n", $$1, $$2}'
@echo ""
# ─── Setup / Install ──────────────────────────────────────────────────────────
.PHONY: setup
setup: setup-bridge setup-mobile ## Install all dependencies
.PHONY: setup-bridge
setup-bridge: ## Install Bridge dependencies (npm + cargo)
@echo "$(C_CYAN)▸ Installing Bridge npm deps...$(C_RESET)"
cd $(BRIDGE_DIR) && npm install
@echo "$(C_CYAN)▸ Fetching Rust crates (cargo check)...$(C_RESET)"
cd $(TAURI_DIR) && cargo check
.PHONY: setup-mobile
setup-mobile: ## Install Mobile dependencies (npm)
@echo "$(C_CYAN)▸ Installing Mobile npm deps...$(C_RESET)"
cd $(MOBILE_DIR) && npm install
# ─── Development ───────────────────────────────────────────────────────────────
.PHONY: dev
dev: dev-bridge ## Start Bridge in dev mode (alias)
.PHONY: dev-bridge
dev-bridge: ## Start Bridge (Tauri dev — Vite HMR + native window)
@echo "$(C_GREEN)▸ Starting Tauri dev...$(C_RESET)"
cd $(BRIDGE_DIR) && npm run tauri dev
.PHONY: dev-mobile
dev-mobile: ## Start Mobile Expo dev server
@echo "$(C_GREEN)▸ Starting Expo dev server...$(C_RESET)"
cd $(MOBILE_DIR) && npx expo start --dev-client
.PHONY: dev-mobile-ios
dev-mobile-ios: ## Run Mobile on iOS simulator
@echo "$(C_GREEN)▸ Running Expo on iOS...$(C_RESET)"
cd $(MOBILE_DIR) && npm run ios
.PHONY: dev-web
dev-web: ## Start Bridge Vite dev server only (no Tauri window)
@echo "$(C_GREEN)▸ Starting Vite dev server...$(C_RESET)"
cd $(BRIDGE_DIR) && npm run dev
# ─── Build ─────────────────────────────────────────────────────────────────────
.PHONY: build
build: build-bridge ## Build all (alias for build-bridge)
.PHONY: build-bridge
build-bridge: ## Build Bridge production (Tauri → .dmg/.app)
@echo "$(C_YELLOW)▸ Building Tauri release...$(C_RESET)"
cd $(BRIDGE_DIR) && npm run tauri build
.PHONY: build-bridge-debug
build-bridge-debug: ## Build Bridge debug (Tauri debug build)
@echo "$(C_YELLOW)▸ Building Tauri debug...$(C_RESET)"
cd $(BRIDGE_DIR) && npm run tauri build -- --debug
.PHONY: build-mobile
build-mobile: ## Build Mobile iOS (EAS development)
@echo "$(C_YELLOW)▸ Building Mobile (EAS development)...$(C_RESET)"
cd $(MOBILE_DIR) && npx eas build --platform ios --profile development
.PHONY: build-mobile-preview
build-mobile-preview: ## Build Mobile iOS (EAS preview)
@echo "$(C_YELLOW)▸ Building Mobile (EAS preview)...$(C_RESET)"
cd $(MOBILE_DIR) && npx eas build --platform ios --profile preview
.PHONY: build-web
build-web: ## Build Bridge frontend only (Vite)
@echo "$(C_YELLOW)▸ Building Vite frontend...$(C_RESET)"
cd $(BRIDGE_DIR) && npm run build
# ─── Test / Lint ───────────────────────────────────────────────────────────────
.PHONY: test
test: test-mobile ## Run all tests
.PHONY: test-mobile
test-mobile: ## Run Mobile Jest tests
@echo "$(C_CYAN)▸ Running Mobile tests...$(C_RESET)"
cd $(MOBILE_DIR) && npm test
.PHONY: test-bridge
test-bridge: ## Run Bridge Rust tests
@echo "$(C_CYAN)▸ Running Rust tests...$(C_RESET)"
cd $(TAURI_DIR) && cargo test
.PHONY: lint
lint: lint-mobile lint-bridge-rust ## Run all linters
.PHONY: lint-mobile
lint-mobile: ## Lint Mobile (expo lint)
cd $(MOBILE_DIR) && npm run lint
.PHONY: lint-bridge-rust
lint-bridge-rust: ## Lint Bridge Rust (clippy)
cd $(TAURI_DIR) && cargo clippy -- -D warnings
# ─── Clean ─────────────────────────────────────────────────────────────────────
.PHONY: clean
clean: clean-bridge clean-mobile ## Clean all build artifacts
.PHONY: clean-bridge
clean-bridge: ## Clean Bridge (Vite dist + Cargo target)
@echo "$(C_YELLOW)▸ Cleaning Bridge...$(C_RESET)"
rm -rf $(BRIDGE_DIR)/dist
cd $(TAURI_DIR) && cargo clean
.PHONY: clean-mobile
clean-mobile: ## Clean Mobile (Expo cache + Metro)
@echo "$(C_YELLOW)▸ Cleaning Mobile...$(C_RESET)"
rm -rf $(MOBILE_DIR)/.expo
rm -rf $(MOBILE_DIR)/dist
rm -rf $(MOBILE_DIR)/web-build
.PHONY: nuke
nuke: ## Nuclear clean — remove node_modules + cargo target
@echo "$(C_YELLOW)▸ Removing all node_modules & cargo target...$(C_RESET)"
rm -rf $(BRIDGE_DIR)/node_modules
rm -rf $(MOBILE_DIR)/node_modules
cd $(TAURI_DIR) && cargo clean
@echo "$(C_GREEN)▸ Done. Run 'make setup' to reinstall.$(C_RESET)"
# ─── Utility ───────────────────────────────────────────────────────────────────
.PHONY: status
status: ## Show project status (git + deps)
@echo "$(C_CYAN)── Git Status ──$(C_RESET)"
@git status --short
@echo ""
@echo "$(C_CYAN)── Bridge npm ──$(C_RESET)"
@[ -d $(BRIDGE_DIR)/node_modules ] && echo " node_modules: ✓" || echo " node_modules: ✗ (run make setup-bridge)"
@echo "$(C_CYAN)── Bridge Rust ──$(C_RESET)"
@[ -d $(TAURI_DIR)/target ] && echo " cargo target: ✓" || echo " cargo target: ✗ (run make setup-bridge)"
@echo "$(C_CYAN)── Mobile npm ──$(C_RESET)"
@[ -d $(MOBILE_DIR)/node_modules ] && echo " node_modules: ✓" || echo " node_modules: ✗ (run make setup-mobile)"
.PHONY: doctor
doctor: ## Check prerequisites (node, npm, cargo, tauri-cli, expo)
@echo "$(C_CYAN)Checking prerequisites...$(C_RESET)"
@printf " node: " && (node --version 2>/dev/null || echo "✗ NOT FOUND")
@printf " npm: " && (npm --version 2>/dev/null || echo "✗ NOT FOUND")
@printf " cargo: " && (cargo --version 2>/dev/null || echo "✗ NOT FOUND")
@printf " rustc: " && (rustc --version 2>/dev/null || echo "✗ NOT FOUND")
@printf " tauri-cli: " && (cd $(BRIDGE_DIR) && npx tauri --version 2>/dev/null || echo "✗ NOT FOUND (run make setup-bridge)")
@printf " expo-cli: " && (cd $(MOBILE_DIR) && npx expo --version 2>/dev/null || echo "✗ NOT FOUND (run make setup-mobile)")
@echo ""
@echo "$(C_GREEN)Done.$(C_RESET)"
.PHONY: open-bridge
open-bridge: ## Open Bridge project in Finder
open $(BRIDGE_DIR)
.PHONY: open-mobile
open-mobile: ## Open Mobile project in Finder
open $(MOBILE_DIR)