Guides

Contributing

Please follow this guide if you want to make a contribution to the Outkit repository. This could be anything from updating the theme, fixing a typo, or adding a new component.

This guide assumes you have Outkit setup locally. If you do not, please follow the getting started guide.

How do decide if a component should be added.

You can refer to the flowchart below to see if your idea for a new component meets all of Outkit's acceptance criteria.

New component flowchart

1. Make your changes on a new branch

The master branch in Outkit is protected - meaning you can not push directly to it. All changes must be made via Pull Requests.

To create a new branch, run the following command

git checkout -b my-new-branch

2. Create a changeset

After you have done all of your work, and before you make a Pull Request, run the yarn changeset command and answer the questions that are asked. It will want to know:

  • what version you are releasing the change at
  • a message to summarise the changes (this message will be written to the changelogs)

Before you accept the changeset, it will display all the data that will be written to the changeset. If this looks fine, agree, and a changeset will be generated in the .changeset directory.

After this, a new changeset will be added which is a markdown file with YAML front matter.

-| .changeset/
-|-| UNIQUE_ID.md

The message you typed can be found in the markdown file. If you want to expand on it, you can write as much markdown as you want, which will all be added to the changelog on publish.

While not every changeset is going to need a huge amount of detail, a good idea of what should be in a changeset is:

  • WHAT the change is
  • WHY the change was made
  • HOW a consumer should update their code

You can have multiple changesets in a single PR. This will give you more granular changelogs, and is encouraged.

Changeset guidelines

Pease try to write in the past tense (e.g. "Added a new feature" rather than "Add a new feature") and write in complete sentences. This means proper capitalisation and punctuation, including full stops/periods at the end of sentences. We try to be terse when possible but if needed it's fine to write multiple lines including examples for changing APIs.

We use the changeset-bot to remind you to generate a changelog if you have forgotten.

3. Formatting / Linting

Outkit uses prettier and eslint to ensure a high quality of code. If you have code that does meet prettiers and eslint standards your PR will fail.

  • Please run yarn format if you do not have auto formatting set-up in your IDE.
  • Please run yarn lint to check for formatting or linting errors