Simply run the commands below and you should have a working storybook displaying all of our components.
git clone repoyarn installyarn dev
Each component follows the folder structure below:
- ComponentName
- index.tsx
- index.stories.tsx
- styles.ts
Exports react component to be consumed
Showcase of component for storybook
Exports a styled component consumed by the react component
When you are ready to publish the package to NPM, use the release.prepare script:
yarn run release.prepare -m "Commit message" --patchThis script will increment the version number in package.json based on the specified version type (--patch, --minor, or --major are valid switches). The script will also check in the changes, commit the changes, and create a git tag with the new version number.
After the script runs successfully, you will need to push the tag to Github. Once the tag is pushed, Travis CI will run and publish the package to NPM. This process usually takes 1-2 minutes.
git push origin x.y.zWhere x.y.z is the new version number (part of the script output).
Notes:
- If the git commit message is left blank, it will default to "[Release]"
- If the version type is left blank,
patchwill be used by default
https://travis-ci.org/unionco/ts-components
Travis CI runs only when tags are pushed! master/branch commits will not trigger a deploy to NPM.