carbon-components-svelte/CONTRIBUTING.md
2020-09-04 17:46:02 -07:00

1.8 KiB

Contributing

Prerequisites

This project uses Node.js and Yarn.

Fork and Clone

Fork the repo and clone your fork:

git clone <YOUR_FORK>
cd carbon-components-svelte

Set the original repo as the upstream:

git remote add upstream git@github.com:IBM/carbon-components-svelte.git
# verify that the upstream is added
git remote -v

Install

Install the project dependencies:

yarn install

Workflow

Develop

This project uses Storybook for UI development and "live" documentation.

Run the following command to start the Storybook:

yarn start

Component Format

Each component should adopt the following structure:

src/Component

└───Component.svelte // main component
└───Component.Skeleton.svelte // Skeleton component (if any)
└───Component.Story.svelte // wrapper for individual stories
└───Component.stories.js // Storybook stories
└───index.js // export components (e.g. `Component.svelte`, `Component.Skeleton.svelte`)

Build

Component Library

To build the component library, run yarn build.

The library should be compiled in two formats:

  • ES: lib/index.mjs
  • UMD: lib/index.js

Storybook

To build the Storybook, run yarn build.

The Storybook should be outputted to the storybook-static folder.

Submit a Pull Request

Sync Your Fork

Before submitting a pull request, make sure your fork is up to date with the latest upstream changes.

git fetch upstream
git checkout master
git merge upstream/master

Submit a PR

After you've pushed your changes to remote, submit your PR. Make sure you are comparing <YOUR_USER_ID>/feature to origin/master.