# Contributing

Contributions are welcome. We’re using [pnpm](https://pnpm.io/).

## Development setup

1. Clone the repository: `$ git clone git@github.com:scalar/scalar.git`
2. Install all dependencies: `$ pnpm install`
3. Build all packages once: `$ pnpm turbo build`
4. Run the development server: `$ pnpm run dev`
5. Open your browser: <http://localhost:3000>

This should give you a nice start page with entrypoints to the various previews and examples.

## Tests

Most packages have a bunch of tests, mostly for all the helper functions we use.

It’s worth to check the tests locally before sending contributions: `$ pnpm test`

If you want to add a test and only run your test file, you can filter the test suite like this:  `$ pnpm test your-test`

## PRs

Don’t worry, we’ll help you to get your PR in. But here is how you can help us:

### Semantic PR titles

We require a semantic PR title, here is an example:

```
docs: Add information about semantic commits
^     ^
|     |__ Subject
|________ Prefix
```

Here are all the prefixes you need to know:

| Prefix   | Description                                                                                                 |
| -------- | ----------------------------------------------------------------------------------------------------------- |
| feat     | A new feature                                                                                               |
| fix      | A bug fix                                                                                                   |
| docs     | Documentation only changes                                                                                  |
| style    | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)      |
| refactor | A code change that neither fixes a bug nor adds a feature                                                   |
| perf     | A code change that improves performance                                                                     |
| test     | Adding missing tests or correcting existing tests                                                           |
| build    | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)         |
| ci       | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
| chore    | Other changes that don't modify src or test files                                                           |
| revert   | Reverts a previous commit                                                                                   |