Skip to content

Commit 4ecb83a

Browse files
chore: update upstream to v8.0.0
2 parents 35cda9e + 865b6db commit 4ecb83a

Some content is hidden

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

61 files changed

+8107
-162
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 )
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: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,28 @@ jobs:
4444
- name: 📦 Setup Node + PNPM + install deps
4545
uses: ./.github/actions/setup-node-pnpm-install
4646

47+
<<<<<<< HEAD
4748
- name: 🚑 Run Doctor Checks
4849
run: |
4950
chmod +x .github/scripts/expo-doctor.sh
51+
=======
52+
- name: Run prebuild
53+
run: pnpm run prebuild
54+
55+
- name: 🚑 Run Doctor Checks
56+
run: |
57+
chmod +x .github/scripts/expo-doctor.sh
58+
rm -rf ios android
59+
>>>>>>> c7bb80d
5060
.github/scripts/expo-doctor.sh
5161

5262
- name: Add doctor report as comment on PR
5363
if: github.event_name == 'pull_request' && always()
5464
uses: marocchino/sticky-pull-request-comment@v2
5565
with:
5666
header: expo-doctor
57-
path: .expo/expo-doctor.md
67+
<<<<<<< HEAD
68+
path: .expo/expo-doctor.md
69+
=======
70+
path: .expo/expo-doctor.md
71+
>>>>>>> c7bb80d
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/lint-ts.yml
3+
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/
4+
5+
# ✍️ Description:
6+
# This workflow is used to create a new version of the app and push a new tag to the repo.
7+
# As this workflow will push code to the repo, we set up GitHub Bot as a Git user.
8+
# This Workflow need to be triggered manually from the Actions tab in the repo.
9+
# 1. Choose your release type (patch, minor, major)
10+
# 2. The workflow will run the np-release script which runs the following steps:
11+
# - Bump the version in package.json based on the release type using np
12+
# - Run the prebuild of the app to align the package.json version with the native code
13+
# - Create a new tag with the new version
14+
# - Push the new tag to the repo
15+
#
16+
17+
# 🚨 GITHUB SECRETS REQUIRED:
18+
# - GH_TOKEN: A GitHub token with write repo access.
19+
# You can generate one from here: https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
20+
# make sure to add it to the repo secrets with the name GH_TOKEN
21+
22+
name: New App Version
23+
24+
on:
25+
workflow_dispatch:
26+
inputs:
27+
release-type:
28+
type: choice
29+
description: 'Release type (one of): patch, minor, major'
30+
required: true
31+
default: 'patch'
32+
options:
33+
- patch
34+
- minor
35+
- major
36+
37+
jobs:
38+
release:
39+
name: Create New Version and push new tag
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
steps:
44+
- name: 🔍 GH_TOKEN
45+
if: env.GH_TOKEN == ''
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
49+
- name: 📦 Checkout project repo
50+
uses: actions/checkout@v4
51+
with:
52+
fetch-depth: 0
53+
token: ${{ secrets.GH_TOKEN }}
54+
55+
- name: 📝 Git User Setup
56+
run: |
57+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
58+
git config --global user.name "github-actions[bot]"
59+
60+
- name: 📦 Setup Node + PNPM + install deps
61+
uses: ./.github/actions/setup-node-pnpm-install
62+
63+
- name: 🏃‍♂️ Run App release
64+
run: |
65+
pnpm app-release ${{ github.event.inputs.release-type }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 🔗 Links:
2+
# Source file: https://github.com/obytes/react-native-template-obytes/blob/master/.github/workflows/new-github-release.yml
3+
# Starter releasing process: https://starter.obytes.com/ci-cd/app-releasing-process/
4+
5+
# ✍️ Description:
6+
# This workflow will be triggered automatically after the new app version workflow has been executed successfully.
7+
# It will create a new GitHub release with the new app version and the release notes.
8+
9+
# 🚨 GITHUB SECRETS REQUIRED: None
10+
11+
name: New GitHub Release
12+
13+
on:
14+
push:
15+
tags:
16+
- '*'
17+
18+
jobs:
19+
release:
20+
name: New GitHub Release
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
steps:
25+
- name: 📦 Checkout project repo
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: 🏃‍♂️Create A Draft Github Release
31+
uses: ncipollo/release-action@v1
32+
with:
33+
generateReleaseNotes: true
34+
draft: false

.github/workflows/type-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ permissions:
2222
contents: read
2323
pull-requests: write
2424

25+
permissions:
26+
contents: read
27+
pull-requests: write
28+
2529
jobs:
2630
type-check:
2731
name: Type Check (tsc)

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<<<<<<< HEAD
2+
=======
3+
4+
>>>>>>> c7bb80d
15
. "$(dirname "$0")/common.sh"
26

37

0 commit comments

Comments
 (0)