🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

generate-react-cli

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-react-cli

A lightweight CLI that runs create-react-app under the hood to boilerplate react apps and generate react components with a little more structure in mind.

1.3.0
Source
npm
Version published
Weekly downloads
8.8K
33.76%
Maintainers
1
Weekly downloads
 
Created
Source

generate-react-cli

Why?

To help speed up productivity in react projects. For example you can run one command (generate-react component <ComponentName>) to instantly generate a component with its corresponding files (stylesheet, test).

We are starting off with the bare minimum of just generating a component. We plan to add additional commands, options, and configurations in the future.

Few notes:

  • We assume that your project was created using create-react-app. Therefore it is using Jest & Enzyme for testing.
  • The CLI also has an opinion on how files are structured within the project. We follow Grouping by features or routes

Install

Run

npm i -g generate-react-cli

Commands

Generate Component

Run

generate-react component <ComponentName>

This will create a folder with your component name within the src/components directory, and it will generate 3 corresponding files (.js, .css, test.js) within it.

Options

You can also provide a custom path to where you want the component to be generated in:

generate-react component <ComponentName> -p src/pages => will create a component folder within the src/pages.

Coming Soon

  • CLI custom configuration: e.g. preprocessor stylesheet type, choose different test framework, choose different file structure type, etc..

Have fun!

Keywords

cli

FAQs

Package last updated on 04 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts