0.8.0 • Published 4 years ago

docs-examples v0.8.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

examples

Tools to work with .examples files for React components.

Local Development

As you develop, you can run an application that displays component examples, documented via a .examples.js file in the __examples__ directory for each component.

From the root of the rock-kit repo:

  1. Run yarn
  2. Run yarn dev:examples
  3. http://localhost:9090 should open automatically in your browser

Sketch Asset Generation

Sketch assets for each component can be generated from the component examples that are displayed in the examples app.

In order to import the components into Sketch, you'll need to first install the asketch2sketch.sketchplugin by downloading html-sketchapp and copying the asketch2sketch.sketchplugin file into your Sketch Plugins directory.

Then to generate the Sketch assets:

  1. Run yarn start:examples to spin up the examples app on localhost:9001
  2. Run yarn generate:sketch to generate a stories.asketch.json file.
  3. Once in Sketch, open the "Plugins" menu, select "From Almost Sketch to Sketch", and select the packages/__examples__/stories.asketch.json file.