Welcome to Ray, and thank you for contributing. Let's get you setup!
Setup
Clone the project and cd
into the directory.
$ git clone git@github.com:WeWork/ray.git $ cd ray
You will need to install Node.js and npm in order to run the project.
Then install dependencies and bootstrap Lerna.
$ yarn bootstrap
Structure
Ray is a multi-package repository powered by Lerna. These packages can be found in packages/
.
The primary packages are
Package | Description |
---|---|
packages/core/ | CSS and JS that make up the design system |
packages/docs-app/ | A documentation site built with Gatsby |
Workflow
After following the setup instructions above, you can use these steps to begin your contributions to the design system.
- Start the development servers
# Spin up both the storybook and docs servers $ yarn dev # Run only the storybook server $ yarn dev:core # Run only the documentation server $ yarn dev:docs
- Modify or create new SCSS/JS in the
packages/core/src
directory - Modify or create new stories in the
packages/core/stories/
directory - Modify or create new documentation in the
docs/
directory - Test your changes (and write tests if applicable):
yarn test
- Commit and push your changes to GitHub and create a pull-request.
- Wait for a review by the maintainers.
Storybook
This is a playground for developers to build and test their HTML/CSS/JS. It runs React for ease of development.
We also use storybook in our continuous integration for visual regression testing. So it's key that stories exist for every component.
Open up localhost:6006
to find the storybook.
Documentation
Our documentation is built with GastbyJS, with content sourced from the markdown in docs/**/*.md
.
Open up localhost:8000
to find the docs site.
Guidelines
- All components should be right-to-left (RTL) compatible
- Strive to document all component permutations in storybook so they're visually tested
- Keep HTML examples simple and follow best practices such as using proper a11y attributes where applicable
- Keep SVGs in HTML examples simple so they code can be easily scanned
- Put focus states and keyboard navigation effects behind the
$ray-accessibility-class
variable, search the codebase for examples - All custom JavaScript/CSS API must be documented