https://boclips.slab.com/posts/boclips-ui-guide-lerna-npm-storybook-am6l9qvt
npm i
lerna bootstrap
npx lerna run build
npm run storybook
The storybook should be accessible at http://localhost:6006/
- Do the code changes
- Build the component
- Commit the changes
- Version the component
npm run version
and then CI will publish your changes to the world
Building one of the components:
lerna run build:dep --scope=@boclips-ui/<name-of-component>
e.g.
lerna run build:dep --scope=@boclips-ui/search-bar
To build all of the packages:
lerna run build:dep
It sometimes may happen that you need to update and publish a component's version without introducing any code changes.
For example, you previously published your components as development versions, and now you only want to promote them to production versions.
There's an NPM script that will force a version bump for all the components:
npm run force-version-bump
You can also bump a single component only in a similar manner, for example:
npm run force-version-bump:component @boclips-ui/button
Or a bunch of them by comma separating the names:
npm run force-version-bump:component @boclips-ui/button,@boclips-ui/tooltip