1 | # Mozu Actions generator
|
2 |
|
3 | Maintainer: [James Zetlen](https://github.com/zetlen)
|
4 |
|
5 | A Mozu Actions generator for Yeoman that provides boilerplate and structure for writing Mozu Custom Functions against the family of Mozu Code Actions. It provides documented function stubs, a build process using Grunt and Browserify, remote sync with the Developer Center, and unit tests using Mocha plus the Mozu Action Simulator.
|
6 |
|
7 | ![A screenshot of the generator in action in an OSX terminal.](http://i.imgur.com/r3sSEvX.png)
|
8 |
|
9 | ## Usage
|
10 |
|
11 | First, install [Yeoman](http://yeoman.io)'s command line tool if you haven't already!
|
12 |
|
13 | ```bash
|
14 | npm install -g yo
|
15 | ```
|
16 |
|
17 | Yeoman looks for globally installed NPM packages that identify themselves as Yeoman generators. So install the generator globally. Also, install the `grunt-cli` command line Grunt package, because you'll need it.
|
18 |
|
19 | ```bash
|
20 | npm install -g generator-mozu-actions grunt-cli
|
21 | ```
|
22 |
|
23 | Make a new directory and `cd` into it:
|
24 | ```
|
25 | mkdir example && cd example
|
26 | ```
|
27 |
|
28 | Run the Yeoman generator!
|
29 | ```
|
30 | yo mozu-actions
|
31 | ```
|
32 |
|
33 | ## Options
|
34 |
|
35 | * `--skip-install`
|
36 |
|
37 | Skips the automatic execution of `npm install` after scaffolding has finished.
|
38 |
|
39 | * `--skip-prompts`
|
40 |
|
41 | Often you may find yourself rerunning the generator in the same directory. Your answers to prompts are saved; if you want to quickly re-run the generator without prompts, use this option. Will not work if you've never run the generator in this directory before.
|
42 |
|
43 | * `--quick`
|
44 |
|
45 | Equivalent to `--skip-install --skip-prompts`.
|
46 |
|
47 | * `--internal`
|
48 |
|
49 | Allows integration with non-production Mozu environments. The prompts will include an extra question about which environment to sync with.
|
50 |
|
51 |
|
52 | ## Creating Additional Actions
|
53 |
|
54 | The generator uses a Yeoman sub-generator to create the action implementation scaffolds and unit test scaffolds. You can call this sub-generator directly, after creating your project, to add more scaffolding for additional actions:
|
55 |
|
56 | ```
|
57 | yo mozu-actions:action
|
58 | ```
|
59 |
|
60 | This will prompt you to add to your list of actions, and then will write the additional action scaffolds.
|