About: Blazingly fast command line utility for generating React components faster.
Motivation: Imagine you're writing on React. You need to create new component, or new page, or new module, etc. What you need to do is:
- go to directory
- make directory like
your-component - in this directory create two empty files:
YourComponent.jsxandYourComponent.css - in the
.jsxfile you need to write the basic skeleton:
import "./YourComponent.css";
const YourComponent = () => {
return (
<>
<some elements>
</>
);
}
export default YourComponent;And then finally, only then can you write a business logic. In this pipeline at every stop you can make a type or a mistake. Then you have to spend time looking through all the titles. Culmination: 👎
With this utility pipeline the pipeline becomes a single command to start writing business logic:
rgc # if you have useful aliasThen you need to select what you want to create:
Which folder should we put the component in?
c — components, p — pages, m - modules:
Set the name:
What do we call the component? pages/
Accept changes:
So I'm creating the files:
./pages/Test.jsx
./pages/Test.scss
Ok? [y]/n:
Done!
After cloning repo run:
cd react-comps-generator
cargo build --releaseThen add to $PATH this directory:
/path/to/repo/react-comps-generator/target/release
To use shorter rgc command you can add alias to your shell:
alias rgc="react-comps-generator"Or make alias to release folder, to avoid editing $PATH.
If you have questions about this repo or you want to contribute, text me!
Licensed under of The MIT License.
- @alchemmist as Anton Grishin

