mobile-app: Unified React Native + Expo app combining Planner and Journal. OAuth2 PKCE auth, MapLibre maps, versioned REST API with Zod schemas, configurable server URL, offline SQLite, Web Push relay notifications. TanStack Query + Zustand state management. Jest + Maestro testing. 76 tasks across 5 phases. map-core-package: Extract renderer-agnostic map definitions (tiles, color palettes, POI categories, z-index) into @trails-cool/map-core. Pure refactor preparing for MapLibre on mobile. 27 tasks. mobile-activity-recording: GPS recording, live stats, HealthKit/Health Connect export. Separated from mobile-app for independent scheduling. mobile-nearby-sync: BLE route sync between nearby devices for offline group riding. QR waypoint sharing as simpler v1. TXQR noted as future. journal-rest-api spec: Full API contract — endpoints, auth, pagination, errors, discovery, versioning, BRouter proxy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.5 KiB
2.5 KiB
1. Package Setup
- 1.1 Create
packages/map-core/withpackage.json,tsconfig.json, add to pnpm workspace and Turborepo pipeline - 1.2 Create
src/index.tswith re-exports for all modules
2. Tile Definitions
- 2.1 Move
baseLayersandTileLayerConfigfrompackages/map/src/layers.tstopackages/map-core/src/tiles.ts - 2.2 Move
overlayLayersandOverlayLayerConfigtopackages/map-core/src/tiles.ts - 2.3 Update
packages/map/src/layers.tsto re-export from@trails-cool/map-core - 2.4 Update
packages/map/src/index.tsexports
3. Color Palettes
- 3.1 Extract
SURFACE_COLORS,DEFAULT_SURFACE_COLORfromColoredRoute.tsxtomap-core/src/colors/surface.ts - 3.2 Extract
HIGHWAY_COLORS,DEFAULT_HIGHWAY_COLORtomap-core/src/colors/highway.ts - 3.3 Extract
SMOOTHNESS_COLORS,DEFAULT_SMOOTHNESS_COLORtomap-core/src/colors/smoothness.ts - 3.4 Extract
TRACKTYPE_COLORS,DEFAULT_TRACKTYPE_COLORtomap-core/src/colors/tracktype.ts - 3.5 Extract
CYCLEWAY_COLORS,DEFAULT_CYCLEWAY_COLORtomap-core/src/colors/cycleway.ts - 3.6 Extract
BIKEROUTE_COLORS,DEFAULT_BIKEROUTE_COLORtomap-core/src/colors/bikeroute.ts - 3.7 Extract
elevationColor(),routeGradeColor()tomap-core/src/colors/elevation.ts - 3.8 Extract
maxspeedColor()tomap-core/src/colors/maxspeed.ts - 3.9 Create
map-core/src/colors/index.tsre-exporting all color maps and functions - 3.10 Update
ColoredRoute.tsxto import from@trails-cool/map-core - 3.11 Update
ElevationChart.tsxto import from@trails-cool/map-core
4. POI Categories
- 4.1 Move
PoiCategorytype andpoiCategoriesarray frompoi-categories.tstomap-core/src/poi.ts - 4.2 Move
getCategoriesForProfile()andprofileOverlayDefaultstomap-core/src/poi.ts - 4.3 Update Planner imports:
PoiPanel.tsx,use-pois.ts,use-profile-defaults.ts,poi-categories.test.ts - 4.4 Move POI snap distance constant to
map-core/src/snap.ts
5. Z-Index Constants
- 5.1 Move all z-index constants from
z-index.tstomap-core/src/z-index.ts - 5.2 Update Planner imports:
PlannerMap.tsx,PoiPanel.tsx,RouteInteraction.tsx
6. Verification
- 6.1 Run
pnpm typecheck— all packages compile - 6.2 Run
pnpm lint— no import errors - 6.3 Run
pnpm test— all existing tests pass (update import paths in test files) - 6.4 Run
pnpm test:e2e— no regressions - 6.5 Verify
map-corehas zero dependencies in itspackage.json