|
1 | 1 | # Contributing to UseTheForm |
2 | 2 |
|
3 | | -🎉 First off, thanks for taking the time to contribute! 🎉 |
| 3 | +🎉 First off, **thank you** for taking the time to contribute — your help is what keeps this project growing! 🎉 |
4 | 4 |
|
5 | | -With the aim of ensuring that `usetheform` lives and continues to grow we would like to encourage everyone to help and support this library by contributing. |
| 5 | +We welcome all contributions, whether you're fixing bugs, adding new features, improving documentation, or simply spreading the word. Let's build something great together. |
6 | 6 |
|
7 | | -## Pull Request Process |
| 7 | +## Prerequisites |
8 | 8 |
|
9 | | -1. Fork and clone the repo to your local machine |
| 9 | +Before getting started, make sure you have the following tools installed: |
10 | 10 |
|
11 | | -2. Create a new branch from `master` with a meaningful name for a new feature or an issue you want to work on: `git checkout -b your-meaningful-branch-name` |
| 11 | +- **Node.js** (v20.19.0 is recommended) |
| 12 | + Make sure you have Node.js installed. You can manage multiple versions of Node.js using [nvm](https://github.com/nvm-sh/nvm). |
12 | 13 |
|
13 | | -3. Install packages by running: |
| 14 | +- **Corepack** (which comes bundled with Node.js v16.9 and later) |
| 15 | + Corepack allows you to manage Yarn versions per project without requiring a global installation of Yarn. |
14 | 16 |
|
15 | | - > npm i |
16 | | - |
17 | | -4. If you have added/removed code ensure that test suite still passes. |
| 17 | +## 🚀 Getting Started |
18 | 18 |
|
19 | | - > npm test |
20 | | - |
21 | | -5. Write some unit tests to cover as much of your code as possible. |
| 19 | +1. **Fork** the repository and **clone** it to your local machine: |
| 20 | + ```bash |
| 21 | + git clone https://github.com/your-username/usetheform.git |
| 22 | + ``` |
22 | 23 |
|
23 | | -6. Ensure your code lints without errors. |
| 24 | +2. **Enable Yarn via Corepack** (required for newer versions of Node.js): |
24 | 25 |
|
25 | | - > npm run lint |
26 | | - |
27 | | -7. Ensure build passes. |
| 26 | + If you don’t have Yarn installed globally, just enable it with: |
| 27 | + ```bash |
| 28 | + corepack enable |
| 29 | + ``` |
28 | 30 |
|
29 | | - > npm run build |
30 | | - |
31 | | -8. Push your branch: `git push -u origin your-meaningful-branch-name` |
| 31 | + > 💡 `corepack` comes bundled with Node.js (v16.10+), and helps manage Yarn versions. |
32 | 32 |
|
33 | | -9. Submit a pull request to the upstream usetheform repository. |
| 33 | +3. **Install dependencies**: |
| 34 | + ```bash |
| 35 | + yarn |
| 36 | + ``` |
34 | 37 |
|
35 | | -10. Choose a descriptive title and describe your changes briefly. |
| 38 | +4. **Create a new branch** from `master` with a meaningful name: |
| 39 | + ```bash |
| 40 | + git checkout -b your-feature-or-fix-name |
| 41 | + ``` |
36 | 42 |
|
37 | | -## Coding style |
| 43 | +## ✅ Development Checklist |
38 | 44 |
|
39 | | -UseTheForm uses eslint and prettier. As suggestion, you might enable the eslint and prettier plugins in your editor to get real-time feedback. To execute the linting manually, run the following command: `npm run lint` |
| 45 | +Before submitting your pull request, please make sure to: |
40 | 46 |
|
41 | | -## License |
| 47 | +- ✅ **Run tests** to ensure everything works as expected: |
| 48 | + ```bash |
| 49 | + yarn test |
| 50 | + ``` |
42 | 51 |
|
43 | | -By contributing your code to the usetheform GitHub repository, you agree to license your code under the MIT license. |
| 52 | +- ✅ **Write unit tests** for your changes where applicable. |
| 53 | + |
| 54 | +- ✅ **Lint your code** for formatting and style issues: |
| 55 | + ```bash |
| 56 | + yarn lint |
| 57 | + ``` |
| 58 | + |
| 59 | +- ✅ **Build the project** to verify that everything compiles: |
| 60 | + ```bash |
| 61 | + yarn build |
| 62 | + ``` |
| 63 | + |
| 64 | +- ✅ **Push your branch** to your forked repo: |
| 65 | + ```bash |
| 66 | + git push -u origin your-feature-or-fix-name |
| 67 | + ``` |
| 68 | + |
| 69 | +- ✅ **Open a Pull Request** against the `master` branch in the main repository. |
| 70 | + - Use a **clear title** and **brief description** of your changes. |
| 71 | + |
| 72 | +## 🧑💻 Code Style |
| 73 | + |
| 74 | +UseTheForm follows consistent styling via **ESLint** and **Prettier**. |
| 75 | + |
| 76 | +👉 We recommend enabling their plugins in your code editor for real-time feedback. |
| 77 | + |
| 78 | +Run manually: |
| 79 | + |
| 80 | +```bash |
| 81 | +yarn lint |
| 82 | +``` |
| 83 | + |
| 84 | +## 📄 License |
| 85 | + |
| 86 | +By contributing to this project, you agree to license your work under the [MIT License](../LICENSE.md), in line with the rest of the repository. |
0 commit comments