Skip to content

Bash script to create React components using a single command

License

Notifications You must be signed in to change notification settings

luc-mo/react-scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

React scaffold script

Bash script to create React components (or component pages) with a single command.

Usage

  • Add executable permissions to the script
  $ chmod +x react_scaffold.sh
  • Run the script
  $ ./react_scaffold.sh [flags] <ComponentOne> <ComponentTwo> ...

Flags

Flag Description Values Default
-h, --help Show help - -
-c, --component Create a component instead of a component page - component
-p, --page Create a component page instead of a normal component - component
-s, --styles Select styles file css, scss, sass, styled, stitches styled
-l, --language Select language js, ts ts

Examples

  $ ./react_scaffold.sh -p -s sass -l js ComponentOne ComponentTwo

Notes

  • It is recomended to remove the extension of the script file (react_scaffold.sh -> react_scaffold) and move it to /usr/bin, /usr/local/bin or any other directory in your PATH variable to access it from anywhere in your system.

  • By default, the script will create a component in the first components or pages directory it finds recursively from the current location. The option to select a specific directory will be added in the future.

About

Bash script to create React components using a single command

Topics

Resources

License

Stars

Watchers

Forks

Languages