react-cli-codegen
v1.0.3
Published
CLI tool to generate React components, actions, reducers, and more.
Downloads
44
Readme
React CLI Codegen
react-cli-codegen
is a Command-Line Interface (CLI) tool designed to streamline the process of creating files and folders in React projects. Whether you need to generate components, actions, reducers, or other project assets, this CLI tool will automate the process, saving time and reducing errors.
Installation
Install the CLI globally to use it anywhere in your system:
npm install -g react-cli-codegen
Usage
Once installed globally, you can run the CLI by typing the following command in your terminal at the root of your project:
react-cli-codegen
Options
The CLI supports generating the following files and structures
- Components: Create React components with associated files.
- Actions: Generate action files for your Redux setup.
- Reducers: Generate reducer files for your Redux setup.
- APIs: Cooming soon...
- Routing: Cooming soon...
Folder Structure
When generating components and other resources, the following folder structure will be created (as an example)
/src
/components
/YourComponentOne
YourComponentOne.jsx
/YourComponentTwo
YourComponentTwo.jsx
index.js
/redux
/actions
yourAction.js
/reducers
yourReducer.js
index.js
Example
Here’s an example of generating a new component
react-cli-codegen
- Choose "Component" from the options.
- Enter the name of the component.
- The CLI will create the folder structure under
src/components/YourComponent.
Feedback and Support
We welcome any suggestions, code error reports, or feature requests! If you encounter any issues or have ideas to improve this tool, feel free to reach out via email:
We appreciate your input to help make this tool even better!