Upandgo components library
Introduction
This React library gathers all elementary and more complex components that can be reused accross all Upandgo applications.
It has been bootstrapped from this tutorial.
It is built using rollup.js
Prerequisite
- npm version >= 7
- aws SSH key configured to deploy Storybook
- npm SSH key configured to deploy a new version of the package
Workflow
At the time of writing, there is only one branch on the repo (master
). Every new branch (feature, hotfix) can be based on master.
The branch should be merged via a dedicated MR on Gitlab. Before pushing your branch don't forget to increment the package version (via npm version major|minor|patch
)
Once your branch is merged, you can deploy a new package following these steps:
git checkout master
git pull
npm run build
npm publish
Design rules
- Ideally, components should be dumb ie. take the full width of their parent container.
- Use custom class for style override. Classnames should be prefixed with
uag-
to be easily spotted.
Storybook
This library uses Storybook to pre-visualize components. When creating new components, you must create the related stories so that components can be added to the documentation.
When developing new stories, you can use npm run storybook
so you can see your modifications live.
When new stories are added, Storybook should be deployed using the following command ./scripts/deploy-storybook.sh