mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Merge pull request #85 from IBM/docs
docs: add contributing guidelines, update README
This commit is contained in:
commit
f75e3264cc
3 changed files with 117 additions and 5 deletions
110
CONTRIBUTING.md
Normal file
110
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
This project uses node (>=10) and yarn (>=1).
|
||||||
|
|
||||||
|
- [node](https://nodejs.org/en/download/package-manager/#macos) (version 10.x or greater)
|
||||||
|
- [yarn](https://yarnpkg.com/en/docs/install#mac-stable) (version 1.x or greater)
|
||||||
|
|
||||||
|
### Fork and Clone
|
||||||
|
|
||||||
|
Fork the repo and clone your fork:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone <YOUR_FORK>
|
||||||
|
cd carbon-components-svelte
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the original repo as the upstream:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn install
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
### Repo Structure
|
||||||
|
|
||||||
|
```js
|
||||||
|
.storybook // Storybook configuration
|
||||||
|
docs // static, exported Storybook used by GitHub Pages
|
||||||
|
src
|
||||||
|
│
|
||||||
|
└───components // individual components
|
||||||
|
└───internal // code excluded from the component library
|
||||||
|
└───lib // shared utilities
|
||||||
|
```
|
||||||
|
|
||||||
|
### Developing
|
||||||
|
|
||||||
|
This project uses Storybook for UI development and "live" documentation.
|
||||||
|
|
||||||
|
Run the following command to start the Storybook:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn start -p 9090
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Component Format
|
||||||
|
|
||||||
|
Individual components are located in the `src/components` folder:
|
||||||
|
|
||||||
|
Each component should adopt the following structure:
|
||||||
|
|
||||||
|
```js
|
||||||
|
src/components/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`)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building
|
||||||
|
|
||||||
|
#### 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:storybook`.
|
||||||
|
|
||||||
|
The Storybook should be outputted to the `docs` folder.
|
||||||
|
|
||||||
|
## Submitting a Pull Request
|
||||||
|
|
||||||
|
### Sync Your Fork
|
||||||
|
|
||||||
|
Before submitting a pull request, make sure your fork is up to date with the latest upstream changes.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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`.
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
> Svelte implementation of the Carbon Design System
|
> Svelte implementation of the Carbon Design System
|
||||||
|
|
||||||
|
Currently, this project is under active development. See the [ongoing project](https://github.com/IBM/carbon-components-svelte/projects/1) for the anticipated v1.0.0 release.
|
||||||
|
|
||||||
## [Storybook](https://ibm.github.io/carbon-components-svelte)
|
## [Storybook](https://ibm.github.io/carbon-components-svelte)
|
||||||
|
|
||||||
## Supported Components
|
## Supported Components
|
||||||
|
@ -119,13 +121,9 @@ Currently, the following components are supported:
|
||||||
- TooltipIcon
|
- TooltipIcon
|
||||||
- UnorderedList
|
- UnorderedList
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
[Placeholder]
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
[Placeholder]
|
Refer to the [Contributing guidelines](CONTRIBUTING.md).
|
||||||
|
|
||||||
## [Changelog](CHANGELOG.md)
|
## [Changelog](CHANGELOG.md)
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,10 @@
|
||||||
"email": "eric.young.liu@ibm.com"
|
"email": "eric.young.liu@ibm.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10",
|
||||||
|
"yarn": ">=1"
|
||||||
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "lint-staged && pretty-quick --pattern 'src/**/*.{js,svelte}' --staged",
|
"pre-commit": "lint-staged && pretty-quick --pattern 'src/**/*.{js,svelte}' --staged",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue