https://github.com/pratheeshrussell/simple-react-cli
https://github.com/pratheeshrussell/simple-react-cli
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pratheeshrussell/simple-react-cli
- Owner: pratheeshrussell
- Created: 2022-09-01T07:16:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-10T12:04:13.000Z (over 2 years ago)
- Last Synced: 2025-02-10T04:22:34.545Z (4 months ago)
- Language: JavaScript
- Size: 124 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Simple React Cli (Typescript)
Developed upon the work of [vue-generate-component](https://github.com/NetanelBasal/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
```bash
npm install -g @pratheeshrussell/simple-react-cli
```OR
* Clone the repository
* Run
```bash
npm install
```
* Build the Files
```bash
npm run build
```
* Install from local folder
```bash
npm install -g PATH_TO_CLONED FOLDER
```OR
```bash
npm install -g https://github.com/pratheeshrussell/simple-react-cli
```## Usage
### Create new component
```bash
src-ts -g -c Header
```
Will generate a folder called `headerComponent` inside src folder *If you are in project root folder* or *your current directory*check the options available by
```bash
src-ts -g -h
```### Create new hook
```bash
src-ts -g --hook something
```
Will 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
```bash
src-ts --rtk --store storage
```
Will generate a store```bash
src-ts --rtk --slice auth
```
will generate a slice but you must manually add it to the store.```bash
src-ts --rtk --api auth
```
will 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
```bash
src-ts -s
```
check the options available by
```bash
src-ts -s -h
```### Build
```bash
src-ts -b
```## Disclaimer
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
1. Do some manual testing atleast
2. ...