Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
01e9f386a6 | |||
2f4fb28b5d | |||
50b14e60c6 | |||
4753a4ff82 | |||
fe9ea47208 | |||
c8f29dc146 | |||
e7e228c900 | |||
b76cb1376d | |||
eed1a65415 | |||
040100b73f | |||
3ce49c7e97 | |||
55d7018891 | |||
d98d035902 | |||
217af24d25 | |||
11c43f59d9 |
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -4,4 +4,9 @@ console.log("**** starting NPMTS ****");
|
|||||||
var plugins = require("./npmts.plugins");
|
var plugins = require("./npmts.plugins");
|
||||||
var promisechain = require("./npmts.promisechain");
|
var promisechain = require("./npmts.promisechain");
|
||||||
plugins.beautylog.figletSync("NPMTS");
|
plugins.beautylog.figletSync("NPMTS");
|
||||||
promisechain.run();
|
try {
|
||||||
|
promisechain.run();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
18
dist/npmts.assets.js
vendored
Normal file
18
dist/npmts.assets.js
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
"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 looking at required assets");
|
||||||
|
if (config.cli == true) {
|
||||||
|
plugins.smartfile.fsaction.copy(plugins.path.join(paths.npmtsAssetsDir, "cli.js"), paths.distDir);
|
||||||
|
plugins.beautylog.ok("CLI asset has been installed!");
|
||||||
|
done.resolve(config);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
done.resolve(config);
|
||||||
|
}
|
||||||
|
return done.promise;
|
||||||
|
};
|
13
dist/npmts.clean.js
vendored
Normal file
13
dist/npmts.clean.js
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
"use strict";
|
||||||
|
/// <reference path="./typings/main.d.ts" />
|
||||||
|
var plugins = require("./npmts.plugins");
|
||||||
|
var paths = require("./npmts.paths");
|
||||||
|
exports.run = function (configArg) {
|
||||||
|
plugins.beautylog.log("now cleaning up from previous builds");
|
||||||
|
var done = plugins.Q.defer();
|
||||||
|
plugins.smartfile.fsaction.remove(paths.distDir)
|
||||||
|
.then(function () {
|
||||||
|
done.resolve(configArg);
|
||||||
|
});
|
||||||
|
return done.promise;
|
||||||
|
};
|
2
dist/npmts.compile.js
vendored
2
dist/npmts.compile.js
vendored
@ -51,7 +51,7 @@ exports.run = function (configArg) {
|
|||||||
moduleStream.add(stream);
|
moduleStream.add(stream);
|
||||||
}
|
}
|
||||||
moduleStream.on("queueDrain", function () {
|
moduleStream.on("queueDrain", function () {
|
||||||
plugins.beautylog.ok("TypeScript is compiled!");
|
plugins.beautylog.ok("TypeScript has been compiled!");
|
||||||
moduleStream.on("finish", function () {
|
moduleStream.on("finish", function () {
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
});
|
});
|
||||||
|
2
dist/npmts.configfile.js
vendored
2
dist/npmts.configfile.js
vendored
@ -8,7 +8,7 @@ exports.run = function () {
|
|||||||
var configPath = plugins.path.join(paths.cwd, "npmts.json");
|
var configPath = plugins.path.join(paths.cwd, "npmts.json");
|
||||||
if (plugins.smartfile.checks.fileExistsSync(configPath)) {
|
if (plugins.smartfile.checks.fileExistsSync(configPath)) {
|
||||||
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
||||||
config = plugins.smartfile.readFileToObject(configPath);
|
config = plugins.smartfile.local.toObjectSync(configPath);
|
||||||
switch (config.mode) {
|
switch (config.mode) {
|
||||||
case "default":
|
case "default":
|
||||||
case "custom":
|
case "custom":
|
||||||
|
6
dist/npmts.install.js
vendored
6
dist/npmts.install.js
vendored
@ -1,5 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var plugins = require("./npmts.plugins");
|
var plugins = require("./npmts.plugins");
|
||||||
var paths = require("./npmts.paths");
|
var paths = require("./npmts.paths");
|
||||||
exports.run = function (configArg) {
|
exports.run = function (configArg) {
|
||||||
@ -9,11 +9,11 @@ exports.run = function (configArg) {
|
|||||||
* ----------- install typings ---------------
|
* ----------- install typings ---------------
|
||||||
* ----------------------------------------------- */
|
* ----------------------------------------------- */
|
||||||
plugins.beautylog.log("now installing " + "typings".yellow);
|
plugins.beautylog.log("now installing " + "typings".yellow);
|
||||||
var absoluteTypingsArray = plugins.smartpath.absolute(config.typings, paths.cwd);
|
var absoluteTypingsArray = plugins.smartpath.transform.toAbsolute(config.typings, paths.cwd);
|
||||||
plugins.gulp.src(absoluteTypingsArray)
|
plugins.gulp.src(absoluteTypingsArray)
|
||||||
.pipe(plugins.g.typings())
|
.pipe(plugins.g.typings())
|
||||||
.pipe(plugins.g.gFunction(function () {
|
.pipe(plugins.g.gFunction(function () {
|
||||||
plugins.beautylog.ok("typings are installed!");
|
plugins.beautylog.ok("typings have been installed!");
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
}, "atEnd"));
|
}, "atEnd"));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
12
dist/npmts.jsdoc.js
vendored
12
dist/npmts.jsdoc.js
vendored
@ -14,7 +14,7 @@ var genJsdoc = function (configArg) {
|
|||||||
destination: paths.docsDir
|
destination: paths.docsDir
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
plugins.beautylog.ok("JsDoc has been generated!");
|
plugins.beautylog.ok("JsDoc documentation has been generated!");
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
}));
|
}));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
@ -34,17 +34,17 @@ var publishDocs = function (configArg) {
|
|||||||
+ "&& git push --force --quiet "
|
+ "&& git push --force --quiet "
|
||||||
+ "\"" + gitUrl + "\" "
|
+ "\"" + gitUrl + "\" "
|
||||||
+ "master:gh-pages " + "> /dev/null 2>&1";
|
+ "master:gh-pages " + "> /dev/null 2>&1";
|
||||||
if (plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish) {
|
if (configArg.docs.publish) {
|
||||||
plugins.beautylog.log("now publishing docs to GitHub");
|
plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
|
||||||
if (!plugins.shelljs.which('git')) {
|
if (!plugins.shelljs.which('git')) {
|
||||||
plugins.beautylog.error('Git is not installed');
|
plugins.beautylog.error('Git is not installed!');
|
||||||
plugins.shelljs.exit(1);
|
plugins.shelljs.exit(1);
|
||||||
}
|
}
|
||||||
else if (plugins.shelljs.exec(deployScript).code !== 0) {
|
else if (plugins.shelljs.exec(deployScript).code !== 0) {
|
||||||
plugins.beautylog.error('Error: Git failed');
|
plugins.beautylog.error('Git failed!');
|
||||||
plugins.shelljs.exit(1);
|
plugins.shelljs.exit(1);
|
||||||
}
|
}
|
||||||
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
|
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
28
dist/npmts.options.js
vendored
28
dist/npmts.options.js
vendored
@ -1,12 +1,19 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var plugins = require("./npmts.plugins");
|
var plugins = require("./npmts.plugins");
|
||||||
|
exports.isRelease = function () {
|
||||||
|
return plugins.smartci.check.isCi()
|
||||||
|
&& plugins.smartci.check.isTaggedCommit();
|
||||||
|
};
|
||||||
|
exports.doPublish = function () {
|
||||||
|
return exports.isRelease()
|
||||||
|
&& plugins.smartci.get.subJobNumber() != 1;
|
||||||
|
};
|
||||||
exports.run = function (configArg) {
|
exports.run = function (configArg) {
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var config = configArg;
|
var config = configArg;
|
||||||
if (typeof config.coveralls === "undefined") {
|
plugins.beautylog.log("now determining build options");
|
||||||
config.coveralls = false;
|
//handle default mode
|
||||||
}
|
|
||||||
if (config.mode == "default") {
|
if (config.mode == "default") {
|
||||||
config.typings = [
|
config.typings = [
|
||||||
"./ts/typings.json"
|
"./ts/typings.json"
|
||||||
@ -17,11 +24,18 @@ exports.run = function (configArg) {
|
|||||||
_a
|
_a
|
||||||
);
|
);
|
||||||
config.test = ["./index.js"];
|
config.test = ["./index.js"];
|
||||||
done.resolve(config);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
done.resolve(config);
|
|
||||||
}
|
}
|
||||||
|
// handle state of current build
|
||||||
|
exports.isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
||||||
|
: plugins.beautylog.info("NOT A RELEASE build! We are not publishing anything!");
|
||||||
|
// handle coveralls
|
||||||
|
config.coveralls ? void (0) : config.coveralls = false;
|
||||||
|
exports.doPublish() ? void (0) : config.coveralls = false;
|
||||||
|
// handle docs
|
||||||
|
config.docs ? void (0) : config.docs = {};
|
||||||
|
config.docs.publish ? void (0) : config.docs.publish = false;
|
||||||
|
exports.doPublish() ? void (0) : config.docs.publish = false;
|
||||||
|
done.resolve(config);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
var _a;
|
var _a;
|
||||||
};
|
};
|
||||||
|
1
dist/npmts.paths.js
vendored
1
dist/npmts.paths.js
vendored
@ -8,6 +8,7 @@ paths.tsDir = plugins.path.join(paths.cwd, "ts/");
|
|||||||
paths.distDir = plugins.path.join(paths.cwd, "dist/");
|
paths.distDir = plugins.path.join(paths.cwd, "dist/");
|
||||||
paths.docsDir = plugins.path.join(paths.cwd, "docs/");
|
paths.docsDir = plugins.path.join(paths.cwd, "docs/");
|
||||||
paths.testDir = plugins.path.join(paths.cwd, "test/");
|
paths.testDir = plugins.path.join(paths.cwd, "test/");
|
||||||
|
paths.npmtsAssetsDir = plugins.path.join(__dirname, "../assets/");
|
||||||
//Files
|
//Files
|
||||||
paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
|
paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts");
|
||||||
paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
|
paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts");
|
||||||
|
48
dist/npmts.plugins.js
vendored
48
dist/npmts.plugins.js
vendored
@ -1,28 +1,26 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var plugins = {
|
exports.beautylog = require("beautylog");
|
||||||
beautylog: require("beautylog"),
|
exports.fs = require("fs-extra");
|
||||||
fs: require("fs-extra"),
|
exports.gulp = require("gulp");
|
||||||
gulp: require("gulp"),
|
exports.g = {
|
||||||
g: {
|
coveralls: require("gulp-coveralls"),
|
||||||
coveralls: require("gulp-coveralls"),
|
gFunction: require("gulp-function"),
|
||||||
gFunction: require("gulp-function"),
|
istanbul: require("gulp-istanbul"),
|
||||||
istanbul: require("gulp-istanbul"),
|
jsdoc3: require("gulp-jsdoc3"),
|
||||||
jsdoc3: require("gulp-jsdoc3"),
|
mocha: require("gulp-mocha"),
|
||||||
mocha: require("gulp-mocha"),
|
sourcemaps: require("gulp-sourcemaps"),
|
||||||
sourcemaps: require("gulp-sourcemaps"),
|
typescript: require("gulp-typescript"),
|
||||||
typescript: require("gulp-typescript"),
|
typings: require("gulp-typings")
|
||||||
typings: require("gulp-typings")
|
|
||||||
},
|
|
||||||
merge2: require("merge2"),
|
|
||||||
projectinfo: require("projectinfo"),
|
|
||||||
sourceMapSupport: require("source-map-support").install(),
|
|
||||||
path: require("path"),
|
|
||||||
Q: require("q"),
|
|
||||||
shelljs: require("shelljs"),
|
|
||||||
smartcli: require("smartcli"),
|
|
||||||
smartenv: require("smartenv"),
|
|
||||||
smartfile: require("smartfile"),
|
|
||||||
smartpath: require("smartpath")
|
|
||||||
};
|
};
|
||||||
module.exports = plugins;
|
exports.merge2 = require("merge2");
|
||||||
|
exports.projectinfo = require("projectinfo");
|
||||||
|
exports.sourceMapSupport = require("source-map-support").install();
|
||||||
|
exports.path = require("path");
|
||||||
|
exports.Q = require("q");
|
||||||
|
exports.shelljs = require("shelljs");
|
||||||
|
exports.smartci = require("smartci");
|
||||||
|
exports.smartcli = require("smartcli");
|
||||||
|
exports.smartenv = require("smartenv");
|
||||||
|
exports.smartfile = require("smartfile");
|
||||||
|
exports.smartpath = require("smartpath");
|
||||||
|
33
dist/npmts.promisechain.js
vendored
33
dist/npmts.promisechain.js
vendored
@ -1,18 +1,43 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var NpmtsConfigFile = require("./npmts.configfile");
|
var plugins = require("./npmts.plugins");
|
||||||
var NpmtsOptions = require("./npmts.options");
|
var NpmtsAssets = require("./npmts.assets");
|
||||||
var NpmtsInstall = require("./npmts.install");
|
var NpmtsClean = require("./npmts.clean");
|
||||||
var NpmtsCompile = require("./npmts.compile");
|
var NpmtsCompile = require("./npmts.compile");
|
||||||
|
var NpmtsConfigFile = require("./npmts.configfile");
|
||||||
|
var NpmtsInstall = require("./npmts.install");
|
||||||
var NpmtsJsdoc = require("./npmts.jsdoc");
|
var NpmtsJsdoc = require("./npmts.jsdoc");
|
||||||
|
var NpmtsOptions = require("./npmts.options");
|
||||||
var NpmtsTests = require("./npmts.tests");
|
var NpmtsTests = require("./npmts.tests");
|
||||||
exports.run = function () {
|
exports.run = function () {
|
||||||
var promisechain;
|
var promisechain;
|
||||||
NpmtsConfigFile.run()
|
NpmtsConfigFile.run()
|
||||||
.then(NpmtsOptions.run)
|
.then(NpmtsOptions.run)
|
||||||
|
.then(NpmtsClean.run)
|
||||||
.then(NpmtsInstall.run)
|
.then(NpmtsInstall.run)
|
||||||
.then(NpmtsCompile.run)
|
.then(NpmtsCompile.run)
|
||||||
|
.then(NpmtsAssets.run)
|
||||||
.then(NpmtsJsdoc.run)
|
.then(NpmtsJsdoc.run)
|
||||||
.then(NpmtsTests.run);
|
.then(NpmtsTests.run)
|
||||||
|
.then(function (configArg) {
|
||||||
|
var shipString = "" +
|
||||||
|
"\n" +
|
||||||
|
"\n" +
|
||||||
|
" # # ( )\n" +
|
||||||
|
" ___#_#___|__\n" +
|
||||||
|
" _ |____________| _\n" +
|
||||||
|
" _=====| | | | | |==== _\n" +
|
||||||
|
" =====| |.---------------------------. | |====\n" +
|
||||||
|
" <--------------------' . . . . . . . . '--------------/\n" +
|
||||||
|
" \\ /\n" +
|
||||||
|
" \\___________________________________________________________/\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n";
|
||||||
|
if (process.env.CI) {
|
||||||
|
console.log(shipString);
|
||||||
|
plugins.beautylog.success("READY TO SHIP!");
|
||||||
|
}
|
||||||
|
});
|
||||||
return promisechain;
|
return promisechain;
|
||||||
};
|
};
|
||||||
|
2
dist/npmts.tests.js
vendored
2
dist/npmts.tests.js
vendored
@ -23,7 +23,7 @@ exports.run = function (configArg) {
|
|||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "./coverage/lcov.info")])
|
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 () {
|
.pipe(plugins.g.gFunction(function () {
|
||||||
plugins.beautylog.ok("coverage data has beend uploaded Coveralls!");
|
plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
|
||||||
}, "atEnd"));
|
}, "atEnd"));
|
||||||
return stream;
|
return stream;
|
||||||
};
|
};
|
||||||
|
17
package.json
17
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "npmts",
|
"name": "npmts",
|
||||||
"version": "3.4.0",
|
"version": "3.6.2",
|
||||||
"description": "write npm modules with TypeScript",
|
"description": "write npm modules with TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -26,29 +26,28 @@
|
|||||||
"homepage": "https://github.com/pushrocks/npmts#readme",
|
"homepage": "https://github.com/pushrocks/npmts#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautylog": "3.1.2",
|
"beautylog": "3.1.2",
|
||||||
"fs-extra": "^0.26.5",
|
"fs-extra": "^0.26.7",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-concat": "^2.6.0",
|
"gulp-concat": "^2.6.0",
|
||||||
"gulp-coveralls": "^0.1.4",
|
"gulp-coveralls": "^0.1.4",
|
||||||
"gulp-function": "^1.1.1",
|
"gulp-function": "^1.1.1",
|
||||||
"gulp-if": "^2.0.0",
|
"gulp-if": "^2.0.0",
|
||||||
"gulp-istanbul": "^0.10.3",
|
"gulp-istanbul": "^0.10.3",
|
||||||
"gulp-jsdoc3": "^0.2.0",
|
"gulp-jsdoc3": "^0.2.1",
|
||||||
"gulp-mocha": "^2.2.0",
|
"gulp-mocha": "^2.2.0",
|
||||||
"gulp-sourcemaps": "^1.6.0",
|
"gulp-sourcemaps": "^1.6.0",
|
||||||
"gulp-typescript": "2.12.1",
|
"gulp-typescript": "2.12.1",
|
||||||
"gulp-typings": "1.1.0",
|
"gulp-typings": "1.3.0",
|
||||||
"merge2": "1.0.1",
|
"merge2": "1.0.1",
|
||||||
"projectinfo": "1.0.1",
|
"projectinfo": "1.0.1",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"shelljs": "^0.6.0",
|
"shelljs": "^0.6.0",
|
||||||
|
"smartci": "0.0.1",
|
||||||
"smartcli": "0.0.11",
|
"smartcli": "0.0.11",
|
||||||
"smartenv": "1.2.0",
|
"smartenv": "1.2.0",
|
||||||
"smartfile": "0.0.11",
|
"smartfile": "2.2.0",
|
||||||
"smartpath": "2.1.0",
|
"smartpath": "3.0.1",
|
||||||
"source-map-support": "^0.4.0"
|
"source-map-support": "^0.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {}
|
||||||
"gulp-typings": "^1.1.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"mode":"custom",
|
"mode":"default",
|
||||||
"ts":{
|
"ts":{
|
||||||
"./customdir/*.ts":"./"
|
"./customdir/*.ts":"./"
|
||||||
},
|
},
|
||||||
@ -12,5 +12,6 @@
|
|||||||
"coveralls":true,
|
"coveralls":true,
|
||||||
"docs": {
|
"docs": {
|
||||||
"publish":true
|
"publish":true
|
||||||
}
|
},
|
||||||
|
"cli":true
|
||||||
}
|
}
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"ambientDependencies": {
|
"ambientDependencies": {
|
||||||
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",
|
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts",
|
||||||
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
"mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts",
|
||||||
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d",
|
"colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts",
|
||||||
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777"
|
"vinyl": "github:DefinitelyTyped/DefinitelyTyped/vinyl/vinyl.d.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,4 +3,11 @@ console.log("**** starting NPMTS ****");
|
|||||||
import plugins = require("./npmts.plugins");
|
import plugins = require("./npmts.plugins");
|
||||||
import promisechain = require("./npmts.promisechain");
|
import promisechain = require("./npmts.promisechain");
|
||||||
plugins.beautylog.figletSync("NPMTS");
|
plugins.beautylog.figletSync("NPMTS");
|
||||||
promisechain.run();
|
|
||||||
|
try {
|
||||||
|
promisechain.run();
|
||||||
|
}
|
||||||
|
catch(err){
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
17
ts/npmts.assets.ts
Normal file
17
ts/npmts.assets.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/// <reference path="./typings/main.d.ts" />
|
||||||
|
import plugins = require("./npmts.plugins");
|
||||||
|
import paths = require("./npmts.paths");
|
||||||
|
|
||||||
|
export var run = function(configArg){
|
||||||
|
let done = plugins.Q.defer();
|
||||||
|
let config = configArg;
|
||||||
|
plugins.beautylog.log("now looking at required assets");
|
||||||
|
if(config.cli == true){
|
||||||
|
plugins.smartfile.fsaction.copy(plugins.path.join(paths.npmtsAssetsDir,"cli.js"),paths.distDir);
|
||||||
|
plugins.beautylog.ok("CLI asset has been installed!");
|
||||||
|
done.resolve(config);
|
||||||
|
} else {
|
||||||
|
done.resolve(config);
|
||||||
|
}
|
||||||
|
return done.promise;
|
||||||
|
};
|
13
ts/npmts.clean.ts
Normal file
13
ts/npmts.clean.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/// <reference path="./typings/main.d.ts" />
|
||||||
|
import plugins = require("./npmts.plugins");
|
||||||
|
import paths = require("./npmts.paths");
|
||||||
|
|
||||||
|
export let run = function(configArg){
|
||||||
|
plugins.beautylog.log("now cleaning up from previous builds");
|
||||||
|
let done = plugins.Q.defer();
|
||||||
|
plugins.smartfile.fsaction.remove(paths.distDir)
|
||||||
|
.then(function(){
|
||||||
|
done.resolve(configArg);
|
||||||
|
});
|
||||||
|
return done.promise;
|
||||||
|
};
|
@ -55,7 +55,7 @@ export var run = function(configArg){
|
|||||||
moduleStream.add(stream);
|
moduleStream.add(stream);
|
||||||
}
|
}
|
||||||
moduleStream.on("queueDrain",function(){
|
moduleStream.on("queueDrain",function(){
|
||||||
plugins.beautylog.ok("TypeScript is compiled!");
|
plugins.beautylog.ok("TypeScript has been compiled!");
|
||||||
moduleStream.on("finish",function(){
|
moduleStream.on("finish",function(){
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,7 @@ export var run = function(){
|
|||||||
var configPath = plugins.path.join(paths.cwd,"npmts.json");
|
var configPath = plugins.path.join(paths.cwd,"npmts.json");
|
||||||
if(plugins.smartfile.checks.fileExistsSync(configPath)){
|
if(plugins.smartfile.checks.fileExistsSync(configPath)){
|
||||||
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
plugins.beautylog.info("npmts.json".blue + " config file found!");
|
||||||
config = plugins.smartfile.readFileToObject(configPath);
|
config = plugins.smartfile.local.toObjectSync(configPath);
|
||||||
switch (config.mode){
|
switch (config.mode){
|
||||||
case "default":
|
case "default":
|
||||||
case "custom":
|
case "custom":
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
import plugins = require("./npmts.plugins");
|
import plugins = require("./npmts.plugins");
|
||||||
import paths = require("./npmts.paths");
|
import paths = require("./npmts.paths");
|
||||||
export var run = function(configArg){
|
export var run = function(configArg){
|
||||||
@ -8,11 +8,11 @@ export var run = function(configArg){
|
|||||||
* ----------- install typings ---------------
|
* ----------- install typings ---------------
|
||||||
* ----------------------------------------------- */
|
* ----------------------------------------------- */
|
||||||
plugins.beautylog.log("now installing " + "typings".yellow);
|
plugins.beautylog.log("now installing " + "typings".yellow);
|
||||||
let absoluteTypingsArray = plugins.smartpath.absolute(config.typings,paths.cwd);
|
var absoluteTypingsArray = plugins.smartpath.transform.toAbsolute(config.typings,paths.cwd);
|
||||||
plugins.gulp.src(absoluteTypingsArray)
|
plugins.gulp.src(absoluteTypingsArray)
|
||||||
.pipe(plugins.g.typings())
|
.pipe(plugins.g.typings())
|
||||||
.pipe(plugins.g.gFunction(function(){
|
.pipe(plugins.g.gFunction(function(){
|
||||||
plugins.beautylog.ok("typings are installed!");
|
plugins.beautylog.ok("typings have been installed!");
|
||||||
done.resolve(config);
|
done.resolve(config);
|
||||||
},"atEnd"));
|
},"atEnd"));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
@ -14,7 +14,7 @@ var genJsdoc = function(configArg){
|
|||||||
destination: paths.docsDir
|
destination: paths.docsDir
|
||||||
}
|
}
|
||||||
}, function(){
|
}, function(){
|
||||||
plugins.beautylog.ok("JsDoc has been generated!");
|
plugins.beautylog.ok("JsDoc documentation has been generated!");
|
||||||
done.resolve(configArg)
|
done.resolve(configArg)
|
||||||
}));
|
}));
|
||||||
return done.promise;
|
return done.promise;
|
||||||
@ -40,16 +40,16 @@ var publishDocs = function(configArg){
|
|||||||
+ "\"" + gitUrl + "\" "
|
+ "\"" + gitUrl + "\" "
|
||||||
+ "master:gh-pages " + "> /dev/null 2>&1";
|
+ "master:gh-pages " + "> /dev/null 2>&1";
|
||||||
|
|
||||||
if(plugins.smartenv.getEnv().isTravis && configArg.docs && configArg.docs.publish){
|
if(configArg.docs.publish){
|
||||||
plugins.beautylog.log("now publishing docs to GitHub");
|
plugins.beautylog.log("now publishing JsDoc documentation to GitHub");
|
||||||
if (!plugins.shelljs.which('git')) {
|
if (!plugins.shelljs.which('git')) {
|
||||||
plugins.beautylog.error('Git is not installed');
|
plugins.beautylog.error('Git is not installed!');
|
||||||
plugins.shelljs.exit(1);
|
plugins.shelljs.exit(1);
|
||||||
} else if (plugins.shelljs.exec(deployScript).code !== 0) {
|
} else if (plugins.shelljs.exec(deployScript).code !== 0) {
|
||||||
plugins.beautylog.error('Error: Git failed');
|
plugins.beautylog.error('Git failed!');
|
||||||
plugins.shelljs.exit(1);
|
plugins.shelljs.exit(1);
|
||||||
}
|
}
|
||||||
plugins.beautylog.ok("JsDoc has been deployed to GitHub!");
|
plugins.beautylog.ok("JsDoc documentation has been deployed to GitHub!");
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
} else {
|
} else {
|
||||||
done.resolve(configArg);
|
done.resolve(configArg);
|
||||||
|
@ -1,11 +1,23 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
import plugins = require("./npmts.plugins");
|
import plugins = require("./npmts.plugins");
|
||||||
|
|
||||||
|
export let isRelease = function():boolean {
|
||||||
|
return plugins.smartci.check.isCi()
|
||||||
|
&& plugins.smartci.check.isTaggedCommit();
|
||||||
|
};
|
||||||
|
|
||||||
|
export let doPublish = function():boolean {
|
||||||
|
return isRelease()
|
||||||
|
&& plugins.smartci.get.subJobNumber() != 1;
|
||||||
|
};
|
||||||
|
|
||||||
export var run = function(configArg){
|
export var run = function(configArg){
|
||||||
var done = plugins.Q.defer();
|
var done = plugins.Q.defer();
|
||||||
var config = configArg;
|
var config = configArg;
|
||||||
if (typeof config.coveralls === "undefined"){
|
|
||||||
config.coveralls = false;
|
plugins.beautylog.log("now determining build options");
|
||||||
}
|
|
||||||
|
//handle default mode
|
||||||
if (config.mode == "default"){
|
if (config.mode == "default"){
|
||||||
config.typings = [
|
config.typings = [
|
||||||
"./ts/typings.json"
|
"./ts/typings.json"
|
||||||
@ -15,9 +27,22 @@ export var run = function(configArg){
|
|||||||
["./test/test.ts"]: "./test/"
|
["./test/test.ts"]: "./test/"
|
||||||
};
|
};
|
||||||
config.test = ["./index.js"];
|
config.test = ["./index.js"];
|
||||||
done.resolve(config);
|
|
||||||
} else {
|
|
||||||
done.resolve(config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle state of current build
|
||||||
|
|
||||||
|
isRelease() ? plugins.beautylog.info("All right: This is a RELEASE build!")
|
||||||
|
: plugins.beautylog.info("NOT A RELEASE build! We are not publishing anything!");
|
||||||
|
|
||||||
|
// handle coveralls
|
||||||
|
config.coveralls ? void(0) : config.coveralls = false;
|
||||||
|
doPublish() ? void(0) : config.coveralls = false;
|
||||||
|
|
||||||
|
// handle docs
|
||||||
|
config.docs ? void(0) : config.docs = {};
|
||||||
|
config.docs.publish ? void(0) : config.docs.publish = false;
|
||||||
|
doPublish() ? void(0) : config.docs.publish = false;
|
||||||
|
|
||||||
|
done.resolve(config);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
@ -9,6 +9,8 @@ paths.distDir = plugins.path.join(paths.cwd,"dist/");
|
|||||||
paths.docsDir = plugins.path.join(paths.cwd,"docs/");
|
paths.docsDir = plugins.path.join(paths.cwd,"docs/");
|
||||||
paths.testDir = plugins.path.join(paths.cwd,"test/");
|
paths.testDir = plugins.path.join(paths.cwd,"test/");
|
||||||
|
|
||||||
|
paths.npmtsAssetsDir = plugins.path.join(__dirname,"../assets/");
|
||||||
|
|
||||||
//Files
|
//Files
|
||||||
paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
|
paths.indexTS = plugins.path.join(paths.cwd,"ts/index.ts");
|
||||||
paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");
|
paths.testTS = plugins.path.join(paths.cwd,"ts/test.ts");
|
||||||
|
@ -1,28 +1,26 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
var plugins = {
|
export let beautylog = require("beautylog");
|
||||||
beautylog: require("beautylog"),
|
export let fs = require("fs-extra");
|
||||||
fs: require("fs-extra"),
|
export let gulp = require("gulp");
|
||||||
gulp: require("gulp"),
|
export let g = {
|
||||||
g: {
|
coveralls: require("gulp-coveralls"),
|
||||||
coveralls: require("gulp-coveralls"),
|
gFunction: require("gulp-function"),
|
||||||
gFunction: require("gulp-function"),
|
istanbul: require("gulp-istanbul"),
|
||||||
istanbul: require("gulp-istanbul"),
|
jsdoc3: require("gulp-jsdoc3"),
|
||||||
jsdoc3: require("gulp-jsdoc3"),
|
mocha: require("gulp-mocha"),
|
||||||
mocha: require("gulp-mocha"),
|
sourcemaps: require("gulp-sourcemaps"),
|
||||||
sourcemaps: require("gulp-sourcemaps"),
|
typescript: require("gulp-typescript"),
|
||||||
typescript: require("gulp-typescript"),
|
typings: require("gulp-typings")
|
||||||
typings: require("gulp-typings")
|
|
||||||
|
|
||||||
},
|
|
||||||
merge2: require("merge2"),
|
|
||||||
projectinfo: require("projectinfo"),
|
|
||||||
sourceMapSupport:require("source-map-support").install(),
|
|
||||||
path: require("path"),
|
|
||||||
Q:require("q"),
|
|
||||||
shelljs: require("shelljs"),
|
|
||||||
smartcli: require("smartcli"),
|
|
||||||
smartenv: require("smartenv"),
|
|
||||||
smartfile: require("smartfile"),
|
|
||||||
smartpath: require("smartpath")
|
|
||||||
};
|
};
|
||||||
export = plugins;
|
export let merge2 = require("merge2");
|
||||||
|
export let projectinfo = require("projectinfo");
|
||||||
|
export let sourceMapSupport = require("source-map-support").install();
|
||||||
|
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 smartenv = require("smartenv");
|
||||||
|
export let smartfile = require("smartfile");
|
||||||
|
export let smartpath = require("smartpath");
|
@ -1,17 +1,45 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
/// <reference path="./typings/main.d.ts" />
|
||||||
import NpmtsConfigFile = require("./npmts.configfile");
|
import plugins = require("./npmts.plugins");
|
||||||
import NpmtsOptions = require("./npmts.options");
|
|
||||||
import NpmtsInstall = require("./npmts.install");
|
import NpmtsAssets = require("./npmts.assets");
|
||||||
|
import NpmtsClean = require("./npmts.clean");
|
||||||
import NpmtsCompile = require("./npmts.compile");
|
import NpmtsCompile = require("./npmts.compile");
|
||||||
|
import NpmtsConfigFile = require("./npmts.configfile");
|
||||||
|
import NpmtsInstall = require("./npmts.install");
|
||||||
import NpmtsJsdoc = require("./npmts.jsdoc");
|
import NpmtsJsdoc = require("./npmts.jsdoc");
|
||||||
|
import NpmtsOptions = require("./npmts.options");
|
||||||
import NpmtsTests = require("./npmts.tests");
|
import NpmtsTests = require("./npmts.tests");
|
||||||
|
|
||||||
export var run = function(){
|
export var run = function(){
|
||||||
var promisechain;
|
var promisechain;
|
||||||
NpmtsConfigFile.run()
|
NpmtsConfigFile.run()
|
||||||
.then(NpmtsOptions.run)
|
.then(NpmtsOptions.run)
|
||||||
|
.then(NpmtsClean.run)
|
||||||
.then(NpmtsInstall.run)
|
.then(NpmtsInstall.run)
|
||||||
.then(NpmtsCompile.run)
|
.then(NpmtsCompile.run)
|
||||||
|
.then(NpmtsAssets.run)
|
||||||
.then(NpmtsJsdoc.run)
|
.then(NpmtsJsdoc.run)
|
||||||
.then(NpmtsTests.run);
|
.then(NpmtsTests.run)
|
||||||
|
.then(function(configArg){
|
||||||
|
let shipString = "" +
|
||||||
|
"\n" +
|
||||||
|
"\n" +
|
||||||
|
" # # ( )\n" +
|
||||||
|
" ___#_#___|__\n" +
|
||||||
|
" _ |____________| _\n" +
|
||||||
|
" _=====| | | | | |==== _\n" +
|
||||||
|
" =====| |.---------------------------. | |====\n" +
|
||||||
|
" <--------------------' . . . . . . . . '--------------/\n" +
|
||||||
|
" \\ /\n" +
|
||||||
|
" \\___________________________________________________________/\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n" +
|
||||||
|
" wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww\n"
|
||||||
|
if (process.env.CI){
|
||||||
|
console.log(shipString);
|
||||||
|
plugins.beautylog.success("READY TO SHIP!");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
return promisechain;
|
return promisechain;
|
||||||
};
|
};
|
@ -28,7 +28,7 @@ export var run = function(configArg) {
|
|||||||
var stream = plugins.gulp.src([plugins.path.join(paths.cwd,"./coverage/lcov.info")])
|
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(){
|
.pipe(plugins.g.gFunction(function(){
|
||||||
plugins.beautylog.ok("coverage data has beend uploaded Coveralls!");
|
plugins.beautylog.ok("Tests have passed and coverage data has been uploaded to Coveralls!");
|
||||||
},"atEnd"));
|
},"atEnd"));
|
||||||
return stream;
|
return stream;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user