@croacroa/react-native-template 1.0.0 → 2.0.1

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 (70) 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 +21 -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 +60 -6
  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 +286 -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/validation.ts +2 -1
  70. package/utils/withAccessibility.tsx +272 -0
package/package.json CHANGED
@@ -1,170 +1,175 @@
1
- {
2
- "name": "@croacroa/react-native-template",
3
- "version": "1.0.0",
4
- "description": "Production-ready React Native template with Expo, authentication, i18n, offline support, and more",
5
- "main": "expo-router/entry",
6
- "author": "Croacroa <contact@croacroa.dev>",
7
- "license": "MIT",
8
- "homepage": "https://github.com/croacroa-dev-team/template-react-native#readme",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/croacroa-dev-team/template-react-native.git"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/croacroa-dev-team/template-react-native/issues"
15
- },
16
- "keywords": [
17
- "react-native",
18
- "expo",
19
- "template",
20
- "typescript",
21
- "nativewind",
22
- "tailwind",
23
- "zustand",
24
- "react-query",
25
- "authentication",
26
- "i18n",
27
- "offline",
28
- "biometrics",
29
- "push-notifications",
30
- "sentry",
31
- "production-ready"
32
- ],
33
- "scripts": {
34
- "start": "expo start",
35
- "dev": "expo start --dev-client",
36
- "android": "expo run:android",
37
- "ios": "expo run:ios",
38
- "web": "expo start --web",
39
- "build:dev": "eas build --profile development",
40
- "build:preview": "eas build --profile preview",
41
- "build:prod": "eas build --profile production",
42
- "submit:ios": "eas submit --platform ios",
43
- "submit:android": "eas submit --platform android",
44
- "test": "jest",
45
- "test:watch": "jest --watch",
46
- "test:coverage": "jest --coverage",
47
- "storybook": "storybook dev -p 6006",
48
- "storybook:build": "storybook build",
49
- "lint": "eslint . --ext .ts,.tsx",
50
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
51
- "format": "prettier --write \"**/*.{ts,tsx,json,md}\"",
52
- "typecheck": "tsc --noEmit",
53
- "prepare": "husky"
54
- },
55
- "dependencies": {
56
- "@expo/vector-icons": "^14.0.0",
57
- "@gorhom/bottom-sheet": "^4.6.0",
58
- "@hookform/resolvers": "^3.6.0",
59
- "@react-native-async-storage/async-storage": "^1.23.1",
60
- "@react-native-community/netinfo": "^11.3.2",
61
- "@sentry/react-native": "^7.8.0",
62
- "@tanstack/query-async-storage-persister": "^5.51.1",
63
- "@tanstack/react-query": "^5.51.1",
64
- "@tanstack/react-query-persist-client": "^5.51.1",
65
- "bottleneck": "^2.19.5",
66
- "burnt": "^0.12.2",
67
- "clsx": "^2.1.1",
68
- "expo": "~52.0.0",
69
- "expo-constants": "~17.0.0",
70
- "expo-dev-client": "~5.0.0",
71
- "expo-device": "~7.0.0",
72
- "expo-font": "~13.0.0",
73
- "expo-image": "~2.0.0",
74
- "expo-linking": "~7.0.0",
75
- "expo-local-authentication": "~15.0.0",
76
- "expo-localization": "~15.0.0",
77
- "expo-notifications": "~0.29.0",
78
- "expo-router": "~4.0.0",
79
- "expo-secure-store": "~14.0.0",
80
- "expo-splash-screen": "~0.29.0",
81
- "expo-status-bar": "~2.0.0",
82
- "expo-system-ui": "~4.0.0",
83
- "expo-updates": "~0.26.0",
84
- "i18next": "^23.0.0",
85
- "nativewind": "^4.0.1",
86
- "react": "18.3.1",
87
- "react-hook-form": "^7.52.1",
88
- "react-i18next": "^14.0.0",
89
- "react-native": "0.76.0",
90
- "react-native-gesture-handler": "~2.20.0",
91
- "react-native-reanimated": "~3.16.0",
92
- "react-native-safe-area-context": "^4.12.0",
93
- "react-native-screens": "~4.0.0",
94
- "react-native-worklets": "^0.7.1",
95
- "tailwind-merge": "^2.3.0",
96
- "tailwindcss": "^3.4.4",
97
- "zod": "^3.23.8",
98
- "zustand": "^4.5.4"
99
- },
100
- "devDependencies": {
101
- "@babel/core": "^7.24.0",
102
- "@storybook/addon-essentials": "^8.1.0",
103
- "@storybook/addon-react-native-web": "^0.0.24",
104
- "@storybook/react": "^8.1.0",
105
- "@storybook/react-webpack5": "^8.1.0",
106
- "@testing-library/jest-native": "^5.4.3",
107
- "@testing-library/react-native": "^12.5.1",
108
- "@types/jest": "^29.5.12",
109
- "@types/react": "~18.3.0",
110
- "@typescript-eslint/eslint-plugin": "^7.0.0",
111
- "@typescript-eslint/parser": "^7.0.0",
112
- "eslint": "^8.57.0",
113
- "eslint-config-expo": "^8.0.0",
114
- "eslint-config-prettier": "^9.1.0",
115
- "eslint-plugin-prettier": "^5.1.3",
116
- "husky": "^9.0.11",
117
- "jest": "^29.7.0",
118
- "jest-expo": "~52.0.0",
119
- "lint-staged": "^15.2.7",
120
- "prettier": "^3.3.2",
121
- "storybook": "^8.1.0",
122
- "typescript": "^5.3.0"
123
- },
124
- "lint-staged": {
125
- "*.{ts,tsx}": [
126
- "eslint --fix",
127
- "prettier --write"
128
- ],
129
- "*.{json,md}": [
130
- "prettier --write"
131
- ]
132
- },
133
- "files": [
134
- "app",
135
- "assets",
136
- "components",
137
- "constants",
138
- "hooks",
139
- "i18n",
140
- "services",
141
- "stores",
142
- "types",
143
- "utils",
144
- "scripts",
145
- "maestro",
146
- "docs",
147
- ".storybook",
148
- ".github",
149
- "__tests__",
150
- "app.config.ts",
151
- "babel.config.js",
152
- "eas.json",
153
- "global.css",
154
- "jest.config.js",
155
- "metro.config.js",
156
- "nativewind-env.d.ts",
157
- "tailwind.config.js",
158
- "tsconfig.json",
159
- ".env.example",
160
- ".eslintrc.js",
161
- ".prettierrc",
162
- ".gitignore",
163
- "CHANGELOG.md",
164
- "CONTRIBUTING.md",
165
- "README.md"
166
- ],
167
- "publishConfig": {
168
- "access": "public"
169
- }
170
- }
1
+ {
2
+ "name": "@croacroa/react-native-template",
3
+ "version": "2.0.1",
4
+ "description": "Production-ready React Native template with Expo, authentication, i18n, offline support, and more",
5
+ "main": "expo-router/entry",
6
+ "author": "Croacroa <contact@croacroa.dev>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/croacroa-dev-team/template-react-native#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/croacroa-dev-team/template-react-native.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/croacroa-dev-team/template-react-native/issues"
15
+ },
16
+ "keywords": [
17
+ "react-native",
18
+ "expo",
19
+ "template",
20
+ "typescript",
21
+ "nativewind",
22
+ "tailwind",
23
+ "zustand",
24
+ "react-query",
25
+ "authentication",
26
+ "i18n",
27
+ "offline",
28
+ "biometrics",
29
+ "push-notifications",
30
+ "sentry",
31
+ "production-ready"
32
+ ],
33
+ "scripts": {
34
+ "start": "expo start",
35
+ "dev": "expo start --dev-client",
36
+ "android": "expo run:android",
37
+ "ios": "expo run:ios",
38
+ "web": "expo start --web",
39
+ "build:dev": "eas build --profile development",
40
+ "build:preview": "eas build --profile preview",
41
+ "build:prod": "eas build --profile production",
42
+ "submit:ios": "eas submit --platform ios",
43
+ "submit:android": "eas submit --platform android",
44
+ "test": "jest",
45
+ "test:watch": "jest --watch",
46
+ "test:coverage": "jest --coverage",
47
+ "storybook": "storybook dev -p 6006",
48
+ "storybook:build": "storybook build",
49
+ "lint": "eslint . --ext .ts,.tsx",
50
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
51
+ "format": "prettier --write \"**/*.{ts,tsx,json,md}\"",
52
+ "typecheck": "tsc --noEmit",
53
+ "docs": "typedoc",
54
+ "docs:watch": "typedoc --watch",
55
+ "prepare": "husky"
56
+ },
57
+ "dependencies": {
58
+ "@expo/vector-icons": "^14.0.4",
59
+ "@gorhom/bottom-sheet": "^5.0.6",
60
+ "@hookform/resolvers": "^3.9.1",
61
+ "@react-native-async-storage/async-storage": "^2.1.0",
62
+ "@react-native-community/netinfo": "^11.4.1",
63
+ "@sentry/react-native": "^6.5.0",
64
+ "@shopify/flash-list": "^1.7.3",
65
+ "@tanstack/query-async-storage-persister": "^5.66.0",
66
+ "@tanstack/react-query": "^5.66.0",
67
+ "@tanstack/react-query-persist-client": "^5.66.0",
68
+ "bottleneck": "^2.19.5",
69
+ "burnt": "^0.12.2",
70
+ "clsx": "^2.1.1",
71
+ "expo": "~52.0.0",
72
+ "expo-background-fetch": "~13.0.3",
73
+ "expo-constants": "~17.0.3",
74
+ "expo-dev-client": "~5.0.8",
75
+ "expo-device": "~7.0.1",
76
+ "expo-font": "~13.0.2",
77
+ "expo-image": "~2.0.4",
78
+ "expo-linking": "~7.0.4",
79
+ "expo-local-authentication": "~15.0.1",
80
+ "expo-localization": "~16.0.0",
81
+ "expo-notifications": "~0.29.12",
82
+ "expo-router": "~4.0.15",
83
+ "expo-secure-store": "~14.0.1",
84
+ "expo-splash-screen": "~0.29.20",
85
+ "expo-status-bar": "~2.0.1",
86
+ "expo-system-ui": "~4.0.6",
87
+ "expo-task-manager": "~12.0.3",
88
+ "expo-updates": "~0.26.12",
89
+ "i18next": "^24.2.1",
90
+ "nativewind": "^4.1.23",
91
+ "react": "18.3.1",
92
+ "react-hook-form": "^7.54.2",
93
+ "react-i18next": "^15.2.0",
94
+ "react-native": "0.76.6",
95
+ "react-native-gesture-handler": "~2.20.2",
96
+ "react-native-reanimated": "~3.16.7",
97
+ "react-native-safe-area-context": "^4.14.1",
98
+ "react-native-screens": "~4.4.0",
99
+ "tailwind-merge": "^2.6.0",
100
+ "tailwindcss": "^3.4.17",
101
+ "zod": "^3.24.1",
102
+ "zustand": "^5.0.3"
103
+ },
104
+ "devDependencies": {
105
+ "@babel/core": "^7.26.0",
106
+ "@storybook/addon-essentials": "^8.5.0",
107
+ "@storybook/addon-react-native-web": "^0.0.24",
108
+ "@storybook/react": "^8.5.0",
109
+ "@storybook/react-webpack5": "^8.5.0",
110
+ "@testing-library/jest-native": "^5.4.3",
111
+ "@testing-library/react-native": "^12.9.0",
112
+ "@types/jest": "^29.5.14",
113
+ "@types/react": "~18.3.18",
114
+ "@typescript-eslint/eslint-plugin": "^8.21.0",
115
+ "@typescript-eslint/parser": "^8.21.0",
116
+ "eslint": "^8.57.1",
117
+ "eslint-config-expo": "^8.0.1",
118
+ "eslint-config-prettier": "^9.1.0",
119
+ "eslint-plugin-prettier": "^5.2.3",
120
+ "husky": "^9.1.7",
121
+ "jest": "^29.7.0",
122
+ "jest-expo": "~52.0.3",
123
+ "lint-staged": "^15.3.0",
124
+ "prettier": "^3.4.2",
125
+ "storybook": "^8.5.0",
126
+ "typedoc": "^0.27.6",
127
+ "typescript": "^5.7.3"
128
+ },
129
+ "lint-staged": {
130
+ "*.{ts,tsx}": [
131
+ "eslint --fix",
132
+ "prettier --write"
133
+ ],
134
+ "*.{json,md}": [
135
+ "prettier --write"
136
+ ]
137
+ },
138
+ "files": [
139
+ "app",
140
+ "assets",
141
+ "components",
142
+ "constants",
143
+ "hooks",
144
+ "i18n",
145
+ "services",
146
+ "stores",
147
+ "types",
148
+ "utils",
149
+ "scripts",
150
+ "maestro",
151
+ "docs",
152
+ ".storybook",
153
+ ".github",
154
+ "__tests__",
155
+ "app.config.ts",
156
+ "babel.config.js",
157
+ "eas.json",
158
+ "global.css",
159
+ "jest.config.js",
160
+ "metro.config.js",
161
+ "nativewind-env.d.ts",
162
+ "tailwind.config.js",
163
+ "tsconfig.json",
164
+ ".env.example",
165
+ ".eslintrc.js",
166
+ ".prettierrc",
167
+ ".gitignore",
168
+ "CHANGELOG.md",
169
+ "CONTRIBUTING.md",
170
+ "README.md"
171
+ ],
172
+ "publishConfig": {
173
+ "access": "public"
174
+ }
175
+ }