2.0.0 • Published 4 years ago

react-components-boilerplate-cli v2.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

React boilerplate code generator for component

This cli lets you to create react components with boilerplate code generation for imports, render and PropTypes , you can create respective scss and test file for component.

Create components with below folder structure

  • ComponentName/index.jsx
  • ComponentName/index.spec.js(optional)
  • ComponentName/index.scss (optional)

Usage

  • Install cli:
  • npm install -g react-components-boilerplate-cli

  • Create functional components type using prompts:

    • crc
  • Create Plain Component

    • crc <ComponentName>
  • Create Component with scss and test file

    • crc <ComponentName> scss test
  • Create Component with props

    • crc <ComponentName> props

Examples

  • Create Component with jsx ,test and scss files

screen recording

  • Create Component with props

screen recording

  • Create Component with jsx body through emmet syntax

screen recording

Emmet cheat-sheet for jsx code generation

https://docs.emmet.io/cheat-sheet/

For scss files, its required to use react-css-module npm package

https://www.npmjs.com/package/react-css-modules#module-bundler

You have to pass props in sequence order separated by -: PropName-Type-isRequired-DefaultValue Type and isRequired are optioanal arguments with default value string and Y respectivly if isRequired is passed N then default value to prop is assigned based on type of prop

Type crc -help for assist