From 759d4031d2a83c92a408df7a01adeeb7b386b87e Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 19 May 2016 22:11:18 +0200 Subject: [PATCH] prepare for better smartfile module. --- dist/index.js | 2 +- dist/npmts.assets.js | 2 +- dist/npmts.clean.js | 11 +++++++++-- dist/npmts.cli.js | 2 +- dist/npmts.compile.js | 2 +- dist/npmts.configfile.js | 2 +- dist/npmts.install.js | 2 +- dist/npmts.jsdoc.js | 2 +- dist/npmts.options.js | 2 +- dist/npmts.paths.js | 2 +- dist/npmts.plugins.js | 2 +- dist/npmts.promisechain.js | 2 +- dist/npmts.publish.js | 2 +- dist/npmts.tests.js | 2 +- test/assets/dist/index.js | 4 ++-- test/assets/test/test.js | 4 ++-- test/assets/test/test.ts | 2 +- test/assets/ts/index.js | 8 -------- test/assets/ts/index.js.map | 1 - test/assets/ts/index.ts | 2 +- test/assets/ts/typings.json | 2 +- ts/index.ts | 2 +- ts/npmts.assets.ts | 2 +- ts/npmts.clean.ts | 13 +++++++++++-- ts/npmts.cli.ts | 2 +- ts/npmts.compile.ts | 2 +- ts/npmts.configfile.ts | 2 +- ts/npmts.install.ts | 2 +- ts/npmts.jsdoc.ts | 2 +- ts/npmts.options.ts | 2 +- ts/npmts.paths.ts | 2 +- ts/npmts.plugins.ts | 2 +- ts/npmts.promisechain.ts | 4 ++-- ts/npmts.publish.ts | 2 +- ts/npmts.tests.ts | 2 +- ts/typings.json | 2 +- 36 files changed, 55 insertions(+), 48 deletions(-) delete mode 100644 test/assets/ts/index.js delete mode 100644 test/assets/ts/index.js.map diff --git a/dist/index.js b/dist/index.js index 5aefc5c..569e833 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// console.log("**** starting NPMTS ****"); var plugins = require("./npmts.plugins"); var npmts_promisechain_1 = require("./npmts.promisechain"); diff --git a/dist/npmts.assets.js b/dist/npmts.assets.js index ad4cba9..7d2b151 100644 --- a/dist/npmts.assets.js +++ b/dist/npmts.assets.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); diff --git a/dist/npmts.clean.js b/dist/npmts.clean.js index bf8bd7a..6beedc9 100644 --- a/dist/npmts.clean.js +++ b/dist/npmts.clean.js @@ -1,12 +1,19 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); +var removeDist = function () { + return plugins.smartfile.fsaction.remove(paths.distDir); +}; +var removeTypings = function () { + return plugins.smartfile.fsaction.remove(paths.distDir); +}; exports.run = function (configArg) { npmts_promisechain_1.npmtsOra.text("cleaning up from previous builds..."); var done = plugins.Q.defer(); - plugins.smartfile.fsaction.remove(paths.distDir) + removeDist() + .then(removeTypings) .then(function () { plugins.beautylog.ok("Cleaned up from previous builds!"); done.resolve(configArg); diff --git a/dist/npmts.cli.js b/dist/npmts.cli.js index 7f65af0..46e920c 100644 --- a/dist/npmts.cli.js +++ b/dist/npmts.cli.js @@ -1 +1 @@ -/// +/// diff --git a/dist/npmts.compile.js b/dist/npmts.compile.js index ae40adb..7b7ff22 100644 --- a/dist/npmts.compile.js +++ b/dist/npmts.compile.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var helpers = require("./npmts.compile.helpers"); diff --git a/dist/npmts.configfile.js b/dist/npmts.configfile.js index 03a0c7d..fee079f 100644 --- a/dist/npmts.configfile.js +++ b/dist/npmts.configfile.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); exports.run = function () { diff --git a/dist/npmts.install.js b/dist/npmts.install.js index 273c55e..e1694be 100644 --- a/dist/npmts.install.js +++ b/dist/npmts.install.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); diff --git a/dist/npmts.jsdoc.js b/dist/npmts.jsdoc.js index 9b6cb44..1cc7162 100644 --- a/dist/npmts.jsdoc.js +++ b/dist/npmts.jsdoc.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); diff --git a/dist/npmts.options.js b/dist/npmts.options.js index 5537ae2..d428621 100644 --- a/dist/npmts.options.js +++ b/dist/npmts.options.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var npmts_promisechain_1 = require("./npmts.promisechain"); exports.isCi = function () { diff --git a/dist/npmts.paths.js b/dist/npmts.paths.js index 1e8a8fe..7132619 100644 --- a/dist/npmts.paths.js +++ b/dist/npmts.paths.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = {}; paths.cwd = plugins.smartcli.get.cwd().path; diff --git a/dist/npmts.plugins.js b/dist/npmts.plugins.js index 25e877c..3f6a31b 100644 --- a/dist/npmts.plugins.js +++ b/dist/npmts.plugins.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// exports.beautylog = require("beautylog"); exports.fs = require("fs-extra"); exports.gulp = require("gulp"); diff --git a/dist/npmts.promisechain.js b/dist/npmts.promisechain.js index 5c7df9b..3e510a3 100644 --- a/dist/npmts.promisechain.js +++ b/dist/npmts.promisechain.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); exports.npmtsOra = new plugins.beautylog.Ora("setting up TaskChain", "cyan"); exports.npmtsOra.start(); diff --git a/dist/npmts.publish.js b/dist/npmts.publish.js index 9639299..250857a 100644 --- a/dist/npmts.publish.js +++ b/dist/npmts.publish.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var NpmtsTests = require("./npmts.tests"); var NpmtsJsdoc = require("./npmts.jsdoc"); diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js index 8af81a6..c9f1ce0 100644 --- a/dist/npmts.tests.js +++ b/dist/npmts.tests.js @@ -1,5 +1,5 @@ "use strict"; -/// +/// var plugins = require("./npmts.plugins"); var paths = require("./npmts.paths"); var npmts_promisechain_1 = require("./npmts.promisechain"); diff --git a/test/assets/dist/index.js b/test/assets/dist/index.js index e883510..32400fb 100644 --- a/test/assets/dist/index.js +++ b/test/assets/dist/index.js @@ -1,4 +1,4 @@ -/// +/// var testplugin = { logSomething: function () { console.log("only function executed"); @@ -6,4 +6,4 @@ var testplugin = { }; module.exports = testplugin; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0QztBQUM1QyxJQUFJLFVBQVUsR0FBRztJQUNiLFlBQVksRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0JBQXdCLENBQUMsQ0FBQztJQUMxQyxDQUFDO0NBQ0osQ0FBQztBQUNGLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxyXG5sZXQgdGVzdHBsdWdpbiA9IHtcclxuICAgIGxvZ1NvbWV0aGluZzogZnVuY3Rpb24oKXtcclxuICAgICAgICBjb25zb2xlLmxvZyhcIm9ubHkgZnVuY3Rpb24gZXhlY3V0ZWRcIik7XHJcbiAgICB9XHJcbn07XHJcbm1vZHVsZS5leHBvcnRzID0gdGVzdHBsdWdpbjsiXX0= +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDZDQUE2QztBQUM3QyxJQUFJLFVBQVUsR0FBRztJQUNiLFlBQVksRUFBRTtRQUNWLE9BQU8sQ0FBQyxHQUFHLENBQUMsd0JBQXdCLENBQUMsQ0FBQztJQUMxQyxDQUFDO0NBQ0osQ0FBQztBQUNGLE1BQU0sQ0FBQyxPQUFPLEdBQUcsVUFBVSxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9pbmRleC5kLnRzXCIgLz5cclxubGV0IHRlc3RwbHVnaW4gPSB7XHJcbiAgICBsb2dTb21ldGhpbmc6IGZ1bmN0aW9uKCl7XHJcbiAgICAgICAgY29uc29sZS5sb2coXCJvbmx5IGZ1bmN0aW9uIGV4ZWN1dGVkXCIpO1xyXG4gICAgfVxyXG59O1xyXG5tb2R1bGUuZXhwb3J0cyA9IHRlc3RwbHVnaW47Il19 diff --git a/test/assets/test/test.js b/test/assets/test/test.js index 0a9f409..e05af2c 100644 --- a/test/assets/test/test.js +++ b/test/assets/test/test.js @@ -1,4 +1,4 @@ -/// +/// var testplugin = require("../dist/index.js"); describe("testplugins", function () { describe(".logSomething", function () { @@ -8,4 +8,4 @@ describe("testplugins", function () { }); }); -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0RBQWdEO0FBQ2hELElBQUksVUFBVSxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO0FBQzdDLFFBQVEsQ0FBQyxhQUFhLEVBQUM7SUFDbkIsUUFBUSxDQUFDLGVBQWUsRUFBQztRQUNyQixFQUFFLENBQUMsc0JBQXNCLEVBQUM7WUFDdEIsVUFBVSxDQUFDLFlBQVksRUFBRSxDQUFBO1FBQzdCLENBQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQ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Gx1Z2luID0gcmVxdWlyZShcIi4uL2Rpc3QvaW5kZXguanNcIik7XHJcbmRlc2NyaWJlKFwidGVzdHBsdWdpbnNcIixmdW5jdGlvbigpe1xyXG4gICAgZGVzY3JpYmUoXCIubG9nU29tZXRoaW5nXCIsZnVuY3Rpb24oKXtcclxuICAgICAgICBpdChcInNob3VsZCBsb2cgc29tZXRoaW5nXCIsZnVuY3Rpb24oKXtcclxuICAgICAgICAgICAgdGVzdHBsdWdpbi5sb2dTb21ldGhpbmcoKVxyXG4gICAgICAgIH0pO1xyXG4gICAgfSk7XHJcbn0pOyJdfQ== diff --git a/test/assets/test/test.ts b/test/assets/test/test.ts index 7afae46..6960cd4 100644 --- a/test/assets/test/test.ts +++ b/test/assets/test/test.ts @@ -1,4 +1,4 @@ -/// +/// var testplugin = require("../dist/index.js"); describe("testplugins",function(){ describe(".logSomething",function(){ diff --git a/test/assets/ts/index.js b/test/assets/ts/index.js deleted file mode 100644 index 3f8ddd7..0000000 --- a/test/assets/ts/index.js +++ /dev/null @@ -1,8 +0,0 @@ -/// -var testplugin = { - logSomething: function () { - console.log("only function executed"); - } -}; -module.exports = testplugin; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/test/assets/ts/index.js.map b/test/assets/ts/index.js.map deleted file mode 100644 index c8ff991..0000000 --- a/test/assets/ts/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,IAAI,UAAU,GAAG;IACb,YAAY,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC1C,CAAC;CACJ,CAAC;AACF,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} \ No newline at end of file diff --git a/test/assets/ts/index.ts b/test/assets/ts/index.ts index c8fa281..71a4f99 100644 --- a/test/assets/ts/index.ts +++ b/test/assets/ts/index.ts @@ -1,4 +1,4 @@ -/// +/// let testplugin = { logSomething: function(){ console.log("only function executed"); diff --git a/test/assets/ts/typings.json b/test/assets/ts/typings.json index c24f02b..4c1dd63 100644 --- a/test/assets/ts/typings.json +++ b/test/assets/ts/typings.json @@ -1,5 +1,5 @@ { - "ambientDependencies": { + "globalDependencies": { "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts", "mocha": "github:Bartvds/tsd-deftools/typings/DefinitelyTyped/mocha/mocha.d.ts", "colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts", diff --git a/ts/index.ts b/ts/index.ts index 9939672..8b0ce74 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -1,4 +1,4 @@ -/// +/// console.log("**** starting NPMTS ****"); import * as plugins from "./npmts.plugins" import {promisechain} from "./npmts.promisechain"; diff --git a/ts/npmts.assets.ts b/ts/npmts.assets.ts index d869ad7..ed2097b 100644 --- a/ts/npmts.assets.ts +++ b/ts/npmts.assets.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import {npmtsOra} from "./npmts.promisechain"; diff --git a/ts/npmts.clean.ts b/ts/npmts.clean.ts index 86551d8..3302f30 100644 --- a/ts/npmts.clean.ts +++ b/ts/npmts.clean.ts @@ -1,12 +1,21 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import {npmtsOra} from "./npmts.promisechain"; +let removeDist = function(){ + return plugins.smartfile.fsaction.remove(paths.distDir); +}; + +let removeTypings = function(){ + return plugins.smartfile.fsaction.remove(paths.distDir); +}; + export let run = function(configArg){ npmtsOra.text("cleaning up from previous builds..."); let done = plugins.Q.defer(); - plugins.smartfile.fsaction.remove(paths.distDir) + removeDist() + .then(removeTypings) .then(function(){ plugins.beautylog.ok("Cleaned up from previous builds!"); done.resolve(configArg); diff --git a/ts/npmts.cli.ts b/ts/npmts.cli.ts index 17f6a8b..07d5cba 100644 --- a/ts/npmts.cli.ts +++ b/ts/npmts.cli.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// \ No newline at end of file diff --git a/ts/npmts.compile.ts b/ts/npmts.compile.ts index 1bc91d6..0d863a8 100644 --- a/ts/npmts.compile.ts +++ b/ts/npmts.compile.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import helpers = require("./npmts.compile.helpers"); diff --git a/ts/npmts.configfile.ts b/ts/npmts.configfile.ts index 188b0d0..31d48ef 100644 --- a/ts/npmts.configfile.ts +++ b/ts/npmts.configfile.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); export var run = function(){ diff --git a/ts/npmts.install.ts b/ts/npmts.install.ts index f5523ec..e1e78e2 100644 --- a/ts/npmts.install.ts +++ b/ts/npmts.install.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import {npmtsOra} from "./npmts.promisechain"; diff --git a/ts/npmts.jsdoc.ts b/ts/npmts.jsdoc.ts index a26f2cf..a2e1aae 100644 --- a/ts/npmts.jsdoc.ts +++ b/ts/npmts.jsdoc.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import {npmtsOra} from "./npmts.promisechain"; diff --git a/ts/npmts.options.ts b/ts/npmts.options.ts index 22756b7..0dd4698 100644 --- a/ts/npmts.options.ts +++ b/ts/npmts.options.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import {npmtsOra} from "./npmts.promisechain"; diff --git a/ts/npmts.paths.ts b/ts/npmts.paths.ts index b38444c..a985ee8 100644 --- a/ts/npmts.paths.ts +++ b/ts/npmts.paths.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); var paths:any = {}; paths.cwd = plugins.smartcli.get.cwd().path; diff --git a/ts/npmts.plugins.ts b/ts/npmts.plugins.ts index 699439d..89bf8a1 100644 --- a/ts/npmts.plugins.ts +++ b/ts/npmts.plugins.ts @@ -1,4 +1,4 @@ -/// +/// export import beautylog = require("beautylog"); export let fs = require("fs-extra"); export let gulp = require("gulp"); diff --git a/ts/npmts.promisechain.ts b/ts/npmts.promisechain.ts index 8d731d1..4a39263 100644 --- a/ts/npmts.promisechain.ts +++ b/ts/npmts.promisechain.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); export let npmtsOra = new plugins.beautylog.Ora("setting up TaskChain","cyan"); @@ -45,7 +45,7 @@ export let promisechain = function(){ plugins.beautylog.success("READY TO SHIP!"); } else { npmtsOra.endOk("Tasks finished!"); - plugins.beautylog.success("Done!") + plugins.beautylog.success("Done!"); } done.resolve(); }); diff --git a/ts/npmts.publish.ts b/ts/npmts.publish.ts index 7757b34..93089d0 100644 --- a/ts/npmts.publish.ts +++ b/ts/npmts.publish.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import NpmtsTests = require("./npmts.tests"); diff --git a/ts/npmts.tests.ts b/ts/npmts.tests.ts index 0ac6967..1f50956 100644 --- a/ts/npmts.tests.ts +++ b/ts/npmts.tests.ts @@ -1,4 +1,4 @@ -/// +/// import plugins = require("./npmts.plugins"); import paths = require("./npmts.paths"); import {npmtsOra} from "./npmts.promisechain"; diff --git a/ts/typings.json b/ts/typings.json index aff7dc7..bdef787 100644 --- a/ts/typings.json +++ b/ts/typings.json @@ -1,5 +1,5 @@ { - "ambientDependencies": { + "globalDependencies": { "colors": "github:DefinitelyTyped/DefinitelyTyped/colors/colors.d.ts#09e37435ffb2c56a6f908081194a74756f24f99d", "istanbul": "registry:dt/istanbul#0.4.0+20160316155526", "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#78d36dd49b6b55b9fdfe61776a12bf05c8b07777",