@labsavvyapp/ui-components
UI Components used across multiple LabSavvy Projects
Table of Contents
Requirements
- NodeJS must be v12.x.x
- NPM
Installation
git clone https://bitbucket.org/labsavvy/ls_ui_components
cd ls_ui_components
npm install
Available NPM scripts
Build
npm run build
Storybooks
npm run storybook
Tests
npm test
Components folder structure
See Components Readme.
Contributing
Push
Build, commit and push
npm run push -- "commit message"
Development
- Run
npm run storybook
and use the storybook's UI to develop your component - Once the PR is approved and merged, publish your package
Test a package before release
Test on Storybook
- Create a story book file in
<ComponentName>/<ComponentName>.stories.jsx
- Run
npm run build
- Review by running
npm run storybook
Test it on the client application
- Run
npm run build
on the UI-Components side - On the
ls_ui_components
folder, runnpm link
, and then, to avoid a dupe React issue, runnpm link ../ls_webapp/node_modules/react
(assuming you have your webapp in a sister folder calledls_webapp
) - On the
ls_webapp
folder, runnpm link @labsavvyapp/ui-components
Publish a package version
NOTE: Test before you publish
- Run
npm run build
to make sure that you're publishing the last version of your code - Update the version number in
package.json
- Update the
CHANGELOG.md
accordingly - Create a storybook file for each component and test it on the client application before publishing.
- After PR approval, publish the new version - e.g.
npm publish
- Push to master and generate a new tag for the newly created version
Do not forget to run npm login
in order to publish
Conventions
package versioning
follow the guidelines for npm sematic versioning as described in the following document: https://docs.npmjs.com/about-semantic-versioning#incrementing-semantic-versions-in-published-packages
Branch naming
issue-id/branch-name
Pull request naming
issue-id: Short description