Skip to content

codeabiswas/mkcomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

mkcomp

I'm tired of creating a new component structure every time for React.

Idea totally not stolen from @joshwcomeau/new-component ;)

Here's the folder/file breakdown:

  • Folder: <name-of-component>

    • index.js: Contains the logic for the component

    • styled.js: Some sweet styling from styled-components


Usage

  1. The help command

    ➜ mkcomp --help
    mkcomp creates boilerplate code for a new React component and leverages styled-components.
    Usage: mkcomp [component-name-1] [component-name-2] ... [component-name-n]
    Type mkcomp -h or mkcomp --help to repeat this message.
    
  2. Creating new components

    ➜ mkcomp Button Dropdown Sidebar Modal
    Project Directory: /home/codeabiswas/Developer/mkcomp
    Creating a components folder...
    Button has been successfully created!
    Dropdown has been successfully created!
    Sidebar has been successfully created!
    Modal has been successfully created!
    

Installation

Note: This has only been tried and tested on Ubuntu. It has good chances of working with MacOS. Strong doubt on Windows (unless some WSL magic is involved but it hasn't been tested).

  1. Clone or download this repo (unzip if downloaded).
  2. Unless you have one already, create a root folder in your root directory called bin/.
cd ~
mkdir bin/
  1. Add the absolute path of the bin/ directory to your .bashrc (or .bash_profile, .zshrc, etc.) as shown below.
export PATH=$PATH:<absolute-path-of-bin/-directory>
  1. Copy the mkcomp file to that folder
cp mkcomp ~/bin
  1. Give mkcomp executable rights after entering the bin/ folder
cd ~/bin
chmod +x mkcomp

Contributors

  • Andrei Biswas @codeabiswas

About

I'm tired of creating a new component structure every time for React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages