Skip to content

Latest commit

 

History

History
65 lines (50 loc) · 2.27 KB

CONTRIBUTING.md

File metadata and controls

65 lines (50 loc) · 2.27 KB

Contributing

If you would like to contribute code to analytics-react-native you can do so through GitHub by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also make sure your code runs by building and testing.

Style Guide

We use prettier to format our code, and commitzen to format commits.

Building an integration

To build an integration you'll first need to integrate it using the native Analytics SDK, here's a documentation to do so for iOS or for Android. When your integration is ready you'll need to add it to integrations.yml and check it works by building and testing.

Environment

This project is a Yarn workspace, npm is not supported. To install dependencies run :

$ yarn

Building

  • Build the @segment/react-native package:
    $ yarn core build
  • Build the @segment/react-native-* packages:
    $ yarn integrations build
  • Build the test application for iOS and Android:
    $ yarn test-app build
  • Launch these three steps one by one:
    $ yarn build

Testing

$ yarn test

Architecture

  • packages/core: the @segment/analytics-react-native module
    • docs: the generated TypeScript documentation, commited using a lint-staged hook
    • src: JavaScript module
    • ios: iOS native module
    • android: Android native module
  • packages/integrations:
    • integrations.yml: the unique source of truth for supported integrations
    • src: a set of generators using integrations.yml
      • gen-integrations.ts: generates @segment/react-native-* packages in build/
      • gen-readme.ts: updates README.md Integrations section
    • test-app:
      • project: the generated react-native test-app root