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.

Main Tasks

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

CommandDescriptionNotes
npm run buildRuns compliers to convert (S)CSS and [TJ]S(X) to browser-friendly codeNo 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.
npm run lintRuns 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.
npm testRuns 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.
npm startRuns storybook or starts the local server to test developmentMake sure all variations are covered and all props have knobs

Ancillary Tasks

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

CommandDescriptionNotes
npm run commitRuns the interactive commitlint for help contributing an acceptable commit messagehttps://commitlint.js.org
npm run build:cssRuns node-sass and postcss to compile the (S)CSS into CSShttps://sass-lang.com, https://postcss.org
npm run build:jsRuns the compiler the [TJ]S(X) into JShttp://typescriptlang.org
npm run lint:cssRuns stylelint to test the (S)CSS for style violationshttps://stylelint.io
npm run lint:docsRuns alex to test for sensitive languagehttps://alexjs.com
npm run lint:jsRuns eslint to test the [TJ]S(X) for style violationshttps://eslint.org
npm run test:jsRuns jest for testinghttps://jestjs.io
npm run docsRuns storybook to build out the docs/https://storybook.js.org