-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
207 lines (165 loc) · 7.29 KB
/
Copy pathMakefile
File metadata and controls
207 lines (165 loc) · 7.29 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# =============================================================================
# ɳTasks repo-level Makefile
#
# Thin wrapper over backend/Makefile + apps/mobile (React Native/Expo).
#
# nSelf-First: `make up` delegates to `nself start` via backend/Makefile.
# Run `make build` once before first `make up` (generates docker-compose.yml).
# =============================================================================
BACKEND := backend
APP_MOBILE := apps/mobile
APP_DESKTOP := apps/desktop
WEB_NTASK := web/ntask
# ---------------------------------------------------------------------------
# Backend — nSelf-First
# ---------------------------------------------------------------------------
.PHONY: build
build: ## Build the nSelf backend stack (run once before first `make up`)
$(MAKE) -C $(BACKEND) build
.PHONY: up
up: ## Start the backend stack via nself start (nSelf-First)
$(MAKE) -C $(BACKEND) up
.PHONY: down
down: ## Stop the backend stack via nself stop
$(MAKE) -C $(BACKEND) down
.PHONY: restart
restart: ## Restart the backend stack
$(MAKE) -C $(BACKEND) restart
.PHONY: logs
logs: ## Tail backend logs
$(MAKE) -C $(BACKEND) logs
.PHONY: status
status: ## Show backend service status
$(MAKE) -C $(BACKEND) status
.PHONY: health
health: ## Run backend health checks (Hasura, Auth, Storage)
$(MAKE) -C $(BACKEND) health
.PHONY: test
test: ## Run the backend smoke-test suite
$(MAKE) -C $(BACKEND) test
# ---------------------------------------------------------------------------
# Mobile — React Native / Expo (apps/mobile)
# ---------------------------------------------------------------------------
.PHONY: mobile-install
mobile-install: ## Install mobile app dependencies (pnpm install)
cd $(APP_MOBILE) && pnpm install
.PHONY: mobile-start
mobile-start: ## Start Expo dev server (scan QR with Expo Go)
cd $(APP_MOBILE) && pnpm start
.PHONY: mobile-ios
mobile-ios: ## Run mobile app on iOS simulator
cd $(APP_MOBILE) && pnpm ios
.PHONY: mobile-android
mobile-android: ## Run mobile app on Android emulator
cd $(APP_MOBILE) && pnpm android
.PHONY: mobile-test
mobile-test: ## Run mobile unit tests
cd $(APP_MOBILE) && pnpm test
.PHONY: mobile-lint
mobile-lint: ## Run mobile linter
cd $(APP_MOBILE) && pnpm lint
.PHONY: mobile-typecheck
mobile-typecheck: ## Run TypeScript type check on mobile app
cd $(APP_MOBILE) && pnpm typecheck
.PHONY: mobile-ci-local
mobile-ci-local: ## Run the same gate CI runs for apps/mobile/ (lint + typecheck + test)
@echo "==> [mobile-ci-local] lint"
cd $(APP_MOBILE) && pnpm lint
@echo "==> [mobile-ci-local] typecheck"
cd $(APP_MOBILE) && pnpm typecheck
@echo "==> [mobile-ci-local] test"
cd $(APP_MOBILE) && pnpm test
@echo "==> [mobile-ci-local] DONE"
.PHONY: ci-mobile
ci-mobile: mobile-lint mobile-typecheck mobile-test ## Run full mobile CI gate
# ---------------------------------------------------------------------------
# Bootstrap / Upgrade / Demo
# ---------------------------------------------------------------------------
.PHONY: bootstrap
bootstrap: ## One-command local dev setup: backend + mobile install (idempotent)
$(MAKE) -C $(BACKEND) bootstrap
@echo "--- Mobile ---"
cd $(APP_MOBILE) && pnpm install
@echo ""
@echo "Bootstrap complete!"
@echo " Backend: http://localhost:8080"
@echo " Hasura Console: http://localhost:8080/console"
@echo " Mailhog UI: http://localhost:8025"
@echo " Mobile: make mobile-start"
.PHONY: upgrade
upgrade: ## Upgrade ntask to latest (backup -> pull -> rebuild -> migrate -> health)
$(MAKE) -C $(BACKEND) upgrade
.PHONY: demo-seed
demo-seed: ## Seed demo data (requires DEMO_SEED=1 to prevent accidents)
$(MAKE) -C $(BACKEND) demo-seed DEMO_SEED=$(DEMO_SEED)
# ---------------------------------------------------------------------------
# Combined gates
# ---------------------------------------------------------------------------
.PHONY: ci-local
ci-local: mobile-ci-local test ## Run full CI gate: mobile lint/typecheck/test + backend smoke
.PHONY: test-all
test-all: ## Run all lint + test suites (RN + backend)
$(MAKE) mobile-ci-local && $(MAKE) test
# ---------------------------------------------------------------------------
# Desktop — Tauri 2 (apps/desktop wrapping web/ntask)
# ---------------------------------------------------------------------------
.PHONY: desktop-dev
desktop-dev: ## Start Tauri desktop in dev mode (requires web/ntask dev server on :3017)
@echo "==> Ensure web/ntask dev server is running: make web-dev (or cd web/ntask && pnpm dev)"
cd $(APP_DESKTOP) && pnpm tauri dev
.PHONY: web-dev
web-dev: ## Start web/ntask Vite dev server on :3017
cd $(WEB_NTASK) && pnpm dev
.PHONY: desktop-build
desktop-build: ## Full production desktop build (builds web/ntask first, then Tauri)
@echo "==> [desktop-build] Building web/ntask SPA..."
cd $(WEB_NTASK) && pnpm build
@echo "==> [desktop-build] Building Tauri desktop..."
cd $(APP_DESKTOP) && pnpm tauri build
@echo "==> [desktop-build] DONE"
.PHONY: desktop-build-debug
desktop-build-debug: ## Debug desktop build (builds web/ntask first, then Tauri --debug)
@echo "==> [desktop-build-debug] Building web/ntask SPA..."
cd $(WEB_NTASK) && pnpm build
@echo "==> [desktop-build-debug] Building Tauri desktop (debug)..."
cd $(APP_DESKTOP) && pnpm tauri build --debug
@echo "==> [desktop-build-debug] DONE"
.PHONY: desktop-install
desktop-install: ## Install desktop npm deps
cd $(APP_DESKTOP) && pnpm install
.PHONY: tag-desktop
tag-desktop: ## Tag and push a desktop release (reads version from tauri.conf.json)
$(eval VERSION := $(shell jq -r '.version' $(APP_DESKTOP)/src-tauri/tauri.conf.json))
@echo "Tagging ntask-v$(VERSION)"
git tag "ntask-v$(VERSION)"
git push origin "ntask-v$(VERSION)"
# ---------------------------------------------------------------------------
# Legacy Flutter targets (archived — app/ was removed in the RN migration)
#
# These no-op and print a pointer. They are NOT a compatibility shim: a fork
# that still has app/ gets the warning too, not a working build. They exist
# purely so `make flutter-test` answers with the right command instead of
# "No rule to make target", which is the whole of their value.
# ---------------------------------------------------------------------------
.PHONY: flutter-run
flutter-run: ## (Legacy Flutter shell — not the active app surface)
@echo "WARNING: Flutter app/ is archived. Active app is apps/mobile (React Native)."
@echo "Use: make mobile-start"
.PHONY: flutter-test
flutter-test: ## (Legacy Flutter shell — not the active app surface)
@echo "WARNING: Flutter app/ is archived. Active tests are in apps/mobile."
@echo "Use: make mobile-test"
.PHONY: flutter-analyze
flutter-analyze: ## (Legacy Flutter shell — not the active app surface)
@echo "WARNING: Flutter app/ is archived."
@echo "Use: make mobile-lint && make mobile-typecheck"
.PHONY: flutter-build-web
flutter-build-web: ## (Legacy Flutter shell — not the active app surface)
@echo "WARNING: Flutter app/ is archived. Web surface is web/ntask (Vite)."
# ---------------------------------------------------------------------------
# Help
# ---------------------------------------------------------------------------
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help