New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

scaffold-react-component

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scaffold-react-component

Scaffold a React component with styles, tests and a story.

latest
npmnpm
Version
0.0.10
Version published
Maintainers
1
Created
Source

npm

scaffold-react-component

Scaffold a React component with styles, tests and a story.

This tool is reasonably opionated and assumes you are using:

  • React
  • SCSS modules
  • Jest (unit tests)
  • Storybook (document components)

Feel free to fork and modify if you're using something else.

Installation

It's recommend to install this globally, so it's available across all projects.

npm install -g scaffold-react-component

Usage

For full guidance run:

scaffold --help

To scaffold a functional React component use, e.g.

scaffold Modal

To scaffold a ES6 class React component use the second argument, or the --type/-t parameter.

  • scaffold Modal class
  • scaffold Modal --type class
  • scaffold Modal -t class

By default, the Storybook category will be set to 'Common', you can override this with the --storybookCategory/-sb parameter.

  • scaffold Modal -storybookCategory UI
  • scaffold Modal -sb UI

Directory Creation

By default scaffold will create the directory for the component if needed. It will skip this step if:

  • the directory already exists, and it is empty
  • the current working directory matches the intended name, and it is empty

Publishing a new version of this package

Make sure you have np installed globally:

npm install -g np.

Run np and follow the instructions to publish the new package.

Contributing

Please feel free to raise any issues you come across, and we welcome any pull requests!

Contributors

  • clarkd

FAQs

Package last updated on 17 Apr 2020

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