A boilerplate for building React libraries
- Rollup with Babel support
- Test runner: Jest
- Code Coverage reporter: Codecov
- ES Linting: ESLint using AirBnb style guide for library sources
- Example from official Rollup tutorial
- Demo project with create-react-app
Install the latest Node JS and Yarn and simply run yarn
or yarn install
command in the project directory.
During development, run:
yarn start # watches and builds new code changes
yarn flow # performs type checking on files
See official documentation for a usage guide.
Yarn will run postinstall for updating flowtype definitions when new packages are added.
yarn lint # runs linter to detect any style issues
yarn lint --fix # tries to fix lint issues
yarn test # runs functional/unit tests using Jest
yarn test --coverage # with coverage
yarn build
yarn link
cd demo/
yarn # install dependencies
yarn start # watch, build, and serve the demo app on localhost:3000
Review demo/README.md for more information.