base-generators
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -113,3 +113,5 @@ /*! | ||
var fn = util.configfile(configfile, opts); | ||
return this.base.invoke(fn); | ||
var app = this.base.invoke(fn); | ||
this.register(name, app); | ||
return app; | ||
}); | ||
@@ -116,0 +118,0 @@ |
@@ -117,2 +117,5 @@ 'use strict'; | ||
generator.on('error', function(err) { | ||
if (app.options.verbose || app.options.stack) { | ||
console.log(app.options.stack ? err.stack : err); | ||
} | ||
this.parent.emit('error', this.error(err, generator)); | ||
@@ -190,13 +193,10 @@ }.bind(this)); | ||
try { | ||
throw new Error(err.message); | ||
} catch (e) { | ||
Object.defineProperty(e, 'name', { | ||
configurable: true, | ||
get: function() { | ||
return inst.name; | ||
} | ||
}); | ||
this.stack = e.stack; | ||
} | ||
Object.defineProperty(err, 'name', { | ||
configurable: true, | ||
get: function() { | ||
return inst.name; | ||
} | ||
}); | ||
this.stack = err.stack; | ||
} | ||
@@ -203,0 +203,0 @@ |
@@ -36,3 +36,3 @@ 'use strict'; | ||
if (typeof fn !== 'function') { | ||
return context; | ||
return app; | ||
} | ||
@@ -39,0 +39,0 @@ |
{ | ||
"name": "base-generators", | ||
"description": "Adds project-generator support to your `base` application.", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"homepage": "https://github.com/jonschlinkert/base-generators", | ||
@@ -68,6 +68,9 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"toc": true, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"layout": "default", | ||
"related": { | ||
@@ -89,5 +92,6 @@ "highlight": "base-task", | ||
"composer", | ||
"gulp" | ||
"gulp", | ||
"verb" | ||
] | ||
} | ||
} | ||
} |
@@ -7,2 +7,4 @@ # base-generators [](https://www.npmjs.com/package/base-generators) [](https://travis-ci.org/jonschlinkert/base-generators) | ||
## TOC | ||
- [Install](#install) | ||
@@ -17,2 +19,3 @@ - [Usage](#usage) | ||
- [Related projects](#related-projects) | ||
- [Generate docs](#generate-docs) | ||
- [Running tests](#running-tests) | ||
@@ -59,3 +62,3 @@ - [Contributing](#contributing) | ||
Tasks are exactly the same as [gulp](http://gulpjs.com) tasks, and are powered by [bach](https://github.com/phated/bach) and [composer](https://github.com/jonschlinkert/composer). | ||
Tasks are exactly the same as [gulp](http://gulpjs.com) tasks, and are powered by [bach](https://github.com/gulpjs/bach) and [composer](https://github.com/doowb/composer). | ||
@@ -280,3 +283,3 @@ **Register a task:** | ||
### [.register](index.js#L132) | ||
### [.register](index.js#L134) | ||
@@ -300,3 +303,3 @@ Register generator `name` with the given `fn`. | ||
### [.generator](index.js#L156) | ||
### [.generator](index.js#L158) | ||
@@ -320,3 +323,3 @@ Register generator `name` with the given `fn`, or get generator `name` if only one argument is passed. This method calls the `.getGenerator` method but goes one step further: if `name` is not already registered, it will try to resolve and register the generator before returning it (or `undefined` if unsuccessful). | ||
### [.hasGenerator](index.js#L188) | ||
### [.hasGenerator](index.js#L190) | ||
@@ -345,3 +348,3 @@ Return true if the given `name` exists on the `generators` object. Dot-notation may be used to check for sub-generators. | ||
### [.getGenerator](index.js#L212) | ||
### [.getGenerator](index.js#L214) | ||
@@ -364,3 +367,3 @@ Get generator `name` from `app.generators`. Dot-notation may be used to get a sub-generator. | ||
### [.globalGenerator](index.js#L254) | ||
### [.globalGenerator](index.js#L256) | ||
@@ -375,3 +378,3 @@ Search for globally installed generator `name`. If found, then generator | ||
### [.findGenerator](index.js#L281) | ||
### [.findGenerator](index.js#L283) | ||
@@ -388,3 +391,3 @@ Find generator `name`, by first searching the cache, | ||
### [.invoke](index.js#L333) | ||
### [.invoke](index.js#L335) | ||
@@ -404,3 +407,3 @@ Invoke the given generator in the context of (`this`) the current instance. | ||
### [.extendWith](index.js#L370) | ||
### [.extendWith](index.js#L372) | ||
@@ -425,3 +428,3 @@ Alias for `.invoke`, Extend the current generator instance with the settings of other generators. | ||
### [.generate](index.js#L408) | ||
### [.generate](index.js#L410) | ||
@@ -464,3 +467,3 @@ Run a `generator` and `tasks`, calling the given `callback` function upon completion. | ||
### [.generateEach](index.js#L483) | ||
### [.generateEach](index.js#L485) | ||
@@ -484,3 +487,3 @@ Iterate over an array of generators and tasks, calling [generate](#generate) on each. | ||
### [.alias](index.js#L507) | ||
### [.alias](index.js#L509) | ||
@@ -495,3 +498,3 @@ Create a generator alias from the given `name`. | ||
### [.fullname](index.js#L527) | ||
### [.fullname](index.js#L529) | ||
@@ -506,13 +509,23 @@ Create a generator's full name from the given `alias`. | ||
### [.configfile](index.js#L542) | ||
### [.configname](index.js#L544) | ||
Getter/setter for defining the `configname` name to use for lookups. | ||
By default `configname` is set to `generator.js`. | ||
### [.configfile](index.js#L566) | ||
Getter/setter for defining the `configfile` name to use for lookups. | ||
By default `configfile` is set to `generator.js`. | ||
### [.modulename](index.js#L560) | ||
### [.configpath](index.js#L584) | ||
Getter/setter for defining the `configpath` name to use for lookups. | ||
By default `configpath` is set to `generator.js`. | ||
### [.modulename](index.js#L602) | ||
Getter/setter for defining the `modulename` name to use for lookups. | ||
By default `modulename` is set to `generate`. | ||
### [.base](index.js#L587) | ||
### [.base](index.js#L629) | ||
@@ -552,2 +565,16 @@ Getter/setter for the `base` (or shared) instance of `generate`. | ||
## Generate docs | ||
Generate readme and API documentation with [verb](https://github.com/verbose/verb): | ||
```sh | ||
$ npm i -d && npm run docs | ||
``` | ||
Or, if [verb](https://github.com/verbose/verb) is installed globally: | ||
```sh | ||
$ verb | ||
``` | ||
## Running tests | ||
@@ -579,2 +606,2 @@ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on February 11, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on February 12, 2016._ |
51031
1007
589