Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stylesuxx/generator-ho

Yeoman generator for aliased generator functionality.
https://github.com/stylesuxx/generator-ho

Last synced: about 1 month ago
JSON representation

Yeoman generator for aliased generator functionality.

Awesome Lists containing this project

README

        

# generator-ho
[![npm version](https://badge.fury.io/js/generator-ho.svg)](https://badge.fury.io/js/generator-ho) [![Build Status](https://travis-ci.org/stylesuxx/generator-ho.svg)](https://travis-ci.org/stylesuxx/generator-ho)
![Amount of Downloads per month](https://img.shields.io/npm/dm/generator-ho.svg "Amount of Downloads") [![Dependency Status](https://david-dm.org/stylesuxx/generator-ho.svg)](https://david-dm.org/stylesuxx/generator-ho) [![devDependency Status](https://david-dm.org/stylesuxx/generator-ho/dev-status.svg)](https://david-dm.org/stylesuxx/generator-ho#info=devDependencies)

>Generator for aliased generator functionality.

## Why?
With a simple JSON config file you can save yourself from a lot of typing and expose all needed sub generators for your generator in a simple way:
```Bash
yo react-webpack-redux:action addItem
# vs
yo ho action addItem
```

See *Examples* below for more details.

## Installation
Install the generator globally:
```Bash
sudo npm install generator-ho -g
```

## Usage
To use **ho** with your project just add a *ho.json* file describing your aliases:
```JSON
{
"command": {
"generator": "some-generator",
"subgen": "sub",
"parameters": [ "name"]
}
}
```

subgen and parameters are optional.

### Listing available commands
To list commands that may be invoked via *ho*, just run:
```Bash
yo ho --help
```

### Invoking commands
You can now invoke those aliased commands by running:
```Bash
yo ho command arg1 arg2
```

## Examples
If *ho.json* looks like this:
```JSON
{
"action": {
"generator": "react-webpack-redux",
"subgen": "action",
"parameters": [ "name" ]
},
"reducer": {
"generator": "react-webpack-redux",
"subgen": "reducer",
"parameters": [ "name" ]
},
"component": {
"generator": "react-webpack",
"subgen": "component",
"parameters": [ "name" ]
}
}
```
it will produce a help like this:
```Bash
Usage:
yo ho:app [options]

Options:
-h, --help # Print the generator's options and usage
--skip-cache # Do not remember prompt answers Default: false
--skip-install # Do not automatically install dependencies Default: false

Arguments:
command # Available commands to invoke:
+ action (yo react-webpack-redux:action )
+ reducer (yo react-webpack-redux:reducer )
+ component (yo react-webpack:component )

Type: String Required: true

```
and will allow for the following commands to be executed:
```Bash
yo ho action addItem
yo ho reducer item
yo ho component ItemList
```

## [MIT](https://opensource.org/licenses/MIT) License
Copyright (c) 2015 Chris Landa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.