Optimized template repository for React component libraries.
This template will give you a jumpstart on designing, testing, and publishing your very own React component library!
Click on the Use this template button to generate your own repository from this one.
Run npm install
first to install package dependencies.
npm start
- Shortcut fornpm run styleguide:serve
npm run lint
- Run the StandardJS linter to check for warnings and errorsnpm run build
- Build the component library to the dist foldernpm test
- Run the Jest testing suite to verify that the components will behave correctlynpm run storybook:serve
- Run the Styleguidist server for component visualizationnpm run storybook:build
- Build a static Styleguidist site to the docs folder
Import the theme file in your application the apply the correct styling to all components.
import '~@matthewdowns/react-component-library-boilerplate/styles/theme.less';
Components that use colors will import the LESS variables defined in _colors.less.
Package publishing is handled automatically via GitHub Actions. You can view the publishing workflow here.
First, create a new branch - release/vx.x.x - and run the `npm version {major,minor,patch,etc.} command to update the package.json version automatically.
For example, if the lastest tag version is v1.0.4, then you would create a new branch off of main called v1.0.5, and then run npm version patch
to upgrade the packge version from 1.0.4 to 1.0.5.
Please note that the package.json version should never include the "v" prefix, according to the semantic versioning specification. However, it does specifies that tags on GitHub or other version control systems can be prefixed with a "v".
After you've pushed the branch to GitHub, you can create a new release, where the Choose a tag dropdown lets you specify the tag version (remember to include a "v" prefix) as well as the target, which would be your release branch.
At this point, the publish workflow should be running - you can see the status of all actions on the repository here.
Distributed under the MIT License. See LICENSE for more information.
Matthew Downs
Email: matthew.downsc@gmail.com
Twitter: @mdownsxy
Project Link: https://github.com/matthewdowns/react-component-library-boilerplate