All work on React Native CLI happens directly on GitHub. Contributors send pull requests which go through review process.
Working on your first pull request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
- Fork the repo and create your branch from
master
(a guide on how to fork a repository). - Run
yarn
ornpm install
to install all required dependencies. - Now you are ready to do the changes.
Repository is splitted into two packages:
local-cli
- Historically, it was included inreact-native
package. Contains all the commands code.global-cli
- Historically, it was areact-native-cli
package and the only reason this package existed was to initialize an empty project.
You can test your changes by calling cli.js
directly from the cloned repository. You need to make sure the version of React Native matches the one present in devDependencies of the CLI. Otherwise, you may get unexpected errors.
node /path/to/cloned/project/packages/local-cli/cli.js
Currently we use flow
for typechecking, eslint
with prettier
for linting and formatting the code and jest
for testing.
yarn flow
: runflow
yarn lint
: runeslint
andprettier
yarn test
: run unit tests
We prefix our commit messages with one of the following to signify the kind of change:
- build: Changes that affect the build system or external dependencies
- ci, chore: Changes to our CI configuration files and scripts
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code
- test: Adding missing tests or correcting existing tests
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that
flow
,eslint
and all tests are passing. - Preview the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
You can report issues on our bug tracker. Please follow the issue template when opening an issue.
By contributing to React Native CLI, you agree that your contributions will be licensed under its MIT license.