|
| 1 | +Hello and welcome to the contributing guide for Generative AI Experiences. Thanks for considering participating in our project 🙇 |
| 2 | + |
| 3 | +## Reporting an issue |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +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/generative-experiences/issues). Don't hesitate to thumb up an issue that corresponds to the problem you have. |
| 8 | + |
| 9 | +## The code contribution process |
| 10 | + |
| 11 | +Generative AI Experiences is developed in TypeScript. |
| 12 | + |
| 13 | +For any code contribution, you need to: |
| 14 | + |
| 15 | +- Fork and clone the project |
| 16 | +- Create a new branch for what you want to solve (fix/_name-of-fix_, feat/_name-of-the-feature_) |
| 17 | +- Make your changes |
| 18 | +- Open a pull request |
| 19 | + |
| 20 | +Then: |
| 21 | + |
| 22 | +- Peer review of the pull request (by at least one of the core contributors) |
| 23 | +- Automatic checks (tests, commits, linters) |
| 24 | +- When everything is green, your contribution is merged 🚀 |
| 25 | + |
| 26 | +## Commit conventions |
| 27 | + |
| 28 | +This project follows the [conventional changelog](https://conventionalcommits.org/) approach. This means that all commit messages should be formatted using the following scheme: |
| 29 | + |
| 30 | +``` |
| 31 | +type(scope): description |
| 32 | +``` |
| 33 | + |
| 34 | +In most cases, we use the following types: |
| 35 | + |
| 36 | +- `fix`: for any resolution of an issue (identified or not) |
| 37 | +- `feat`: for any new feature |
| 38 | +- `refactor`: for any code change that neither adds a feature nor fixes an issue |
| 39 | +- `docs`: for any documentation change or addition |
| 40 | +- `chore`: for anything that is not related to the library itself (doc, tooling) |
| 41 | + |
| 42 | +Even though the scope is optional, we try to fill it in as it helps us better understand the impact of a change. We either use the name of the package/component impacted or we use impact topic (e.g. `docs`, `tooling`, `deps`, `ci`). |
| 43 | + |
| 44 | +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)"). |
| 45 | + |
| 46 | +Some examples of valid commit messages (used as first lines): |
| 47 | + |
| 48 | +> - fix(client): update getHeadlines parameters |
| 49 | +> - chore(deps): update dependency bundlesize to v0.18.4 |
| 50 | +> - chore: reword contributions guides |
| 51 | +
|
| 52 | +## Requirements |
| 53 | + |
| 54 | +To run this project, you will need: |
| 55 | + |
| 56 | +- Node.js ≥ 20.17 (current stable version) – [nvm](https://github.com/creationix/nvm#install-script) is recommended |
| 57 | +- [Yarn](https://yarnpkg.com) |
| 58 | + |
| 59 | +## Launch the dev environment |
| 60 | + |
| 61 | +First, build the libraries: |
| 62 | + |
| 63 | +```sh |
| 64 | +yarn build |
| 65 | +``` |
| 66 | + |
| 67 | +Go in the relevant example package an add `.env` file, following the `.env.example`. |
| 68 | +Add the information of the Algolia app you want to test the libraries on. |
| 69 | + |
| 70 | +Then start the server of the relevant example: |
| 71 | + |
| 72 | +```sh |
| 73 | +yarn --cwd examples/playground yarn dev |
| 74 | +``` |
| 75 | + |
| 76 | +Finally, go to the URL displayed on the terminal (generally http://localhost:5173) to view the example in a browser. |
| 77 | + |
| 78 | +## Folders of the project |
| 79 | + |
| 80 | +Here are the main files and folders of the project. |
| 81 | + |
| 82 | +``` |
| 83 | +▸ examples/ << Examples, grouped per flavor |
| 84 | + ▸ playground/ << React basic example |
| 85 | + ▸ playground-js/ << JS basic example |
| 86 | +▸ packages/ << Packages of the project |
| 87 | + ▸ generative-experiences-api-client/ << Generative AI Experiences JS API client library |
| 88 | + ▸ generative-experiences-js/ << The Generative AI Experiences JS library |
| 89 | + ▸ generative-experiences-react/ << The Generative AI Experiences React library |
| 90 | + ▸ generative-experiences-vdom/ << The primitives for building flavors of the Generative AI Experiences widgets |
| 91 | +▸ test/ << The test utilites |
| 92 | + ▸ utils/ << Global utilities for the tests |
| 93 | +▸ scripts/ << The scripts for maintaining the project |
| 94 | + CHANGELOG.md << The autogenerated changelog (based on commits) |
| 95 | + CONTRIBUTING.md << this file |
| 96 | + package.json << The definition of the project |
| 97 | + README.md << The introduction of the project |
| 98 | +``` |
| 99 | + |
| 100 | +## Release |
| 101 | + |
| 102 | +### Main version |
| 103 | + |
| 104 | +To release a stable version, go on `master` (`git checkout master`) and use: |
| 105 | + |
| 106 | +```sh |
| 107 | +yarn run release |
| 108 | +``` |
| 109 | + |
| 110 | +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. |
0 commit comments