Package Exports
- @patreon/studio
- @patreon/studio/build/index.js
- @patreon/studio/module/index.js
- @patreon/studio/scripts/sync/lib/icon-replacement-map.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@patreon/studio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Studio Design System
Introduction
Studio Design System is Patreon’s web design system and is built with React and Styled Components and written in Typescript.
The docs for Studio Design System live at https://studio.patreon.com
Getting Started
Installation
npm i -P @patreon/studioHow to use
View available Studio components and how to use them in the docs.
As an example, here’s how you’d import the Text component:
import { Text } from '@patreon/studio'Docs
We use Docz to generate the Studio docs that live at https://studio.patreon.com.
How to run the docs locally
Run npm run docs:server and open localhost:3003 in your browser.
Storybook
Storybook is a component development environment. Our version of Storybook uses the component story format, which expects stories to be written in the following format.
export ExampleStory = () => <ExampleComponent />How to run Storybook locally
Run npm run storybook.
Tests
How to run tests
Run npm run test or npm run test:watch
How to use Happo locally
Happo is our tool for visual regression testing. It's integrated as part of our CircleCI tests, but can also be run locally, with a little bit of setup:
- Open up 1Password and search for a secure note titled: "Happo .env Variables - Studio"
- Create a
.envfile in thestudiodirectory (it will be ignored by git) - Add the .env variables from the 1Password document to the new file.
- If you haven’t already, run
npm installto make sure dependencies are installed (dotenvin particular). - Run
npm run happo dev, which will watch files for changes and with the--onlyflag can be limited to specific components. See the docs for more info. - Happo will run tests, then provide a url where you can see the report.
Developing in PRF
If you haven't done it, checkout studio into a sibling directory of PRF and then run devx sync.
From within a devx attach session, go to /opt/code/studio and run npm install
and then run npm run prf:link to link your local dev version of studio to PRF.
This script will also watch for changes and rebuild as needed. Each rebuild isn't
particularly fast, so it's recommended you watch the console output to know when
it's safe to reload your dev browser. See npm run prf:link -- --help for more
info.
Clean up when done
Run npm run prf:unlink to revert to the published version of Studio.