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 21, 2015
1 parent a823d83 commit 9362b80
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
33 changes: 26 additions & 7 deletions build/tasks/doc.js
Original file line number Diff line number Diff line change
@@ -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
);
});
4 changes: 4 additions & 0 deletions doc/core-js.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module 'core-js' {
var coreJs;
export default coreJs;
}
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"format": "amd",
"directories": {
"lib": "dist/amd"
},
"devDependencies": {
"babel": "npm:babel-core@^5.1.13",
"babel-runtime": "npm:babel-runtime@^5.1.13",
"core-js": "npm:core-js@^0.9.5",
"traceur": "github:jmcriffey/[email protected]",
"traceur-runtime": "github:jmcriffey/[email protected]"
}
},
"devDependencies": {
Expand All @@ -34,6 +41,8 @@
"gulp-bump": "^0.3.1",
"gulp-jshint": "^1.9.0",
"gulp-rename": "^1.2.2",
"gulp-typedoc": "^1.2.1",
"gulp-typedoc-extractor": "^0.0.8",
"gulp-yuidoc": "^0.1.2",
"jasmine-core": "^2.1.3",
"jshint-stylish": "^1.0.0",
Expand All @@ -46,6 +55,7 @@
"object.assign": "^1.0.3",
"require-dir": "^0.1.0",
"run-sequence": "^1.0.2",
"vinyl": "^0.5.1",
"vinyl-paths": "^1.0.0",
"yargs": "^2.1.1"
},
Expand Down

0 comments on commit 9362b80

Please sign in to comment.