reactjs-extended
About
Extended CLI for ReactJs repetative task like creating smart component, dumb component, etc.
Feature:
- Doesn`t need to be installed along with your project dependency.
- Can create typescript, javascript type smart class based component.
- Can create typescript, javascript type dumb function based component.
- Now in V2.0.0, it gives you the power to create custom template on your own.
More features to be added in future. Keep looking forward.
Installation
Global installation
npm install reactjs-extended -g
Note: Doesn`t require to be installed as a dependency in your project
Flags Available
Flag | Possible Value | Mandatory |
--name | Any valid name without space (Upper camel case is preferred) | Yes |
--template* | TS-SMART-CLASS, TS-DUMB-FUNCTION, JS-SMART-CLASS, JS-DUMB-FUNCTION, custom-template-folder-name** | Yes |
* TS = Typescript, JS = Javascript
** Give the custom template folder name after placing template in desired folder
Usage
Once globally installed. Based on your requirement, it can be used in following ways:
- To get help on this library uses, use below command -
reactjs-extended-help
- If you want to generate typescript based component, use below command -
reactjs-extended --name=ComponentName --template=TS-SMART-CLASS
- If you want to generate javascript based component, use below command -
reactjs-extended --name=ComponentName --template=JS-SMART-CLASS
- If you want to generate custom structure, use below command -
reactjs-extended --name=ComponentName --template=template-one
NOTE: custom folder with template file must present in respective directory. See help for more information.
Output
- A folder will be created based on name flag value. It will treated as component name.
- Based on command run, file generated will be either typescript (tsx, ts) or javascript (jsx, js).
- Following file will be generated based on the command used -
TS-SMART-CLASS: Action, Component (class), Constant, Container, Helper, Model, Query, Reducer
TS-DUMB-FUNCTION: Component (function), Model
JS-SMART-CLASS: Action, Component (class), Constant, Container, Helper, Query, Reducer
JS-DUMB-FUNCTION: Component (function)
Custom Struture: All 'XXX' keyword will be replaced by '--name' flag value
Contact
- Author: Subhendu Kumar Sahoo
- Email: smaro.nitr@gmail.com
- Website: https://smaro-nitr.github.io
- Always welcome for a bugfix, feature suggestion, and feedback