Contributing
Contributions are always welcome, no matter how large or small!
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the code of conduct.
Development Workflow
1. Setup
To get started with the project, run yarn in the root directory to install the required dependencies for both the library and the example app:
yarn
2. Running the Example App
While developing, you can run the example app to test your changes.
Start the Metro Bundler:
yarn example start
Run on Android:
yarn example android
Run on iOS:
yarn example ios
Any changes to JavaScript files in src/ are automatically reflected in the example app. Changes to Native Code (Java, Kotlin, ObjC, Swift) require rebuilding the example app.
3. Testing & Linting
Before submitting a PR, ensure your code passes all tests and linting checks.
Run Unit Tests:
yarn test
Run Type Check:
yarn typecheck
Run Linter:
yarn lint
Fix Linter errors:
yarn lint --fix
Release & Deployment
We use react-native-builder-bob to build the package.
1. Build the package
To check if the package builds correctly:
yarn build
or
yarn prepare
2. Verify files
Check the lib/ folder to make sure CommonJS, Module, and TypeScript definitions are generated correctly.
3. Publish (Maintainers only)
To publish a new version to npm:
- Update the version in
package.json. - Run
npm publish(theprepublishOnlyhook will automatically runbob build).
npm publish
Commit Message Convention
We follow the conventional commits specification for our commit messages:
| Type | Description |
|---|---|
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 |
chore | Tooling changes, e.g. change CI config |