PLASMA by WeWork
Plasma is a design system for creating sensible, modern interfaces.
Component docs at http://plasma.guide
Storybook at http://plasma.guide/dev/storybook
Select and Datepicker components do not work right now. Use react-select
and datepicker directly in Spacestation.
Running Storybook
yarn start
yarn storybook
Developing with Storybook
git checkout -b mybranch
stories/
directory as you add / update components!yarn run styleguide
.yarn run styleguide:build
yarn flow:buildTypeDefs
This will output flow-typed compatible definitions of Flow types for Plasma. For Spacestation, you likely want to yarn flow:buildTypeDefs | pbcopy
(if on Mac) and paste the contents to the plasma_vx.x.x.js
under flow-typed/
./docs/publish.sh
from the root dir. This will update the docs, commit to gh-pages, and push to github (updating http://plasma.guide)Info here: https://react-styleguidist.js.org/docs/documenting.html
yarn test:update
to update jest snapshots.yarn run pack
to bundle the .js and .css file into /dist
folder.npm version patch
. This will bump the version in package.json and create a new tag and push the tag to Github.npm login
. login is in 1password, when prompted for email please use: dev-team@wework.comnpm publish
from the root directory to publish to NPM registry.cd
to local Plasma repo.yarn link
.cd
to local Spacestation repo.yarn link @wework-dev/plasma
. This creates a symlink in Spacestation's node_modules/@wework-dev/plasma
folder that points to local Plasma repo.yarn unlink @wework-dev/plasma
cd /plasma
git checkout -b mybranch
yarn watch
/dist
cd /spacestation
yarn start
yarn add @wework-dev/plasma
in your project.Include the Plasma object (or individual components) in your Javascript. Plasma object example:
import Plasma from '@wework-dev/plasma';
<Plasma.Button label="Click it" />;
Individual components example:
import { Button } from '@wework-dev/plasma';
<Button label="Click it" />;
For testing, Plasma uses Jest (https://facebook.github.io/jest/) with Enzyme (http://airbnb.io/enzyme/).
Tests are located in src/tests
.
Flow coverage can be checked via yarn flow:coverage
.
yarn test
for a single run or yarn test:watch
to watch for changes.