|
1 | | -# Contributing to DocSearch |
| 1 | +Hi (future) collaborator! |
2 | 2 |
|
3 | | -Welcome to the contributing guide for DocSearch! |
| 3 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 4 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
4 | 5 |
|
5 | | -If this guide does not contain what you are looking for and thus prevents you from contributing, don't hesitate to leave a message on the [Discord](https://discord.gg/bRTacwYrfX) or to [open an issue](https://github.com/algolia/docsearch/issues). |
6 | 6 |
|
7 | | -## Reporting an issue |
| 7 | +- [Where to start?](#where-to-start) |
| 8 | +- [Development workflow](#development-workflow) |
| 9 | + - [Requirements](#requirements) |
| 10 | + - [Build](#build) |
| 11 | + - [Serve](#serve) |
| 12 | + - [Test](#test) |
| 13 | + - [Docs](#docs) |
| 14 | + - [Release](#release) |
8 | 15 |
|
9 | | -Opening an issue is very effective way to contribute because many users might also be impacted. We'll make sure to fix it quickly if it's technically feasible and doesn't have important side effects for other users. |
| 16 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
10 | 17 |
|
11 | | -Before reporting an issue, first check that there is not an already open issue for the same topic using the [issues page](https://github.com/algolia/docsearch/issues). Don't hesitate to thumb up an issue that corresponds to the problem you have. |
| 18 | +# Where to start? |
12 | 19 |
|
13 | | -Another element that will help us go faster at solving the issue is to provide a reproducible test case. We recommend to [use this CodeSandbox template](https://codesandbox.io/s/github/algolia/docsearch/tree/main/examples/demo). |
| 20 | +Have a fix or a new feature? Search for corresponding issues first, then create a new one if needed. |
14 | 21 |
|
15 | | -## Code contribution |
| 22 | +# Development workflow |
16 | 23 |
|
17 | | -For any code contribution, you need to: |
18 | | - |
19 | | -- Fork and clone the project |
20 | | -- Create a new branch for what you want to solve (fix/_issue-number_, feat/_name-of-the-feature_) |
21 | | -- Make your changes |
22 | | -- Open a pull request |
23 | | - |
24 | | -Then: |
25 | | - |
26 | | -- A team member will review the pull request |
27 | | -- Automatic checks will be run |
28 | | - |
29 | | -When every check is green and a team member approves, your contribution is merged! 🚀 |
30 | | - |
31 | | -## Commit conventions |
32 | | - |
33 | | -This project follows the [conventional changelog](https://conventionalcommits.org/) approach. This means that all commit messages should be formatted using the following scheme: |
34 | | - |
35 | | -``` |
36 | | -type(scope): description |
37 | | -``` |
| 24 | +## Requirements |
38 | 25 |
|
39 | | -In most cases, we use the following types: |
| 26 | +To run this project, you will need: |
40 | 27 |
|
41 | | -- `fix`: for any resolution of an issue (identified or not) |
42 | | -- `feat`: for any new feature |
43 | | -- `refactor`: for any code change that neither adds a feature nor fixes an issue |
44 | | -- `docs`: for any documentation change or addition |
45 | | -- `chore`: for anything that is not related to the library itself (doc, tooling) |
| 28 | +- Node.js >= v8.7.0, use nvm - [install |
| 29 | + instructions][15] |
| 30 | +- Yarn |
46 | 31 |
|
47 | | -Even though the scope is optional, we try to fill it in as it helps us better understand the impact of a change. |
| 32 | +## Build |
48 | 33 |
|
49 | | -Finally, if your work is based on an issue on GitHub, please add in the body of the commit message "fix #1234" if it solves the issue #1234 (read "[Closing issues using keywords](https://help.github.com/en/articles/closing-issues-using-keywords)"). |
| 34 | +`yarn run build` will build all files in `./dist`. This includes regular and |
| 35 | +minified files for `<script>` inclusion, as well as classes for `import`ing. |
50 | 36 |
|
51 | | -Some examples of valid commit messages (used as first lines): |
| 37 | +The command itself is split into `yarn run build:js` and `yarn run build:css` if |
| 38 | +you want to build a subset. |
52 | 39 |
|
53 | | -> - fix(searchbox): add `type` input property |
54 | | -> - chore(deps): update dependency rollup-plugin-babel to v3.0.7 |
55 | | -> - fix(modal): increase default height |
56 | | -> - docs(contributing): reword release section |
| 40 | +## Serve |
57 | 41 |
|
58 | | -## Requirements |
| 42 | +You can have all this files served on localhost, along with live-reload, with |
| 43 | +the `yarn run serve` command. |
59 | 44 |
|
60 | | -To run this project, you will need: |
| 45 | +## Test |
61 | 46 |
|
62 | | -- Node.js ≥ 18 – [nvm](https://github.com/nvm-sh/nvm#install-script) is recommended |
63 | | -- [Yarn](https://yarnpkg.com) |
| 47 | +You can run all tests with `yarn run test`, and `yarn run test:watch` will run |
| 48 | +them with auto-reload. |
64 | 49 |
|
65 | 50 | ## Release |
66 | 51 |
|
67 | | -```sh |
68 | | -yarn run release |
69 | | -``` |
70 | | - |
71 | | -It will create a pull request for the next release. When it's reviewed, approved and merged, then CircleCI will automatically publish it to npm. |
| 52 | +`npm run release` will guide you through the release process. Note that you have |
| 53 | +to use `npm` and not `yarn` for this one otherwise it won't deploy to npm. |
| 54 | + |
| 55 | +[1]: #where-to-start |
| 56 | +[2]: #development-workflow |
| 57 | +[3]: #requirements |
| 58 | +[4]: #launch |
| 59 | +[5]: #local-build |
| 60 | +[6]: #commit-message-guidelines |
| 61 | +[7]: #revert |
| 62 | +[8]: #type |
| 63 | +[9]: #scope |
| 64 | +[10]: #subject |
| 65 | +[11]: #body |
| 66 | +[12]: #footer |
| 67 | +[13]: #releasing |
| 68 | +[15]: https://github.com/creationix/nvm#install-script |
0 commit comments