If you want to contribute or run a local version of the Formo React Native Analytics SDK, follow these steps:
Run the following command to build the SDK:
pnpm install
pnpm build
pnpm testTo test your SDK changes in a test app, you can link the package locally using pnpm link.
For example, if your projects are in the same directory:
~/
├── your-react-native-app/
└── sdk-react-native/
Run the following commands:
# In ~/your-react-native-app
pnpm link ../sdk-react-nativeAny changes you make to your local package require rebuilding to be reflected:
# In ~/sdk-react-native
pnpm buildThe changes will automatically be available in the linked project.
To remove the link:
# In ~/your-react-native-app
pnpm unlink ../sdk-react-nativeRun the test suite:
pnpm testRun tests with coverage:
pnpm test:coverageCheck code style:
pnpm lintRun TypeScript type checking:
pnpm typecheck-
Preview release notes:
pnpm preview-release
This shows what the release notes will look like based on commits since the last tag.
-
Update the version using pnpm:
pnpm version patch # For bug fixes pnpm version minor # For new features pnpm version major # For breaking changes
This automatically:
- Updates
package.jsonwith the new version - Updates
src/version.tswith the new version (via theversionscript hook) - Creates a git commit with both changes
- Creates a version tag (e.g.,
v1.0.1)
- Updates
-
Push the commit and tag:
git push --follow-tags
-
Automatic workflow execution:
- GitHub Actions workflow triggers on the
v*tag - Builds and tests the package
- Publishes to npm using OIDC (no tokens needed!)
- Creates a GitHub release with:
- Changelog from git commits
- Installation instructions
- GitHub Actions workflow triggers on the