2016-07-14 22:38:41 +00:00
|
|
|
"use strict";
|
|
|
|
require("typings-global");
|
|
|
|
var plugins = require("./npmts.plugins");
|
|
|
|
var paths = require("./npmts.paths");
|
|
|
|
var npmts_promisechain_1 = require("./npmts.promisechain");
|
2016-09-02 12:10:09 +00:00
|
|
|
var npmts_check_1 = require("./npmts.check");
|
2016-07-14 22:38:41 +00:00
|
|
|
var genTypeDoc = function (configArg) {
|
|
|
|
var done = plugins.Q.defer();
|
2016-07-15 10:22:19 +00:00
|
|
|
npmts_promisechain_1.npmtsOra.text("now generating " + "TypeDoc documentation".yellow);
|
2016-07-14 22:38:41 +00:00
|
|
|
plugins.beautylog.log("TypeDoc Output:");
|
|
|
|
plugins.gulp.src(plugins.path.join(paths.tsDir, "**/*.ts"))
|
|
|
|
.pipe(plugins.g.typedoc({
|
|
|
|
// TypeScript options (see typescript docs)
|
|
|
|
module: "commonjs",
|
|
|
|
target: "es6",
|
|
|
|
includeDeclarations: true,
|
|
|
|
// Output options (see typedoc docs)
|
2016-08-30 14:35:46 +00:00
|
|
|
out: paths.pagesApiDir,
|
|
|
|
json: plugins.path.join(paths.pagesApiDir, "file.json"),
|
2016-07-14 22:38:41 +00:00
|
|
|
// TypeDoc options (see typedoc docs)
|
2016-09-02 12:10:09 +00:00
|
|
|
name: npmts_check_1.projectInfo.name,
|
|
|
|
readme: plugins.path.join(paths.cwd, "README.md"),
|
|
|
|
// theme: "default",
|
2016-07-15 10:22:19 +00:00
|
|
|
ignoreCompilerErrors: true,
|
2016-07-14 22:38:41 +00:00
|
|
|
version: true,
|
|
|
|
}))
|
|
|
|
.pipe(plugins.g.gFunction(done.resolve, "atEnd"));
|
|
|
|
return done.promise;
|
|
|
|
};
|
|
|
|
exports.run = function (configArg) {
|
|
|
|
var done = plugins.Q.defer();
|
2016-08-19 07:46:36 +00:00
|
|
|
if (configArg.docs) {
|
2016-08-13 21:54:17 +00:00
|
|
|
genTypeDoc(configArg)
|
|
|
|
.then(function () {
|
|
|
|
done.resolve(configArg);
|
|
|
|
});
|
|
|
|
}
|
2016-08-19 07:46:36 +00:00
|
|
|
else {
|
|
|
|
done.resolve(configArg);
|
|
|
|
}
|
2016-08-13 21:54:17 +00:00
|
|
|
;
|
2016-07-14 22:38:41 +00:00
|
|
|
return done.promise;
|
|
|
|
};
|