@doctorlogic/react-components
v0.0.1-231
Published
The DoctorLogic react component library.
Downloads
49
Keywords
Readme
doctorlogic.react-components
DoctorLogic's react component library. See the storybook.
Node Version
This project uses .node-version
file to indicate the correct node version to use for this project. You can use a tool like NVS (Node Version Switcher) to manage the Node.js version on your machine. NVS is a cross-platform tool for switching between different versions and forks of Node.js.
How to Use NVS
Install NVS by following the instructions on the NVS GitHub page.
Once NVS is installed, you can switch to the Node.js version required for this project by running the following command in your terminal:
nvs use
npm
Scripts
npm run build
Cleans and builds the project into the dist
directory.
Sub scripts:
build:ts
- builds the.tsx?
filesbuild:assets
- copies the.scss
and.svg
assets intodist
npm run clean
Deletes the build output.
npm t[est]
Tests the project. Please add more!
We use jest with the ts-jest preset.
npm run storybook
Starts storybook locally.
npm run build-dl-storybook
Builds a static storybook
site. See exporting storybook.
Storybook
The master
branch is automatically deployed with GitLab Pages.
Versioning
We do all of our versioning using npm version
. You should never modify the package.json:version
manually.
Version Scheme
Because this project is still a work in progress, all versioning will be done with npm version prerelease
. It is preferable to add a message with the -m
flag. There is currently no standard template for the message, but consider something like Upgrade to %s <reason for upgrade>
. (Note %s leaving %s in message will automatically be replaced with new version number)
After running npm version
, be sure to run the git push
and git push --tags
commands (or simply git push --follow-tags
).
Future Version Scheme
This is an initial plan and should be reviewed by the team
The current plan is to follow Semantic Versioning, with a slight caveat. While we will be using major
, minor
, patch
, and prerelease
, they will have slightly different meaning.
major
- Same asSemVer
. Will start at1
and only be incremented if incompatible API changes are made. Would require a major change in the way our components work. A breaking change for a single component will not trigger amajor
version bump.minor
- Incremented at the beginning of each sprint. Will start at1
. While it is tied to the sprint, the actual number will not be related to the sprint number. At the end of each sprint (before the deploy), the newminor
version (containing all of the sprint's changes) will be published.patch
- Used for bug fixes. If fixes are needed between sprints, apatch
version will be published with the fixes for the previous sprint'sminor
version.prerelease
- Used for tickets. As tickets are merged, a newprerelease
version will be published to be available in dependent projects.
Publishing
First time User
After getting access to npm pakage you will need to add your user locally - https://docs.npmjs.com/cli/v6/commands/npm-adduser
The project can be published by simply running npm publish
. You do not need to build before publishing. The prepublishOnly
script will be run to test and build the project before the publish is run.
Make sure to follow the instructions in versioning.
How to deploy changes to npm
- make sure you are on the
master
branch - run
git status
to make sure your local is in sync - run
npm run build && npm test
and visit dist folder to ensure scss files are there - run
npm version prerelease -m "Upgrade to %s <reason for upgrade>"
- run
git push --follow-tags
- run
npm publish