Skip to content

Commit ab42b41

Browse files
satya164ferrannp
authored andcommitted
docs: simplify contribution guidelines (callstack#283)
It's still pretty big, but all the important stuff about setting up the environment is on the top. Rest is verified by the pre-commit hook, so not a big deal if people don't read them.
1 parent a28d935 commit ab42b41

File tree

3 files changed

+51
-38
lines changed

3 files changed

+51
-38
lines changed

CONTRIBUTING.md

+42-38
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Contributing to React Native Paper
22

3-
React Native Paper was started by [satya164](https://github.com/satya164) and [ahmedlhanafy](https://github.com/ahmedlhanafy). Right now, is one of [Callstack](https://callstack.com)'s open source projects that is currently under active development.
4-
53
## [Code of Conduct](/CODE_OF_CONDUCT.md)
64

75
We want this community to be friendly and respectful to each other. Please read [the full text](/CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated.
@@ -10,63 +8,69 @@ We want this community to be friendly and respectful to each other. Please read
108

119
The core team works directly on GitHub and all work is public.
1210

13-
### Workflow and Pull Requests
11+
### Development workflow
1412

15-
> **Working on your first Pull Request?**
16-
You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
13+
> **Working on your first pull request?** You can learn how from this *free* series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
1714
18-
*Before* submitting a pull request, please make sure the following is done:
15+
1. Fork the repo and create your branch from `master` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
16+
2. Run `yarn bootstrap` to setup the developement environment.
17+
3. Do the changes you want and test them out in the example app before sending a pull request.
1918

20-
1. Fork the repo and create your branch from `master` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/))
19+
### Commit message convention
2120

22-
2. We have a commit message convention, messages should start by one of the following:
23-
* `fix`: : for bug fixes, e.g. fix Button color on DarkTheme
24-
* `feat`: for new features, e.g. add Snackbar component
25-
* `refactor`: for code/structure refactor, e.g. new structure folder for components
26-
* `BREAKING`: for changes that break current versiong usage, e.g. remove withTheme
27-
* `docs`: changes into documentation, e.g. add usage example for Button
28-
* `chore`: tooling changes, e.g. change circle ci config
29-
* `test`: for testcases, eg unit, snapshot testing
21+
We prefix our commit messages with one of the following to signify the kind of change:
3022

31-
3. We use `flow`, `eslint` and `prettier`. Be sure that `npm run flow` and `npm run lint -- --fix` give no errors.
23+
* `fix`: bug fixes, e.g. fix Button color on DarkTheme.
24+
* `feat`: new features, e.g. add Snackbar component.
25+
* `refactor`: code/structure refactor, e.g. new structure folder for components.
26+
* `docs`: changes into documentation, e.g. add usage example for Button.
27+
* `test`: adding or updating tests, eg unit, snapshot testing.
28+
* `chore`: tooling changes, e.g. change circle ci config.
29+
* `BREAKING`: for changes that break existing usage, e.g. change API of a component.
3230

33-
4. If you work on a component:
34-
* Be sure to follow the specifics (design, name convention, etc) described in the [official material docs](https://material.io/guidelines/)
35-
* For any Text usage, use our components provided in the Typography folder
36-
* If your app depends on the theme always wrap you component with `withTheme` to get the theme as a prop instead of the context
37-
* Default colors will be provided by the theme, if you find that there's something missing from the theme that might be beneficial for other components don't hesitate to add it
38-
* Make sure to write a brief description of every prop when defining `type Props`
39-
* Make sure to provide an example usage for the component (check how others do it)
31+
Our pre-commit hooks verify that your commit message matches this format when committing.
4032

41-
5. In case of doubts, check out the current code. For example, we use the prop `icon` not `iconName`.
33+
### Linting and tests
4234

43-
6. You can run `yarn bootstrap` which will install all the dependencies in example & docs folder respectively.
35+
We use `flow` for type checking, `eslint` with `prettier` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when commiting. You can also run the following commands manually:
4436

45-
## Running the example
37+
* `yarn flow`: run flow on all files.
38+
* `yarn lint`: run eslint and prettier.
39+
* `yarn test`: run tests.
4640

47-
The example app uses [Expo](https://expo.io/). You will need to install the Expo app for [Android](https://play.google.com/store/apps/details?id=host.exp.exponent) and [iOS](https://itunes.apple.com/app/apple-store/id982107779) to start developing.
41+
### Sending a pull request
4842

49-
After you're done, you can run `yarn && yarn start` in the `example/` folder and scan the QR code to launch it on your device.
43+
When you're sending a pull request:
5044

51-
## Working on documentation
45+
* Prefer small pull requests focused on one change.
46+
* Verify that `flow`, `eslint` and tests are passing.
47+
* Preview the documentation to make sure it looks good.
48+
* Follow the pull request template when opening a pull request.
5249

53-
The documentation is automatically generated from the [flowtype](https://flowtype.org) annotation in the components. You can add comments above the type annotations to add descriptions. To preview the generated documentation, run `yarn && yarn start` in the `docs/` folder.
50+
When you're working on a component:
5451

55-
When your pull request is merged to master, the documentation updates are automatically deployed to the website.
52+
* Follow the guidelines described in the [official material design docs](https://material.io/guidelines/).
53+
* Write a brief description of every prop when defining `type Props` to aid with documentation.
54+
* Provide an example usage for the component (check other components to get a idea).
5655

57-
## Reporting New Issues
56+
### Running the example
5857

59-
The best way to get your bug fixed is to provide a reduced test case. Please provide a public repository with a runnable example.
58+
The example app uses [Expo](https://expo.io/). You will need to install the Expo app for [Android](https://play.google.com/store/apps/details?id=host.exp.exponent) and [iOS](https://itunes.apple.com/app/apple-store/id982107779) to start developing.
6059

61-
## How to Get in Touch
60+
After you're done, you can run `yarn start` in the `example/` folder and scan the QR code to launch it on your device.
6261

63-
* Callstack Open Source Slack - [#react-native-paper](https://slack.callstack.io/).
62+
### Working on documentation
63+
64+
The documentation is automatically generated from the [flowtype](https://flowtype.org) annotations in the components. You can add comments above the type annotations to add descriptions. To preview the generated documentation, run `yarn start` in the `docs/` folder.
6465

65-
## Code Conventions
66+
## Reporting issues
6667

67-
We use [eslint-config-callstack](https://github.com/callstack/eslint-config-callstack-io).
68+
You can report issues on our [bug tracker](https://github.com/callstack/react-native-paper/issues). Please follow the issue template when opening an issue.
69+
70+
## Get in touch
71+
72+
* Callstack Open Source Slack - [#react-native-paper](https://slack.callstack.io/).
6873

6974
## License
7075

7176
By contributing to React Native Paper, you agree that your contributions will be licensed under its **MIT** license.
72-

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Refer to the [getting started guide](https://callstack.github.io/react-native-pa
3030

3131
Check the components and their usage in our [documentation](https://callstack.github.io/react-native-paper/index.html).
3232

33+
## Contributing
34+
35+
Read the [contribution guidelines](/CONTRIBUTING.md) before contributing.
36+
3337
<!-- badges -->
3438
[build-badge]: https://img.shields.io/circleci/project/github/callstack/react-native-paper/master.svg?style=flat-square
3539
[build]: https://circleci.com/gh/callstack/react-native-paper

docs/pages/4.contributing.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Contributing
3+
---
4+
5+
/../../CONTRIBUTING.md

0 commit comments

Comments
 (0)