|
| 1 | +# Contributing to Create InstantSearch App |
| 2 | + |
| 3 | +Thank you for wanting to get involved in Create InstantSearch App! |
| 4 | + |
| 5 | +The goal of the package is to enable users to create InstantSearch applications quickly. |
| 6 | + |
| 7 | +## Core concepts |
| 8 | + |
| 9 | +The `create-instantsearch-app` CLI is based on the module `createInstantSearchApp(path, options?, tasks?)`. |
| 10 | + |
| 11 | +### Folder structure |
| 12 | + |
| 13 | +``` |
| 14 | +▸ src |
| 15 | + ▸ api The source code of the module `createInstantSearchApp()` |
| 16 | + ▸ cli The source code of the CLI `create-instantsearch-app` |
| 17 | + ▸ tasks The tasks of the app generation lifecycle |
| 18 | + ▸ templates The official templates supported |
| 19 | + ▸ utils The utility functions for the package |
| 20 | +▸ scripts The end-to-end tests and release scripts |
| 21 | + CHANGELOG.md |
| 22 | + CONTRIBUTING.md |
| 23 | + LICENSE |
| 24 | + README.md |
| 25 | + index.js |
| 26 | + package.json |
| 27 | +``` |
| 28 | + |
| 29 | +### Creating a template |
| 30 | + |
| 31 | +When [creating a template](README.md#templates), you will need to run end-to-end tests (`yarn run test:e2e:templates`) to update all the [snapshots](https://facebook.github.io/jest/docs/en/snapshot-testing.html). These snapshots are meant to avoid regressions that can potentially happen when we unintentionally update a behavior in the source code. |
| 32 | + |
| 33 | +## Requirements |
| 34 | + |
| 35 | +- [Node](https://nodejs.org) ≥ 8 |
| 36 | +- [Yarn](https://yarnpkg.com) |
| 37 | + |
| 38 | +## Workflow |
| 39 | + |
| 40 | +### Filing issues |
| 41 | + |
| 42 | +Creating issues, either for reporting a bug or asking for a new feature is always great. [When doing so](https://github.com/algolia/create-instantsearch-app/issues/new/choose), you'll get asked what kind of issue you want to create. Each of these templates will help you create an effective report. |
| 43 | + |
| 44 | +### Contributing to the code |
| 45 | + |
| 46 | +Code contributions are always welcome, although you should make sure to [open an issue](https://github.com/algolia/create-instantsearch-app/issues/new/choose) to notice us what you plan to do. |
| 47 | + |
| 48 | +You will need to follow these steps: |
| 49 | + |
| 50 | +- [Fork the repository](https://help.github.com/articles/fork-a-repo/) |
| 51 | +- Clone the project: `git clone https://github.com/algolia/create-instantsearch-app.git` |
| 52 | +- Install the dependencies: `yarn` |
| 53 | +- [Create a new branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/#creating-a-branch) |
| 54 | + - `fix/issue-number` for a fix |
| 55 | + - `feat/name-of-the-feature` for a feature |
| 56 | + - `docs/what-you-changed` for documentation |
| 57 | +- Apply your changes |
| 58 | +- Run tests: |
| 59 | + - `yarn lint` |
| 60 | + - `yarn test` |
| 61 | + - `yarn test:e2e` |
| 62 | +- [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) |
| 63 | + |
| 64 | +We will then review your pull request! |
| 65 | + |
| 66 | +### Releases |
| 67 | + |
| 68 | +- [Generate a new GitHub token](https://github.com/settings/tokens/new) with the scope `repo` (necessary for creating GitHub releases) |
| 69 | +- Store this token in an [environment variable](https://en.wikipedia.org/wiki/Environment_variable) called `GITHUB_TOKEN_CISA` |
| 70 | +- Make sure you're on the `master` branch |
| 71 | +- Run commands (do not use `yarn` for releasing): |
| 72 | + - `npm run release:beta` for a new beta version |
| 73 | + - `npm run release` for a new stable version |
| 74 | +- Follow the command-line instructions |
| 75 | + |
| 76 | +## Conventions |
| 77 | + |
| 78 | +### Commits |
| 79 | + |
| 80 | +This project follows the [conventional changelog](https://conventionalcommits.org/) approach. This means that all commit messages should be formatted using the following scheme: |
| 81 | + |
| 82 | +``` |
| 83 | +type(scope): description |
| 84 | +``` |
| 85 | + |
| 86 | +These commits are then used to generate the [changelog](CHANGELOG.md). |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +Thank you for contributing! |
0 commit comments