Skip to content

Working With the Code

If you’re contributing to the codebase, its helpful to know the handful of commands that are used to ensure code is of the highest quality or allows you to visual your changes. Below is the list of tasks available.

These tasks are run most often, and most are required to pass checks before any feature can be approved.

Command Description Notes
pnpm build Runs compliers to convert (S)CSS and [TJ]S(X) to browser-friendly code No reason to run this unless you’re debugging output of code. This is run as part of the publishing process, so ensuring it passes can help.
pnpm lint Runs the linting suite; includes markdown, (s)css, and [tj]s(x) husky will attempt to run this on every commit and auto-fix. While it’s not required for this to pass and you may bypass with the flag of --no-verify, its good to run to help debugging and ensure a faster PR process.
pnpm test Runs the testing suite; includes sensitive language, (s)css, and [tj]s(x) If the test coverage drops below the configured numbers, this will fail despite all tests pass. In that event, you should see a message with the percentages to which it dropped.
pnpm start Runs storybook or starts the local server to test development Make sure all variations are covered and all props have knobs

Not the main tasks that get run everyday, but in the event you need finer control or help, these may be available.

Command Description Notes
pnpm commit Runs the interactive commitlint for help contributing an acceptable commit message https://commitlint.js.org
pnpm build:css Runs node-sass and postcss to compile the (S)CSS into CSS https://sass-lang.com, https://postcss.org
pnpm build:js Runs the compiler the [TJ]S(X) into JS http://typescriptlang.org
pnpm lint:css Runs stylelint to test the (S)CSS for style violations https://stylelint.io
pnpm lint:docs Runs alex to test for sensitive language https://alexjs.com
pnpm lint:js Runs eslint to test the [TJ]S(X) for style violations https://eslint.org
pnpm test:js Runs jest for testing https://jestjs.io
pnpm docs Runs storybook to build out the docs/ https://storybook.js.org