/rgen

React component cli tool

Primary LanguageJavaScriptMIT LicenseMIT

rgen

React component generator

Installation

Using npm

npm install -g rgen

Using yarn

yarn global add rgen

Usage

rgen -n MyNewComponent -e jsx -w story -t stateless

Options

  • -n | --name <name-of-component> - the name for the component / file to generate, by default the component name will be a directory that an index.js(x) file gets written to.
  • -e | --ext <file-extension-for-component>
    • jsx - (default)
    • js
  • -d | --dir - output directory
  • -t | --type <component-type> - type of component to create
  • -w | --with <space-separated-options> - generate additional files, currently supports

TODO

  • Classes / functional components
  • Stories (storybook)
  • (S)CSS
  • Configure output folder (Each option can have a separate folder, default to class folder)
  • Styled component
  • Jest / enzyme
  • Snapshots
  • Read .rgen file for configs (optional)