Skip to content

Latest commit

 

History

History
89 lines (54 loc) · 3.11 KB

CONTRIBUTING.md

File metadata and controls

89 lines (54 loc) · 3.11 KB

Contributing

Thanks for being willing to contribute! 🙏

Working on your first Pull Request (PR)? You can learn how from this free series How to Contribute to an Open Source Project on GitHub

Open issues

Please check out the the open issues. Issues labelled Good First Issueare especially good to start with.

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.

Opening a Pull Request

Pull requests are welcome for this repo! PRs are especially welcome for:

  • Bugfixes
  • Image compression improvements
  • Image quality improvements
  • Performance improvements

Setup

  1. Install pnpm
  2. Fork this repo and clone your copy locally
  3. Run pnpm i to install dependencies

Writing code

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.

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. Clarity is favored over strict rules. Changelogs are generated separately from git (see the Changelogs section)

Writing the PR

Please fill out the template! It’s a very lightweight template 🙂.

Opening a PR

When opening a pull request, make sure all of the following is done:

  • Tests are added
  • Build passes (npm run build)
  • Tests pass (npm test)
  • Linting passes (npm run lint)

Lastly, be sure to fill out the complete PR template!

Changelogs

The changelog is generated via changesets, and is separate from Git commit messages and pull request titles. To write a human-readable changelog for your changes, run:

npx changeset

This will ask if it’s a patch, minor, or major change (semver), 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!

Testing

This library uses Vitest for testing. There’s a great VS Code extension you can optionally use if you’d like in-editor debugging tools.

Running tests

To run the entire test suite once, run:

pnpm test

To run an individual test:

pnpm test -- [partial filename]

To start the entire test suite in watch mode:

npx vitest

Running linting

To run ESLint on the project:

npm run lint