Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

CONTRIBUTING.md

135 lines7.1 KB

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/TanStack/form/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/TanStack/form/issues/new/choose). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [GitHub Discussions](https://github.com/TanStack/form/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 `$ pnpm install`.
21 - We use [pnpm](https://pnpm.io/) v7 for package management.
22 - We use [nvm](https://github.com/nvm-sh/nvm) to manage node versions - please make sure to use the version mentioned in `.nvmrc`.
23- Run development server using `pnpm run watch`.
24- Implement your changes and tests to files in the `src/` directory and corresponding test files.
25- Document your changes in the appropriate doc page.
26- Git stage your required changes and commit (see below commit guidelines).
27- Submit PR for review.
28​
29### Running examples
30- Make sure you've installed the dependencies by running `$ pnpm install` in the repo's root directory.
31- If you want to run the example against your local changes, run `pnpm run watch` in the repo's root directory. Otherwise, it will be run against the latest TanStack Form release.
32- Run `pnpm run dev` in the selected examples' directory.
33​
34#### Note on `examples/react-native`
35React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
36​
37#### Note on standalone execution
38If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Form release.
39​
40## Online one-click setup
41​
42You 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:
43​
44- clone the `TanStack/form` repo.
45- install all the dependencies in `/` and `/docs`.
46- run `npm start` in the root(`/`) to Auto-build files.
47- run `npm run dev` in `/docs`.
48​
49[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/form)
50​
51## Commit message conventions
52​
53`TanStack/form` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
54​
55We 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**.
56​
57### Commit Message Format
58​
59Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
60format that includes a **type**, a **scope** and a **subject**:
61​
62```
63<type>(<scope>): <subject>
64<BLANK LINE>
65<body>
66<BLANK LINE>
67<footer>
68```
69​
70The **header** is mandatory and the **scope** of the header is optional.
71​
72Any 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.
73​
74### Type
75​
76Must be one of the following:
77​
78- **feat**: A new feature
79- **fix**: A bug fix
80- **docs**: Documentation only changes
81- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
82 semi-colons, etc)
83- **refactor**: A code change that neither fixes a bug nor adds a feature
84- **perf**: A code change that improves performance
85- **test**: Adding missing or correcting existing tests
86- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
87 generation
88​
89### Scope
90​
91The scope could be anything specifying place of the commit change. For example `useForm`, `useMutation` etc...
92​
93You can use `*` when the change affects more than a single scope.
94​
95### Subject
96​
97The subject contains succinct description of the change:
98​
99- use the imperative, present tense: "change" not "changed" nor "changes"
100- don't capitalize first letter
101- no dot (.) at the end
102​
103### Body
104​
105Just 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.
106​
107### Footer
108​
109The 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).
110​
111**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.
112​
113### Example
114​
115Here is an example of the release type that will be done based on a commit messages:
116​
117| Commit message | Release type |
118| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
119| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
120| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
121| `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 |
122​
123### Revert
124​
125If 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.
126​
127## Pull requests
128​
129Maintainers merge pull requests by squashing all commits and editing the commit message if necessary using the GitHub user interface.
130​
131Use an appropriate commit type. Be especially careful with breaking changes.
132​
133## Releases
134​
135For each new commit added to `main` 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.