@croacroa/react-native-template 1.0.0 → 2.0.0

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.
Files changed (69) hide show
  1. package/.github/workflows/ci.yml +187 -184
  2. package/.github/workflows/eas-build.yml +55 -55
  3. package/.github/workflows/eas-update.yml +50 -50
  4. package/CHANGELOG.md +106 -106
  5. package/CONTRIBUTING.md +377 -377
  6. package/README.md +399 -399
  7. package/__tests__/components/snapshots.test.tsx +131 -0
  8. package/__tests__/integration/auth-api.test.tsx +227 -0
  9. package/__tests__/performance/VirtualizedList.perf.test.tsx +362 -0
  10. package/app/(public)/onboarding.tsx +5 -5
  11. package/app.config.ts +45 -2
  12. package/assets/images/.gitkeep +7 -7
  13. package/components/onboarding/OnboardingScreen.tsx +370 -370
  14. package/components/onboarding/index.ts +2 -2
  15. package/components/providers/SuspenseBoundary.tsx +357 -0
  16. package/components/providers/index.ts +13 -0
  17. package/components/ui/Avatar.tsx +316 -316
  18. package/components/ui/Badge.tsx +416 -416
  19. package/components/ui/BottomSheet.tsx +307 -307
  20. package/components/ui/Checkbox.tsx +261 -261
  21. package/components/ui/OptimizedImage.tsx +369 -369
  22. package/components/ui/Select.tsx +240 -240
  23. package/components/ui/VirtualizedList.tsx +285 -0
  24. package/components/ui/index.ts +23 -18
  25. package/constants/config.ts +97 -54
  26. package/docs/adr/001-state-management.md +79 -79
  27. package/docs/adr/002-styling-approach.md +130 -130
  28. package/docs/adr/003-data-fetching.md +155 -155
  29. package/docs/adr/004-auth-adapter-pattern.md +144 -144
  30. package/docs/adr/README.md +78 -78
  31. package/hooks/index.ts +27 -25
  32. package/hooks/useApi.ts +102 -5
  33. package/hooks/useAuth.tsx +82 -0
  34. package/hooks/useBiometrics.ts +295 -295
  35. package/hooks/useDeepLinking.ts +256 -256
  36. package/hooks/useMFA.ts +499 -0
  37. package/hooks/useNotifications.ts +39 -0
  38. package/hooks/useOffline.ts +32 -2
  39. package/hooks/usePerformance.ts +434 -434
  40. package/hooks/useTheme.tsx +76 -0
  41. package/hooks/useUpdates.ts +358 -358
  42. package/i18n/index.ts +194 -77
  43. package/i18n/locales/ar.json +101 -0
  44. package/i18n/locales/de.json +101 -0
  45. package/i18n/locales/en.json +101 -101
  46. package/i18n/locales/es.json +101 -0
  47. package/i18n/locales/fr.json +101 -101
  48. package/jest.config.js +4 -4
  49. package/maestro/README.md +113 -113
  50. package/maestro/config.yaml +35 -35
  51. package/maestro/flows/login.yaml +62 -62
  52. package/maestro/flows/mfa-login.yaml +92 -0
  53. package/maestro/flows/mfa-setup.yaml +86 -0
  54. package/maestro/flows/navigation.yaml +68 -68
  55. package/maestro/flows/offline-conflict.yaml +101 -0
  56. package/maestro/flows/offline-sync.yaml +128 -0
  57. package/maestro/flows/offline.yaml +60 -60
  58. package/maestro/flows/register.yaml +94 -94
  59. package/package.json +175 -170
  60. package/services/analytics.ts +428 -428
  61. package/services/api.ts +340 -340
  62. package/services/authAdapter.ts +333 -333
  63. package/services/backgroundSync.ts +626 -0
  64. package/services/index.ts +54 -22
  65. package/services/security.ts +229 -0
  66. package/tailwind.config.js +47 -47
  67. package/utils/accessibility.ts +446 -446
  68. package/utils/index.ts +52 -43
  69. package/utils/withAccessibility.tsx +272 -0
@@ -1,68 +1,68 @@
1
- appId: ${APP_ID}
2
- name: Navigation Flow
3
- tags:
4
- - navigation
5
- - smoke
6
- ---
7
- # Navigation Flow Test
8
- # Tests navigation between main screens
9
-
10
- - launchApp:
11
- clearState: true
12
-
13
- # Login first
14
- - tapOn:
15
- text: "Email"
16
- - inputText: "test@example.com"
17
- - tapOn:
18
- text: "Password"
19
- - inputText: "password123"
20
- - tapOn:
21
- text: "Sign In"
22
- index: 1
23
- - waitForAnimationToEnd:
24
- timeout: 5000
25
-
26
- # Verify we're on home
27
- - assertVisible: "Home"
28
-
29
- # Navigate to Profile
30
- - tapOn: "Profile"
31
- - waitForAnimationToEnd
32
- - assertVisible: "Profile"
33
- - assertVisible: "test@example.com"
34
-
35
- # Navigate to Settings
36
- - tapOn: "Settings"
37
- - waitForAnimationToEnd
38
- - assertVisible: "Settings"
39
- - assertVisible: "Appearance"
40
- - assertVisible: "Theme"
41
-
42
- # Test theme toggle
43
- - tapOn: "Theme"
44
- - waitForAnimationToEnd
45
- - assertVisible: "Dark"
46
- - tapOn: "Dark"
47
- - waitForAnimationToEnd
48
-
49
- # Go back
50
- - back
51
- - assertVisible: "Settings"
52
-
53
- # Navigate back to Home
54
- - tapOn: "Home"
55
- - waitForAnimationToEnd
56
- - assertVisible: "Home"
57
-
58
- # Test sign out
59
- - tapOn: "Profile"
60
- - waitForAnimationToEnd
61
- - scrollUntilVisible:
62
- element: "Sign Out"
63
- direction: DOWN
64
- - tapOn: "Sign Out"
65
- - waitForAnimationToEnd
66
-
67
- # Verify we're back on login
68
- - assertVisible: "Sign In"
1
+ appId: ${APP_ID}
2
+ name: Navigation Flow
3
+ tags:
4
+ - navigation
5
+ - smoke
6
+ ---
7
+ # Navigation Flow Test
8
+ # Tests navigation between main screens
9
+
10
+ - launchApp:
11
+ clearState: true
12
+
13
+ # Login first
14
+ - tapOn:
15
+ text: "Email"
16
+ - inputText: "test@example.com"
17
+ - tapOn:
18
+ text: "Password"
19
+ - inputText: "password123"
20
+ - tapOn:
21
+ text: "Sign In"
22
+ index: 1
23
+ - waitForAnimationToEnd:
24
+ timeout: 5000
25
+
26
+ # Verify we're on home
27
+ - assertVisible: "Home"
28
+
29
+ # Navigate to Profile
30
+ - tapOn: "Profile"
31
+ - waitForAnimationToEnd
32
+ - assertVisible: "Profile"
33
+ - assertVisible: "test@example.com"
34
+
35
+ # Navigate to Settings
36
+ - tapOn: "Settings"
37
+ - waitForAnimationToEnd
38
+ - assertVisible: "Settings"
39
+ - assertVisible: "Appearance"
40
+ - assertVisible: "Theme"
41
+
42
+ # Test theme toggle
43
+ - tapOn: "Theme"
44
+ - waitForAnimationToEnd
45
+ - assertVisible: "Dark"
46
+ - tapOn: "Dark"
47
+ - waitForAnimationToEnd
48
+
49
+ # Go back
50
+ - back
51
+ - assertVisible: "Settings"
52
+
53
+ # Navigate back to Home
54
+ - tapOn: "Home"
55
+ - waitForAnimationToEnd
56
+ - assertVisible: "Home"
57
+
58
+ # Test sign out
59
+ - tapOn: "Profile"
60
+ - waitForAnimationToEnd
61
+ - scrollUntilVisible:
62
+ element: "Sign Out"
63
+ direction: DOWN
64
+ - tapOn: "Sign Out"
65
+ - waitForAnimationToEnd
66
+
67
+ # Verify we're back on login
68
+ - assertVisible: "Sign In"
@@ -0,0 +1,101 @@
1
+ appId: ${APP_ID}
2
+ name: Offline Conflict Resolution Flow
3
+ tags:
4
+ - offline
5
+ - sync
6
+ - conflict
7
+ - edge-case
8
+ ---
9
+ # Offline Conflict Resolution Test
10
+ # Tests conflict resolution when offline changes conflict with server
11
+
12
+ - launchApp:
13
+ clearState: true
14
+
15
+ # Login
16
+ - tapOn:
17
+ text: "Email"
18
+ - inputText: "test@example.com"
19
+ - tapOn:
20
+ text: "Password"
21
+ - inputText: "password123"
22
+ - tapOn:
23
+ text: "Sign In"
24
+ index: 1
25
+ - waitForAnimationToEnd:
26
+ timeout: 5000
27
+
28
+ # Navigate to editable content
29
+ - tapOn: "Profile"
30
+ - waitForAnimationToEnd
31
+
32
+ # Note the current state
33
+ - assertVisible: "Profile"
34
+
35
+ # Go offline
36
+ - setAirplaneMode:
37
+ enabled: true
38
+ - waitForAnimationToEnd:
39
+ timeout: 3000
40
+
41
+ # Edit while offline
42
+ - tapOn:
43
+ text: "Edit Profile"
44
+ optional: true
45
+ - waitForAnimationToEnd
46
+ - tapOn:
47
+ text: "Name"
48
+ optional: true
49
+ - clearText
50
+ - inputText: "Client Version"
51
+ - tapOn:
52
+ text: "Save"
53
+ optional: true
54
+ - waitForAnimationToEnd
55
+
56
+ # Simulate server having different version (via test flag if available)
57
+ # In real test, another client would have modified the same data
58
+
59
+ # Go back online
60
+ - setAirplaneMode:
61
+ enabled: false
62
+ - waitForAnimationToEnd:
63
+ timeout: 5000
64
+
65
+ # Sync should detect conflict
66
+ - waitForAnimationToEnd:
67
+ timeout: 10000
68
+
69
+ # If conflict dialog appears
70
+ - assertVisible:
71
+ text:
72
+ - "Conflict"
73
+ - "modified"
74
+ - "resolve"
75
+ optional: true
76
+
77
+ # Choose resolution strategy (if UI presents options)
78
+ - tapOn:
79
+ text: "Keep my changes"
80
+ optional: true
81
+
82
+ # Or
83
+ - tapOn:
84
+ text: "Use server version"
85
+ optional: true
86
+
87
+ # Or
88
+ - tapOn:
89
+ text: "Merge"
90
+ optional: true
91
+
92
+ - waitForAnimationToEnd:
93
+ timeout: 3000
94
+
95
+ # Verify resolution completed
96
+ - assertVisible:
97
+ text:
98
+ - "resolved"
99
+ - "success"
100
+ - "updated"
101
+ optional: true
@@ -0,0 +1,128 @@
1
+ appId: ${APP_ID}
2
+ name: Offline Sync Flow
3
+ tags:
4
+ - offline
5
+ - sync
6
+ - edge-case
7
+ ---
8
+ # Offline Sync Test
9
+ # Tests offline mutation queueing and sync when back online
10
+
11
+ - launchApp:
12
+ clearState: true
13
+
14
+ # Login while online
15
+ - tapOn:
16
+ text: "Email"
17
+ - inputText: "test@example.com"
18
+ - tapOn:
19
+ text: "Password"
20
+ - inputText: "password123"
21
+ - tapOn:
22
+ text: "Sign In"
23
+ index: 1
24
+ - waitForAnimationToEnd:
25
+ timeout: 5000
26
+
27
+ # Verify login successful
28
+ - assertVisible: "Home"
29
+
30
+ # Navigate to a screen where we can create/edit data
31
+ - tapOn: "Profile"
32
+ - waitForAnimationToEnd
33
+
34
+ # Enable airplane mode to go offline
35
+ - setAirplaneMode:
36
+ enabled: true
37
+
38
+ # Wait for offline detection
39
+ - waitForAnimationToEnd:
40
+ timeout: 3000
41
+
42
+ # Verify offline indicator
43
+ - assertVisible:
44
+ text: "offline"
45
+ optional: true
46
+
47
+ # Try to edit profile (should queue mutation)
48
+ - tapOn:
49
+ text: "Edit Profile"
50
+ optional: true
51
+ - waitForAnimationToEnd
52
+
53
+ # Make a change
54
+ - tapOn:
55
+ text: "Name"
56
+ optional: true
57
+ - clearText
58
+ - inputText: "Offline Updated Name"
59
+
60
+ # Save (should queue for sync)
61
+ - tapOn:
62
+ text: "Save"
63
+ optional: true
64
+ - waitForAnimationToEnd
65
+
66
+ # Verify queued message appears
67
+ - assertVisible:
68
+ text:
69
+ - "queued"
70
+ - "pending"
71
+ - "sync"
72
+ - "offline"
73
+ optional: true
74
+
75
+ # Make another change while offline
76
+ - tapOn:
77
+ text: "Edit"
78
+ optional: true
79
+ - waitForAnimationToEnd
80
+ - tapOn:
81
+ text: "Bio"
82
+ optional: true
83
+ - inputText: "Updated while offline"
84
+ - tapOn:
85
+ text: "Save"
86
+ optional: true
87
+ - waitForAnimationToEnd
88
+
89
+ # Verify multiple items queued
90
+ - assertVisible:
91
+ text:
92
+ - "2 pending"
93
+ - "pending sync"
94
+ optional: true
95
+
96
+ # Go back online
97
+ - setAirplaneMode:
98
+ enabled: false
99
+
100
+ # Wait for sync
101
+ - waitForAnimationToEnd:
102
+ timeout: 10000
103
+
104
+ # Verify sync started
105
+ - assertVisible:
106
+ text:
107
+ - "Syncing"
108
+ - "online"
109
+ optional: true
110
+
111
+ # Wait for sync to complete
112
+ - waitForAnimationToEnd:
113
+ timeout: 5000
114
+
115
+ # Verify sync completed
116
+ - assertVisible:
117
+ text:
118
+ - "synced"
119
+ - "updated"
120
+ - "success"
121
+ optional: true
122
+
123
+ # Verify changes persisted
124
+ - tapOn: "Profile"
125
+ - waitForAnimationToEnd
126
+ - assertVisible:
127
+ text: "Offline Updated Name"
128
+ optional: true
@@ -1,60 +1,60 @@
1
- appId: ${APP_ID}
2
- name: Offline Mode Flow
3
- tags:
4
- - offline
5
- - edge-case
6
- ---
7
- # Offline Mode Test
8
- # Tests app behavior when offline
9
-
10
- - launchApp:
11
- clearState: true
12
-
13
- # Login while online
14
- - tapOn:
15
- text: "Email"
16
- - inputText: "test@example.com"
17
- - tapOn:
18
- text: "Password"
19
- - inputText: "password123"
20
- - tapOn:
21
- text: "Sign In"
22
- index: 1
23
- - waitForAnimationToEnd:
24
- timeout: 5000
25
-
26
- # Verify login successful
27
- - assertVisible: "Home"
28
-
29
- # Enable airplane mode (simulates offline)
30
- - setAirplaneMode:
31
- enabled: true
32
-
33
- # Wait for offline detection
34
- - waitForAnimationToEnd:
35
- timeout: 3000
36
-
37
- # Verify offline indicator appears
38
- - assertVisible:
39
- text: "offline"
40
- optional: true
41
-
42
- # Try to perform an action that requires network
43
- - tapOn: "Profile"
44
- - waitForAnimationToEnd
45
-
46
- # The cached data should still be visible
47
- - assertVisible: "Profile"
48
-
49
- # Disable airplane mode
50
- - setAirplaneMode:
51
- enabled: false
52
-
53
- # Wait for reconnection
54
- - waitForAnimationToEnd:
55
- timeout: 5000
56
-
57
- # Verify back online
58
- - assertVisible:
59
- text: "online"
60
- optional: true
1
+ appId: ${APP_ID}
2
+ name: Offline Mode Flow
3
+ tags:
4
+ - offline
5
+ - edge-case
6
+ ---
7
+ # Offline Mode Test
8
+ # Tests app behavior when offline
9
+
10
+ - launchApp:
11
+ clearState: true
12
+
13
+ # Login while online
14
+ - tapOn:
15
+ text: "Email"
16
+ - inputText: "test@example.com"
17
+ - tapOn:
18
+ text: "Password"
19
+ - inputText: "password123"
20
+ - tapOn:
21
+ text: "Sign In"
22
+ index: 1
23
+ - waitForAnimationToEnd:
24
+ timeout: 5000
25
+
26
+ # Verify login successful
27
+ - assertVisible: "Home"
28
+
29
+ # Enable airplane mode (simulates offline)
30
+ - setAirplaneMode:
31
+ enabled: true
32
+
33
+ # Wait for offline detection
34
+ - waitForAnimationToEnd:
35
+ timeout: 3000
36
+
37
+ # Verify offline indicator appears
38
+ - assertVisible:
39
+ text: "offline"
40
+ optional: true
41
+
42
+ # Try to perform an action that requires network
43
+ - tapOn: "Profile"
44
+ - waitForAnimationToEnd
45
+
46
+ # The cached data should still be visible
47
+ - assertVisible: "Profile"
48
+
49
+ # Disable airplane mode
50
+ - setAirplaneMode:
51
+ enabled: false
52
+
53
+ # Wait for reconnection
54
+ - waitForAnimationToEnd:
55
+ timeout: 5000
56
+
57
+ # Verify back online
58
+ - assertVisible:
59
+ text: "online"
60
+ optional: true
@@ -1,94 +1,94 @@
1
- appId: ${APP_ID}
2
- name: Registration Flow
3
- tags:
4
- - auth
5
- - smoke
6
- ---
7
- # Registration Flow Test
8
- # Tests the complete signup experience
9
-
10
- - launchApp:
11
- clearState: true
12
-
13
- # Navigate to registration
14
- - tapOn: "Sign Up"
15
- - waitForAnimationToEnd
16
-
17
- # Verify we're on register screen
18
- - assertVisible: "Create Account"
19
- - assertVisible: "Join us today"
20
-
21
- # Test validation - empty form
22
- - scrollUntilVisible:
23
- element: "Sign Up"
24
- direction: DOWN
25
- - tapOn:
26
- text: "Sign Up"
27
- index: 1
28
- - assertVisible: "required"
29
-
30
- # Enter name
31
- - tapOn:
32
- text: "Name"
33
- - inputText: "Test User"
34
-
35
- # Enter email
36
- - tapOn:
37
- text: "Email"
38
- - inputText: "newuser@example.com"
39
-
40
- # Enter password (too short)
41
- - tapOn:
42
- text: "Password"
43
- index: 0
44
- - inputText: "short"
45
- - tapOn:
46
- text: "Confirm Password"
47
- - inputText: "short"
48
-
49
- # Try to submit - should show password length error
50
- - tapOn:
51
- text: "Sign Up"
52
- index: 1
53
- - assertVisible: "8 characters"
54
-
55
- # Fix password
56
- - tapOn:
57
- text: "Password"
58
- index: 0
59
- - clearText
60
- - inputText: "SecurePass123"
61
-
62
- # Enter mismatched confirm password
63
- - tapOn:
64
- text: "Confirm Password"
65
- - clearText
66
- - inputText: "DifferentPass123"
67
-
68
- - tapOn:
69
- text: "Sign Up"
70
- index: 1
71
- - assertVisible: "match"
72
-
73
- # Fix confirm password
74
- - tapOn:
75
- text: "Confirm Password"
76
- - clearText
77
- - inputText: "SecurePass123"
78
-
79
- # Submit the form
80
- - tapOn:
81
- text: "Sign Up"
82
- index: 1
83
-
84
- # Wait for registration
85
- - waitForAnimationToEnd:
86
- timeout: 5000
87
-
88
- # Verify successful registration
89
- - assertVisible: "Account created"
90
-
91
- # Verify we're logged in
92
- - assertVisible:
93
- text: "Home"
94
- optional: true
1
+ appId: ${APP_ID}
2
+ name: Registration Flow
3
+ tags:
4
+ - auth
5
+ - smoke
6
+ ---
7
+ # Registration Flow Test
8
+ # Tests the complete signup experience
9
+
10
+ - launchApp:
11
+ clearState: true
12
+
13
+ # Navigate to registration
14
+ - tapOn: "Sign Up"
15
+ - waitForAnimationToEnd
16
+
17
+ # Verify we're on register screen
18
+ - assertVisible: "Create Account"
19
+ - assertVisible: "Join us today"
20
+
21
+ # Test validation - empty form
22
+ - scrollUntilVisible:
23
+ element: "Sign Up"
24
+ direction: DOWN
25
+ - tapOn:
26
+ text: "Sign Up"
27
+ index: 1
28
+ - assertVisible: "required"
29
+
30
+ # Enter name
31
+ - tapOn:
32
+ text: "Name"
33
+ - inputText: "Test User"
34
+
35
+ # Enter email
36
+ - tapOn:
37
+ text: "Email"
38
+ - inputText: "newuser@example.com"
39
+
40
+ # Enter password (too short)
41
+ - tapOn:
42
+ text: "Password"
43
+ index: 0
44
+ - inputText: "short"
45
+ - tapOn:
46
+ text: "Confirm Password"
47
+ - inputText: "short"
48
+
49
+ # Try to submit - should show password length error
50
+ - tapOn:
51
+ text: "Sign Up"
52
+ index: 1
53
+ - assertVisible: "8 characters"
54
+
55
+ # Fix password
56
+ - tapOn:
57
+ text: "Password"
58
+ index: 0
59
+ - clearText
60
+ - inputText: "SecurePass123"
61
+
62
+ # Enter mismatched confirm password
63
+ - tapOn:
64
+ text: "Confirm Password"
65
+ - clearText
66
+ - inputText: "DifferentPass123"
67
+
68
+ - tapOn:
69
+ text: "Sign Up"
70
+ index: 1
71
+ - assertVisible: "match"
72
+
73
+ # Fix confirm password
74
+ - tapOn:
75
+ text: "Confirm Password"
76
+ - clearText
77
+ - inputText: "SecurePass123"
78
+
79
+ # Submit the form
80
+ - tapOn:
81
+ text: "Sign Up"
82
+ index: 1
83
+
84
+ # Wait for registration
85
+ - waitForAnimationToEnd:
86
+ timeout: 5000
87
+
88
+ # Verify successful registration
89
+ - assertVisible: "Account created"
90
+
91
+ # Verify we're logged in
92
+ - assertVisible:
93
+ text: "Home"
94
+ optional: true