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.
-
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
-
Ensure your installed version of
bundler
is the same as theBUNDLED WITH
section found in Gemfile.lock. You can check the version you have by runningbundle -v
. -
From the root directory, run
./setup.sh
-
From the top-level playbook folder run
yarn start-dev
This may take a little while. -
Once you see the "compiled successfully" message in your terminal, navigate to http://localhost:3000 and you should see the playbook website.
Use ./run.sh
to run the application in one step. This will handle dependency updates then start the server. Helpful for fast start-up without bootstrapping especially when switching branches. 🚀
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 usage 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.
The gem & npm package is available as open source under the terms of the ISC License.