docs: add WearOS target documentation to AGENTS.md
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 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
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
**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.
|
||||
|
||||
## Project Structure
|
||||
@@ -28,8 +35,10 @@ src/
|
||||
utils/ # formatTime, calculateSwolf, uuid, etc.
|
||||
constants/ # strokes, poolLengths, colors
|
||||
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/wearos/ # WearOS app (Kotlin/Compose) — survives prebuild
|
||||
```
|
||||
|
||||
## 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
|
||||
- **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`
|
||||
- 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)
|
||||
- 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
|
||||
|
||||
- **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
|
||||
- `react-native-css` is a NativeWind v5 peer dependency — don't remove
|
||||
- `@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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user