|
1 | 1 | # Contributing |
2 | 2 |
|
3 | | -## Reporting Issues |
| 3 | +## General Guideline |
4 | 4 |
|
5 | | -If you have found what you think is a bug, please [start a discussion](https://github.com/pmndrs/jotai/discussions/new). |
| 5 | +### Reporting Issues |
6 | 6 |
|
7 | | -Also for usage questions, please [start a discussion](https://github.com/pmndrs/jotai/discussions/new). |
| 7 | +If you have found what you think is a bug, please [start a discussion](https://github.com/pmndrs/jotai/discussions/new?category=bug-report). |
8 | 8 |
|
9 | | -## Suggesting new features |
| 9 | +For any usage questions, please [start a discussion](https://github.com/pmndrs/jotai/discussions/new?category=q-a). |
10 | 10 |
|
11 | | -If you are here to suggest a feature, first [start a discussion](https://github.com/pmndrs/jotai/discussions/new) 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. |
| 11 | +### Suggesting New Features |
12 | 12 |
|
13 | | -## Development guide |
| 13 | +If you are here to suggest a feature, first [start a discussion](https://github.com/pmndrs/jotai/discussions/new?category=ideas) 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 | 14 |
|
15 | | -If you would like to contribute by fixing an open issue or developing a new feature you can use this suggested workflow: |
| 15 | +### Committing |
16 | 16 |
|
17 | | -### General |
| 17 | +We are applying [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/) here. In short, that means a commit has to be one of the following types: |
18 | 18 |
|
19 | | -1. Fork this repository |
20 | | -2. Create a new feature branch based off the `main` branch |
21 | | -3. Follow the [Core lib](#core-lib) and/or the [docs](#docs) guide below and come back to this once done |
22 | | -4. Run `pnpm run prettier` to format the code |
23 | | -5. Git stage your required changes and commit (review the commit guidelines below) |
24 | | -6. Submit the PR for review |
| 19 | +Your commit type must be one of the following: |
25 | 20 |
|
26 | | -### Core lib |
| 21 | +- **feat**: A new feature. |
| 22 | +- **fix**: A bug fix. |
| 23 | +- **refactor**: A code change that neither fixes a bug nor adds a feature. |
| 24 | +- **chore**: Changes to the build process, configuration, dependencies, CI/CD pipelines, or other auxiliary tools and libraries. |
| 25 | +- **docs**: Documentation-only changes. |
| 26 | +- **test**: Adding missing or correcting existing tests. |
27 | 27 |
|
28 | | -1. Install dependencies by running `pnpm install`. |
29 | | -2. Create failing tests for your fix or new feature in the `tests` folder |
30 | | -3. Implement your changes |
31 | | -4. Build the library `pnpm run build` _(Pro-tip: `pnpm run build-watch` runs the build in watch mode)_ |
32 | | -5. Run the tests and ensure that they pass. |
33 | | -6. You can use `pnpm link` or `yalc` to sym-link this package and test it locally on your own project. Alternatively, you may use CodeSandbox CI's canary releases to test the changes in your own project (requires a PR to be created first) |
34 | | -7. Follow step 4 and onwards from the [general](#general) guide above to bring it to the finish line |
| 28 | +If you are unfamiliar with the usage of conventional commits, |
| 29 | +the short version is to simply specify the type as a first word, |
| 30 | +and follow it with a colon and a space, then start your message |
| 31 | +from a lowercase letter, like this: |
35 | 32 |
|
36 | | -### Docs |
| 33 | +``` |
| 34 | +feat: add a 'foo' type support |
| 35 | +``` |
37 | 36 |
|
38 | | -1. Navigate to the `website` folder. Eg. `cd website` |
39 | | -2. Install dependencies by running `pnpm` in the `website` folder |
40 | | -3. Run `pnpm dev` to start the dev server |
41 | | -4. Navigate to [`http://localhost:9000`](http://localhost:9000) to view the docs |
42 | | -5. Navigate to the `docs` folder and make necessary changes to the docs |
43 | | -6. Add your changes to the docs and see them live reloaded in the browser |
44 | | -7. Follow step 4 and onwards from the [general](#general) guide above to bring it to the finish line |
| 37 | +You can also specify the scope of the commit in the parentheses after a type: |
45 | 38 |
|
46 | | -### Type |
| 39 | +``` |
| 40 | +fix(react): change the 'bar' parameter type |
| 41 | +``` |
47 | 42 |
|
48 | | -We follow the [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/) for our commit messages. Please review the spec for more details. |
| 43 | +### Development |
49 | 44 |
|
50 | | -Your commit type must be one of the following: |
| 45 | +If you would like to contribute by fixing an open issue or developing a new feature you can use this suggested workflow: |
| 46 | + |
| 47 | +#### General |
51 | 48 |
|
52 | | -- **build**: Changes that affect the build system or external dependencies (example scopes: pnpm, npm, rollup, etc.) |
53 | | -- **ci**: Changes to our CI configuration files and scripts (example scopes: GitHub Actions) |
54 | | -- **docs**: Documentation only changes |
55 | | -- **feat**: A new feature |
56 | | -- **fix**: A bug fix |
57 | | -- **perf**: A code change that improves performance |
58 | | -- **refactor**: A code change that neither fixes a bug nor adds a feature |
59 | | -- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
60 | | -- **test**: Adding missing tests or correcting existing tests |
| 49 | +1. Fork this repository. |
| 50 | +2. Create a new feature branch based off the `main` branch. |
| 51 | +3. Follow the [Core](#Core) and/or the [Documentation](#Documentation) guide below and come back to this once done. |
| 52 | +4. Run `pnpm run fix:format` to format the code. |
| 53 | +5. Git stage your required changes and commit. (review the commit guidelines below) |
| 54 | +6. Submit the PR for review. |
61 | 55 |
|
62 | | -## Pull requests |
| 56 | +##### Core |
| 57 | + |
| 58 | +1. Run `pnpm install` to install dependencies. |
| 59 | +2. Create failing tests for your fix or new feature in the [`tests`](./tests/) folder. |
| 60 | +3. Implement your changes. |
| 61 | +4. Run `pnpm run build` to build the library. _(Pro-tip: `pnpm run build-watch` runs the build in watch mode)_ |
| 62 | +5. Run the tests by running `pnpm run test` and ensure that they pass. |
| 63 | +6. You can use `pnpm link` to sym-link this package and test it locally on your own project. Alternatively, you may use CodeSandbox CI's canary releases to test the changes in your own project. (requires a PR to be created first) |
| 64 | +7. Follow step 4 and onwards from the [General](#General) guide above to bring it to the finish line. |
| 65 | + |
| 66 | +### Pull Requests |
63 | 67 |
|
64 | 68 | Please try to keep your pull request focused in scope and avoid including unrelated commits. |
65 | 69 |
|
66 | | -After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or request improvements, therefore, please check ✅ ["Allow edits from maintainers"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) on your PR |
| 70 | +After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or request improvements, therefore, please check ✅ ["Allow edits from maintainers"](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) on your PR. |
| 71 | + |
| 72 | +## Jotai-specific Guideline |
| 73 | + |
| 74 | +##### Documentation |
| 75 | + |
| 76 | +1. Navigate to the [`website`](./website/) folder. (e.g., `cd website`) |
| 77 | +2. Run `pnpm install` to install dependencies in the `website` folder. |
| 78 | +3. Run `pnpm run dev` to start the dev server. |
| 79 | +4. Navigate to [`http://localhost:9000`](http://localhost:9000) to view the documents. |
| 80 | +5. Navigate to the [`docs`](./docs/) folder and make necessary changes to the documents. |
| 81 | +6. Add your changes to the documents and see them live reloaded in the browser. |
| 82 | +7. Follow step 4 and onwards from the [General](#General) guide above to bring it to the finish line. |
67 | 83 |
|
68 | | -Thank you for contributing! |
| 84 | +Thank you for contributing! :heart: |
0 commit comments