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 #
This repository contains a single React Native native module. It has no example app.
Install dependencies and build the JavaScript side:
yarn
yarn prepare
Build the Android library on its own:
yarn android:build
The Gradle wrapper in android/ builds the directory as a standalone Android library
project. Android Studio can open android/ directly.
Exercising the GATT server or client needs a host app running on a device. Add this directory as
a dependency of any React Native or Expo app and let autolinking pick up android/ and
RTNbleServer.podspec; the library does not require changes to the host app.
There is no standalone iOS build: the podspec is compiled by the host app's CocoaPods
installation. The host app must also declare NSBluetoothAlwaysUsageDescription in its
Info.plist.
Make sure your code passes TypeScript:
yarn typecheck
To check for linting errors, run the following:
yarn lint
To fix formatting errors, run the following:
yarn lint --fix
Scripts #
The package.json file contains scripts for common tasks:
yarn: install dependencies.yarn prepare: build the JavaScript package intolib/.yarn android:build: compile the Android library with the Gradle wrapper.yarn clean: removelib/and the Android build output.yarn typecheck: type-check files with TypeScript.yarn lint: lint files with ESLint.
Sending a pull request #
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 linters and tests are passing.
- 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.