0.0.3 • Published 6 years ago
@vinterior/design-system v0.0.3
Vinterior Design System
Developing with Storybook
Running Storybook
- Run the design-system Webpack dev server:
yarn start
- Run the Storybook server:
yarn storybook
- Go to http://localhost:9009/ to view the Storybook
Developing with Storybook
- Follow steps above "Running Storybook"
- Create a new dev branch:
git checkout -b mybranch
- Add / update as necessary
- Add stories to the
stories/
directory as you add / update components!
Creating a Pull Request / Publishing / deploy
Creating a Pull Request
- When you're ready, push your branch to Github and create a pull request.
- If you've made visual changes, include screenshots.
- PR will be reviewed
- When PR is accepted, it will be merged into master.
- (Optional) If you also need to publish a new design-system version, read that section.
Publishing to NPM
- Create a separate PR or bump the npm version in the feature branch, do not publish from master.
- Make sure you're logged in to NPM via
npm login
. When prompted for email please use: dev-team@vinterior.co - Run
yarn publish
to bump the version, bundle the .js and .css file into/dist
folder and publish to npm - Check https://www.npmjs.com/~vinterior to make sure package is updated.
Deploying Live Version
- On the same branch that was just published, run
yarn deploy-storybook
, this should build the static site and deploy to Github Pages - Visit
[vinterior.github.io/design-system](https://vinterior.github.io/design-system)
to check that your changes are now live
Developing with Vinterior App
Link design-system
(you only need to do this once)
- In your terminal,
cd
to local design-system repo. - Run
yarn link
. cd
to local Vinterior App repo.- Run
yarn link @vinterior/design-system
. This creates a symlink in Vinterior App'snode_modules/@vinterior/design-system
folder that points to local design-system repo. - (Optional) If you need to, you can unlink at any time with
yarn unlink @vinterior/design-system
Developing with Vinterior App
- Create a new design-system dev branch:
cd /design-system
git checkout -b mybranch
- Run the design-system dev server with watch:
yarn watch
- Save any changes in design-system, webpack should bundle changes in
/dist
- Run Vinterior:
cd /vinterior-app
server
- Changes you make in design-system should automatically be picked up by Vinterior App after running
yarn build
- Follow "Creating a Pull Request / Publishing"
Using a published design-system
version from NPM
- Run
yarn add @vinterior/design-system
in your project. Include the design-system object (or individual components) in your Javascript. design-system object example:
import design-system from '@vinterior/design-system'; <design-system.Button text="Click it" />;
Individual components example:
import { Button } from '@vinterior/design-system'; <Button text="Click it" />;