Rouch is a simple library that generates React components in folders along with (optional) styles and test script template. Rouch provides a CLI that is very easy to use.
Under development
npm install rouch -g
Say, we want to create a component Dashboard
in the folder src/components
while our current working directory is src/containers
, we simply call:
rouch ../containers Dashboard --style=css --test
This would generate the following files in the folder src/components/Dashboard
:
/Dashboard
Dashboard.js
package.json
Dashboard.test.js
dashboard.css
Generally, the syntax is:
rouch [options] <path> <componentName>
Rouch takes only two important arguments:
path
: The path to generate the componentcomponentName
: The name of the component (which is used to create the individual files).
-s=value --style=value
: This option specifies the extension of the style file that would be generated. It could be css
, sass
,scss
, less
or stylus
-t --test
: If supplied, a template file for possible test scripts would be generated too.
-o --overwrite
: If supplied, this option would make rouch
ovewrite an existing directory.
If you have any cool ideas, I'm game.
Copyright (MIT)