create-ern-boilerplate 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,6 +2,82 @@
|
|
|
2
2
|
|
|
3
3
|
Quick start guide for AI agents working with this boilerplate.
|
|
4
4
|
|
|
5
|
+
### 📋 Pre-Development Checklist
|
|
6
|
+
|
|
7
|
+
Before writing any new code, **ALWAYS** verify:
|
|
8
|
+
|
|
9
|
+
- [ ] **Memory Safety**
|
|
10
|
+
- All useEffect hooks have proper cleanup functions
|
|
11
|
+
- Timers/intervals are cleared on unmount
|
|
12
|
+
- Event listeners are removed on unmount
|
|
13
|
+
- Async operations check if component is still mounted
|
|
14
|
+
|
|
15
|
+
- [ ] **Performance**
|
|
16
|
+
- Heavy computations use `useMemo`
|
|
17
|
+
- Callback functions use `useCallback`
|
|
18
|
+
- Lists use `FlatList` (not `ScrollView` + `map`)
|
|
19
|
+
- Images are optimized and cached
|
|
20
|
+
- Components are memoized where appropriate
|
|
21
|
+
|
|
22
|
+
- [ ] **Error Handling**
|
|
23
|
+
- Try-catch blocks for all async operations
|
|
24
|
+
- Error boundaries wrap critical components
|
|
25
|
+
- User-friendly error messages displayed
|
|
26
|
+
- Errors logged for debugging
|
|
27
|
+
|
|
28
|
+
- [ ] **Race Conditions**
|
|
29
|
+
- Concurrent API calls are properly handled
|
|
30
|
+
- AbortController used for cancellable requests
|
|
31
|
+
- Latest request tracking implemented
|
|
32
|
+
- Functional setState used for state updates
|
|
33
|
+
|
|
34
|
+
- [ ] **Infinite Loops**
|
|
35
|
+
- useEffect dependencies are correct
|
|
36
|
+
- No circular dependencies
|
|
37
|
+
- Objects/arrays in dependencies are memoized
|
|
38
|
+
- Zustand selectors are specific
|
|
39
|
+
|
|
40
|
+
- [ ] **Type Safety**
|
|
41
|
+
- No `any` types (use `unknown` and type guards)
|
|
42
|
+
- No unsafe type assertions
|
|
43
|
+
- API responses properly typed
|
|
44
|
+
- Non-null assertions avoided
|
|
45
|
+
- Discriminated unions for complex states
|
|
46
|
+
|
|
47
|
+
- [ ] **Safe Area Handling**
|
|
48
|
+
- All screens use SafeAreaView or useSafeAreaInsets
|
|
49
|
+
- Bottom components respect home indicator (insets.bottom)
|
|
50
|
+
- Headers account for status bar and notch (insets.top)
|
|
51
|
+
- Modals and bottom sheets have safe area
|
|
52
|
+
- Fixed/absolute positioned elements use insets
|
|
53
|
+
- Tested on devices with notch/Dynamic Island
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### 🔍 Code Review Checklist
|
|
58
|
+
|
|
59
|
+
When reviewing code, **REJECT** if:
|
|
60
|
+
|
|
61
|
+
- ❌ useEffect without cleanup function (for subscriptions, timers, listeners)
|
|
62
|
+
- ❌ Setting state on potentially unmounted component
|
|
63
|
+
- ❌ Heavy computation in render without useMemo
|
|
64
|
+
- ❌ Callback in props without useCallback
|
|
65
|
+
- ❌ Long list using ScrollView + map
|
|
66
|
+
- ❌ Async operation without try-catch
|
|
67
|
+
- ❌ No error boundary around critical features
|
|
68
|
+
- ❌ Concurrent API calls without race condition handling
|
|
69
|
+
- ❌ Object/array in useEffect dependencies without useMemo
|
|
70
|
+
- ❌ Type `any` instead of proper typing
|
|
71
|
+
- ❌ Non-null assertions (!) without null checks
|
|
72
|
+
- ❌ API responses not properly typed
|
|
73
|
+
- ❌ Screen without SafeAreaView or useSafeAreaInsets
|
|
74
|
+
- ❌ Fixed header/footer without safe area padding
|
|
75
|
+
- ❌ Bottom bar without insets.bottom (home indicator overlap)
|
|
76
|
+
- ❌ Hardcoded padding values (44, 20) instead of dynamic insets
|
|
77
|
+
- ❌ Modal without safe area handling
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
5
81
|
## 🚀 First Time Setup
|
|
6
82
|
|
|
7
83
|
When you first enter this project, read these files **in order**:
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "EXPO_USE_DEV_SERVER=false expo start --clear --go",
|
|
7
7
|
"dev": "EXPO_USE_DEV_SERVER=false expo start --clear --go",
|
|
8
|
+
"start:tunnel": "expo start --clear --tunnel",
|
|
8
9
|
"start:staging": "EXPO_USE_DEV_SERVER=false APP_ENV=staging expo start --clear --go",
|
|
9
10
|
"start:prod": "EXPO_USE_DEV_SERVER=false APP_ENV=production expo start --clear --go",
|
|
10
11
|
"android": "expo start --android",
|
|
@@ -2,6 +2,83 @@
|
|
|
2
2
|
|
|
3
3
|
Quick start guide for AI agents working with this boilerplate.
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
### 📋 Pre-Development Checklist
|
|
7
|
+
|
|
8
|
+
Before writing any new code, **ALWAYS** verify:
|
|
9
|
+
|
|
10
|
+
- [ ] **Memory Safety**
|
|
11
|
+
- All useEffect hooks have proper cleanup functions
|
|
12
|
+
- Timers/intervals are cleared on unmount
|
|
13
|
+
- Event listeners are removed on unmount
|
|
14
|
+
- Async operations check if component is still mounted
|
|
15
|
+
|
|
16
|
+
- [ ] **Performance**
|
|
17
|
+
- Heavy computations use `useMemo`
|
|
18
|
+
- Callback functions use `useCallback`
|
|
19
|
+
- Lists use `FlatList` (not `ScrollView` + `map`)
|
|
20
|
+
- Images are optimized and cached
|
|
21
|
+
- Components are memoized where appropriate
|
|
22
|
+
|
|
23
|
+
- [ ] **Error Handling**
|
|
24
|
+
- Try-catch blocks for all async operations
|
|
25
|
+
- Error boundaries wrap critical components
|
|
26
|
+
- User-friendly error messages displayed
|
|
27
|
+
- Errors logged for debugging
|
|
28
|
+
|
|
29
|
+
- [ ] **Race Conditions**
|
|
30
|
+
- Concurrent API calls are properly handled
|
|
31
|
+
- AbortController used for cancellable requests
|
|
32
|
+
- Latest request tracking implemented
|
|
33
|
+
- Functional setState used for state updates
|
|
34
|
+
|
|
35
|
+
- [ ] **Infinite Loops**
|
|
36
|
+
- useEffect dependencies are correct
|
|
37
|
+
- No circular dependencies
|
|
38
|
+
- Objects/arrays in dependencies are memoized
|
|
39
|
+
- Zustand selectors are specific
|
|
40
|
+
|
|
41
|
+
- [ ] **Type Safety**
|
|
42
|
+
- No `any` types (use `unknown` and type guards)
|
|
43
|
+
- No unsafe type assertions
|
|
44
|
+
- API responses properly typed
|
|
45
|
+
- Non-null assertions avoided
|
|
46
|
+
- Discriminated unions for complex states
|
|
47
|
+
|
|
48
|
+
- [ ] **Safe Area Handling**
|
|
49
|
+
- All screens use SafeAreaView or useSafeAreaInsets
|
|
50
|
+
- Bottom components respect home indicator (insets.bottom)
|
|
51
|
+
- Headers account for status bar and notch (insets.top)
|
|
52
|
+
- Modals and bottom sheets have safe area
|
|
53
|
+
- Fixed/absolute positioned elements use insets
|
|
54
|
+
- Tested on devices with notch/Dynamic Island
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### 🔍 Code Review Checklist
|
|
59
|
+
|
|
60
|
+
When reviewing code, **REJECT** if:
|
|
61
|
+
|
|
62
|
+
- ❌ useEffect without cleanup function (for subscriptions, timers, listeners)
|
|
63
|
+
- ❌ Setting state on potentially unmounted component
|
|
64
|
+
- ❌ Heavy computation in render without useMemo
|
|
65
|
+
- ❌ Callback in props without useCallback
|
|
66
|
+
- ❌ Long list using ScrollView + map
|
|
67
|
+
- ❌ Async operation without try-catch
|
|
68
|
+
- ❌ No error boundary around critical features
|
|
69
|
+
- ❌ Concurrent API calls without race condition handling
|
|
70
|
+
- ❌ Object/array in useEffect dependencies without useMemo
|
|
71
|
+
- ❌ Type `any` instead of proper typing
|
|
72
|
+
- ❌ Non-null assertions (!) without null checks
|
|
73
|
+
- ❌ API responses not properly typed
|
|
74
|
+
- ❌ Screen without SafeAreaView or useSafeAreaInsets
|
|
75
|
+
- ❌ Fixed header/footer without safe area padding
|
|
76
|
+
- ❌ Bottom bar without insets.bottom (home indicator overlap)
|
|
77
|
+
- ❌ Hardcoded padding values (44, 20) instead of dynamic insets
|
|
78
|
+
- ❌ Modal without safe area handling
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
5
82
|
## 🚀 First Time Setup
|
|
6
83
|
|
|
7
84
|
When you first enter this project, read these files **in order**:
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "EXPO_USE_DEV_SERVER=false expo start --clear --go",
|
|
7
7
|
"dev": "EXPO_USE_DEV_SERVER=false expo start --clear --go",
|
|
8
|
+
"start:tunnel": "expo start --clear --tunnel",
|
|
8
9
|
"start:staging": "EXPO_USE_DEV_SERVER=false APP_ENV=staging expo start --clear --go",
|
|
9
10
|
"start:prod": "EXPO_USE_DEV_SERVER=false APP_ENV=production expo start --clear --go",
|
|
10
11
|
"android": "expo start --android",
|