3.1.0 • Published 5 years ago

react-generator-toolkit v3.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

React generator

Install:

npm install -g react-generator-toolkit

Create new project from boilerplate

rg new my-app
rg n my-app

Create a component

Create a React functional component with styled component and story book files

rg create Button
rg c Button

Create context (Provider, Consumer, with HOC)

rg context Recipes
rg ctx Recipes

Options

OptionDescriptionDefaultChoices
--base (-b)react app base directorysrc
--dir (-d)directory to output components (relative to base directory)components
--language (-l)language to be used for componentsjs'js', 'typescript'
--type (-t)type of generated componentfunctional'functional', 'class'
--no-styled-component (--nsc)don't output styled-component filefalse
--no-docs (--nsd)don't output doc component filefalse
--no-tests (--nt)don't output spec filefalse
--configconfiguration file.rgrc.json

Config file

Supports all options using the json format, example:

{
	"base": "my-base-dir",
	"dir": "component-dir",
	"no-tests": true
}