docs: add WearOS target documentation to AGENTS.md

This commit is contained in:
2026-08-08 12:55:07 +02:00
parent de90d9b937
commit 3cbe65442f
+22 -3
View File
@@ -1,6 +1,6 @@
# SwimBuddy # SwimBuddy
Swimming workout tracker with Apple Watch companion app. Expo 57 + React Native 0.86 + NativeWind v5 + Drizzle ORM + Swift Watch target. Swimming workout tracker with Apple Watch and WearOS companion apps. Expo 57 + React Native 0.86 + NativeWind v5 + Drizzle ORM + Swift Watch target + Kotlin WearOS target.
## Commands ## Commands
@@ -11,6 +11,13 @@ npx expo prebuild -p ios # Regenerate ios/ dir (safe — targets/ persists)
npx drizzle-kit generate # Regenerate SQL migrations after schema changes npx drizzle-kit generate # Regenerate SQL migrations after schema changes
``` ```
**WearOS:**
```bash
./scripts/build-wearos.sh debug # Build debug APK
./scripts/build-wearos.sh release # Build release APK
./scripts/generate-wearos-icon.sh assets/icon.png # Generate launcher icons
```
No `npm test` or lint scripts exist yet. No `babel.config.js` — NativeWind v5 uses CSS-first config. No `npm test` or lint scripts exist yet. No `babel.config.js` — NativeWind v5 uses CSS-first config.
## Project Structure ## Project Structure
@@ -28,8 +35,10 @@ src/
utils/ # formatTime, calculateSwolf, uuid, etc. utils/ # formatTime, calculateSwolf, uuid, etc.
constants/ # strokes, poolLengths, colors constants/ # strokes, poolLengths, colors
types/ # workout.ts, common.ts types/ # workout.ts, common.ts
modules/watch-connectivity/# Expo native module bridging WCSession modules/watch-connectivity/ # Expo native module bridging WCSession (Apple Watch)
modules/wear-connectivity/ # Expo native module bridging Wear Data Layer (WearOS)
targets/watch/ # Apple Watch app (Swift/SwiftUI) — survives prebuild targets/watch/ # Apple Watch app (Swift/SwiftUI) — survives prebuild
targets/wearos/ # WearOS app (Kotlin/Compose) — survives prebuild
``` ```
## Key Conventions ## Key Conventions
@@ -40,7 +49,7 @@ targets/watch/ # Apple Watch app (Swift/SwiftUI) — survives preb
- **`className` types**: `nativewind-env.d.ts` at root — don't delete - **`className` types**: `nativewind-env.d.ts` at root — don't delete
- **lightningcss pinned** to 1.30.1 in package.json overrides — required by NativeWind v5 - **lightningcss pinned** to 1.30.1 in package.json overrides — required by NativeWind v5
## Watch Target ## Watch Target (Apple Watch)
- Lives in `targets/watch/`, NOT in `ios/` — survives `expo prebuild --clean` - Lives in `targets/watch/`, NOT in `ios/` — survives `expo prebuild --clean`
- Config: `targets/watch/expo-target.config.js` - Config: `targets/watch/expo-target.config.js`
@@ -50,6 +59,15 @@ targets/watch/ # Apple Watch app (Swift/SwiftUI) — survives preb
- HealthKit for swim workout tracking (indoor swimming) - HealthKit for swim workout tracking (indoor swimming)
- Swift types `StoredWorkout`, `StoredSet`, `CompletedLap` in `WorkoutManager.swift` - Swift types `StoredWorkout`, `StoredSet`, `CompletedLap` in `WorkoutManager.swift`
## WearOS Target
- Lives in `targets/wearos/` — survives `expo prebuild --clean`
- Kotlin + Jetpack Compose with Wear OS Compose libraries
- Build: `./scripts/build-wearos.sh` or open `targets/wearos/` in Android Studio
- Uses Wear Data Layer API for phone↔watch communication
- Health Services Client for swim workout tracking
- Namespace: `nl.guidoit.swimbuddy`
## Database ## Database
- **expo-sqlite** + **Drizzle ORM** (SQLite dialect, expo driver) - **expo-sqlite** + **Drizzle ORM** (SQLite dialect, expo driver)
@@ -94,6 +112,7 @@ These are hard-won bugs that will waste hours if rediscovered:
- Watch target compiles as separate Xcode target — not a RN module - Watch target compiles as separate Xcode target — not a RN module
- `react-native-css` is a NativeWind v5 peer dependency — don't remove - `react-native-css` is a NativeWind v5 peer dependency — don't remove
- `@bacons/apple-targets` plugin must be in app.json plugins array - `@bacons/apple-targets` plugin must be in app.json plugins array
- WearOS uses same `applicationId` as iOS bundle identifier — don't change without updating both
## Expo Docs ## Expo Docs