@patreon/studio
v12.40.2
Published
Patreon Studio Design System
Downloads
1,899
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/studio
How to use
View available Studio components and how to use them in the docs.
Local Development
Run npm run dev
and open localhost:6006
in your browser. This will start Storybook and watch for changes.
Tests
How to run tests
Run npm run test
or npm run test:watch
Updating snapshots
If you make changes to a component and the snapshot test fails, you can update the snapshot by running npm run test:ci -- -u
or npm run test:ci -- [file] -u
for a specific snapshot file.
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
.env
file in thestudio
directory (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 install
to make sure dependencies are installed (dotenv
in particular). - Run
npm run happo dev
, which will watch files for changes and with the--only
flag 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 with PRF
If you don't already have a PRF container in rdev, create one:
rdev new patreon_react_features --name prf
Open an SSH session to your container:rdev ssh prf
Inside your container, install Studio in the home directory
cd /home/dev
git clone [email protected]:Patreon/studio.git
Run the same instructions as above:
cd studio
npm install
npm run prf:link
Clean up when done
Run npm run prf:unlink
to revert to the published version of Studio.