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.
The library source lives in the root src/ directory. An example app in example/ is configured to use the local source directly via Metro.
- Node.js >= 18 (see
.nvmrcfor the recommended version) - Yarn v1 (
npm install -g yarn) - Xcode 16+ and CocoaPods (for iOS)
- Android SDK / Android Studio (for Android)
# Install root dependencies
yarn install
# Install example app dependencies
cd example
yarn install
# Install iOS pods
cd ios
pod install
cd ../..The example app's
package.jsonuses"react-native-background-workers": "link:.."to resolve the library from the parent directory. Metro is configured to watch../srcand map imports directly to the source, so any changes you make to the library's TypeScript code will be reflected immediately via Fast Refresh.
From the repo root:
# Start Metro bundler
yarn start
# Run on iOS
yarn ios
# Run on Android
yarn androidOr from the example/ directory:
cd example
yarn start
yarn ios
yarn android# Compile src/ -> lib/ via tsc
yarn build
# Build in watch mode (useful during development)
yarn build:watch
# Type-check without emitting files
yarn typecheck# Check for lint errors
yarn lint
# Auto-fix lint errors
yarn lint:fix| Script | Description |
|---|---|
yarn build |
Compile src/ to lib/ via tsc |
yarn build:watch |
Same as build, in watch mode |
yarn typecheck |
Type-check without emitting |
yarn lint |
Lint src/ and example/ with ESLint |
yarn lint:fix |
Auto-fix lint issues |
yarn start |
Start Metro for the example app |
yarn ios |
Build and run the example on iOS |
yarn android |
Build and run the example on Android |
Working on your first pull request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that
yarn typecheckandyarn lintpass. - Review the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.