Skip to content

Commit d5e55fe

Browse files
chore: update upstream to v8.0.0
2 parents 7cb3332 + 865b6db commit d5e55fe

File tree

140 files changed

+7834
-5574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+7834
-5574
lines changed

.cursorrules

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# React Native/Expo Project
2+
3+
You are an expert in TypeScript, React Native, Expo, and Mobile UI development with Nativewind.
4+
5+
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.
6+
7+
## Project Context
8+
9+
## Code Style and Structure
10+
11+
- Write concise, technical TypeScript code with accurate examples
12+
- Use functional and declarative programming patterns; avoid classes
13+
- Prefer iteration and modularization over code duplication
14+
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
15+
- Ensure components are modular, reusable, and maintainable.
16+
- Component Modularity: Break down components into smaller, reusable pieces. Keep components focused on a single responsibility and shouldn't be more than 80 lines of code.
17+
- To install new packages use `npx expo install <package-name>`
18+
- Structure repository files as follows:
19+
20+
```
21+
src
22+
├── api ## API related code, mainly using axios and react query
23+
├── app ## the main entry point for expo router(file-based routing), when you can find screens and navigation setup
24+
├── components ## shared components
25+
│ ├── card.tsx
26+
│ └── ui ## core ui components. buttons, inputs, etc
27+
├── lib ## shared libraries, auth, env, hooks, i18n, storage, test-utils, utils
28+
├── translations ## translations files for the app
29+
├── types ## shared types
30+
31+
```
32+
33+
## Tech Stack
34+
35+
- Expo
36+
- React Native
37+
- TypeScript
38+
- Nativewind ( Tailwind CSS for React Native )
39+
- Expo Router
40+
- React Query with React Query Kit
41+
- Zustand
42+
- React Native Keyboard Controller
43+
- React Native SVG
44+
- React Native MMKV
45+
46+
## Naming Conventions
47+
48+
- Favor named exports for components and utilities
49+
- Use kebabCase for all files names and directories (e.g., visa-form.tsx)
50+
51+
## TypeScript Usage
52+
53+
- Use TypeScript for all code; prefer types over interfaces
54+
- Avoid enums; use const objects with 'as const' assertion
55+
- Use functional components with TypeScript interfaces
56+
- Define strict types for message passing between different parts of the extension
57+
- Use absolute imports for all files @/...
58+
- Avoid try/catch blocks unless there's good reason to translate or handle error in that abstraction
59+
- Use explicit return types for all functions
60+
61+
## State Management
62+
63+
- Use React Zustand for global state management
64+
- Implement proper cleanup in useEffect hooks
65+
66+
## Syntax and Formatting
67+
68+
- Use "function" keyword for pure functions
69+
- Avoid unnecessary curly braces in conditionals
70+
- Use declarative JSX
71+
- Implement proper TypeScript discriminated unions for message types
72+
73+
## UI and Styling
74+
75+
- Use Nativewind for styling and components
76+
- Use built-in ui components such as Button, Input from `@components/ui`
77+
- Ensure high accessibility (a11y) standards using ARIA roles and native accessibility props.
78+
- Leverage react-native-reanimated and react-native-gesture-handler for performant animations and gestures.
79+
- Avoid unnecessary re-renders by memoizing components and using useMemo and useCallback hooks appropriately.
80+
- Make sure to use defined colors and fonts in the tailwind config file.
81+
82+
Here is a simple example of how a component should be written using :
83+
84+
```tsx
85+
import * as React from 'react';
86+
87+
import { Text, View, Image, SavaAreaView } from '@/components/ui';
88+
89+
// Props should be defined in the top of the component
90+
type Props = {
91+
text: string;
92+
};
93+
94+
export function Title({ text }: Props) {
95+
return (
96+
<View className="flex-row items-center justify-center py-4 pb-2">
97+
<Text className="pr-2 text-2xl">{text}</Text>
98+
<View className="h-[2px] flex-1 bg-neutral-300" />
99+
100+
<Image
101+
source={require('@assets/images/demo.png')}
102+
style={{ width: 24, height: 24 }}
103+
contentFit="contain"
104+
/>
105+
</View>
106+
);
107+
}
108+
```
109+
110+
## Error Handling
111+
112+
- Log errors appropriately for debugging
113+
- Provide user-friendly error messages
114+
115+
## Testing
116+
117+
- Write unit tests using Jest and React Native Testing Library.
118+
- Write unit tests for utilities and complex components
119+
- The test file should be named like the component file but with the .test.tsx extension (e.g., component-name.test.tsx)
120+
- Do not write unit tests for simple components that only show data
121+
122+
## Git Usage
123+
124+
Commit Message Prefixes:
125+
126+
- "fix:" for bug fixes
127+
- "feat:" for new features
128+
- "perf:" for performance improvements
129+
- "docs:" for documentation changes
130+
- "style:" for formatting changes
131+
- "refactor:" for code refactoring
132+
- "test:" for adding missing tests
133+
- "chore:" for maintenance tasks
134+
135+
Rules:
136+
137+
- Use lowercase for commit messages
138+
- Keep the summary line concise with a maximum of 100 characters
139+
- Reference issue numbers when applicable
140+
141+
## Documentation
142+
143+
- Maintain clear README with the following sections:
144+
- Setup ( how to install and run the project )
145+
- Usage ( listing all the commands and how to use them )
146+
- Stack ( the tech stack used in the project )
147+
- Folder Structure ( the folder structure of the project only the important ones inside src )

.eslintignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/scripts/expo-doctor.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Run expo-doctor and capture output and exit code
4+
output=$(npx expo-doctor@latest 2>&1)
5+
exit_code=$?
6+
7+
# Output file location
8+
output_file=".expo/expo-doctor.md"
9+
{
10+
# Add summary based on exit code
11+
if [ $exit_code -eq 0 ]; then
12+
echo "✅ **Good news!** We ran Expo Doctor for this PR and everything looks good, Great job!" > "$output_file"
13+
else
14+
echo "❌ **Action Required:** We ran Expo Doctor for this PR and found some issues that need to be addressed. Please review the complete report below 👇" > "$output_file"
15+
echo >> "$output_file" # Add blank line
16+
echo "\`\`\`shell" >> "$output_file"
17+
echo "$output" >> "$output_file"
18+
echo "\`\`\`" >> "$output_file"
19+
fi
20+
}
21+
22+
# Show original output in terminal
23+
echo "$output"
24+
25+
# Return the original exit code
26+
exit $exit_code

.github/workflows/compress-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout Branch
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
3333
- name: Compress Images

.github/workflows/e2e-android-eas-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
steps:
4646
- name: 📦 Checkout project repo
47-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4848
with:
4949
fetch-depth: 0
5050

.github/workflows/e2e-android-maestro.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: 📦 Checkout project repo
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0
3131

.github/workflows/e2e-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
steps:
2929
- name: 📦 Checkout project repo
30-
uses: actions/checkout@v3
30+
uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
3333

@@ -52,7 +52,7 @@ jobs:
5252

5353
steps:
5454
- name: 📦 Checkout project repo
55-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
5656
with:
5757
fetch-depth: 0
5858

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/eas-build-prod.yml
3+
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/
4+
5+
# ✍️ Description:
6+
# This workflow is used to trigger a build on EAS for Prod environment.
7+
# Can be triggered manually from the actions tab.
8+
# This workflow will use ./actions/eas-build action to trigger the build on EAS with production env.
9+
10+
# 🚨 GITHUB SECRETS REQUIRED:
11+
# - EXPO_TOKEN: Expo token to authenticate with EAS
12+
# - You can get it from https://expo.dev/settings/access-tokens
13+
14+
name: EAS Production Build (Android & IOS) (EAS)
15+
16+
on:
17+
workflow_dispatch:
18+
19+
jobs:
20+
Build:
21+
name: EAS Production Build (Android & IOS) (EAS)
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check for EXPO_TOKEN
25+
run: |
26+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
27+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
28+
exit 1
29+
fi
30+
31+
- name: 📦 Checkout project repo
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: 📦 Setup Node + PNPM + install deps
37+
uses: ./.github/actions/setup-node-pnpm-install
38+
39+
- name: ⏱️ EAS Build
40+
uses: ./.github/actions/eas-build
41+
with:
42+
APP_ENV: production
43+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}

.github/workflows/eas-build-qa.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/eas-build-qa.yml
3+
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/
4+
5+
# ✍️ Description:
6+
# This workflow is used to trigger a build on EAS for the QA environment.
7+
# It will run on every GitHub release published on the repo or can be triggered manually from the actions tab.
8+
# This workflow will use ./actions/eas-build action to trigger the build on EAS with staging env.
9+
10+
# 🚨 GITHUB SECRETS REQUIRED:
11+
# - EXPO_TOKEN: Expo token to authenticate with EAS
12+
# - You can get it from https://expo.dev/settings/access-tokens
13+
14+
name: EAS QA Build (Android & IOS) (EAS)
15+
16+
on:
17+
workflow_dispatch:
18+
release:
19+
types: [published]
20+
21+
jobs:
22+
Build:
23+
name: EAS QA Build (Android & IOS) (EAS)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check for EXPO_TOKEN
27+
run: |
28+
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
29+
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
30+
exit 1
31+
fi
32+
- name: 📦 Checkout project repo
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: 📦 Setup Node + PNPM + install deps
38+
uses: ./.github/actions/setup-node-pnpm-install
39+
40+
- name: ⏱️ EAS Build
41+
uses: ./.github/actions/eas-build
42+
with:
43+
APP_ENV: staging
44+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
45+
VERSION: ${{ github.event.release.tag_name }}
46+
IOS: false # TODO: set as true when IOS account is ready
47+

.github/workflows/expo-doctor.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,42 @@ on:
2323
- 'package.json'
2424
- 'pnpm-lock.yaml'
2525

26+
permissions:
27+
contents: read
28+
pull-requests: write
29+
2630
jobs:
2731
doctor:
2832
name: Expo Doctor (expo)
2933
runs-on: ubuntu-latest
34+
permissions:
35+
contents: read
36+
pull-requests: write
3037

3138
steps:
3239
- name: 📦 Checkout project repo
33-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
3441
with:
3542
fetch-depth: 0
3643

3744
- name: 📦 Setup Node + PNPM + install deps
3845
uses: ./.github/actions/setup-node-pnpm-install
3946

47+
<<<<<<< HEAD
48+
=======
49+
- name: Run prebuild
50+
run: pnpm run prebuild
51+
52+
>>>>>>> c7bb80d
4053
- name: 🚑 Run Doctor Checks
41-
run: rm -rf ios android && pnpm run doctor ## apprently the new update of expo will break if you already have ios and android folders in your project as they will show up a eas warning
54+
run: |
55+
chmod +x .github/scripts/expo-doctor.sh
56+
rm -rf ios android
57+
.github/scripts/expo-doctor.sh
58+
59+
- name: Add doctor report as comment on PR
60+
if: github.event_name == 'pull_request' && always()
61+
uses: marocchino/sticky-pull-request-comment@v2
62+
with:
63+
header: expo-doctor
64+
path: .expo/expo-doctor.md

0 commit comments

Comments
 (0)