@croacroa/react-native-template 1.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.
- package/.env.example +18 -0
- package/.eslintrc.js +55 -0
- package/.github/workflows/ci.yml +184 -0
- package/.github/workflows/eas-build.yml +55 -0
- package/.github/workflows/eas-update.yml +50 -0
- package/.gitignore +62 -0
- package/.prettierrc +11 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.tsx +30 -0
- package/CHANGELOG.md +106 -0
- package/CONTRIBUTING.md +377 -0
- package/README.md +399 -0
- package/__tests__/components/Button.test.tsx +74 -0
- package/__tests__/hooks/useAuth.test.tsx +499 -0
- package/__tests__/services/api.test.ts +535 -0
- package/__tests__/utils/cn.test.ts +39 -0
- package/app/(auth)/_layout.tsx +36 -0
- package/app/(auth)/home.tsx +117 -0
- package/app/(auth)/profile.tsx +152 -0
- package/app/(auth)/settings.tsx +147 -0
- package/app/(public)/_layout.tsx +21 -0
- package/app/(public)/forgot-password.tsx +127 -0
- package/app/(public)/login.tsx +120 -0
- package/app/(public)/onboarding.tsx +5 -0
- package/app/(public)/register.tsx +139 -0
- package/app/_layout.tsx +97 -0
- package/app/index.tsx +21 -0
- package/app.config.ts +72 -0
- package/assets/images/.gitkeep +7 -0
- package/assets/images/adaptive-icon.png +0 -0
- package/assets/images/favicon.png +0 -0
- package/assets/images/icon.png +0 -0
- package/assets/images/notification-icon.png +0 -0
- package/assets/images/splash.png +0 -0
- package/babel.config.js +10 -0
- package/components/ErrorBoundary.tsx +169 -0
- package/components/forms/FormInput.tsx +78 -0
- package/components/forms/index.ts +1 -0
- package/components/onboarding/OnboardingScreen.tsx +370 -0
- package/components/onboarding/index.ts +2 -0
- package/components/ui/AnimatedButton.tsx +156 -0
- package/components/ui/AnimatedCard.tsx +108 -0
- package/components/ui/Avatar.tsx +316 -0
- package/components/ui/Badge.tsx +416 -0
- package/components/ui/BottomSheet.tsx +307 -0
- package/components/ui/Button.stories.tsx +115 -0
- package/components/ui/Button.tsx +104 -0
- package/components/ui/Card.stories.tsx +84 -0
- package/components/ui/Card.tsx +32 -0
- package/components/ui/Checkbox.tsx +261 -0
- package/components/ui/Input.stories.tsx +106 -0
- package/components/ui/Input.tsx +117 -0
- package/components/ui/Modal.tsx +98 -0
- package/components/ui/OptimizedImage.tsx +369 -0
- package/components/ui/Select.tsx +240 -0
- package/components/ui/Skeleton.tsx +180 -0
- package/components/ui/index.ts +18 -0
- package/constants/config.ts +54 -0
- package/docs/adr/001-state-management.md +79 -0
- package/docs/adr/002-styling-approach.md +130 -0
- package/docs/adr/003-data-fetching.md +155 -0
- package/docs/adr/004-auth-adapter-pattern.md +144 -0
- package/docs/adr/README.md +78 -0
- package/eas.json +47 -0
- package/global.css +10 -0
- package/hooks/index.ts +25 -0
- package/hooks/useApi.ts +236 -0
- package/hooks/useAuth.tsx +290 -0
- package/hooks/useBiometrics.ts +295 -0
- package/hooks/useDeepLinking.ts +256 -0
- package/hooks/useNotifications.ts +138 -0
- package/hooks/useOffline.ts +69 -0
- package/hooks/usePerformance.ts +434 -0
- package/hooks/useTheme.tsx +85 -0
- package/hooks/useUpdates.ts +358 -0
- package/i18n/index.ts +77 -0
- package/i18n/locales/en.json +101 -0
- package/i18n/locales/fr.json +101 -0
- package/jest.config.js +32 -0
- package/maestro/README.md +113 -0
- package/maestro/config.yaml +35 -0
- package/maestro/flows/login.yaml +62 -0
- package/maestro/flows/navigation.yaml +68 -0
- package/maestro/flows/offline.yaml +60 -0
- package/maestro/flows/register.yaml +94 -0
- package/metro.config.js +6 -0
- package/nativewind-env.d.ts +1 -0
- package/package.json +170 -0
- package/scripts/init.ps1 +162 -0
- package/scripts/init.sh +174 -0
- package/services/analytics.ts +428 -0
- package/services/api.ts +340 -0
- package/services/authAdapter.ts +333 -0
- package/services/index.ts +22 -0
- package/services/queryClient.ts +97 -0
- package/services/sentry.ts +131 -0
- package/services/storage.ts +82 -0
- package/stores/appStore.ts +54 -0
- package/stores/index.ts +2 -0
- package/stores/notificationStore.ts +40 -0
- package/tailwind.config.js +47 -0
- package/tsconfig.json +26 -0
- package/types/index.ts +42 -0
- package/types/user.ts +63 -0
- package/utils/accessibility.ts +446 -0
- package/utils/cn.ts +14 -0
- package/utils/index.ts +43 -0
- package/utils/toast.ts +113 -0
- package/utils/validation.ts +67 -0
package/.env.example
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# API Configuration
|
|
2
|
+
API_URL=http://localhost:3000
|
|
3
|
+
|
|
4
|
+
# App Variant (development | preview | production)
|
|
5
|
+
APP_VARIANT=development
|
|
6
|
+
|
|
7
|
+
# EAS Project ID (get from expo.dev)
|
|
8
|
+
EAS_PROJECT_ID=your-project-id
|
|
9
|
+
|
|
10
|
+
# Push Notifications
|
|
11
|
+
# Get these from your push notification service
|
|
12
|
+
|
|
13
|
+
# Analytics (optional)
|
|
14
|
+
# ANALYTICS_KEY=your-analytics-key
|
|
15
|
+
|
|
16
|
+
# Sentry (optional - for crash reporting)
|
|
17
|
+
# Get your DSN from: https://sentry.io -> Project Settings -> Client Keys
|
|
18
|
+
EXPO_PUBLIC_SENTRY_DSN=
|
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: [
|
|
4
|
+
"expo",
|
|
5
|
+
"eslint:recommended",
|
|
6
|
+
"plugin:@typescript-eslint/recommended",
|
|
7
|
+
"prettier",
|
|
8
|
+
],
|
|
9
|
+
parser: "@typescript-eslint/parser",
|
|
10
|
+
plugins: ["@typescript-eslint", "prettier"],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaFeatures: {
|
|
13
|
+
jsx: true,
|
|
14
|
+
},
|
|
15
|
+
ecmaVersion: "latest",
|
|
16
|
+
sourceType: "module",
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
// Prettier
|
|
20
|
+
"prettier/prettier": "error",
|
|
21
|
+
|
|
22
|
+
// TypeScript
|
|
23
|
+
"@typescript-eslint/no-unused-vars": [
|
|
24
|
+
"error",
|
|
25
|
+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
26
|
+
],
|
|
27
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
28
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
29
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
30
|
+
|
|
31
|
+
// React
|
|
32
|
+
"react/react-in-jsx-scope": "off",
|
|
33
|
+
"react/prop-types": "off",
|
|
34
|
+
|
|
35
|
+
// General
|
|
36
|
+
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|
37
|
+
"prefer-const": "error",
|
|
38
|
+
"no-var": "error",
|
|
39
|
+
},
|
|
40
|
+
ignorePatterns: [
|
|
41
|
+
"node_modules/",
|
|
42
|
+
".expo/",
|
|
43
|
+
"dist/",
|
|
44
|
+
"coverage/",
|
|
45
|
+
"*.config.js",
|
|
46
|
+
"babel.config.js",
|
|
47
|
+
"metro.config.js",
|
|
48
|
+
".storybook/",
|
|
49
|
+
],
|
|
50
|
+
settings: {
|
|
51
|
+
react: {
|
|
52
|
+
version: "detect",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
NODE_VERSION: '18'
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# ============================================
|
|
18
|
+
# Lint & Type Check
|
|
19
|
+
# ============================================
|
|
20
|
+
lint:
|
|
21
|
+
name: Lint & Type Check
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
31
|
+
cache: 'npm'
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm ci
|
|
35
|
+
|
|
36
|
+
- name: Run ESLint
|
|
37
|
+
run: npm run lint
|
|
38
|
+
|
|
39
|
+
- name: Run TypeScript check
|
|
40
|
+
run: npm run typecheck
|
|
41
|
+
|
|
42
|
+
# ============================================
|
|
43
|
+
# Unit Tests
|
|
44
|
+
# ============================================
|
|
45
|
+
test:
|
|
46
|
+
name: Unit Tests
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- name: Checkout
|
|
50
|
+
uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- name: Setup Node.js
|
|
53
|
+
uses: actions/setup-node@v4
|
|
54
|
+
with:
|
|
55
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
56
|
+
cache: 'npm'
|
|
57
|
+
|
|
58
|
+
- name: Install dependencies
|
|
59
|
+
run: npm ci
|
|
60
|
+
|
|
61
|
+
- name: Run tests with coverage
|
|
62
|
+
run: npm run test:coverage
|
|
63
|
+
|
|
64
|
+
- name: Upload coverage to Codecov
|
|
65
|
+
uses: codecov/codecov-action@v4
|
|
66
|
+
with:
|
|
67
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
68
|
+
files: ./coverage/lcov.info
|
|
69
|
+
fail_ci_if_error: false
|
|
70
|
+
|
|
71
|
+
# ============================================
|
|
72
|
+
# Build Check (Expo)
|
|
73
|
+
# ============================================
|
|
74
|
+
build-check:
|
|
75
|
+
name: Build Check
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- name: Checkout
|
|
79
|
+
uses: actions/checkout@v4
|
|
80
|
+
|
|
81
|
+
- name: Setup Node.js
|
|
82
|
+
uses: actions/setup-node@v4
|
|
83
|
+
with:
|
|
84
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
85
|
+
cache: 'npm'
|
|
86
|
+
|
|
87
|
+
- name: Setup Expo
|
|
88
|
+
uses: expo/expo-github-action@v8
|
|
89
|
+
with:
|
|
90
|
+
expo-version: latest
|
|
91
|
+
eas-version: latest
|
|
92
|
+
token: ${{ secrets.EXPO_TOKEN }}
|
|
93
|
+
|
|
94
|
+
- name: Install dependencies
|
|
95
|
+
run: npm ci
|
|
96
|
+
|
|
97
|
+
- name: Check Expo config
|
|
98
|
+
run: npx expo config --type public
|
|
99
|
+
|
|
100
|
+
- name: Export for web (validates build)
|
|
101
|
+
run: npx expo export --platform web
|
|
102
|
+
|
|
103
|
+
# ============================================
|
|
104
|
+
# E2E Tests with Maestro Cloud
|
|
105
|
+
# ============================================
|
|
106
|
+
e2e:
|
|
107
|
+
name: E2E Tests (Maestro)
|
|
108
|
+
runs-on: ubuntu-latest
|
|
109
|
+
needs: [lint, test]
|
|
110
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
111
|
+
steps:
|
|
112
|
+
- name: Checkout
|
|
113
|
+
uses: actions/checkout@v4
|
|
114
|
+
|
|
115
|
+
- name: Setup Node.js
|
|
116
|
+
uses: actions/setup-node@v4
|
|
117
|
+
with:
|
|
118
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
119
|
+
cache: 'npm'
|
|
120
|
+
|
|
121
|
+
- name: Install dependencies
|
|
122
|
+
run: npm ci
|
|
123
|
+
|
|
124
|
+
- name: Setup Expo
|
|
125
|
+
uses: expo/expo-github-action@v8
|
|
126
|
+
with:
|
|
127
|
+
expo-version: latest
|
|
128
|
+
eas-version: latest
|
|
129
|
+
token: ${{ secrets.EXPO_TOKEN }}
|
|
130
|
+
|
|
131
|
+
# Build for Android (or use existing build)
|
|
132
|
+
- name: Build Android APK
|
|
133
|
+
run: eas build --platform android --profile preview --non-interactive --local
|
|
134
|
+
env:
|
|
135
|
+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
136
|
+
continue-on-error: true
|
|
137
|
+
|
|
138
|
+
# Run Maestro Cloud tests
|
|
139
|
+
- name: Run Maestro Cloud Tests
|
|
140
|
+
uses: mobile-dev-inc/action-maestro-cloud@v1
|
|
141
|
+
with:
|
|
142
|
+
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
|
|
143
|
+
app-file: ./build/*.apk
|
|
144
|
+
flows: ./maestro/flows/
|
|
145
|
+
env: |
|
|
146
|
+
APP_ID=com.croacroa.app
|
|
147
|
+
continue-on-error: true
|
|
148
|
+
|
|
149
|
+
# ============================================
|
|
150
|
+
# Security Audit
|
|
151
|
+
# ============================================
|
|
152
|
+
security:
|
|
153
|
+
name: Security Audit
|
|
154
|
+
runs-on: ubuntu-latest
|
|
155
|
+
steps:
|
|
156
|
+
- name: Checkout
|
|
157
|
+
uses: actions/checkout@v4
|
|
158
|
+
|
|
159
|
+
- name: Setup Node.js
|
|
160
|
+
uses: actions/setup-node@v4
|
|
161
|
+
with:
|
|
162
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
163
|
+
cache: 'npm'
|
|
164
|
+
|
|
165
|
+
- name: Install dependencies
|
|
166
|
+
run: npm ci
|
|
167
|
+
|
|
168
|
+
- name: Run npm audit
|
|
169
|
+
run: npm audit --audit-level=high
|
|
170
|
+
continue-on-error: true
|
|
171
|
+
|
|
172
|
+
# ============================================
|
|
173
|
+
# Notify on failure
|
|
174
|
+
# ============================================
|
|
175
|
+
notify:
|
|
176
|
+
name: Notify
|
|
177
|
+
runs-on: ubuntu-latest
|
|
178
|
+
needs: [lint, test, build-check]
|
|
179
|
+
if: failure()
|
|
180
|
+
steps:
|
|
181
|
+
- name: Send notification
|
|
182
|
+
run: |
|
|
183
|
+
echo "CI failed for ${{ github.repository }}"
|
|
184
|
+
# Add Slack/Discord webhook notification here if needed
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: EAS Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
platform:
|
|
7
|
+
description: 'Platform to build'
|
|
8
|
+
required: true
|
|
9
|
+
default: 'all'
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- all
|
|
13
|
+
- ios
|
|
14
|
+
- android
|
|
15
|
+
profile:
|
|
16
|
+
description: 'Build profile'
|
|
17
|
+
required: true
|
|
18
|
+
default: 'preview'
|
|
19
|
+
type: choice
|
|
20
|
+
options:
|
|
21
|
+
- development
|
|
22
|
+
- preview
|
|
23
|
+
- production
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build:
|
|
27
|
+
name: Build ${{ github.event.inputs.platform }} (${{ github.event.inputs.profile }})
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- name: Checkout
|
|
31
|
+
uses: actions/checkout@v4
|
|
32
|
+
|
|
33
|
+
- name: Setup Node.js
|
|
34
|
+
uses: actions/setup-node@v4
|
|
35
|
+
with:
|
|
36
|
+
node-version: '18'
|
|
37
|
+
cache: 'npm'
|
|
38
|
+
|
|
39
|
+
- name: Setup Expo
|
|
40
|
+
uses: expo/expo-github-action@v8
|
|
41
|
+
with:
|
|
42
|
+
expo-version: latest
|
|
43
|
+
eas-version: latest
|
|
44
|
+
token: ${{ secrets.EXPO_TOKEN }}
|
|
45
|
+
|
|
46
|
+
- name: Install dependencies
|
|
47
|
+
run: npm ci
|
|
48
|
+
|
|
49
|
+
- name: Build iOS
|
|
50
|
+
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'all' }}
|
|
51
|
+
run: eas build --platform ios --profile ${{ github.event.inputs.profile }} --non-interactive
|
|
52
|
+
|
|
53
|
+
- name: Build Android
|
|
54
|
+
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
|
|
55
|
+
run: eas build --platform android --profile ${{ github.event.inputs.profile }} --non-interactive
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: EAS Update (OTA)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '**.md'
|
|
8
|
+
- '.github/**'
|
|
9
|
+
- 'maestro/**'
|
|
10
|
+
- 'docs/**'
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
update:
|
|
14
|
+
name: Publish OTA Update
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '18'
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
|
|
26
|
+
- name: Setup Expo
|
|
27
|
+
uses: expo/expo-github-action@v8
|
|
28
|
+
with:
|
|
29
|
+
expo-version: latest
|
|
30
|
+
eas-version: latest
|
|
31
|
+
token: ${{ secrets.EXPO_TOKEN }}
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm ci
|
|
35
|
+
|
|
36
|
+
- name: Publish update
|
|
37
|
+
run: eas update --auto --non-interactive
|
|
38
|
+
env:
|
|
39
|
+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
40
|
+
|
|
41
|
+
- name: Comment on commit
|
|
42
|
+
uses: actions/github-script@v7
|
|
43
|
+
with:
|
|
44
|
+
script: |
|
|
45
|
+
github.rest.repos.createCommitComment({
|
|
46
|
+
owner: context.repo.owner,
|
|
47
|
+
repo: context.repo.repo,
|
|
48
|
+
commit_sha: context.sha,
|
|
49
|
+
body: '🚀 OTA update published successfully!'
|
|
50
|
+
})
|
package/.gitignore
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Expo
|
|
5
|
+
.expo/
|
|
6
|
+
dist/
|
|
7
|
+
web-build/
|
|
8
|
+
expo-env.d.ts
|
|
9
|
+
|
|
10
|
+
# Native builds
|
|
11
|
+
*.orig.*
|
|
12
|
+
*.jks
|
|
13
|
+
*.p8
|
|
14
|
+
*.p12
|
|
15
|
+
*.key
|
|
16
|
+
*.mobileprovision
|
|
17
|
+
*.orig.*
|
|
18
|
+
android/
|
|
19
|
+
ios/
|
|
20
|
+
|
|
21
|
+
# Metro
|
|
22
|
+
.metro-health-check*
|
|
23
|
+
|
|
24
|
+
# Debug
|
|
25
|
+
npm-debug.*
|
|
26
|
+
yarn-debug.*
|
|
27
|
+
yarn-error.*
|
|
28
|
+
|
|
29
|
+
# macOS
|
|
30
|
+
.DS_Store
|
|
31
|
+
*.pem
|
|
32
|
+
|
|
33
|
+
# Local env files
|
|
34
|
+
.env
|
|
35
|
+
.env.local
|
|
36
|
+
.env.development.local
|
|
37
|
+
.env.test.local
|
|
38
|
+
.env.production.local
|
|
39
|
+
|
|
40
|
+
# TypeScript
|
|
41
|
+
*.tsbuildinfo
|
|
42
|
+
|
|
43
|
+
# Testing
|
|
44
|
+
coverage/
|
|
45
|
+
|
|
46
|
+
# IDE
|
|
47
|
+
.idea/
|
|
48
|
+
.vscode/
|
|
49
|
+
*.swp
|
|
50
|
+
*.swo
|
|
51
|
+
|
|
52
|
+
# Storybook
|
|
53
|
+
storybook-static/
|
|
54
|
+
|
|
55
|
+
# EAS
|
|
56
|
+
.easignore
|
|
57
|
+
|
|
58
|
+
# Secrets (never commit these!)
|
|
59
|
+
google-services.json
|
|
60
|
+
GoogleService-Info.plist
|
|
61
|
+
*.keystore
|
|
62
|
+
repomix-output.xml
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { StorybookConfig } from "@storybook/react-webpack5";
|
|
2
|
+
|
|
3
|
+
const config: StorybookConfig = {
|
|
4
|
+
stories: ["../components/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
5
|
+
addons: [
|
|
6
|
+
"@storybook/addon-essentials",
|
|
7
|
+
"@storybook/addon-react-native-web",
|
|
8
|
+
],
|
|
9
|
+
framework: {
|
|
10
|
+
name: "@storybook/react-webpack5",
|
|
11
|
+
options: {},
|
|
12
|
+
},
|
|
13
|
+
docs: {
|
|
14
|
+
autodocs: true,
|
|
15
|
+
},
|
|
16
|
+
webpackFinal: async (config) => {
|
|
17
|
+
// Add support for absolute imports
|
|
18
|
+
if (config.resolve) {
|
|
19
|
+
config.resolve.alias = {
|
|
20
|
+
...config.resolve.alias,
|
|
21
|
+
"@": require("path").resolve(__dirname, ".."),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return config;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default config;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Preview } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const preview: Preview = {
|
|
6
|
+
parameters: {
|
|
7
|
+
controls: {
|
|
8
|
+
matchers: {
|
|
9
|
+
color: /(background|color)$/i,
|
|
10
|
+
date: /Date$/,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
backgrounds: {
|
|
14
|
+
default: "light",
|
|
15
|
+
values: [
|
|
16
|
+
{ name: "light", value: "#ffffff" },
|
|
17
|
+
{ name: "dark", value: "#0f172a" },
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
decorators: [
|
|
22
|
+
(Story) => (
|
|
23
|
+
<View style={{ padding: 16, flex: 1 }}>
|
|
24
|
+
<Story />
|
|
25
|
+
</View>
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default preview;
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Auth adapter pattern for easy provider switching (Supabase, Firebase, etc.)
|
|
13
|
+
- Internationalization (i18n) support with expo-localization and i18next
|
|
14
|
+
- English and French translations included
|
|
15
|
+
- Language detection and persistence
|
|
16
|
+
- New UI components:
|
|
17
|
+
- `Select` - Dropdown/picker component
|
|
18
|
+
- `Checkbox` and `CheckboxGroup` - Animated checkbox components
|
|
19
|
+
- `BottomSheet` - Modal bottom sheet with @gorhom/bottom-sheet
|
|
20
|
+
- `Avatar` and `AvatarGroup` - User avatar components
|
|
21
|
+
- `Badge`, `Chip`, and `CountBadge` - Label/tag components
|
|
22
|
+
- `OptimizedImage` - High-performance image component with expo-image
|
|
23
|
+
- Deep linking support with `useDeepLinking` hook
|
|
24
|
+
- Biometric authentication with `useBiometrics` hook
|
|
25
|
+
- Analytics adapter for multiple providers (Mixpanel, Amplitude, etc.)
|
|
26
|
+
- Rate limiting for API calls using Bottleneck
|
|
27
|
+
- E2E testing setup with Maestro
|
|
28
|
+
- Login, registration, navigation, and offline flow tests
|
|
29
|
+
- Project documentation:
|
|
30
|
+
- CONTRIBUTING.md
|
|
31
|
+
- CHANGELOG.md
|
|
32
|
+
- Architecture Decision Records (ADRs)
|
|
33
|
+
- GitHub Actions CI/CD workflows:
|
|
34
|
+
- Lint, test, and build checks
|
|
35
|
+
- Maestro Cloud E2E tests
|
|
36
|
+
- EAS Build workflow (manual trigger)
|
|
37
|
+
- EAS Update workflow (OTA on push to main)
|
|
38
|
+
- Onboarding screens with animated pagination
|
|
39
|
+
- OTA updates support with `useUpdates` hook
|
|
40
|
+
- Performance monitoring with `usePerformance` hook
|
|
41
|
+
- Comprehensive accessibility utilities:
|
|
42
|
+
- Builder functions for all UI patterns (button, input, toggle, etc.)
|
|
43
|
+
- Hooks for screen reader, reduce motion, and bold text preferences
|
|
44
|
+
- Utility functions for announcements and focus management
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Primary color changed from blue to emerald green (croacroa branding)
|
|
49
|
+
- API client now includes rate limiting protection
|
|
50
|
+
|
|
51
|
+
### Dependencies Added
|
|
52
|
+
|
|
53
|
+
- `@gorhom/bottom-sheet` ^4.6.0
|
|
54
|
+
- `bottleneck` ^2.19.5
|
|
55
|
+
- `expo-image` ~2.0.0
|
|
56
|
+
- `expo-local-authentication` ~15.0.0
|
|
57
|
+
- `expo-localization` ~15.0.0
|
|
58
|
+
- `i18next` ^23.0.0
|
|
59
|
+
- `react-i18next` ^14.0.0
|
|
60
|
+
|
|
61
|
+
## [1.0.0] - 2024-01-01
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- Initial release
|
|
66
|
+
- Expo SDK 52 with React Native 0.76
|
|
67
|
+
- Expo Router for file-based navigation
|
|
68
|
+
- Authentication flow with secure token storage
|
|
69
|
+
- React Query for data fetching with offline support
|
|
70
|
+
- Zustand for state management
|
|
71
|
+
- NativeWind (Tailwind CSS) for styling
|
|
72
|
+
- React Hook Form with Zod validation
|
|
73
|
+
- Push notifications with Expo Notifications
|
|
74
|
+
- Error tracking with Sentry
|
|
75
|
+
- Storybook for component documentation
|
|
76
|
+
- Jest and Testing Library for unit tests
|
|
77
|
+
- Dark mode support
|
|
78
|
+
- Basic UI components (Button, Input, Card, Modal, Skeleton)
|
|
79
|
+
- Animated components with Reanimated
|
|
80
|
+
- Toast notifications with Burnt
|
|
81
|
+
|
|
82
|
+
### Infrastructure
|
|
83
|
+
|
|
84
|
+
- EAS Build configuration for dev/preview/production
|
|
85
|
+
- ESLint and Prettier setup
|
|
86
|
+
- Husky pre-commit hooks
|
|
87
|
+
- TypeScript strict mode
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Versioning Guide
|
|
92
|
+
|
|
93
|
+
### Version Format: MAJOR.MINOR.PATCH
|
|
94
|
+
|
|
95
|
+
- **MAJOR**: Breaking changes
|
|
96
|
+
- **MINOR**: New features (backwards compatible)
|
|
97
|
+
- **PATCH**: Bug fixes (backwards compatible)
|
|
98
|
+
|
|
99
|
+
### Changelog Categories
|
|
100
|
+
|
|
101
|
+
- **Added**: New features
|
|
102
|
+
- **Changed**: Changes to existing functionality
|
|
103
|
+
- **Deprecated**: Features to be removed
|
|
104
|
+
- **Removed**: Removed features
|
|
105
|
+
- **Fixed**: Bug fixes
|
|
106
|
+
- **Security**: Security improvements
|