|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for being willing to contribute! 🙏 |
| 4 | + |
| 5 | +**Working on your first Pull Request (PR)?** [Egghead has a great free video introduction](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). |
| 6 | + |
| 7 | +## Open issues |
| 8 | + |
| 9 | +Please check out the [the open issues](https://github.com/drwpow/openapi-fetch/issues). Issues labelled [**Help Wanted**](https://github.com/drwpow/openapi-fetch/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and [**Good First Issue**](https://github.com/drwpow/openapi-fetch/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) are especially good to help with. |
| 10 | + |
| 11 | +Contributing doesn’t have to be in code! Simply answering questions in open issues, or providing workarounds, is just as important a contribution as making pull requests. |
| 12 | + |
| 13 | +## Opening a Pull Request |
| 14 | + |
| 15 | +Pull requests are **welcome** for this repo! Bugfixes will always be accepted, though in some cases some small changes may be requested. |
| 16 | + |
| 17 | +However, if adding a feature or breaking change, please **open an issue first to discuss.** This ensures no time or work is wasted writing code that won’t be accepted to the project (see [Project Goals](./README.md#-project-goals)). Undiscussed feature work may be rejected at the discretion of the maintainers. |
| 18 | + |
| 19 | +### Setup |
| 20 | + |
| 21 | +1. Install [pnpm](https://pnpm.io/) |
| 22 | +2. [Fork this repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) and clone your copy locally |
| 23 | +3. Run `pnpm i` to install dependencies |
| 24 | + |
| 25 | +### Writing code |
| 26 | + |
| 27 | +Create a new branch for your PR with `git checkout -b your-branch-name`. Add the relevant code as well as docs and tests. When you push everything up (`git push`), navigate back to your repo GitHub and you should see a prompt to open a new PR. |
| 28 | + |
| 29 | +While best practices for commit messages are encouraged (e.g. start with an imperative verb, keep it short, use the body if needed), this repo doesn’t follow any specific guidelines like [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). Clarity is favored over strict rules. Changelogs are generated separately from git (see [the Changelogs section](#changelogs) |
| 30 | + |
| 31 | +### Writing the PR |
| 32 | + |
| 33 | +**Please fill out the template!** It’s a very lightweight template 🙂. |
| 34 | + |
| 35 | +### Changelogs |
| 36 | + |
| 37 | +The changelog is generated via [changesets](https://github.com/changesets/changesets), and is separate from Git commit messages and pull request titles. To write a human-readable changelog for your changes, run: |
| 38 | + |
| 39 | +``` |
| 40 | +npx changeset |
| 41 | +``` |
| 42 | + |
| 43 | +This will ask if it’s a `patch`, `minor`, or `major` change ([semver](https://semver.org/)), along with a plain description of what you did. Commit this new file along with the rest of your PR, and during the next release this will go into the official changelog! |
| 44 | + |
| 45 | +### CI |
| 46 | + |
| 47 | +All PRs must fix lint errors, and all tests must pass. PRs will not be merged until all CI checks are “green” (✅). |
| 48 | + |
| 49 | +#### Tests |
| 50 | + |
| 51 | +This library uses [Vitest](https://vitest.dev/) for testing. There’s a great [VS Code extension](https://marketplace.visualstudio.com/items?itemName=ZixuanChen.vitest-explorer) you can optionally use if you’d like in-editor debugging tools. |
| 52 | + |
| 53 | +To run the entire test suite, run: |
| 54 | + |
| 55 | +```bash |
| 56 | +npm test |
| 57 | +``` |
| 58 | + |
| 59 | +To run an individual test: |
| 60 | + |
| 61 | +```bash |
| 62 | +npm test -- [partial filename] |
| 63 | +``` |
| 64 | + |
| 65 | +To start the entire test suite in watch mode: |
| 66 | + |
| 67 | +```bash |
| 68 | +npx vitest |
| 69 | +``` |
0 commit comments