A template for repositories of custom React components and hooks, properly typed with Typescript, divided
into sub packages with Lerna and visually testable with Storybook.
packages/ includes two examples for
subpackages that you can build upon:
packages/component-package with a sample implementation of a custom
react component, including a spec test-file, a storybook story and a MDX-based storybook documentation; And
packages/hook-package with a sample implementation of a custom react hook, including a hook test implementation
and a storybook story.
It also automatically deploys the storybook to GitHub Pages. You can view the default storybook here:
gh-pagesbranch and click on Save (root directory is fine).
When developing locally, run in the root directory...
yarnto install dependencies
yarn testto run tests in all packages
yarn buildto build distributables and typings in
yarn storybookto run a local storybook server
yarn build-storybookto build the storybook
npx lerna versionto interactively bump the packages versions. This automatically commits the version, tags the commit and pushes to git remote.
npx lerna publishto publish all packages to NPM that have changed since the last release. This automatically bumps the versions interactively.