Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Latest commit

 

History

History
76 lines (46 loc) · 2.36 KB

CONTRIBUTING.md

File metadata and controls

76 lines (46 loc) · 2.36 KB

How to contribute

This project uses the fork feature in Github for anyone outside of the core maintainers.

Develop Locally

We use NVM to manage node versions. Our node version is in the ./nvmrc file. We also assume you have access to our private org on NPM.

Run the following commands to get your local development environment set up.

  1. Make sure you're using the specified npm version
nvm use
  1. Install all dependencies off of the package-lock.json. (Use npm i if you're introducing new dependencies. Please note that all dev-dependencies need to be listed on the root package.json as well as the package specific package.json)
npm ci
  1. Builds all the things
npm run build
  1. We use Storybook to develop locally along with Next.js.
npm run storybook
  1. Don't forget to add your component to the kitchen-sink page. You can run npm run docsite:dev to develop and test with the kitchen-sink page. You can only access this page directly via http://localhost:3000/kitchen-sink. This page allows us to quickly check that all the components render as expected.

Testing

We use Testing Library and/or Storybook's new Interaction feature for Unit & Interaction Testing

This command runs the Jest.

npm run test

This command runs the Storybook Test runner

npm run test-storybook

Good resources on testing:

Avoid writing "render" or "display" tests. Leverage our "Tests" stories in Storybook for this. Those UI tests will be tested in Chromatic.

Component Development

Create a new component use the following command. It will stub out all the required files using plop-templates.

npm run new-component NewComponentName

You can create an experimental release for testing by following the release doc

Contribute a component

Release a component