Ensure you have the following software installed:
- Java 11 (the default in Android Studio 2020.3.1 and higher)
git clone https://github.com/invertase/notifee.git
cd notifee/
yarn
Note: During this step, the package.json
script prepare
is called, which includes a call to build:core:ios
.
During that step, the current "NotifeeCore" iOS files are copied into packages/react-native/ios/...
. If you modify
iOS core code and want to test it you will want to re-run that step, or temporarily modify packages/react-native/RNNotifee.podspec
to contain $NotifeeCoreFromSources=true
so that the up to date source files are actually incorporated in the final build.
The same issue applies to Android code if you need to see development changes to the NotifeeCore Android code in an Android build. Run yarn build:core:android
to generate a new AAR file for Android then rebuild/restart the Android app for core Android
changes to take effect.
This "core build" process may change in the future and we are open to suggestions that maintain the NotifeeCore code as a separate item so that it may be re-used by other projects (e.g. Flutter), not just the react-native API wrapper.
yarn tests_rn:packager
Ensure you have TypeScript compiler running to listen to react-native
submodule changes:
yarn build:rn:watch
The following package scripts are exported to help you run tests;
yarn tests_rn:test
- run Jest tests once and exit.yarn tests_rn:jest-watch
- run Jest tests in interactive mode and watch for changes.yarn tests_rn:jest-coverage
- run Jest tests with coverage. Coverage is output to./coverage
.
Tests can be found in the tests_react_native/specs
directory.
FIXME: Currently to get native code working correctly you need to do this:
cd tests_react_native/node_modules/@notifee && \rm -fr react-native && ln -s ../../../packages/react-native .
...that allows xcodebuild and android to link in the raw / maybe-unpublished code from local files instead of NPM package
To run tests, use these commands:
Android
: runyarn tests_rn:android:test
iOS
: runyarn tests_rn:ios:test
Runs ESLint and respective type checks on project files
yarn validate:all:js
yarn validate:all:ts
Maintainers with write access to the repo and the npm organization can publish new versions by following the release checklist below.
- Navigate to the React Native package:
cd packages/react-native
- Update release notes here
- Bump version:
npm version {minor/patch}
- Tag the repo (current format is
@notifee/[email protected]
) - Push the release notes / version / tag to the repo:
git push --tags
- Create a release on the repo:
gh release create @notifee/[email protected] --title "@notifee/[email protected]" --notes "[Release Notes](https://notifee.app/react-native/docs/release-notes)"
- Publish to npm:
npm publish