DEV Community

loading...
Cover image for Building a React Directory Structure Generator CLI Tool With Bash

Building a React Directory Structure Generator CLI Tool With Bash

medsaad profile image A. S. Zaghloul ・1 min read

I had quite a journey learning bash scripting and sharing what I've learned with you in the process, from basic commands to bash files and conditionals (I'll share the list of these tutorial at the end of this thread below).

There are a lot still that we can learn but I'll dedicate an intermediate series for this separate from the first one. Currently, It's time to create a project .. a real world project that can be used in actual situations. That's why I've learned bash in the first place, simply to automate tasks and be more productive.

The project that I'll be building is a React directory structure generator following the atomic pattern. Each part of the project will build a functional tool and then we will pile up feature and make some refactoring each time.

After this 14 minutes video, you will be able to run the following commands:

  • structg.sh generate atomic generates the new folder structure
  • structg.sh generate <page|atom|molecule|organism> generates new component & style file in its respective folder and adds boilerplate code in the component file.

Check out previous bash tutorials:

Discussion

pic
Editor guide