Skip to content

Commit ce9d852

Browse files
committed
Finish 0.0.8
2 parents c3372c3 + 700f56b commit ce9d852

File tree

3 files changed

+43
-29
lines changed

3 files changed

+43
-29
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<a name="0.0.8"></a>
2+
## 0.0.8 (2017-10-31)
3+
4+
### Bug Fixes
5+
6+
* **chore:** don't stop stream ([4d74a147](https://github.com/compodoc/gulp-compodoc/commit/4d74a147)), closes [#4](https://github.com/compodoc/gulp-compodoc/issues/4)
7+
18
<a name="0.0.7"></a>
29
## 0.0.7 (2017-07-08)
310

index.js

+34-27
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
11
'use strict';
22
const gutil = require('gulp-util'),
3-
PluginError = gutil.PluginError,
4-
es = require('event-stream'),
5-
through = require('through2'),
6-
compodocModule = require('@compodoc/compodoc'),
7-
PLUGIN_NAME = 'gulp-compodoc';
3+
PluginError = gutil.PluginError,
4+
es = require('event-stream'),
5+
through = require('through2'),
6+
compodocModule = require('@compodoc/compodoc'),
7+
PLUGIN_NAME = 'gulp-compodoc';
88

99
function compodoc(options) {
1010
var files = [];
11-
options = options || {};
11+
options = options || {};
1212

1313
return es.through(function(file) {
14-
files.push(file.path);
15-
}, function() {
16-
var stream = this;
14+
files.push(file.path);
15+
}, function() {
16+
var stream = this;
1717

18-
if (files.length === 0) {
19-
stream.emit('error', new PluginError(PLUGIN_NAME, 'No input files for compodoc.'));
20-
stream.emit('end');
21-
return;
22-
} else if (!options.output) {
23-
stream.emit('error', new PluginError(PLUGIN_NAME, 'You must either specify the \'output\' option.'));
24-
stream.emit('end');
25-
return;
26-
} else {
18+
if (files.length === 0) {
19+
stream.emit('error', new PluginError(PLUGIN_NAME, 'No input files for compodoc.'));
20+
stream.emit('end');
21+
return;
22+
} else if (!options.output) {
23+
stream.emit('error', new PluginError(PLUGIN_NAME, 'You must either specify the \'output\' option.'));
24+
stream.emit('end');
25+
return;
26+
} else {
2727
var app = new compodocModule.Application(options);
2828

29-
app.setFiles(files);
30-
app.generate();
31-
32-
process.on('exit', function() {
29+
try {
30+
app.setFiles(files);
31+
app.generate().then(function() {
32+
stream.emit('end');
33+
return;
34+
}, function(error) {
35+
stream.emit('error', new PluginError(PLUGIN_NAME, error));
36+
stream.emit('end');
37+
return;
38+
});
39+
} catch (e) {
40+
stream.emit('error', e);
3341
stream.emit('end');
34-
});
35-
36-
return;
37-
}
38-
});
42+
return;
43+
}
44+
}
45+
});
3946
}
4047

4148
module.exports = compodoc;

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@compodoc/gulp-compodoc",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Compodoc plugin for gulp",
55
"main": "index.js",
66
"scripts": {
@@ -32,7 +32,7 @@
3232
"node": ">=5.10.0"
3333
},
3434
"dependencies": {
35-
"@compodoc/compodoc": "^1.0.0-beta.11",
35+
"@compodoc/compodoc": "^1.0.3",
3636
"event-stream": "^3.3.4",
3737
"gulp-util": "^3.0.7",
3838
"through2": "^2.0.1"

0 commit comments

Comments
 (0)