Contributions are always welcome, no matter how large or small!
This guide is intended to get a new contributor from a clean machine to a running project and a PR-ready change.
This project is a monorepo managed with Yarn workspaces.
- Root package: the React Native library.
example/: demo app that consumes the local library.
example is wired to the local source, so library changes are reflected there.
- iOS development requires macOS (Xcode).
- Android development works on macOS, Linux, and Windows.
- Full end-to-end local development for both platforms requires macOS.
Install the following before you start:
- Git (latest stable).
- Node.js
v20.19.0(see.nvmrc). - Yarn
3.6.1(seepackageManagerand.yarnrc.yml). - Java JDK
17for Android builds. - Android Studio + Android SDK tools (for Android work).
- Ruby
>= 2.6.10and Bundler (for iOS pod setup). - CocoaPods matching
example/Gemfileconstraints. - Xcode (for iOS work).
Android project values used by this repo:
compileSdkVersion = 35targetSdkVersion = 35inexampleminSdkVersion = 24buildToolsVersion = 35.0.0ndkVersion = 27.1.12297006
Run these once after installation:
node -v
yarn -v
java -version
ruby -v
bundle -vFor CocoaPods (after Bundler is installed):
cd example
bundle exec pod --version
cd ..Do not use npm for this repository. It depends on Yarn workspaces.
- Clone the repository and move into it.
- Ensure Node.js
v20.19.0is active. - Install JavaScript dependencies from the repo root.
yarn installInstall Ruby gems and pods from example:
cd example
bundle install
bundle exec pod install --project-directory=ios
cd ..Notes:
example/react-native.config.jsenables automatic pods installation for some flows, butbundle exec pod install --project-directory=iosis still the reliable manual step for first-time setup and pod changes.- Open the workspace file (not the project file) when using Xcode:
example/ios/MoyasarSdkExample.xcworkspace
Install Android SDK components required by the project:
- Android SDK Platform 35
- Android SDK Build-Tools 35.0.0
- Android NDK 27.1.12297006
Set your SDK path for Gradle if needed:
- File:
example/android/local.properties - Example value:
sdk.dir=/Users/<your-user>/Library/Android/sdkAlso ensure JAVA_HOME points to JDK 17.
Run commands from the repository root.
- Start Metro in terminal 1:
yarn example start- Start one platform in terminal 2:
Android:
yarn example androidiOS:
yarn example iosUse these when you want explicit platform build commands:
yarn example build:android
yarn example build:iosIn Metro logs, confirm a line similar to:
Running "MoyasarSdkExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
"fabric":true and "concurrentRoot":true indicate New Architecture is running.
- JavaScript and TypeScript changes usually reflect via Fast Refresh.
- Native Android/iOS changes require rebuilding the app.
- The example app is the primary place to validate your local library changes.
Native IDE entry points:
- Android Studio: open
example/android. - Xcode: open
example/ios/MoyasarSdkExample.xcworkspace.
Run all checks from the repository root:
yarn lint
yarn typecheck
yarn test
yarn prepareTo auto-fix lint formatting where possible:
yarn lint --fixThis repository follows Conventional Commits.
fix: bug fixes, e.g. fix crash due to deprecated method.feat: new features, e.g. add new method to the module.refactor: code refactor, e.g. migrate from class components to hooks.docs: changes into documentation, e.g. add usage example for the module.test: adding or updating tests, e.g. add integration tests using detox.chore: tooling changes, e.g. change CI config.
Commit hooks are configured through lefthook.yml.
Symptom:
- Xcode build fails with sandbox or pods manifest mismatch.
Fix:
cd example
bundle install
bundle exec pod install --project-directory=ios
cd ..If you use a custom Node installation manager and Xcode cannot find Node:
- Update
example/ios/.xcode.env.localsoNODE_BINARYpoints to your currentnodebinary.
Symptom:
- Gradle cannot find Android SDK.
Fix:
- Ensure
example/android/local.propertiesexists andsdk.dirpoints to your SDK. - Ensure required SDK/NDK versions are installed.
Symptom:
- Gradle reports no Java runtime or invalid
JAVA_HOME.
Fix:
- Install JDK 17.
- Set
JAVA_HOMEto that installation. - Re-open your terminal and retry.
rm -rf node_modules example/node_modules
yarn install
cd example
bundle install
bundle exec pod install --project-directory=ios
cd ..Before opening your PR:
- Keep PRs focused on one logical change.
- Ensure lint, typecheck, tests, and build preparation pass.
- Update docs/tests when behavior changes.
- Use Conventional Commits.
- If changing public API or major behavior, open an issue or discuss with maintainers first.
Create a Github release with a version tag vX.X.X (e.g. v0.12.0) and the CD pipeline will handle the rest.
We use TypeScript for type checking, ESLint with Prettier for linting and formatting the code, and Jest for testing.
Our pre-commit hooks verify that the linter and tests pass when committing.
The package.json file contains various scripts for common tasks:
yarn: setup project by installing dependencies.yarn typecheck: type-check files with TypeScript.yarn lint: lint files with ESLint.yarn test: run unit tests with Jest.yarn example start: start the Metro server for the example app.yarn example android: run the example app on Android.yarn example ios: run the example app on iOS.