New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

generator-mnml-component

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-mnml-component

yeoman generator for minimalistic React components

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

mnml React Component Generator

When components obey the single responsibility principle, they're easier to develop, test, refactor, troubleshoot...

mnml is a Yeoman scaffolding generator for creating React components that align with this philosophy.

Principles of mnml components:

  1. A component should have a single responsibility (Ex: connect with Redux)
  2. Components should be grouped together by feature (Ex: ButtonContainer, ButtonWithState, ButtonPresenter)
  3. Component groups should have a wrapper component (Ex: Button)
  4. Each component should have a separate test file (except for the wrapper component)

Quickstart

Install Yeoman

npm install -g yo

Install the mnml Component Generator

npm install -g generator-mnml-component

Generate a Component

yo mnml-component

Types of Components

These are the possible Components that could be generated using mnml-component

Presenter

Folder Structure
  • ComponentName
    • index.js
    • ComponentNamePresenter.js
    • __tests__
      • ComponentNamePresenter.spec.js
Component Hierarchy
ComponentName
  ComponentNamePresenter

Container Presenter

Folder Structure
  • ComponentName
    • index.js
    • ComponentNameContainer.js
    • ComponentNamePresenter.js
    • __tests__
      • ComponentNameContainer.spec.js
      • ComponentNamePresenter.spec.js
Component Hierarchy
ComponentName
  ComponentNameContainer
    ComponentNamePresenter

Container WithState Presenter

Folder Structure
  • ComponentName
    • index.js
    • ComponentNameContainer.js
    • ComponentNameWithState.js
    • ComponentNamePresenter.js
    • __tests__
      • ComponentNameContainer.spec.js
      • ComponentNameWithState.spec.js
      • ComponentNamePresenter.spec.js
Component Hierarchy
ComponentName
  ComponentNameContainer
    ComponentNameWithState
      ComponentNamePresenter

Todo

  • add support for Apollo client
  • add support for TypeScript

Keywords

FAQs

Package last updated on 28 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc