Giter Club home page Giter Club logo

goodz's Introduction

goodz

A command-line utility for generating goodness

Goodz allows for structured, repeatable code generation for development teams.

Install

Install globally

$ npm install -g goodz

Install locally in your project

$ yarn add goodz --dev
// package.json
"Scripts": {
    "goodz": "goodz"
}

Usage

$ goodz --help

  Usage
    $ goodz          Select from a list of generators
    $ goodz <name>   Run a generator of that name

  Options
    -h, --help       Display the help screen
    -d, --dir        Specify base path directory
    -v, --version    Display the version number

  Examples
    $ goodz react.component
    $ goodz react.component --dir app

Uses Plop and Inquirer underneath... ๐Ÿ™Œ

Generators

React App

Generates a functional React app. Based on Create React App, but with some added goodness.

$ goodz react.app

Options

What is the name of your project?

Should this react app have Redux? (Y/n)

React Component

Generates a react component inside your app, based on atomic design principles

$ goodz react.component

Options

Name of component?" (e.g. Button)

Where should this component live?
choices: ["atoms", "molecules", "organisms", "templates"]

Do you need a Stateless or Stateful component?
choices: ["Stateless", "Stateful"]

Should this component be connected to the redux store? (y/N)

What functions would you like to include?
choices: ["constructor", "componentDidMount", "componentWillMount"]
*statefull components only*

What redux functions would you like to include?
choices: ["componentWillReceiveProps", "mapStateToProps", "mapDispatchToProps"]
*connected components only*

Output

  โ””โ”€โ”€ src      
      โ””โ”€โ”€ components                
          โ””โ”€โ”€ atoms
              โ””โ”€โ”€ Button
                  |โ”€โ”€ Button.js            - Component file
                  |โ”€โ”€ Button.style.js      - Scoped styled component
                  |โ”€โ”€ index.js             - For easy reference
                  โ””โ”€โ”€ __tests__
                      โ””โ”€โ”€ Button.test.js   - Jest unit test file

React Saga

Generates a saga inside your Redux app

$ goodz react.saga

Options

Saga Name? (e.g. counter)

Action Constant? (e.g. COUNTER_INCREMENT)

Reducer Constant? (e.g. COUNTER_CHANGED)

Output

  โ””โ”€โ”€ src      
      โ””โ”€โ”€ state                
        |โ”€โ”€ middleware.js
        |โ”€โ”€ saga.js
        โ””โ”€โ”€ store.js
        โ””โ”€โ”€ counter                
          |โ”€โ”€ counter.actions.js
          |โ”€โ”€ counter.reducer.js
          |โ”€โ”€ counter.saga.js
          โ””โ”€โ”€ index.js

FAQ

Why did you make this?

Everyone deserves some goodness from time to time.

Related

  • Create React App - Set up a modern web app by running one command.
  • Redux - A predictable state container for JavaScript apps.
  • Redux Saga - An alternative side effect model for Redux apps.
  • Styled Components - Visual primitives for the component age.
  • Jest - Delightful JavaScript Testing.
  • Enzyme - JavaScript Testing utilities for React.

License

MIT

goodz's People

Contributors

rsbowers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.