now stating npmts version

This commit is contained in:
Philipp Kunz 2016-06-10 00:53:30 +02:00
parent a6c4a99d82
commit e3b84af278
9 changed files with 22 additions and 76 deletions

4
dist/index.js vendored
View File

@ -1,11 +1,15 @@
"use strict";
require("typings-global");
// start early and load modules
var early = require("early");
early.start("NPMTS");
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var npmts_promisechain_1 = require("./npmts.promisechain");
early.stop();
plugins.beautylog.figletSync("NPMTS");
var projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
plugins.beautylog.info("npmts version: " + projectInfo.version);
try {
npmts_promisechain_1.promisechain();
}

28
dist/npmts.jsdoc.js vendored
View File

@ -20,34 +20,6 @@ var genJsdoc = function (configArg) {
}));
return done.promise;
};
exports.publishDocs = function (configArg) {
var done = plugins.Q.defer();
var gitUrl = plugins.projectinfo.npm(paths.cwd, {
gitAccessToken: process.env.GITHUB_TOKEN
}).git.httpsUrl;
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init " + "> /dev/null 2>&1 "
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
+ "&& git config user.email \"travis@shipzone.io\" " + "> /dev/null 2>&1 "
+ "&& git add . " + "> /dev/null 2>&1 "
+ "&& git commit -m \"Deploy to GitHub Pages\" " + "> /dev/null 2>&1 "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages " + "> /dev/null 2>&1";
plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed!');
plugins.shelljs.exit(1);
}
else if (plugins.shelljs.exec(deployScript).code !== 0) {
plugins.beautylog.error('Git failed!');
plugins.shelljs.exit(1);
}
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
done.resolve(configArg);
return done.promise;
};
exports.run = function (configArg) {
var done = plugins.Q.defer();
genJsdoc(configArg)

3
dist/npmts.paths.js vendored
View File

@ -1,6 +1,9 @@
"use strict";
require("typings-global");
var plugins = require("./npmts.plugins");
//Npmts Paths
exports.npmtsPackageRoot = plugins.path.join(__dirname, "../");
//Project paths
exports.cwd = plugins.smartcli.get.cwd().path;
//Directories
exports.tsDir = plugins.path.join(exports.cwd, "ts/");

View File

@ -1,13 +1,9 @@
"use strict";
require("typings-global");
var plugins = require("./npmts.plugins");
var NpmtsJsdoc = require("./npmts.jsdoc");
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
var promiseArray = [];
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void (0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void (0);
plugins.Q.all(promiseArray).then(done.resolve);
done.resolve();
return done.promise;
};

View File

@ -1,11 +1,16 @@
import "typings-global";
// start early and load modules
import * as early from "early";
early.start("NPMTS");
import * as plugins from "./npmts.plugins"
import * as paths from "./npmts.paths";
import {promisechain} from "./npmts.promisechain";
early.stop();
plugins.beautylog.figletSync("NPMTS");
let projectInfo = new plugins.projectinfo.ProjectinfoNpm(paths.npmtsPackageRoot);
plugins.beautylog.info("npmts version: " + projectInfo.version);
try {
promisechain();

View File

@ -21,41 +21,6 @@ let genJsdoc = function(configArg){
return done.promise;
};
export let publishDocs = function(configArg){
let done = plugins.Q.defer();
let gitUrl = plugins.projectinfo.npm(
paths.cwd,
{
gitAccessToken:process.env.GITHUB_TOKEN
}
).git.httpsUrl;
let deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init " + "> /dev/null 2>&1 "
+ "&& git config user.name \"TRAVIS CI\" " + "> /dev/null 2>&1 "
+ "&& git config user.email \"travis@shipzone.io\" " + "> /dev/null 2>&1 "
+ "&& git add . " + "> /dev/null 2>&1 "
+ "&& git commit -m \"Deploy to GitHub Pages\" " + "> /dev/null 2>&1 "
+ "&& git push --force --quiet "
+ "\"" + gitUrl + "\" "
+ "master:gh-pages " + "> /dev/null 2>&1";
plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed!');
plugins.shelljs.exit(1);
} else if (plugins.shelljs.exec(deployScript).code !== 0) {
plugins.beautylog.error('Git failed!');
plugins.shelljs.exit(1);
}
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
done.resolve(configArg);
return done.promise;
};
export let run = function(configArg){
let done = plugins.Q.defer();

View File

@ -1,6 +1,11 @@
import "typings-global";
import plugins = require("./npmts.plugins");
//Npmts Paths
export let npmtsPackageRoot = plugins.path.join(__dirname,"../");
//Project paths
export let cwd = plugins.smartcli.get.cwd().path;
//Directories

View File

@ -15,15 +15,15 @@ export let g = {
};
export let lodashObject = require('lodash/fp/object');
export let merge2 = require("merge2");
export let projectinfo = require("projectinfo");
export import projectinfo = require("projectinfo");
export let path = require("path");
export let Q = require("q");
export let shelljs = require("shelljs");
export let smartci = require("smartci");
export let smartcli = require("smartcli");
export let smartcov = require("smartcov");
export let smartenv = require("smartenv");
export let smartfile = require("smartfile");
export import smartenv = require("smartenv");
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");
export import smartstring = require("smartstring");
export let sourceMapSupport = require("source-map-support").install(); // this is required to display errors correctly during testing

View File

@ -6,10 +6,6 @@ import NpmtsJsdoc = require("./npmts.jsdoc");
export let run = function(configArg){
let done = plugins.Q.defer();
let config = configArg;
let promiseArray = [];
config.docs.publish ? promiseArray.push(NpmtsJsdoc.publishDocs(configArg)) : void(0);
promiseArray.length === 0 ? plugins.beautylog.info("Did not publish anything!") : void(0);
plugins.Q.all(promiseArray).then(done.resolve);
done.resolve();
return done.promise;
};