Compare commits

...

17 Commits

Author SHA1 Message Date
d98d035902 3.4.1 2016-03-12 10:26:53 +01:00
217af24d25 fixs some cosmetics 2016-03-12 10:26:42 +01:00
11c43f59d9 update devDeps 2016-03-12 10:23:32 +01:00
14c36dd894 3.4.0 2016-03-12 10:21:34 +01:00
9f74fab2b2 now using gulp-typings 2016-03-12 10:21:16 +01:00
8efa67a4ff 3.3.2 2016-02-25 08:39:48 +01:00
f7304f59a5 add optional docs publishing 2016-02-25 08:39:38 +01:00
070385867e 3.3.1 2016-02-25 08:26:32 +01:00
e429eb8ae0 fix cli call 2016-02-25 08:26:00 +01:00
6045174edb 3.3.0 2016-02-23 20:02:18 +01:00
08dcdb2c9f now installing typings before compiling 2016-02-23 20:02:07 +01:00
44aa92c83c now completeley hiding git console output 2016-02-23 18:58:44 +01:00
e43541cf90 3.2.2 2016-02-23 18:35:36 +01:00
414e845b80 fix config traveling 2016-02-23 18:35:28 +01:00
c18eb85ec8 fixed repo path 2016-02-23 18:24:07 +01:00
3ae3598c96 update env vars 2016-02-23 18:10:03 +01:00
26eca7aa65 added GitHub Token again 2016-02-23 17:44:35 +01:00
31 changed files with 279 additions and 268 deletions

8
.gitignore vendored
View File

@ -1,10 +1,10 @@
.idea/
.c9/
node_modules/
test/**/node_modules/
test/assets/docs/
test/**/typings/
test/**/coverage/
test/assets/**/node_modules/
test/assets/**/docs/
test/assets/**/typings/
test/assets/**/coverage/
ts/*.js
ts/*.js.map
ts/typings/

View File

@ -2,5 +2,6 @@
support
compile
test/
docs/
examples
.gitignore

View File

@ -1,7 +1,7 @@
language: node_js
node_js:
- "4.3.1"
- "stable"
- 4.3.1
- stable
deploy:
provider: npm
email: npm@lossless.digital
@ -10,3 +10,6 @@ deploy:
on:
tags: true
repo: pushrocks/npmts
env:
global:
secure: kPKBMnEKoC+K5dXpl11NhuK3LSp0c0fRO60Akj3QeQBjUWnVAcF0Ht30c31y0lnJaMEzXhmUIKdR7RQnlmw5be4TYGINzY7FD3Dcv7o+HO1ZQrkpMWSu46jF6ZJer9moGjZ8e0rX8wZyB9SqsXYlwWRzqvxfOVxQfTvU3BEnJKHbhq+R5JMJ8dwLBPNTJKMWKq85KNsjo3ap0BjxdBUoRLzvrn31VOPH30BkvmLGc5YiIz5QmITll/T2wmQKYTNT2qDlEJ729B8pYa3eNlCNi89AxsLDGCmEoJAVrPsyw5g+gAyBqZ1GRULy83UJbELUq7cse3MRLMSwCAm4f0INRAuqcyiKYJ4+LHd0NwKrFQ/dQ0pvyBTbbEjNemXaakkWH7S6F03UvF+u+tiQ7C97XH0CRsseGlm36zCkAClEhtWVWA4U0Q5c6zqRAAOYOI0xquXalRKPTJe7fCYewp2eqmlp8drt8MxancyKI/ynXNoR5vGFzDTSRoPjTlaYQPmbiH4+Nd5+6Qoj94PEIqghebIPDQo3C7vWts4WGccux5b2q524UgB63hjJQA6+GQOo1q4RibouS6WScn8/tW/ZOEP+sNhDfkeiZUIjye+Q3PyzonGHefgSQ8wBbsc8LOX0cKUcEFWr14nhdQ9ZeW+hrSSF04TbM4zGJPGcKhmT2UU=

2
assets/cli.js Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
var index = require("./index.js");

View File

@ -4,7 +4,7 @@ var plugins = {
gulp: require("gulp"),
g:{
typescript: require("gulp-typescript"),
header: require("gulp-header")
typings:require("gulp-typings")
},
mergeStream: require("merge2"),
path: require("path")
@ -18,7 +18,13 @@ paths = {
plugins.beautylog.log('now compiling NPMTS');
plugins.gulp.task('indexTS', function() {
plugins.gulp.task("typings",function(){
var stream = plugins.gulp.src(plugins.path.join(paths.packageBase,"ts/typings.json"))
.pipe(plugins.g.typings());
return stream;
});
plugins.gulp.task("TS",["typings"], function() {
var stream = plugins.gulp.src([
plugins.path.join(paths.packageBase,'ts/**/*.ts'),
"!" + plugins.path.join(paths.packageBase,'ts/typings/**/*.d.ts')
@ -27,12 +33,16 @@ plugins.gulp.task('indexTS', function() {
target:"ES5",
module:"commonjs"
}))
.pipe(plugins.g.header('#!/usr/bin/env node\n\n'))
.pipe(plugins.gulp.dest(plugins.path.join(paths.packageBase, 'dist/')));
return stream;
});
plugins.gulp.task('default',['indexTS'], function() {
plugins.gulp.task("CLI",function(){
var stream = plugins.gulp.src(plugins.path.join(paths.packageBase,"assets/cli.js"))
.pipe(plugins.gulp.dest(plugins.path.join(paths.packageBase, 'dist/')))
});
plugins.gulp.task('default',['TS',"CLI"], function() {
plugins.beautylog.success('Typescript compiled');
});

3
dist/cli.js vendored
View File

@ -1,3 +1,2 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />
var index = require("./index.js");

3
dist/index.js vendored
View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
console.log("**** starting NPMTS ****");
var plugins = require("./npmts.plugins");

2
dist/npmts.cli.js vendored
View File

@ -1,3 +1 @@
#!/usr/bin/env node
/// <reference path="./typings/main.d.ts" />

39
dist/npmts.compile.js vendored
View File

@ -1,45 +1,16 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
exports.run = function (configArg) {
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now running custom tasks");
plugins.beautylog.log("now compiling " + "TypeScript".yellow);
var moduleStream = plugins.merge2({ end: false });
/* -------------------------------------------------
* ----------- first install typings ---------------
* ----------- compile TypeScript --------------------------
* ----------------------------------------------- */
var typingsDone = plugins.Q.defer();
var typingsCounter = 0;
var typingsCounterAdvance = function () {
typingsCounter++;
if (typeof config.typings[typingsCounter] != "undefined") {
installTypings();
}
else {
plugins.beautylog.success("custom typings installed successfully");
typingsDone.resolve();
}
};
var installTypings = function () {
plugins.beautylog.log("now installing " + "typings.json".yellow + " from " + config.typings[typingsCounter].blue);
plugins.typings.install({ production: false, cwd: plugins.path.join(paths.cwd, config.typings[typingsCounter]) })
.then(function () {
typingsCounterAdvance();
}, function () {
plugins.beautylog.error("something went wrong: Check if path is correct: " + config.typings[typingsCounter].blue);
typingsCounterAdvance();
});
};
installTypings();
/* -------------------------------------------------
* ----------- second compile TS -------------------
* ----------------------------------------------- */
typingsDone.promise.then(function () {
for (var key in config.ts) {
plugins.beautylog.log("now compiling" + key.blue);
var outputPathIsDir;
try {
if (plugins.fs.statSync(plugins.path.join(paths.cwd, config.ts[key])).isDirectory()) {
@ -80,12 +51,12 @@ exports.run = function (configArg) {
moduleStream.add(stream);
}
moduleStream.on("queueDrain", function () {
plugins.beautylog.success("custom TypeScript installed successfully");
plugins.beautylog.ok("TypeScript is compiled!");
moduleStream.on("finish", function () {
done.resolve(config);
});
moduleStream.end();
});
});
/*==================== END TYPESCRIPT =====================*/
return done.promise;
};

View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
@ -18,6 +17,7 @@ exports.run = function () {
break;
default:
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
process.exit(1);
}
;
}

20
dist/npmts.install.js vendored Normal file
View File

@ -0,0 +1,20 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
exports.run = function (configArg) {
var config = configArg;
var done = plugins.Q.defer();
/* -------------------------------------------------
* ----------- install typings ---------------
* ----------------------------------------------- */
plugins.beautylog.log("now installing " + "typings".yellow);
var absoluteTypingsArray = plugins.smartpath.absolute(config.typings, paths.cwd);
plugins.gulp.src(absoluteTypingsArray)
.pipe(plugins.g.typings())
.pipe(plugins.g.gFunction(function () {
plugins.beautylog.ok("typings are installed!");
done.resolve(config);
}, "atEnd"));
return done.promise;
};

41
dist/npmts.jsdoc.js vendored
View File

@ -1,9 +1,8 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
var genJsdoc = function () {
var genJsdoc = function (configArg) {
var done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
plugins.gulp.src([
@ -14,31 +13,28 @@ var genJsdoc = function () {
opts: {
destination: paths.docsDir
}
}, done.resolve));
}, function () {
plugins.beautylog.ok("JsDoc has been generated!");
done.resolve(configArg);
}));
return done.promise;
};
var publishDocs = function () {
var publishDocs = function (configArg) {
var done = plugins.Q.defer();
try {
var gitUrl = plugins.projectinfo.npm(paths.cwd, {
gitAccessToken: process.env.GITHUB_TOKEN
}).git.httpsUrl;
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init "
+ "&& git config user.name \"TRAVIS CI\" "
+ "&& git config user.email \"travis@shipzone.io\" "
+ "&& git add . "
+ "&& git commit -m \"Deploy to GitHub Pages\" "
+ "&& 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";
}
catch (err) {
console.log(err);
}
if (plugins.smartenv.getEnv().isTravis) {
+ "master:gh-pages " + "> /dev/null 2>&1";
if (plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish) {
plugins.beautylog.log("now publishing docs to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed');
@ -48,16 +44,17 @@ var publishDocs = function () {
plugins.beautylog.error('Error: Git failed');
plugins.shelljs.exit(1);
}
done.resolve();
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
done.resolve(configArg);
}
else {
done.resolve();
done.resolve(configArg);
}
return done.promise;
};
exports.run = function () {
exports.run = function (configArg) {
var done = plugins.Q.defer();
genJsdoc()
genJsdoc(configArg)
.then(publishDocs)
.then(done.resolve);
return done.promise;

View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
exports.run = function (configArg) {
@ -10,7 +9,7 @@ exports.run = function (configArg) {
}
if (config.mode == "default") {
config.typings = [
"./ts/"
"./ts/typings.json"
];
config.ts = (_a = {},
_a["./ts/**/*.ts"] = "./dist/",

3
dist/npmts.paths.js vendored
View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = {};

View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = {
beautylog: require("beautylog"),
@ -12,7 +11,8 @@ var plugins = {
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript")
typescript: require("gulp-typescript"),
typings: require("gulp-typings")
},
merge2: require("merge2"),
projectinfo: require("projectinfo"),
@ -23,6 +23,6 @@ var plugins = {
smartcli: require("smartcli"),
smartenv: require("smartenv"),
smartfile: require("smartfile"),
typings: require("typings")
smartpath: require("smartpath")
};
module.exports = plugins;

View File

@ -1,8 +1,8 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var NpmtsConfigFile = require("./npmts.configfile");
var NpmtsOptions = require("./npmts.options");
var NpmtsInstall = require("./npmts.install");
var NpmtsCompile = require("./npmts.compile");
var NpmtsJsdoc = require("./npmts.jsdoc");
var NpmtsTests = require("./npmts.tests");
@ -10,6 +10,7 @@ exports.run = function () {
var promisechain;
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsInstall.run)
.then(NpmtsCompile.run)
.then(NpmtsJsdoc.run)
.then(NpmtsTests.run);

10
dist/npmts.tests.js vendored
View File

@ -1,5 +1,4 @@
#!/usr/bin/env node
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
@ -22,9 +21,13 @@ exports.run = function (configArg) {
var coveralls = function () {
plugins.beautylog.log("now uploading coverage data to coveralls");
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
.pipe(plugins.g.coveralls())
.pipe(plugins.g.gFunction(function () {
plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
}, "atEnd"));
return stream;
};
plugins.beautylog.log("now starting tests");
istanbul().on("finish", function () {
mocha().on("finish", function () {
if (plugins.smartenv.getEnv().isTravis && config.coveralls) {
@ -33,6 +36,7 @@ exports.run = function (configArg) {
});
}
else {
plugins.beautylog.ok("Tests have passed!");
done.resolve(config);
}
});

View File

@ -1,6 +1,6 @@
{
"name": "npmts",
"version": "3.2.1",
"version": "3.4.1",
"description": "write npm modules with TypeScript",
"main": "dist/index.js",
"bin": {
@ -31,25 +31,22 @@
"gulp-concat": "^2.6.0",
"gulp-coveralls": "^0.1.4",
"gulp-function": "^1.1.1",
"gulp-header": "^1.7.1",
"gulp-if": "^2.0.0",
"gulp-istanbul": "^0.10.3",
"gulp-jsdoc3": "^0.2.0",
"gulp-mocha": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-typescript": "2.11.0",
"gulp-typescript": "2.12.1",
"gulp-typings": "1.1.0",
"merge2": "1.0.1",
"projectinfo": "1.0.1",
"q": "^1.4.1",
"shelljs": "^0.6.0",
"smartcli": "0.0.11",
"smartenv": "1.1.0",
"smartenv": "1.2.0",
"smartfile": "0.0.11",
"source-map-support": "^0.4.0",
"typings": "^0.6.8"
"smartpath": "2.1.0",
"source-map-support": "^0.4.0"
},
"devDependencies": {
"gulp-header": "^1.7.1"
}
"devDependencies": {}
}

3
test/assets/custom.js Normal file
View File

@ -0,0 +1,3 @@
var hello = "hello";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLEtBQUssR0FBRyxPQUFPLENBQUMiLCJmaWxlIjoiY3VzdG9tLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGhlbGxvID0gXCJoZWxsb1wiOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

View File

@ -1,13 +1,16 @@
{
"mode":"default",
"mode":"custom",
"ts":{
"./customdir/*.ts":"./"
},
"typings":[
"./ts",
"./subts1/",
"./subts2/",
"./customdir"
"./ts/typings.json",
"./subts1/typings.json",
"./subts2/typings.json",
"./customdir/typings.json"
],
"coveralls":true
"coveralls":true,
"docs": {
"publish":true
}
}

View File

@ -5,7 +5,7 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/sometest/somerepo.git"
"url": "git+https://github.com/pushrocks/npmts.git"
},
"scripts": {
"test": "(npmts)"

3
test/assets/tsfile1.js Normal file
View File

@ -0,0 +1,3 @@
var something = "something";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRzZmlsZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBSSxTQUFTLEdBQUcsV0FBVyxDQUFDIiwiZmlsZSI6InRzZmlsZTEuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc29tZXRoaW5nID0gXCJzb21ldGhpbmdcIjsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

View File

@ -1 +0,0 @@
/// <reference path="./typings/main.d.ts" />

View File

@ -4,39 +4,13 @@ import paths = require("./npmts.paths");
export var run = function(configArg){
var done = plugins.Q.defer();
var config = configArg;
plugins.beautylog.log("now running custom tasks");
plugins.beautylog.log("now compiling " + "TypeScript".yellow);
var moduleStream = plugins.merge2({end: false});
/* -------------------------------------------------
* ----------- first install typings ---------------
* ----------- compile TypeScript --------------------------
* ----------------------------------------------- */
var typingsDone = plugins.Q.defer();
var typingsCounter:number = 0;
var typingsCounterAdvance = function(){
typingsCounter++;
if(typeof config.typings[typingsCounter] != "undefined"){
installTypings();
} else {
plugins.beautylog.success("custom typings installed successfully");
typingsDone.resolve();
}
};
var installTypings = function() {
plugins.beautylog.log("now installing " + "typings.json".yellow + " from " + config.typings[typingsCounter].blue);
plugins.typings.install({production: false, cwd: plugins.path.join(paths.cwd,config.typings[typingsCounter])})
.then(function(){
typingsCounterAdvance();
},function(){
plugins.beautylog.error("something went wrong: Check if path is correct: " + config.typings[typingsCounter].blue);
typingsCounterAdvance();
});
};
installTypings();
/* -------------------------------------------------
* ----------- second compile TS -------------------
* ----------------------------------------------- */
typingsDone.promise.then(function(){
for (var key in config.ts) {
plugins.beautylog.log("now compiling" + key.blue);
var outputPathIsDir:boolean;
try {
if(plugins.fs.statSync(plugins.path.join(paths.cwd,config.ts[key])).isDirectory()){
@ -81,12 +55,15 @@ export var run = function(configArg){
moduleStream.add(stream);
}
moduleStream.on("queueDrain",function(){
plugins.beautylog.success("custom TypeScript installed successfully");
plugins.beautylog.ok("TypeScript is compiled!");
moduleStream.on("finish",function(){
done.resolve(config);
});
moduleStream.end();
});
});
/*==================== END TYPESCRIPT =====================*/
return done.promise;
};

View File

@ -16,6 +16,7 @@ export var run = function(){
break;
default:
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
process.exit(1);
};
} else {
plugins.beautylog.log("no config file found: so mode is " + "default".yellow);

19
ts/npmts.install.ts Normal file
View File

@ -0,0 +1,19 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
export var run = function(configArg){
var config = configArg;
var done = plugins.Q.defer();
/* -------------------------------------------------
* ----------- install typings ---------------
* ----------------------------------------------- */
plugins.beautylog.log("now installing " + "typings".yellow);
let absoluteTypingsArray = plugins.smartpath.absolute(config.typings,paths.cwd);
plugins.gulp.src(absoluteTypingsArray)
.pipe(plugins.g.typings())
.pipe(plugins.g.gFunction(function(){
plugins.beautylog.ok("typings are installed!");
done.resolve(config);
},"atEnd"));
return done.promise;
};

View File

@ -2,7 +2,7 @@
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
var genJsdoc = function(){
var genJsdoc = function(configArg){
var done = plugins.Q.defer();
plugins.beautylog.log("now generating " + "JsDoc documentation".blue);
plugins.gulp.src([
@ -13,13 +13,15 @@ var genJsdoc = function(){
opts: {
destination: paths.docsDir
}
}, done.resolve));
}, function(){
plugins.beautylog.ok("JsDoc has been generated!");
done.resolve(configArg)
}));
return done.promise;
};
var publishDocs = function(){
var publishDocs = function(configArg){
var done = plugins.Q.defer();
try {
var gitUrl = plugins.projectinfo.npm(
paths.cwd,
{
@ -29,22 +31,17 @@ var publishDocs = function(){
var deployScript = ""
+ "cd " + paths.docsDir + " "
+ "&& git init "
+ "&& git config user.name \"TRAVIS CI\" "
+ "&& git config user.email \"travis@shipzone.io\" "
+ "&& git add . "
+ "&& git commit -m \"Deploy to GitHub Pages\" "
+ "&& 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";
}
catch (err){
console.log(err);
}
+ "master:gh-pages " + "> /dev/null 2>&1";
if(plugins.smartenv.getEnv().isTravis){
plugins.beautylog.log("now publishing docs to GitHub")
if(plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish){
plugins.beautylog.log("now publishing docs to GitHub");
if (!plugins.shelljs.which('git')) {
plugins.beautylog.error('Git is not installed');
plugins.shelljs.exit(1);
@ -52,17 +49,18 @@ var publishDocs = function(){
plugins.beautylog.error('Error: Git failed');
plugins.shelljs.exit(1);
}
done.resolve();
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
done.resolve(configArg);
} else {
done.resolve();
done.resolve(configArg);
}
return done.promise;
};
export var run = function(){
export var run = function(configArg){
var done = plugins.Q.defer();
genJsdoc()
genJsdoc(configArg)
.then(publishDocs)
.then(done.resolve);
return done.promise;

View File

@ -8,7 +8,7 @@ export var run = function(configArg){
}
if (config.mode == "default"){
config.typings = [
"./ts/"
"./ts/typings.json"
];
config.ts = {
["./ts/**/*.ts"]: "./dist/",

View File

@ -10,7 +10,8 @@ var plugins = {
jsdoc3: require("gulp-jsdoc3"),
mocha: require("gulp-mocha"),
sourcemaps: require("gulp-sourcemaps"),
typescript: require("gulp-typescript")
typescript: require("gulp-typescript"),
typings: require("gulp-typings")
},
merge2: require("merge2"),
@ -22,6 +23,6 @@ var plugins = {
smartcli: require("smartcli"),
smartenv: require("smartenv"),
smartfile: require("smartfile"),
typings: require("typings")
smartpath: require("smartpath")
};
export = plugins;

View File

@ -1,6 +1,7 @@
/// <reference path="./typings/main.d.ts" />
import NpmtsConfigFile = require("./npmts.configfile");
import NpmtsOptions = require("./npmts.options");
import NpmtsInstall = require("./npmts.install");
import NpmtsCompile = require("./npmts.compile");
import NpmtsJsdoc = require("./npmts.jsdoc");
import NpmtsTests = require("./npmts.tests");
@ -8,6 +9,7 @@ export var run = function(){
var promisechain;
NpmtsConfigFile.run()
.then(NpmtsOptions.run)
.then(NpmtsInstall.run)
.then(NpmtsCompile.run)
.then(NpmtsJsdoc.run)
.then(NpmtsTests.run);

View File

@ -26,10 +26,14 @@ export var run = function(configArg) {
var coveralls = function(){
plugins.beautylog.log("now uploading coverage data to coveralls");
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
.pipe(plugins.g.coveralls());
.pipe(plugins.g.coveralls())
.pipe(plugins.g.gFunction(function(){
plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
},"atEnd"));
return stream;
};
plugins.beautylog.log("now starting tests");
istanbul().on("finish",function(){
mocha().on("finish",function(){
if(plugins.smartenv.getEnv().isTravis && config.coveralls){
@ -37,6 +41,7 @@ export var run = function(configArg) {
done.resolve(config);
})
} else {
plugins.beautylog.ok("Tests have passed!");
done.resolve(config);
}
})