- Directory structure
- Setup
- Lint and format
- Build
- Unit test
- E2E test
- Update documents' ToC and CLI usage section
This repository adopts mono-repo structure using Lerna.
Each package has the following role:
packages/storycap
: Contains Storycap's main application source code. This packages has a responsibility for capturing screenshots and depends onstorycrawler
.packages/storycrawler
: Contains basic utilities source to build a crawler for Storybook. This package should have functions to connect Storybook, launch Puppeteer processes, and manage parallel asynchronous tasks.
Clone this repository and execute the following:
$ yarn --frozen-lockfile
$ yarn bootstrap
$ yarn lint # runs eslint
$ yarn format # runs prettier --write
$ yarn build
$ cd packages/<package-name>
$ yarn build
# or
$ yarn run tsc -p tsconfig.build.json
$ yarn test
$ cd packages/<package-name>
$ yarn test
# or
$ yarn run jest
$ ./e2e.sh
When the command exit successfully, check __screenshots__
dir. There should be captured PNG files.
And e2e.sh
also accepts a specific storybook example's name. For example:
$ ./e2e.sh examples/v4-simple
We insert ToC and CLI usage section to some Markdown files(e.g. README.md) using script. If you touch *.md
files or add an option to CLI, please exec the following command when you stage the changes:
$ yarn doc