Open History to see the last commit
1# Contributing
2β
3## Questions
4β
5If you have questions about implementation details, help or support, then please use our dedicated community forum at [GitHub Discussions](https://github.com/tannerlinsley/react-query/discussions) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum.
6β
7## Reporting Issues
8β
9If you have found what you think is a bug, please [file an issue](https://github.com/tannerlinsley/react-query/issues/new). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [GitHub Discussions](https://github.com/tannerlinsley/react-query/discussions)
10β
11## Suggesting new features
12β
13If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented.
14β
15## Development
16β
17If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:
18β
19- Fork this repository
20- Install dependencies by running `$ yarn`
21- Link `react-query` locally by running `$ yarn link`
22- Auto-build files as you edit by running `$ yarn start`
23- Implement your changes and tests to files in the `src/` directory and corresponding test files
24- To run examples, follow their individual directions. Usually this is just `$ yarn && yarn start`.
25- To run examples using your local build, link to the local `react-query` by running `$ yarn link react-query` from the example's directory
26- Document your changes in the appropriate doc page
27- Git stage your required changes and commit (see below commit guidelines)
28- Submit PR for review
29β
30## Online one-click setup
31β
32You can use Gitpod (An Online Open Source VS Code like IDE which is free for Open Source) for developing online. With a single click it will start a workspace and automatically:
33β
34- clone the `react-query` repo.
35- install all the dependencies in `/` and `/docs`.
36- run `yarn start` in the root(`/`) to Auto-build files.
37- run `yarn dev` in `/docs`.
38β
39[](https://gitpod.io/#https://github.com/tannerlinsley/react-query)
40β
41## Commit message conventions
42β
43`react-query` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
44β
45We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**.
46β
47### Commit Message Format
48β
49Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
50format that includes a **type**, a **scope** and a **subject**:
51β
52```
53<type>(<scope>): <subject>
54<BLANK LINE>
55<body>
56<BLANK LINE>
57<footer>
58```
59β
60The **header** is mandatory and the **scope** of the header is optional.
61β
62Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
63β
64### Type
65β
66Must be one of the following:
67β
68- **feat**: A new feature
69- **fix**: A bug fix
70- **docs**: Documentation only changes
71- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
72 semi-colons, etc)
73- **refactor**: A code change that neither fixes a bug nor adds a feature
74- **perf**: A code change that improves performance
75- **test**: Adding missing or correcting existing tests
76- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
77 generation
78β
79### Scope
80β
81The scope could be anything specifying place of the commit change. For example `useQuery`, `useMutation` etc...
82β
83You can use `*` when the change affects more than a single scope.
84β
85### Subject
86β
87The subject contains succinct description of the change:
88β
89- use the imperative, present tense: "change" not "changed" nor "changes"
90- don't capitalize first letter
91- no dot (.) at the end
92β
93### Body
94β
95Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
96β
97### Footer
98β
99The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
100β
101**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
102β
103### Example
104β
105Here is an example of the release type that will be done based on a commit messages:
106β
107| Commit message | Release type |
108| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
109| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
110| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
111| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
112β
113### Revert
114β
115If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
116β
117## Pull requests
118β
119Maintainers merge pull requests by squashing all commits and editing the commit message if necessary using the GitHub user interface.
120β
121Use an appropriate commit type. Be especially careful with breaking changes.
122β
123## Releases
124β
125For each new commit added to `master` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.