fix typedoc integration

This commit is contained in:
Philipp Kunz 2016-09-02 14:10:09 +02:00
parent 93682e9ec4
commit 82c00fe444
5 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,5 @@
/// <reference types="q" /> /// <reference types="q" />
import * as plugins from "./npmts.plugins"; import * as plugins from "./npmts.plugins";
import { ProjectinfoNpm } from "projectinfo";
export declare let projectInfo: ProjectinfoNpm;
export declare let run: (configArg: any) => plugins.Q.Promise<{}>; export declare let run: (configArg: any) => plugins.Q.Promise<{}>;

4
dist/npmts.check.js vendored
View File

@ -2,10 +2,10 @@
var plugins = require("./npmts.plugins"); var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain"); var npmts_promisechain_1 = require("./npmts.promisechain");
exports.projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
var checkProjectTypings = function (configArg) { var checkProjectTypings = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
var cwdProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd); if (typeof exports.projectInfo.packageJson.typings == "undefined") {
if (typeof cwdProjectInfo.packageJson.typings == "undefined") {
plugins.beautylog.error("please add typings field to package.json"); plugins.beautylog.error("please add typings field to package.json");
process.exit(1); process.exit(1);
} }

View File

@ -3,6 +3,7 @@ require("typings-global");
var plugins = require("./npmts.plugins"); var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths"); var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain"); var npmts_promisechain_1 = require("./npmts.promisechain");
var npmts_check_1 = require("./npmts.check");
var genTypeDoc = function (configArg) { var genTypeDoc = function (configArg) {
var done = plugins.Q.defer(); var done = plugins.Q.defer();
npmts_promisechain_1.npmtsOra.text("now generating " + "TypeDoc documentation".yellow); npmts_promisechain_1.npmtsOra.text("now generating " + "TypeDoc documentation".yellow);
@ -17,8 +18,9 @@ var genTypeDoc = function (configArg) {
out: paths.pagesApiDir, out: paths.pagesApiDir,
json: plugins.path.join(paths.pagesApiDir, "file.json"), json: plugins.path.join(paths.pagesApiDir, "file.json"),
// TypeDoc options (see typedoc docs) // TypeDoc options (see typedoc docs)
name: "my-project", name: npmts_check_1.projectInfo.name,
//theme: "default", readme: plugins.path.join(paths.cwd, "README.md"),
// theme: "default",
ignoreCompilerErrors: true, ignoreCompilerErrors: true,
version: true, version: true,
})) }))

View File

@ -2,10 +2,14 @@ import * as plugins from "./npmts.plugins";
import * as paths from "./npmts.paths"; import * as paths from "./npmts.paths";
import { npmtsOra } from "./npmts.promisechain"; import { npmtsOra } from "./npmts.promisechain";
import {ProjectinfoNpm} from "projectinfo";
export let projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
let checkProjectTypings = (configArg) => { let checkProjectTypings = (configArg) => {
let done = plugins.Q.defer(); let done = plugins.Q.defer();
let cwdProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
if(typeof cwdProjectInfo.packageJson.typings == "undefined"){ if(typeof projectInfo.packageJson.typings == "undefined"){
plugins.beautylog.error(`please add typings field to package.json`); plugins.beautylog.error(`please add typings field to package.json`);
process.exit(1); process.exit(1);
}; };

View File

@ -3,6 +3,8 @@ import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths"); import paths = require("./npmts.paths");
import { npmtsOra } from "./npmts.promisechain"; import { npmtsOra } from "./npmts.promisechain";
import {projectInfo} from "./npmts.check";
let genTypeDoc = function (configArg) { let genTypeDoc = function (configArg) {
let done = plugins.Q.defer(); let done = plugins.Q.defer();
npmtsOra.text("now generating " + "TypeDoc documentation".yellow); npmtsOra.text("now generating " + "TypeDoc documentation".yellow);
@ -19,9 +21,9 @@ let genTypeDoc = function (configArg) {
json: plugins.path.join(paths.pagesApiDir, "file.json"), json: plugins.path.join(paths.pagesApiDir, "file.json"),
// TypeDoc options (see typedoc docs) // TypeDoc options (see typedoc docs)
name: "my-project", name: projectInfo.name,
readme: plugins.path.join(paths.cwd,"README.md"),
//theme: "default", // theme: "default",
ignoreCompilerErrors: true, ignoreCompilerErrors: true,
version: true, version: true,
})) }))