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.
Note: release is fully automated now in .github/workflows/publish.yml
and controlled by the .releaserc
file
Simply navigate to the release publish workflow, and use the manual trigger to publish from main branch:
Afterwards, you may verify that everything worked by checking the expected work products:
- Verify that there is a new github release: https://github.com/invertase/notifee/releases
- Verify that there is a new npmjs release (may take a moment to update): https://www.npmjs.com/package/@notifee/react-native?activeTab=versions
- Verify that the changelog is updated: https://docs.page/invertase/notifee/react-native/release-notes
- Verify that there is a new tag correctly created: https://github.com/invertase/notifee/tags
- Verify that there is a commit with that tag, with the updated release notes: https://github.com/invertase/notifee/commits/main/
If for some reason the automated process is not working, or you want to re-automate it using some other tools, these are the steps to take to correctly create and publish a release:
-
Navigate to the React Native package:
cd packages/react-native
-
Update release notes here
-
Bump version:
npm version {major/minor/patch} --legacy-peer-deps
-
Publish to npm:
npm publish
(this generates a new core AAR, and requires a valid NPM login with permission to publish the Notifee package on npmjs.com) -
Commit those changes (after npm publish so new AAR files are committed)
-
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:
export TAGNAME=`git tag --list|sort -r|head -1` gh release create ${TAGNAME} --title "${TAGNAME}" --notes "[Release Notes](https://github.com/invertase/notifee/blob/main/docs/react-native/release-notes.mdx)"