diff --git a/.gitignore b/.gitignore index 49763fd..18dd06b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ test/**/typings/ test/**/coverage/ ts/*.js ts/*.js.map +ts/typings/ .DS_Store \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 7f05d1a..3cfd876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "4.2.4" + - "4.2.6" deploy: provider: npm email: npm@lossless.digital diff --git a/dist/npmts.compile.js b/dist/npmts.compile.js index c4ef9fc..5f076cc 100644 --- a/dist/npmts.compile.js +++ b/dist/npmts.compile.js @@ -4,14 +4,14 @@ var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); exports.run = function (configArg) { - var done = plugins.q.defer(); + var done = plugins.Q.defer(); var config = configArg; plugins.beautylog.log("now running custom tasks"); - var moduleStream = plugins.mergeStream({ end: false }); + var moduleStream = plugins.merge2({ end: false }); /* ------------------------------------------------- * ----------- first install typings --------------- * ----------------------------------------------- */ - var typingsDone = plugins.q.defer(); + var typingsDone = plugins.Q.defer(); var typingsCounter = 0; var typingsCounterAdvance = function () { typingsCounter++; diff --git a/dist/npmts.configfile.js b/dist/npmts.configfile.js index 18844f0..4909f76 100644 --- a/dist/npmts.configfile.js +++ b/dist/npmts.configfile.js @@ -4,7 +4,7 @@ var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); exports.run = function () { - var done = plugins.q.defer(); + var done = plugins.Q.defer(); var config = {}; var configPath = plugins.path.join(paths.cwd, "npmts.json"); if (plugins.smartfile.checks.fileExistsSync(configPath)) { diff --git a/dist/npmts.jsdoc.js b/dist/npmts.jsdoc.js new file mode 100644 index 0000000..631f1cf --- /dev/null +++ b/dist/npmts.jsdoc.js @@ -0,0 +1,48 @@ +#!/usr/bin/env node + +/// +var plugins = require("./npmts.plugins"); +var paths = require("./npmts.paths"); +var genJsdoc = function () { + var done = plugins.Q.defer(); + plugins.beautylog.log("now generating " + "JsDoc documentation".blue); + plugins.gulp.src([ + plugins.path.join(paths.cwd, "README.md"), + plugins.path.join(paths.distDir, "**/*.js") + ]) + .pipe(plugins.g.jsdoc3({ + opts: { + destination: paths.docsDir + } + }, done.resolve)); + return done.promise; +}; +var publishDocs = function () { + var done = plugins.Q.defer(); + var deployScript = "" + + "cd " + paths.docsDir + " " + + "&& mkdir hello"; + if (true || plugins.smartenv.getEnv().isTravis) { + plugins.beautylog.log("now publishing docs 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('Error: Git commit failed'); + plugins.shelljs.exit(1); + } + done.resolve(); + } + else { + done.resolve(); + } + return done.promise; +}; +exports.run = function () { + var done = plugins.Q.defer(); + genJsdoc() + .then(publishDocs) + .then(done.resolve); + return done.promise; +}; diff --git a/dist/npmts.options.js b/dist/npmts.options.js index cd0cc74..674d873 100644 --- a/dist/npmts.options.js +++ b/dist/npmts.options.js @@ -3,7 +3,7 @@ /// var plugins = require("./npmts.plugins"); exports.run = function (configArg) { - var done = plugins.q.defer(); + var done = plugins.Q.defer(); var config = configArg; if (typeof config.coveralls === "undefined") { config.coveralls = false; diff --git a/dist/npmts.paths.js b/dist/npmts.paths.js index 1c89cae..0792fcf 100644 --- a/dist/npmts.paths.js +++ b/dist/npmts.paths.js @@ -4,8 +4,12 @@ var plugins = require("./npmts.plugins"); var paths = {}; paths.cwd = plugins.smartcli.get.cwd().path; +//Directories paths.tsDir = plugins.path.join(paths.cwd, "ts/"); +paths.distDir = plugins.path.join(paths.cwd, "dist/"); +paths.docsDir = plugins.path.join(paths.cwd, "docs/"); +paths.testDir = plugins.path.join(paths.cwd, "test/"); +//Files paths.indexTS = plugins.path.join(paths.cwd, "ts/index.ts"); paths.testTS = plugins.path.join(paths.cwd, "ts/test.ts"); -paths.testDir = plugins.path.join(paths.cwd, "test/"); module.exports = paths; diff --git a/dist/npmts.plugins.js b/dist/npmts.plugins.js index addc434..aeafe45 100644 --- a/dist/npmts.plugins.js +++ b/dist/npmts.plugins.js @@ -7,16 +7,21 @@ var plugins = { gulp: require("gulp"), g: { coveralls: require("gulp-coveralls"), + gFunction: require("gulp-function"), istanbul: require("gulp-istanbul"), + jsdoc3: require("gulp-jsdoc3"), mocha: require("gulp-mocha"), sourcemaps: require("gulp-sourcemaps"), typescript: require("gulp-typescript") }, - mergeStream: require("merge2"), + merge2: require("merge2"), + projectinfo: require("projectinfo"), sourceMapSupport: require("source-map-support").install(), path: require("path"), - q: require("q"), + Q: require("q"), + shelljs: require("shelljs"), smartcli: require("smartcli"), + smartenv: require("smartenv"), smartfile: require("smartfile"), typings: require("typings") }; diff --git a/dist/npmts.promisechain.js b/dist/npmts.promisechain.js index 2fd6e26..f484069 100644 --- a/dist/npmts.promisechain.js +++ b/dist/npmts.promisechain.js @@ -4,12 +4,14 @@ var NpmtsConfigFile = require("./npmts.configfile"); var NpmtsOptions = require("./npmts.options"); var NpmtsCompile = require("./npmts.compile"); +var NpmtsJsdoc = require("./npmts.jsdoc"); var NpmtsTests = require("./npmts.tests"); exports.run = function () { var promisechain; NpmtsConfigFile.run() .then(NpmtsOptions.run) .then(NpmtsCompile.run) + .then(NpmtsJsdoc.run) .then(NpmtsTests.run); return promisechain; }; diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js index 44d29dd..d90bbdc 100644 --- a/dist/npmts.tests.js +++ b/dist/npmts.tests.js @@ -4,7 +4,7 @@ var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); exports.run = function (configArg) { - var done = plugins.q.defer(); + var done = plugins.Q.defer(); var config = configArg; var istanbul = function () { var stream = plugins.gulp.src([plugins.path.join(paths.cwd, "dist/*.js")]) @@ -20,13 +20,14 @@ exports.run = function (configArg) { return stream; }; 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()); return stream; }; istanbul().on("finish", function () { mocha().on("finish", function () { - if (process.env.TRAVIS && config.coveralls) { + if (plugins.smartenv.getEnv().isTravis && config.coveralls) { coveralls().on("finish", function () { done.resolve(config); }); diff --git a/package.json b/package.json index 6d521fa..1d0155e 100644 --- a/package.json +++ b/package.json @@ -25,20 +25,25 @@ }, "homepage": "https://github.com/pushrocks/npmts#readme", "dependencies": { - "beautylog": "2.1.1", + "beautylog": "3.0.2", "fs-extra": "^0.26.5", "gulp": "3.9.1", "gulp-concat": "^2.6.0", "gulp-coveralls": "^0.1.4", + "gulp-function": "^1.1.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-typings": "0.0.0", + "gulp-typings": "1.1.0", "merge2": "1.0.1", + "projectinfo": "0.0.5", "q": "^1.4.1", + "shelljs": "^0.6.0", "smartcli": "0.0.11", + "smartenv": "1.0.6", "smartfile": "0.0.11", "source-map-support": "^0.4.0", "typings": "^0.6.8" diff --git a/test/assets/docs/fonts/glyphicons-halflings-regular.eot b/test/assets/docs/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/test/assets/docs/fonts/glyphicons-halflings-regular.eot differ diff --git a/test/assets/docs/fonts/glyphicons-halflings-regular.svg b/test/assets/docs/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/test/assets/docs/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/assets/docs/fonts/glyphicons-halflings-regular.ttf b/test/assets/docs/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/test/assets/docs/fonts/glyphicons-halflings-regular.ttf differ diff --git a/test/assets/docs/fonts/glyphicons-halflings-regular.woff b/test/assets/docs/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/test/assets/docs/fonts/glyphicons-halflings-regular.woff differ diff --git a/test/assets/docs/fonts/glyphicons-halflings-regular.woff2 b/test/assets/docs/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/test/assets/docs/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/test/assets/docs/img/glyphicons-halflings-white.png b/test/assets/docs/img/glyphicons-halflings-white.png new file mode 100644 index 0000000..3bf6484 Binary files /dev/null and b/test/assets/docs/img/glyphicons-halflings-white.png differ diff --git a/test/assets/docs/img/glyphicons-halflings.png b/test/assets/docs/img/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/test/assets/docs/img/glyphicons-halflings.png differ diff --git a/test/assets/docs/index.html b/test/assets/docs/index.html new file mode 100644 index 0000000..cb59690 --- /dev/null +++ b/test/assets/docs/index.html @@ -0,0 +1,208 @@ + + + + + + + Documentation Index + + + + + + + + + + + + + +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/assets/docs/quicksearch.html b/test/assets/docs/quicksearch.html new file mode 100644 index 0000000..348ac81 --- /dev/null +++ b/test/assets/docs/quicksearch.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/test/assets/docs/scripts/docstrap.lib.js b/test/assets/docs/scripts/docstrap.lib.js new file mode 100644 index 0000000..1a5a9db --- /dev/null +++ b/test/assets/docs/scripts/docstrap.lib.js @@ -0,0 +1,11 @@ +if(!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c}catch(e){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("