Skip to content

Commit

Permalink
chore(all): update build, d.ts, lint, doc process
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 10, 2016
1 parent dcb53d4 commit 4ec8d37
Show file tree
Hide file tree
Showing 20 changed files with 1,176 additions and 6,192 deletions.
23 changes: 18 additions & 5 deletions build/tasks/doc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
var gulp = require('gulp');
var paths = require('../paths');
var typedoc = require('gulp-typedoc');
var typedocExtractor = require('gulp-typedoc-extractor');
var runSequence = require('run-sequence');
var through2 = require('through2');

gulp.task('doc-generate', function(){
return gulp.src([paths.output + '*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/npm/*/*.d.ts'])
return gulp.src([paths.output + paths.packageName + '.d.ts'])
.pipe(typedoc({
target'es6',
includeDeclarationstrue,
moduleResolution: 'node',
jsonpaths.doc + '/api.json',
namepaths.packageName + '-docs', 
mode: 'modules',
Expand All @@ -18,16 +19,28 @@ gulp.task('doc-generate', function(){
}));
});

gulp.task('doc-extract', function(){
gulp.task('doc-shape', function(){
return gulp.src([paths.doc + '/api.json'])
.pipe(typedocExtractor(paths.packageName))
.pipe(through2.obj(function(file, enc, callback) {
var json = JSON.parse(file.contents.toString('utf8')).children[0];

json = {
name: paths.packageName,
children: json.children,
groups: json.groups
};

file.contents = new Buffer(JSON.stringify(json));
this.push(file);
return callback();
}))
.pipe(gulp.dest(paths.doc));
});

gulp.task('doc', function(callback){
return runSequence(
'doc-generate',
'doc-extract',
'doc-shape',
callback
);
});
Loading

0 comments on commit 4ec8d37

Please sign in to comment.