Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d98d035902 | |||
217af24d25 | |||
11c43f59d9 | |||
14c36dd894 | |||
9f74fab2b2 | |||
8efa67a4ff | |||
f7304f59a5 | |||
070385867e | |||
e429eb8ae0 |
8
.gitignore
vendored
8
.gitignore
vendored
@ -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/
|
||||
|
@ -2,5 +2,6 @@
|
||||
support
|
||||
compile
|
||||
test/
|
||||
docs/
|
||||
examples
|
||||
.gitignore
|
2
assets/cli.js
Normal file
2
assets/cli.js
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
var index = require("./index.js");
|
@ -4,7 +4,6 @@ var plugins = {
|
||||
gulp: require("gulp"),
|
||||
g:{
|
||||
typescript: require("gulp-typescript"),
|
||||
header: require("gulp-header"),
|
||||
typings:require("gulp-typings")
|
||||
},
|
||||
mergeStream: require("merge2"),
|
||||
@ -25,7 +24,7 @@ plugins.gulp.task("typings",function(){
|
||||
return stream;
|
||||
});
|
||||
|
||||
plugins.gulp.task("indexTS",["typings"], function() {
|
||||
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')
|
||||
@ -34,12 +33,16 @@ plugins.gulp.task("indexTS",["typings"], 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
3
dist/cli.js
vendored
@ -1,3 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var index = require("./index.js");
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -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
2
dist/npmts.cli.js
vendored
@ -1,3 +1 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
|
39
dist/npmts.compile.js
vendored
39
dist/npmts.compile.js
vendored
@ -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;
|
||||
};
|
||||
|
4
dist/npmts.configfile.js
vendored
4
dist/npmts.configfile.js
vendored
@ -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
20
dist/npmts.install.js
vendored
Normal 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;
|
||||
};
|
8
dist/npmts.jsdoc.js
vendored
8
dist/npmts.jsdoc.js
vendored
@ -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");
|
||||
@ -15,6 +14,7 @@ var genJsdoc = function (configArg) {
|
||||
destination: paths.docsDir
|
||||
}
|
||||
}, function () {
|
||||
plugins.beautylog.ok("JsDoc has been generated!");
|
||||
done.resolve(configArg);
|
||||
}));
|
||||
return done.promise;
|
||||
@ -34,7 +34,7 @@ var publishDocs = function (configArg) {
|
||||
+ "&& git push --force --quiet "
|
||||
+ "\"" + gitUrl + "\" "
|
||||
+ "master:gh-pages " + "> /dev/null 2>&1";
|
||||
if (plugins.smartenv.getEnv().isTravis) {
|
||||
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');
|
||||
@ -44,7 +44,7 @@ var publishDocs = function (configArg) {
|
||||
plugins.beautylog.error('Error: Git failed');
|
||||
plugins.shelljs.exit(1);
|
||||
}
|
||||
plugins.beautylog.success("Docs have been deployed to GitHub");
|
||||
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
|
||||
done.resolve(configArg);
|
||||
}
|
||||
else {
|
||||
|
5
dist/npmts.options.js
vendored
5
dist/npmts.options.js
vendored
@ -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
3
dist/npmts.paths.js
vendored
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./npmts.plugins");
|
||||
var paths = {};
|
||||
|
8
dist/npmts.plugins.js
vendored
8
dist/npmts.plugins.js
vendored
@ -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;
|
||||
|
5
dist/npmts.promisechain.js
vendored
5
dist/npmts.promisechain.js
vendored
@ -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
10
dist/npmts.tests.js
vendored
@ -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);
|
||||
}
|
||||
});
|
||||
|
15
package.json
15
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "npmts",
|
||||
"version": "3.3.0",
|
||||
"version": "3.4.1",
|
||||
"description": "write npm modules with TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
@ -36,20 +36,17 @@
|
||||
"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",
|
||||
"gulp-typings": "^1.1.0"
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
3
test/assets/custom.js
Normal file
3
test/assets/custom.js
Normal file
@ -0,0 +1,3 @@
|
||||
var hello = "hello";
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImN1c3RvbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLEtBQUssR0FBRyxPQUFPLENBQUMiLCJmaWxlIjoiY3VzdG9tLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGhlbGxvID0gXCJoZWxsb1wiOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
|
@ -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
|
||||
}
|
||||
}
|
3
test/assets/tsfile1.js
Normal file
3
test/assets/tsfile1.js
Normal file
@ -0,0 +1,3 @@
|
||||
var something = "something";
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRzZmlsZTEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBSSxTQUFTLEdBQUcsV0FBVyxDQUFDIiwiZmlsZSI6InRzZmlsZTEuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc29tZXRoaW5nID0gXCJzb21ldGhpbmdcIjsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
|
@ -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;
|
||||
};
|
||||
|
@ -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
19
ts/npmts.install.ts
Normal 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;
|
||||
};
|
@ -14,6 +14,7 @@ var genJsdoc = function(configArg){
|
||||
destination: paths.docsDir
|
||||
}
|
||||
}, function(){
|
||||
plugins.beautylog.ok("JsDoc has been generated!");
|
||||
done.resolve(configArg)
|
||||
}));
|
||||
return done.promise;
|
||||
@ -39,8 +40,8 @@ var publishDocs = function(configArg){
|
||||
+ "\"" + gitUrl + "\" "
|
||||
+ "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);
|
||||
@ -48,7 +49,7 @@ var publishDocs = function(configArg){
|
||||
plugins.beautylog.error('Error: Git failed');
|
||||
plugins.shelljs.exit(1);
|
||||
}
|
||||
plugins.beautylog.success("Docs have been deployed to GitHub");
|
||||
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
|
||||
done.resolve(configArg);
|
||||
} else {
|
||||
done.resolve(configArg);
|
||||
|
@ -8,7 +8,7 @@ export var run = function(configArg){
|
||||
}
|
||||
if (config.mode == "default"){
|
||||
config.typings = [
|
||||
"./ts/"
|
||||
"./ts/typings.json"
|
||||
];
|
||||
config.ts = {
|
||||
["./ts/**/*.ts"]: "./dist/",
|
||||
|
@ -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;
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user