A boilerplate for building React libraries
- Rollup with Babel, SCSS and other plugins:
- styled-components with default stylelint support
- Run tests with Jest
- Code Coverage reporting with Codecov
- Manual Testing with Storybook
- Structural and interaction testing with Enzyme
- Type checking with Flow
- JS style check with ESLint using AirBnb style guide
Install the latest Node JS LTS and Yarn and simply run yarn
or yarn install
command in the root and stories directory.
Install flowtypes using the package script:
yarn flow-typed
It is advised to run the script whenever NPM packages are installed.
During development,
# watch and build new source changes
yarn start
# or serve *.stories.js files and manually test on the Storyboard app
yarn storyboard
This project uses two package.json structure.
yarn add [package-name] --dev # for dev tools
yarn add [package-name] # for app
cd stories/
yarn add [package-name]
yarn flow # performs type checking on files
yarn lint # runs linter to detect any style issues (css & js)
yarn lint:css # lint only css
yarn lint:js # lint only js
yarn lint:js --fix # tries to fix js lint issues
yarn test # runs functional/unit tests using Jest
yarn test --coverage # with coverage
yarn build # builds sources at src/