Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Latest commit

 

History

History
76 lines (47 loc) · 1.9 KB

developing.md

File metadata and controls

76 lines (47 loc) · 1.9 KB

Developing Polythene

Setting up the development repo

Install Lerna:

npm install -g lerna

Get the Polythene repo and prepare:

git clone https://github.com/ArthurClemens/polythene.git
cd polythene
npm

This will install all dependencies and run lerna bootstrap.

Commands:

  • lerna run build - builds all components (in each dist directory)
  • lerna run build:component button - builds the button component; the same goes for the other components
  • lerna run build:tests - builds the tests
  • lerna run clean - removes all dist directories

Packages are built with Rollup, both as es module and as umd. Rollup creates cleaner files compared to Webpack. If you like to experiment, build scripts are in the root scripts directory.

Testing

Test files for each component are located in packages/test-COMPONENT. These include Jest snapshots to verify the output.

If you haven't done so, start by installing all dependencies in the root:

  • npm install - this will install all dependencies and run lerna bootstrap

Editing tests

  • Modify and build files:
    • npm run build - builds files in dist
  • Update snapshots:
    • npm run test
    • npm run test:watch

Viewing tests

Test files can be viewed by the "test renderers":

  • With Mithril: cd packages/tests-render-mithril
  • With React: cd packages/tests-render-react

Run in the browser: