We want this community to be friendly and respectful to each other. Please follow our Code of Conduct in all your interactions with the project.
To get started with the project, run yarn bootsrap
in the root directory to install the required dependencies for each package:
yarn bootsrap
This project uses
yarn
as a package manager. While it's possible to run individual commands withnpm
, please refrain from using it, especiallynpm install.
🙅
While developing, you can run the fixture app to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
To start the packager:
yarn start
To run the fixture app on Android:
yarn android
To run the example app on iOS:
yarn ios
Make sure your code passes TypeScript and ESLint. Run the following to verify:
yarn flightcheck
To fix formatting errors, run the following:
yarn lint --fix
Remember to add tests for your change if possible. Run the unit tests by:
yarn test
The repo contains a documentation website build with Docusaurus. Please make sure that your changes are reflected in the documentation, if it's API or configuration changes. Any improvements to documentation itself are also welcomed.
Source files for documentation can be found in ./documentation/docs folder.
To start working with documentation and run it locally:
cd documentation && yarn
yarn run build && yarn run server
Now local website is running at http://localhost:3000
We use TypeScript for type checking, ESLint with Prettier and @shopify/eslint-plugin for linting and formatting the code, and Jest for testing.
The package.json
file contains various scripts for common tasks:
yarn up
: setup project by installing all dependencies and pods.yarn typescript
: type-check files with TypeScript.yarn lint
/yarn lint --fix
: lint files with ESLint/try to fix lint issues.yarn flightcheck
: check types, linting, and tests all together.yarn test
: run unit tests with Jest.yarn start
: start the Metro server for the example app.yarn android
: run the example app on Android.yarn ios
: run the example app on iOS.yarn release
: prepare all packages for release.
Please take some time to correctly fill our pull request template and detail the proposed changes. This will help reviewers to better understand the context of your PR and provide valuable insights.
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Before pushing your branch make sure to locally run the
yarn flightcheck
command (which does all of the following:yarn build
,yarn test
andyarn lint
). This should save you some time and prevent the CI pipeline from blocking your PR. - Update the documentation if your PR changes the API.
- Follow the pull request template when opening a pull request.
- If your PR is a new feature and not a bug fix, consider opening an issue describing your idea. This ensures you get feedback from the maintainers and don't write code that might not be used.
To make releases easier, we adhere to conventional commits as specified here. If you create a PR, you can either edit the PR title and then do "Squash and rebase". If you need multiple commits, then make sure that all the PR commits comply with the conventional commits specification and then you can do "Rebase and merge".
There is a CI check that will check whether either of those holds true.
Releases are done by Shopify engineers following the steps on RELEASE.md.