rng-cli
A simple cli for react js
Installation
This package is available on npm as rng-cli
.
npm install react-generator-component -g
Features
version 1.1.7
- Add argument --stories : create file for Storybook
Description
- You can create React js components with the following characteristics:
folderComponent
- component.js
- component.scss
- component.test.js
- component.stories.js
Description of each file:
- component.js: This file contains the component with an initial code.
- component.scss: This file contains the sass styles, with breakpoints for the different devices.
- component.test.js: This File contains a basic Test example for the component.
- component.stories.js: This file contains a basic example of a stories for Storybook.
How to use
To use this component in its current version 1.0.3, follow the instructions below:
- Go to the component containing folder using Terminal or Cmd.
- To create a page, enter the console : rng-cli --n 'pagename' --type 'indexPage'
- To create a component, enter the console : rng-cli --n 'componentname' --type 'button'
- To create a component with stories, enter the console : rng-cli --n 'componentname' --type 'button' --stories true
- Verify that both the folder and the files have been generated.
Options
--n : Name of component. --stories :Generate file for stories.