-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
346 lines (283 loc) · 11 KB
/
Copy pathMakefile
File metadata and controls
346 lines (283 loc) · 11 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
.PHONY: dev dev-mobile build start lint lint-check format format-check format-lint \
install clean clean-install test test-watch test-coverage test-ui \
e2e e2e-headed e2e-ui e2e-journey e2e-chrome e2e-report e2e-install e2e-debug \
tauri-dev tauri-build \
tauri-build-macos tauri-build-macos-arm tauri-build-macos-intel \
tauri-build-windows tauri-build-windows-arm \
tauri-build-linux tauri-build-linux-arm \
tauri-android-init tauri-android-dev tauri-android-build tauri-android-build-aab \
android-deep-link-scheme \
tauri-ios-init tauri-ios-dev tauri-ios-build \
tauri-info tauri-update tauri-clean tauri-icons \
tauri-build-all-desktop tauri-build-all-mobile
# ============================================
# Next.js Development & Build
# ============================================
# Start the development server
dev:
pnpm run dev
# Start dev server bound to all interfaces for mobile device access
dev-mobile:
@LOCAL_IP=$$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null || echo "localhost"); \
echo "Starting dev server at http://$$LOCAL_IP:3001"; \
echo "Run 'make tauri-ios-dev' or 'make tauri-android-dev' in another terminal"; \
pnpm exec next dev -H 0.0.0.0 -p 3001
# Build the application for production
build:
pnpm run build
# Start the production server
start:
pnpm run start
# ============================================
# Code Quality
# ============================================
# Run ESLint to check for code quality issues
lint:
pnpm run lint
# Run ESLint to check for code quality issues without fixing
lint-check:
pnpm run lint:check
# Format code using Prettier
format:
pnpm run format
# Check code formatting without making changes
format-check:
pnpm run format:check
# Format and lint code in one command
format-lint:
pnpm run format-lint
# ============================================
# Dependencies
# ============================================
# Install all dependencies
install:
pnpm install
# Clean build artifacts and dependencies
clean:
rm -rf node_modules
rm -rf .next
rm -rf dist
rm -rf dist-electron
rm -rf .turbo
rm -rf playwright-report
rm -rf e2e/playwright-report
rm -rf test-results
rm -rf e2e/test-results
rm -rf coverage
# Clean everything and reinstall
clean-install:
$(MAKE) clean
$(MAKE) install
# ============================================
# Unit Tests (Vitest)
# ============================================
# Run all tests
test:
pnpm run test
# Run all tests in watch mode
test-watch:
pnpm run test:watch
# Run all tests in coverage mode
test-coverage:
pnpm run test:coverage
# Run all tests in UI mode
test-ui:
pnpm run test:ui
# ============================================
# E2E Tests (Playwright)
# ============================================
# Run all e2e tests (all browsers)
e2e:
cd e2e && npx playwright test
# Run e2e tests in headed mode (visible browser)
e2e-headed:
cd e2e && npx playwright test --headed
# Run e2e tests in UI mode (interactive)
e2e-ui:
cd e2e && npx playwright test --ui
# Run e2e tests for a specific journey (usage: make e2e-journey J=01)
e2e-journey:
cd e2e && npx playwright test journeys/$(J)-*.spec.ts
# Run e2e tests only on Chrome
e2e-chrome:
cd e2e && npx playwright test --project=skills-desktop-chrome
# Run e2e tests and show the HTML report
e2e-report:
cd e2e && npx playwright show-report playwright-report
# Install Playwright browsers
e2e-install:
npx playwright install --with-deps
# Run e2e tests in debug mode
e2e-debug:
cd e2e && npx playwright test --debug
# ============================================
# Tauri Desktop Development
# ============================================
# Tauri development mode (runs Next.js dev server + Tauri desktop app)
tauri-dev:
cargo tauri dev
# Build Tauri for the current platform (auto-detects OS)
tauri-build:
cargo tauri build
# ============================================
# Tauri macOS Builds
# ============================================
# Build for macOS (Universal binary - Intel + Apple Silicon)
tauri-build-macos:
cargo tauri build --target universal-apple-darwin
# Build for macOS Apple Silicon only
tauri-build-macos-arm:
cargo tauri build --target aarch64-apple-darwin
# Build for macOS Intel only
tauri-build-macos-intel:
cargo tauri build --target x86_64-apple-darwin
# ============================================
# Tauri Windows Builds
# ============================================
# Build for Windows x64
tauri-build-windows:
cargo tauri build --target x86_64-pc-windows-msvc
# Build for Windows ARM64
tauri-build-windows-arm:
cargo tauri build --target aarch64-pc-windows-msvc
# ============================================
# Tauri Linux Builds
# ============================================
# Build for Linux x64
tauri-build-linux:
cargo tauri build --target x86_64-unknown-linux-gnu
# Build for Linux ARM64
tauri-build-linux-arm:
cargo tauri build --target aarch64-unknown-linux-gnu
# ============================================
# Tauri Mobile - Android
# ============================================
# Initialize Android project (run once)
tauri-android-init:
cargo tauri android init
@bash scripts/android-add-deep-link-scheme.sh
# Re-apply the iblai-skills:// custom URL scheme intent filters to the generated
# (gitignored) Android manifest so SSO deep links route the browser back into the
# app. Idempotent; runs automatically before every Android build/dev target.
android-deep-link-scheme:
@bash scripts/android-add-deep-link-scheme.sh
# Run Android dev build (auto-detects local IP for dev server)
# Run 'make dev-mobile' first in another terminal
tauri-android-dev: android-deep-link-scheme
@LOCAL_IP=$$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null); \
if [ -z "$$LOCAL_IP" ]; then \
echo "Error: Could not detect local IP address"; \
exit 1; \
fi; \
echo "Using dev server at http://$$LOCAL_IP:3001"; \
TAURI_DEV_URL="http://$$LOCAL_IP:3001" cargo tauri android dev \
--config '{"build":{"devUrl":"http://'"$$LOCAL_IP"':3001","frontendDist":"http://'"$$LOCAL_IP"':3001"}}'
# Build for Android (release APK)
tauri-android-build: android-deep-link-scheme
cargo tauri android build
# Build for Android (release AAB for Play Store)
tauri-android-build-aab: android-deep-link-scheme
cargo tauri android build --aab
# ============================================
# Tauri Mobile - iOS (macOS only)
# ============================================
# Initialize iOS project (run once)
tauri-ios-init:
cargo tauri ios init
# Run iOS dev build (auto-detects local IP for dev server)
# Run 'make dev-mobile' first in another terminal
tauri-ios-dev:
@LOCAL_IP=$$(ipconfig getifaddr en0 2>/dev/null || ipconfig getifaddr en1 2>/dev/null); \
if [ -z "$$LOCAL_IP" ]; then \
echo "Error: Could not detect local IP address"; \
exit 1; \
fi; \
echo "Using dev server at http://$$LOCAL_IP:3001"; \
TAURI_DEV_URL="http://$$LOCAL_IP:3001" cargo tauri ios dev \
--config '{"build":{"devUrl":"http://'"$$LOCAL_IP"':3001","frontendDist":"http://'"$$LOCAL_IP"':3001"}}'
# Build for iOS (release)
tauri-ios-build:
cargo tauri ios build
# ============================================
# Tauri Utilities
# ============================================
# Check Tauri build dependencies and environment
tauri-info:
cargo tauri info
# Update Tauri CLI and Cargo dependencies
tauri-update:
cargo install tauri-cli --version "^2.0.0"
cd src-tauri && cargo update
# Clean Tauri build artifacts
tauri-clean:
rm -rf src-tauri/target
# Generate Tauri icons from a source image (requires 1024x1024 PNG at src-tauri/icons/icon.png)
tauri-icons:
cargo tauri icon src-tauri/icons/icon.png
# ============================================
# Tauri Build All Platforms
# ============================================
# Build for all desktop platforms (run on appropriate CI runners)
tauri-build-all-desktop: tauri-build-macos tauri-build-windows tauri-build-linux
@echo "All desktop builds completed"
# Build for all mobile platforms
tauri-build-all-mobile: tauri-android-build tauri-ios-build
@echo "All mobile builds completed"
# ============================================
# Help
# ============================================
help:
@echo "Available commands:"
@echo ""
@echo " Development:"
@echo " make dev - Start Next.js dev server"
@echo " make dev-mobile - Start dev server on 0.0.0.0:3001 for mobile"
@echo " make build - Build for production"
@echo " make start - Start production server"
@echo ""
@echo " Code Quality:"
@echo " make lint - Lint and fix"
@echo " make lint-check - Lint without fixing"
@echo " make format - Format with Prettier"
@echo " make format-check - Check formatting"
@echo ""
@echo " Testing:"
@echo " make test - Run unit tests"
@echo " make test-watch - Run unit tests in watch mode"
@echo " make test-coverage - Run unit tests with coverage"
@echo " make e2e - Run all e2e tests"
@echo " make e2e-headed - Run e2e tests with visible browser"
@echo " make e2e-ui - Run e2e tests in interactive UI"
@echo " make e2e-journey J=01 - Run a specific e2e journey"
@echo " make e2e-chrome - Run e2e tests on Chrome only"
@echo " make e2e-debug - Run e2e tests in debug mode"
@echo ""
@echo " Tauri Desktop:"
@echo " make tauri-dev - Desktop dev mode with hot reload"
@echo " make tauri-build - Build for current platform"
@echo " make tauri-build-macos - Build macOS universal binary"
@echo " make tauri-build-macos-arm - Build macOS Apple Silicon"
@echo " make tauri-build-macos-intel - Build macOS Intel"
@echo " make tauri-build-windows - Build Windows x64"
@echo " make tauri-build-windows-arm - Build Windows ARM64"
@echo " make tauri-build-linux - Build Linux x64"
@echo " make tauri-build-linux-arm - Build Linux ARM64"
@echo ""
@echo " Tauri Mobile:"
@echo " make tauri-ios-init - Initialize iOS project (run once)"
@echo " make tauri-ios-dev - iOS dev build (run dev-mobile first)"
@echo " make tauri-ios-build - iOS release build"
@echo " make tauri-android-init - Initialize Android project (run once)"
@echo " make tauri-android-dev - Android dev build (run dev-mobile first)"
@echo " make tauri-android-build - Android release APK"
@echo " make tauri-android-build-aab - Android release AAB"
@echo ""
@echo " Tauri Utilities:"
@echo " make tauri-info - Show build environment info"
@echo " make tauri-update - Update Tauri CLI and deps"
@echo " make tauri-clean - Clean Rust build artifacts"
@echo " make tauri-icons - Generate icons from source image"
yalc-refresh:
yalc remove @iblai/iblai-js @iblai/data-layer @iblai/web-utils @iblai/web-containers && yalc add @iblai/iblai-js @iblai/data-layer @iblai/web-utils @iblai/web-containers
yalc-remove:
yalc remove @iblai/iblai-js @iblai/data-layer @iblai/web-utils @iblai/web-containers