Skip to content

syncush/react-boilerplate-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-boilerplate-cli

version

Cli tool for creating react components

new-component

Creates a new component at the current working directory.

Includes a directory, index.js, css file and component file

Use example:

new-component --class MyComponent

Options:

--class : Class Component (default)

--hooks : Functional Stateful Hooks Component

--func : Functional statless Component

--ts : TypeScript templates (Class Component)

--4spaces : Indent with 4 spaces (default)

--2spaces : Indent with 2 spaces instead of the default 4

--less : less styling extension

--sass : scss styling extension

--story : stories.js file for Storybook

Installation:

Save the react-boilerplate-cli folder somewhere in your PC (for example C:)

Make sure Python 3 is installed on your system (run python -V command on your cmd)

Edit the new-component.bat file so the path in the file is the script file path

Copy the new-component.bat to somewhere that your PATH variable knows, or add the folder to your PATH variable (Do a windows search for "environment" and add the path to the PATH variable )

Make sure to close and reopen the cmd, Powershell or VS Code and such so it will know the new script in the PATH

Contributors