<commit_before># generator-ng-poly [![NPM version](https://badge.fury.io/js/generator-ng-poly.svg)](http://badge.fury.io/js/generator-ng-poly) [![Build Status](https://travis-ci.org/dustinspecker/generator-ng-poly.svg?branch=v0.0.9)](https://travis-ci.org/dustinspecker/generator-ng-poly) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/generator-ng-poly.svg)](https://coveralls.io/r/dustinspecker/generator-ng-poly?branch=master)
[![Dependencies](https://david-dm.org/dustinspecker/generator-ng-poly.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/generator-ng-poly/dev-status.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=devDependencies&view=table) [![PeerDependencies](https://david-dm.org/dustinspecker/generator-ng-poly/peer-status.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=peerDependencies&view=table)

> [Yeoman](http://yeoman.io) generator for AngularJS apps with optional Polymer support

## Purpose

This generator focuses on organizing Angular components by feature (home, about, video player, etc.) instead of by type (controller, service, directive, etc.) to encourage the development of self-contained, reusable components.

A typical workflow with this generator consists of creating an Angular module ([ng-poly:module](#module)) and then generating controllers, directives, etc. for this module to create a new feature.

**Polymer is just an added feature, but it isn't required to utilize this generator.**

## Usage

Install `generator-ng-poly`:

```
npm install -g generator-ng-poly
```

Run `yo ng-poly`
Yeoman will then ask for an app name and language preferences.

Run `gulp` to build and start the development environment.

## User Groups

Please feel free to ask any questions on our [GitHub Issues](https://github.com/dustinspecker/generator-ng-poly/issues) or [Google Group](https://groups.google.com/forum/#!forum/generator-ng-poly)

## Generators

Available generators:
* AngularJS
  - [ng-poly](#app) (a.k.a. [ng-poly:app](#app))
  - [ng-poly:constant](#constant)
  - [ng-poly:controller](#controller)
  - [ng-poly:directive](#directive)
  - [ng-poly:factory](#factory)
  - [ng-poly:filter](#filter)
  - [ng-poly:module](#module)
  - [ng-poly:provider](#provider)
  - [ng-poly:route](#route)
  - [ng-poly:service](#service)
  - [ng-poly:value](#value)
  - [ng-poly:view](#view)
* Polymer
  - [ng-poly:element](#element)

Languages and Features supported:
  * Markup
    - HAML, HTML, Jade
  * Application scripting languages
    - CoffeeScript †, JavaScript
  * Testing scripting languages
    - CoffeeScript, JavaScript
  * Style languages
    - CSS, LESS, SCSS, Stylus
  * Routers
    - Angular Route, UI Router
  * Unit testing
    - Jasmine (Karma as the test runner) for AngularJS
    - Mocha with Chai (Karma as the test runner) for AngularJS
  * e2e testing
    - Protractor (Jasmine) for AngularJS
  * Frameworks
    - Bootstrap with AngularStrap
    - Bootstrap with UI Bootstrap
    - Foundation with Angular Foundation
  * Polymer
    - Core, Paper
  * Task runners
    - Gulp
  * Other supported Bower packages:
    - Angular Animate
    - Angular Cookies
    - Angular Resource
    - Angular Sanitize
    - Angular Touch
    - Font Awesome
    - Lo-Dash
    - Restangular

[Configurations](#configurations):
  * Syntax
    - [Controller As](#controller-as-syntax)
    - [Pass Function](#pass-function)
    - [Named Functions](#named-functions)

† Code coverage isn't currently performed on CoffeeScript application source code

### Gulp Tasks
`gulp` will start a localhost and open in the default browser 

Using `--stage prod` will concat and minify HTML, CSS, and Angular modules.

`gulp build` will compile the assets

`gulp dev` will call the build task and setup the development environment

`gulp unitTest` will run unit tests via Karma and create code coverage reports

`gulp webdriverUpdate` will download the Selenium server standalone and Chrome driver for e2e testing

`gulp e2eTest` will run e2e tests via Protractor (must start a localhost before running `gulp e2eTest`)


* * *
**All generators ask for a module name except app and element. All generators except app take a name as an argument. A name can be written with CamelCase or hyphens.**

Generators requiring a module can take a module option to bypass the prompt:
```
yo ng-poly:view newView --module=home/kitchen
```
**A module value of `app` will add the new components to the module defined in app.js or app.coffee.**
* * *

**Examples are shown with HTML, LESS, JavaScript, Jasmine, and UI Router as the app configuration.**

### App
Asks for application name and language preferences to scaffold out an application with a home module. It will also ask if tests should be placed in the `app/` or `tests/` directory. It'll ask for some additional Bower dependencies and then install npm and Bower dependencies.

Example:
```
yo ng-poly
[?] What is the app's name?
[?] What host should the app run on?
[?] Which port should the app run on?
[?] Which folder should the app be developed in?
[?] Which is the preferred markup language?
[?] Which is the preferred application scripting language?
[?] Want to use Controller As syntax?
[?] Should functions be defined and passed instead of defined inline (in callbacks)?
[?] Want to use named functions instead of anonymous?
[?] Where should unit tests be saved?
[?] Which is the preferred test scripting language?
[?] Which is the preferred unit testing framework?
[?] Which is the preferred style language?
[?] Should Polymer support be enabled?
[?] Should a framework be setup?
[?] Should ngRoute be used instead of UI Router?
[?] Which additional Bower components should be installed?
```

Produces:
```
root/
├── app/
│   ├── fonts/ (empty)
│   ├── home/
│   │   ├── home.{coffee,js}
│   │   ├── home.{css,less,scss,styl}
│   │   ├── home.tpl.{haml,html,jade}<commit_msg>(docs) update ng-poly:app questions<commit_after># generator-ng-poly [![NPM version](https://badge.fury.io/js/generator-ng-poly.svg)](http://badge.fury.io/js/generator-ng-poly) [![Build Status](https://travis-ci.org/dustinspecker/generator-ng-poly.svg?branch=v0.0.9)](https://travis-ci.org/dustinspecker/generator-ng-poly) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/generator-ng-poly.svg)](https://coveralls.io/r/dustinspecker/generator-ng-poly?branch=master)
[![Dependencies](https://david-dm.org/dustinspecker/generator-ng-poly.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/generator-ng-poly/dev-status.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=devDependencies&view=table) [![PeerDependencies](https://david-dm.org/dustinspecker/generator-ng-poly/peer-status.svg)](https://david-dm.org/dustinspecker/generator-ng-poly/#info=peerDependencies&view=table)

> [Yeoman](http://yeoman.io) generator for AngularJS apps with optional Polymer support

## Purpose

This generator focuses on organizing Angular components by feature (home, about, video player, etc.) instead of by type (controller, service, directive, etc.) to encourage the development of self-contained, reusable components.

A typical workflow with this generator consists of creating an Angular module ([ng-poly:module](#module)) and then generating controllers, directives, etc. for this module to create a new feature.

**Polymer is just an added feature, but it isn't required to utilize this generator.**

## Usage

Install `generator-ng-poly`:

```
npm install -g generator-ng-poly
```

Run `yo ng-poly`
Yeoman will then ask for an app name and language preferences.

Run `gulp` to build and start the development environment.

## User Groups

Please feel free to ask any questions on our [GitHub Issues](https://github.com/dustinspecker/generator-ng-poly/issues) or [Google Group](https://groups.google.com/forum/#!forum/generator-ng-poly)

## Generators

Available generators:
* AngularJS
  - [ng-poly](#app) (a.k.a. [ng-poly:app](#app))
  - [ng-poly:constant](#constant)
  - [ng-poly:controller](#controller)
  - [ng-poly:directive](#directive)
  - [ng-poly:factory](#factory)
  - [ng-poly:filter](#filter)
  - [ng-poly:module](#module)
  - [ng-poly:provider](#provider)
  - [ng-poly:route](#route)
  - [ng-poly:service](#service)
  - [ng-poly:value](#value)
  - [ng-poly:view](#view)
* Polymer
  - [ng-poly:element](#element)

Languages and Features supported:
  * Markup
    - HAML, HTML, Jade
  * Application scripting languages
    - CoffeeScript †, JavaScript
  * Testing scripting languages
    - CoffeeScript, JavaScript
  * Style languages
    - CSS, LESS, SCSS, Stylus
  * Routers
    - Angular Route, UI Router
  * Unit testing
    - Jasmine (Karma as the test runner) for AngularJS
    - Mocha with Chai (Karma as the test runner) for AngularJS
  * e2e testing
    - Protractor (Jasmine) for AngularJS
  * Frameworks
    - Bootstrap with AngularStrap
    - Bootstrap with UI Bootstrap
    - Foundation with Angular Foundation
  * Polymer
    - Core, Paper
  * Task runners
    - Gulp
  * Other supported Bower packages:
    - Angular Animate
    - Angular Cookies
    - Angular Resource
    - Angular Sanitize
    - Angular Touch
    - Font Awesome
    - Lo-Dash
    - Restangular

[Configurations](#configurations):
  * Syntax
    - [Controller As](#controller-as-syntax)
    - [Pass Function](#pass-function)
    - [Named Functions](#named-functions)

† Code coverage isn't currently performed on CoffeeScript application source code

### Gulp Tasks
`gulp` will start a localhost and open in the default browser 

Using `--stage prod` will concat and minify HTML, CSS, and Angular modules.

`gulp build` will compile the assets

`gulp dev` will call the build task and setup the development environment

`gulp unitTest` will run unit tests via Karma and create code coverage reports

`gulp webdriverUpdate` will download the Selenium server standalone and Chrome driver for e2e testing

`gulp e2eTest` will run e2e tests via Protractor (must start a localhost before running `gulp e2eTest`)


* * *
**All generators ask for a module name except app and element. All generators except app take a name as an argument. A name can be written with CamelCase or hyphens.**

Generators requiring a module can take a module option to bypass the prompt:
```
yo ng-poly:view newView --module=home/kitchen
```
**A module value of `app` will add the new components to the module defined in app.js or app.coffee.**
* * *

**Examples are shown with HTML, LESS, JavaScript, Jasmine, and UI Router as the app configuration.**

### App
Asks for application name and language preferences to scaffold out an application with a home module. It will also ask if tests should be placed in the `app/` or `tests/` directory. It'll ask for some additional Bower dependencies and then install npm and Bower dependencies.

Example:
```
yo ng-poly
[?] What is the app's name?
[?] Which version of Angular should be used?
[?] What host should the app run on?
[?] Which port should the app run on?
[?] Which folder should the app be developed in?
[?] Which is the preferred markup language?
[?] Which is the preferred application scripting language?
[?] Want to use Controller As syntax?
[?] Should functions be defined and passed instead of defined inline (in callbacks)?
[?] Want to use named functions instead of anonymous?
[?] Where should unit tests be saved?
[?] Which is the preferred test scripting language?
[?] Which is the preferred unit testing framework?
[?] Which is the preferred style language?
[?] Should Polymer support be enabled?
[?] Should a framework be setup?
[?] Should ngRoute be used instead of UI Router?
[?] Which additional Bower components should be installed?
```

Produces:
```
root/
├── app/
│   ├── fonts/ (empty)
│   ├── home/
│   │   ├── home.{coffee,js}
│   │   ├── home.{css,less,scss,styl}
│   │   ├── home.tpl.{haml,html,jade}
{'fraction_non_alphanumeric': 0.11937329022631187, 'fraction_numerical': 0.0013263698914034651, 'mean_word_length': 4.2520679146713105, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7068710', 'n_tokens_mistral': 3822, 'n_tokens_neox': 3595, 'n_words': 1257}