Skip to content

Commit

Permalink
feat(docs): generate api.json from .d.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichaelgraham committed Aug 9, 2015
1 parent 910df5f commit a6960cb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
33 changes: 26 additions & 7 deletions build/tasks/doc.js
@@ -1,14 +1,33 @@
var gulp = require('gulp');
var tools = require('aurelia-tools');
var paths = require('../paths');
var yuidoc = require('gulp-yuidoc');
var typedoc = require("gulp-typedoc");
var typedocExtractor = require("gulp-typedoc-extractor");
var runSequence = require('run-sequence');

gulp.task('doc-generate', function(){
return gulp.src(paths.source)
.pipe(yuidoc.parser(null, 'api.json'))
.pipe(gulp.dest(paths.doc));
return gulp.src([paths.output + '*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/github/aurelia/*/*.d.ts'])
.pipe(typedoc({
            target"es6",
            includeDeclarationstrue,
            jsonpaths.doc + '/api.json',
            namepaths.packageName + '-docs', 
mode: 'modules',
excludeExternals: true,
            ignoreCompilerErrorsfalse,
            versiontrue
        }));
});

gulp.task('doc', ['doc-generate'], function(){
tools.transformAPIModel(paths.doc);
gulp.task('doc-extract', function(){
return gulp.src([paths.doc + '/api.json'])
.pipe(typedocExtractor(paths.packageName))
.pipe(gulp.dest(paths.doc));
});

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

0 comments on commit a6960cb

Please sign in to comment.