Skip to content

Latest commit

 

History

History
93 lines (58 loc) · 2.03 KB

CONTRIBUTING.md

File metadata and controls

93 lines (58 loc) · 2.03 KB

Contributing

Project setup

The Node.js version required is specified in /.nvmrc. The project use npm workspaces to manage dependencies.

Start by cloning the repository, then install the dependencies:

npm install

Working on the library

If you want to make changes to the library, go to the Chūshō package directory:

cd packages/chusho

Then run the playground:

npm start

You’re ready to make changes in the library and view them live in your favorite browser at localhost:3000.

The library code is in lib while the playground and examples are in src.

Working on the docs

To make changes in the documentation, go to the docs package:

cd packages/docs

Then start the dev server:

npm start

You can now see your changes live at localhost:8080.

Code quality

tl;dr From the root directory, you can run all the tests in a single command with:

npm test

Code styling

Code styling is enforced by EsLint & Prettier. The following commands should be run in the root directory.

npm run validate

Autofix as many offenses as possible:

npm run format

Unit tests

Unit tests are located in the chusho package, the following commands should therefor be run in the packages/chusho directory.

To run the unit test suites:

npm run test:unit

End-to-end tests

End-to-end tests are located in the chusho package, the following commands should therefor be run in the packages/chusho directory.

To start the playground server and run the suite in headless mode once, use:

npm run test:e2e

You can also run Cypress in interactive mode while developing. This requires you to have started the playground server in a separate process (see Working on the library above), after which you can run:

npm run test:e2e:dev