Thanks for your interest in contributing to @2060.io/react-native-eid-reader! This document describes the workflow for developing, testing and submitting changes.
This project uses Yarn workspaces and ships a fully working example app under example/ that consumes the library directly from src/.
To get started, clone the repo and install dependencies from the root of the project:
yarnThe example app is the easiest way to develop and test the library. Any change you make in src/ will be picked up by Metro via workspaces.
# Start Metro
yarn example start
# In a separate terminal, run the app
yarn example android
# or (after `cd example/ios && pod install`)
yarn example iosSee the example README and the React Native environment setup guide if you need help setting up Android Studio / Xcode.
- Android sources live in
android/src/main/java/.... Openexample/androidin Android Studio to get full IDE support while editing the library code. - iOS sources live in
ios/. Openexample/ios/NfcPassportReaderExample.xcworkspacein Xcode after runningpod install.
The following scripts are available from the repo root:
yarn typecheck— run TypeScript without emittingyarn lint— run ESLint over the codebaseyarn test— run the Jest test suiteyarn prepare— build the library (commonjs, ESM and.d.ts) viareact-native-builder-bobyarn example <script>— run any script from theexampleworkspace (e.g.yarn example android)
Please make sure yarn typecheck, yarn lint and yarn test all pass before opening a pull request.
We follow the Conventional Commits specification. This is enforced by commitlint via a git hook.
Examples:
feat: support reading DG11 data groupfix(android): handle transceive timeout gracefullydocs: clarify iOS entitlement setupchore: bump example to react-native 0.85.2
The commit type (feat, fix, docs, chore, refactor, test, ci, ...) is used to drive release notes.
- Fork the repo and create a branch from
main. - Make your changes, keeping the diff focused on a single concern.
- If you change behaviour, update or add tests and update the README / API docs as needed.
- Ensure
yarn typecheck && yarn lint && yarn testall pass. - Open a PR against
mainwith a clear description of what and why. Link any related issues.
For non-trivial changes, please open an issue first to discuss the approach before investing a lot of time.
When filing a bug report, include:
- The version of the library, React Native, and the OS/device you're on
- A minimal reproduction (ideally based on the
example/app) - Relevant logs (Metro, Android
logcat, Xcode console) - Whether you're on the New Architecture or the legacy bridge
Be kind and respectful. We follow the spirit of the Contributor Covenant.
By contributing, you agree that your contributions will be licensed under the MIT License that covers the project.