@pratheeshrussell/simple-react-cli v0.0.9
Simple React Cli (Typescript)
Developed upon the work of vue-generate-component.
Developed within a couple of hours so expect bugs.
CLI util for generating React components.
READ THIS FIRST
This is not a replacement for react. You must have setup React project separately
Installation
npm install -g @pratheeshrussell/simple-react-cliOR
- Clone the repository
- Run
npm install- Build the Files
npm run build- Install from local folder
npm install -g PATH_TO_CLONED FOLDEROR
npm install -g https://github.com/pratheeshrussell/simple-react-cliUsage
Create new component
src-ts -g -c HeaderWill generate a folder called headerComponent inside src folder If you are in project root folder or your current directory
check the options available by
src-ts -g -hCreate new hook
src-ts -g --hook somethingWill get back to this once I learn more about react hooks. For now it will generate a function that starts with the keyword use and export it.
Redux toolkit options
src-ts --rtk --store storageWill generate a store
src-ts --rtk --slice authwill generate a slice but you must manually add it to the store.
src-ts --rtk --api authwill generate a sample Query and a Mutation but you must manually add it to the store.
Will add more commands once I learn more about it.
Serve
src-ts -scheck the options available by
src-ts -s -hBuild
src-ts -bDisclaimer
This project tries to solve tedious copy&paste operations from our daily workflow. Please notice that the generated files will require some external libraries for react and redux toolkit. Make sure these libraries are available in your project.
TODO
- Do some manual testing atleast
- ...