Playbook is the first design system built for both Rails & React interfaces. Inspired by Velocity, Playbook takes a modern design approach and applies it in a way that makes it easy to support bleeding edge or legacy systems. Playbook is built & maintained by the User Experience & Development teams at Power Home Remodeling, the largest home remodeler in the US.
- asdf
- Install language tools:
asdf install
asdf plugin add ruby
asdf plugin add yarn
asdf plugin add nodejs
- After cloning the repo, you should have the following nested folders among other files. It will be important to pay attention to which folder we are in as we get playbook running:
playbook │ playbook │ playbook-website
- From the top-level playbook folder run:
yarn install && yarn prepare
- cd into the playbook-website folder:
cd playbook-website
- From the playbook-website folder run:
bundle install
- From the playbook folder run:
bundle install
note: If you receive a bundle(r) related error, be sure that bundler is installed first. See the BUNDLED WITH section ofplaybook-website/Gemfile.lock
for the exact version to install. - For example, if the version from above is
2.2.11
then you would rungem install bundler -v 2.2.11
then proceed withbundle install
afterwards. - cd back into the top-level playbook folder:
cd ..
- From the top-level playbook folder run
yarn start-dev
This may take a little while. - Once it says "compiled successfully", navigate to http://localhost:3000 and you should see the playbook website.
cd playbook && ./test.sh
- You need to be working in
playbook/playbook
orplaybook/playbook-website
subdirectory - run
yarn workspace playbook-website add <lib name>
to add to the website - run
yarn workspace playbook-ui add <lib name>
to add to the kit source - run
yarn workspace playbook-project add <lib name>
to add to the main project
- Generating a Kit
- Rails Kit
- Rails Kit Helpers
- Using a Kit within a Kit
- Understanding Rails Kit HTML Wrapper
- Kit Stylesheet
- From inside the
playbook-ui
directory, runyarn link
; - From Inside the project you want to test with
playbook-ui
, runyarn link playbook-ui
; - Rebuild the project now using this version of
playbook-ui
; - Test all the things!
- When finished, from inside the project you were testing with
playbook-ui
, runyarn unlink playbook-ui
; - From Inside the
playbook-ui
directory, runyarn unlink
;
We are currently backfilling test cases for React kit test coverage using Jest and React Testing Library. More additions and enhancements to the testing libraries are currently in the works. In the meantime, please take a look at these resources:
- https://github.com/testing-library/jest-dom#usage for useage and examples
- https://jestjs.io/docs/en/using-matchers
When a new kit is generated, a placeholder React kit test will also be created. You can run all the tests with yarn test
.
Keep in mind: Styles are brought in from playbook through the rails gem, so you will not be able to test scss updates with yarn linking.