react-generate-comp v2.0.1
react-generate-comp
Generate React components in current execute directory by typing with CLI.
Works on Windows / MacOS / Linux.
We are updating to V2 which supporting
Typescript
in default. If you are upgraded from V1, please be care that you do not have to useTypescript -t
flag from now on. Instead of Javascript users, you have to apply theJavascript -j
flag.
π§ Features
- Create a basic components with ts / js config.
- Follow the practice of react official ts / js docs.
- Generate Components / Slice / useState in one line.
- No configs, easy to use with prompts.
π» Setup / Instal
npm i -g react-generate-comp
πΊοΈ Usage
Generate Component
rgc -c <Components names>
rgc <javascript Flag> -c <Components name>
<Javascript Flag>
-j, --javascript For enable javascript jsx generate
<React native Flag>
-n, --native For generate react native components
<Components name>
-c, --components for Generate comp name
<useState name>
-u, --useState Generate useState line code to your clipboard
Usage:
Create a TSX components named "HelloComp" for `React`
rgc -c helloComp
Create two TSX components named "HelloComp" and "ByeComp" for `React`
rgc -c helloComp ByeComp
Create a JSX components named "Yolocomp" for `React`
rgc -j -c yolocomp
Create a TSX components named "HelloComp" for `React native`
rgc -n -c helloComp
Create a jsx components named "Yolocomp" for `React native`
rgc -j -n -c yolocomp
Create a useState named with "[ number, setNumber ]"
rgc -u number
Create a set of folder and file for init the new Vite / CRP project
rgc -i
πΌοΈ Generated Template
rgc -t -c "testComp"
Template
rgc -c "hiComp"
Template
rgc -t -s "todo"
Template
rgc -s "todo"
Template
πΊοΈ Road Map
- β First class typescript support
- β Generate other related stuff
- β¬οΈ Init more template
π Dev Logs
- 2.0.0
- Default generating
.tsx
,.ts
for all related files. - Remove
RTK Slice
generation. - Allow to create more than one componnents with same command.
- Better UX for reminder.
- 1.5.0
- Add react native component generate
-n
flag
- 1.4.5
- Add zustand template to
rgc --init
- 1.4.3
- Cli
-c
,-s
will not overwrite file that already exist in the current path.
- 1.4.1 / 1.4.2
init project javascript
will not generate interface folder from now.
- 1.4.0
- Added
rgc --init
prompt features. - Added RTK generate in init project features.
- 1.3.2
- Fixing bug on prompt cancel issues.
- Fixing RTKSlice Ts spacing issues.
- Better reminder prompt.
- Added
rgc --init
functions for init project folder data.
- 1.3.0
- Updated generate log syntax.
- Now typing
rgc
will active a prompts interface to select regarding generate stuff. - Color log improvement.
- 1.2.x
- Added
rgc -u <setState_name>
generate function.
π License
MIT
3 months ago
3 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago