Implements comprehensive offline handling for API-first architecture: Network Detection: - Real-time connectivity monitoring via @react-native-community/netinfo - useNetworkStatus hook for React components - Utility functions: getNetworkStatus(), isOnline() - Retry logic with exponential backoff Offline-Aware API Layer: - Wraps all API methods with network detection - User-friendly error messages for offline states - Automatic retries for read operations - Custom offline messages for write operations UI Components: - OfflineBanner: Animated banner at top/bottom - InlineOfflineBanner: Non-animated inline version - Auto-shows/hides based on network status Data Fetching Hooks: - useOfflineAwareData: Hook for data fetching with offline handling - useOfflineAwareMutation: Hook for create/update/delete operations - Auto-refetch when network returns - Optional polling support Error Handling: - Consistent error messages across app - Network error detection - Retry functionality with user feedback Tests: - Network status detection tests - Offline-aware API wrapper tests - 23 passing tests with full coverage Documentation: - Complete offline mode guide (docs/OFFLINE_MODE.md) - Usage examples (components/examples/OfflineAwareExample.tsx) - Best practices and troubleshooting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
91 lines
2.9 KiB
JSON
91 lines
2.9 KiB
JSON
{
|
|
"name": "wellnuo",
|
|
"main": "expo-router/entry",
|
|
"version": "1.0.0",
|
|
"scripts": {
|
|
"start": "expo start",
|
|
"reset-project": "node ./scripts/reset-project.js",
|
|
"build-info": "node scripts/generate-build-info.js",
|
|
"android": "npm run build-info && expo run:android",
|
|
"ios": "npm run build-info && expo run:ios",
|
|
"web": "expo start --web",
|
|
"test": "jest",
|
|
"test:watch": "jest --watch",
|
|
"test:coverage": "jest --coverage",
|
|
"lint": "expo lint",
|
|
"postinstall": "patch-package"
|
|
},
|
|
"dependencies": {
|
|
"@expo/vector-icons": "^15.0.3",
|
|
"@orbital-systems/react-native-esp-idf-provisioning": "^0.5.0",
|
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
"@react-native-community/netinfo": "^11.5.0",
|
|
"@react-native-picker/picker": "^2.11.4",
|
|
"@react-navigation/bottom-tabs": "^7.4.0",
|
|
"@react-navigation/elements": "^2.6.3",
|
|
"@react-navigation/native": "^7.1.8",
|
|
"@stripe/stripe-react-native": "0.50.3",
|
|
"expo": "~54.0.31",
|
|
"expo-audio": "~1.1.1",
|
|
"expo-av": "~16.0.8",
|
|
"expo-build-properties": "~1.0.10",
|
|
"expo-camera": "~17.0.10",
|
|
"expo-clipboard": "~8.0.8",
|
|
"expo-constants": "~18.0.13",
|
|
"expo-crypto": "^15.0.8",
|
|
"expo-dev-client": "~6.0.20",
|
|
"expo-device": "^8.0.10",
|
|
"expo-file-system": "~19.0.21",
|
|
"expo-font": "~14.0.10",
|
|
"expo-haptics": "~15.0.8",
|
|
"expo-image": "~3.0.11",
|
|
"expo-image-manipulator": "^14.0.8",
|
|
"expo-image-picker": "~17.0.10",
|
|
"expo-linking": "~8.0.11",
|
|
"expo-notifications": "~0.32.16",
|
|
"expo-router": "~6.0.21",
|
|
"expo-secure-store": "^15.0.8",
|
|
"expo-speech": "~14.0.8",
|
|
"expo-speech-recognition": "^3.0.1",
|
|
"expo-splash-screen": "~31.0.13",
|
|
"expo-status-bar": "~3.0.9",
|
|
"expo-symbols": "~1.0.8",
|
|
"expo-system-ui": "~6.0.9",
|
|
"expo-web-browser": "~15.0.10",
|
|
"mqtt": "^5.14.1",
|
|
"react": "19.1.0",
|
|
"react-dom": "19.1.0",
|
|
"react-native": "0.81.5",
|
|
"react-native-base64": "^0.2.2",
|
|
"react-native-ble-plx": "^3.5.0",
|
|
"react-native-fs": "^2.20.0",
|
|
"react-native-gesture-handler": "~2.28.0",
|
|
"react-native-get-random-values": "~1.11.0",
|
|
"react-native-reanimated": "~4.1.1",
|
|
"react-native-root-toast": "^4.0.1",
|
|
"react-native-safe-area-context": "~5.6.0",
|
|
"react-native-screens": "~4.16.0",
|
|
"react-native-web": "~0.21.0",
|
|
"react-native-webview": "13.15.0",
|
|
"react-native-worklets": "0.5.1",
|
|
"react-native-zip-archive": "^7.0.2",
|
|
"ultravox-react-native": "^0.0.1"
|
|
},
|
|
"devDependencies": {
|
|
"@testing-library/jest-native": "^5.4.3",
|
|
"@testing-library/react-native": "^13.3.3",
|
|
"@types/jest": "^30.0.0",
|
|
"@types/react": "~19.1.0",
|
|
"eslint": "^9.25.0",
|
|
"eslint-config-expo": "~10.0.0",
|
|
"jest": "^30.2.0",
|
|
"jest-expo": "^54.0.16",
|
|
"patch-package": "^8.0.1",
|
|
"playwright": "^1.57.0",
|
|
"sharp": "^0.34.5",
|
|
"ts-jest": "^29.4.6",
|
|
"typescript": "~5.9.2"
|
|
},
|
|
"private": true
|
|
}
|