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" />
import * as plugins from "./npmts.plugins";
import { ProjectinfoNpm } from "projectinfo";
export declare let projectInfo: ProjectinfoNpm;
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 paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
exports.projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
var checkProjectTypings = function (configArg) {
var done = plugins.Q.defer();
var cwdProjectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
if (typeof cwdProjectInfo.packageJson.typings == "undefined") {
if (typeof exports.projectInfo.packageJson.typings == "undefined") {
plugins.beautylog.error("please add typings field to package.json");
process.exit(1);
}

View File

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

View File

@ -2,10 +2,14 @@ import * as plugins from "./npmts.plugins";
import * as paths from "./npmts.paths";
import { npmtsOra } from "./npmts.promisechain";
import {ProjectinfoNpm} from "projectinfo";
export let projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.cwd);
let checkProjectTypings = (configArg) => {
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`);
process.exit(1);
};

View File

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