Home

Awesome

generator-rui-angular

Yeoman generator for angular projects with a focus on rapydscript, rapydml, sass, bootstrap, and angular-ui.

Getting Started

Installation

Make sure you have yeoman installed:

npm install -g yo

Install generator-rui-angular:

npm install git://github.com/loolmeh/generator-rui-angular.git

Quick Start

Make a new directory:

mkdir myapp && cd myapp

Run the main generator:

yo rui-angular

Run a subgenerator to add more content:

yo rui-angular:[subgen]

To build run:

grunt build

files will automatically appear in dist/dev by default or whatever dist_path you specified

To build a release:

grunt release:[release-name]

files will appear in dist/release-name with a zip of contents inside

To run the tests:

grunt test

To run the end to end tests:

grunt teste2e

make sure you have the jdk, selenium/selenium drivers, and the browser binaries you are targeting.

To run the watch tasks:

grunt watch

To run the live dev server:

grunt serve

you need a separate running watch tasks for livereload to work

Features

Configuration

Configuration is stored in .gen_config and should be written for you by the app generator. It determines quite a bit of behavior for the generators that otherwise would need lots of options on the commandline.

Available settings:

Generators

Available generators:

Generator Options and Arguments

Most generators accept the following arguments:

Most generators accept the following options/flags:

App

Sets up a new angularjs app and walks you through configuring it and installing its dependencies.

Args: (none)

Module

Adds a module file name-module.ext. Also adds a reference to the files in index.ml.

Args: name path

Partial

Invokes both the controller and route generators. Then adds a markup template and a stylesheet. All relevant files are appended to index.ml's head. Also if you're using sass or less the stylesheet paths are appended to index.sass/index.less.

Args: name url path module

Options: --nocss --include

Controller

Adds a controller file name-ctrl.ext with spec name-ctrl-spec.ext. The controller can be accessed as name_ctrl.

Args: name path module

Route

Adds a route by appending some code to the target module file.

Args: name url ctrl module

Options: --noctrl

Directive

Adds a directive file name-directive.ext with spec name-directive-spec.ext. It also adds a template markup and a stylesheet, with references in index.ml's head and in index.ss in case its sass/less.

Args: name path module

Options: --notpl --nocss

Dep

Adds a module dependency to a target through appending code. Has options to target all or a bulk, add or remove.

Args: cmd deps mods

Options: --all --conf

Headep

Adds a script/style reference to the head section of index.ml. Generates the appropriate markup for it and attributes for build targeting.

Args: files

Options: --style --concat --copy --remove

Bowerdep

Adds all the linkable files under a bower package's main option to the head section of index.ml.

Args: deps

Rest

for filter, service, etc.. 2 files are produced main+spec and accepts the usual args and options with no special ones.

Args: name path module

Goodies in the GenUtils class

After you inherit from the GenUtils class all this would be accessible on the this object in the generator.

there's some variables set by default for you on this as well, these are affected by options:

Writing more subgenerators

All you need is to inherit from the GenUtils class and yeoman's Base generator. Then make your own class and add that to the prototype too and export the mess. See the filter generator for a simple straight forward example of copying templates and supporting the usual args and options with implicit default values.

Contributing

Pull requests are welcome. Using rapydscript and the existing code/classes is preferred.

Release History

License

MIT