Skip to content

Commit

Permalink
Doc: How do I add a generator? (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzraho authored Jan 8, 2020
1 parent 378c120 commit 4726610
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ A Yeoman code generator for Adobe I/O Applications.
[![Codecov Coverage](https://img.shields.io/codecov/c/github/adobe/generator-aio-app/master.svg?style=flat-square)](https://codecov.io/gh/adobe/generator-aio-app/)
[![Greenkeeper badge](https://badges.greenkeeper.io/adobe/generator-aio-app.svg)](https://greenkeeper.io/)

## Use with aio CLI
## Usage

### OOTB with aio-cli

- `npm install -g @adobe/aio-cli`

Expand All @@ -19,7 +21,7 @@ A Yeoman code generator for Adobe I/O Applications.
- `aio app delete action` to delete an existing action
- `aio app delete web-assets` to delete the app's UI

## Standalone Usage
### Standalone with yeoman

- `npm install -g yo @adobe/generator-aio-app`

Expand All @@ -33,6 +35,23 @@ A Yeoman code generator for Adobe I/O Applications.

Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.

### How to provide new template generators

Two types of generators can be easily contributed to the project:

- action generators, e.g. [analytics action generator](./generators/add-action/analytics/index.js):

- add a new action template generator into `generators/add-action/<generator-name>/index.js`. It is recommended that
the generator extends `lib/ActionGenerator.js` that provides a set of helpers.
- add template files into `generators/add-action/<generator-name>/templates/`
- update `generators/add-action/index.js` to reference the newly added generator in the prompt choices.

- web assets generators, e.g. [raw html/js generator](./generators/add-web-assets/raw/index.js):

- add a new web assets template generator into `generators/add-web-assets/<generator-name>/index.js`.
- add template files into `generators/add-web-assets/<generator-name>/templates/`
- update `generators/add-web-assets/index.js` to reference the newly added generator in the prompt choices.

## Licensing

This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.

0 comments on commit 4726610

Please sign in to comment.