A design system for doc-blocks UI components, built on @design-systems/cli.
This repo contains a collection of components that make writing rich component documentation with @storybook/addon-docs
a breeze!
To use a component from this repo you will first need to install the component into your project.
For an example we will try to use the @doc-blocks/row
component.
npm i @doc-blocks/row
# or with yarn
yarn add @doc-blocks/row
Then to use the component in your code just import it!
import { Row } from "@doc-blocks/row";
If you don't want to install all of the different components you can install doc-blocks
.
To create a new component:
yarn run create
Follow the prompts and you will have a new sub-package for your component!
# First link the package
yarn
# Then start developing
cd components/<Component Name>
yarn run dev
Before submitting a pull request ensure that all of the following work:
yarn build
yarn lint
yarn test
Inside the package.json there are a bunch of scripts that this repo uses to run the project in development and to build the project.
Below you can read a description of scripts you should use while developing in this project.
yarn dev
: Builds everything and starts a storybook with all componentsyarn test
: Runjest
over the test filesyarn lint
: Lint all files usingeslint
yarn clean
: Remove all dependencies, build files, and generated files from the projectyarn create
: Create a new components withing the repoyarn create:package
: Create a new package withing the repoyarn size
: Determine how your changes effect the size of all sub-packages
Every command works at both the monorepo and package level. The means you can run some script from just the package/component for a faster development experience.
yarn dev
: Build any dependency in the monorepo the component depends on, and start a storybook with just the componentyarn test
: Test just the componentyarn lint
: Lint just the componentyarn clean
: Clean the generated files for just the componentyarn size
: Determine how your changes effect the size of the component
Thanks goes to these wonderful people (emoji key):
Andrew Lisowski 💻 📖 💡 🚇 |
Kelly Harrop 📖 💻 |
Kendall Gassner 💻 |
Sean Powell 📖 💡 |
Josh Harwood 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!