Opinionated generator of React components with styles stories and test
First, install Yeoman and generator-picantes-react using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-picantes-react
Then generate your new react components:
yo picantes-react:component Name
This will generate the following files:
Component.js
Main component fileComponent.test.js
Jest simple snapshot testComponent.stories.js
Storybook fileindex.js
Entry point to the component that could have an apollo wrapperstyles.scss
Stylesheet for the component
Options:
- nostyles Do not generate styles.scss and dont wrap component with
isomorphic-style-loader
(default: true) - stateless Generate a function component instead of a class (default: true)
- useapollo Generate a Apollo wrapper on index.js (default: false)
- quiet Dont prompt (default: false)
To test local modifications run
npm link
So the generator points to the local version
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
MIT © Mauricio Saglietto