js-build-tools 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/build.js +24 -24
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +13 -13
- package/dist/bundleLint.js +19 -19
- package/dist/bundleMinify.js +11 -11
- package/dist/compileReadme.js +11 -11
- package/dist/default.js +14 -14
- package/dist/dist.js +9 -9
- package/dist/distLint.js +18 -18
- package/dist/distMinify.js +10 -10
- package/dist/partials/addToReadme.js +18 -18
- package/dist/partials/beginWatcher.js +10 -10
- package/dist/partials/clean.js +13 -13
- package/dist/partials/distFor.js +16 -16
- package/dist/partials/distForSrc.js +9 -9
- package/dist/partials/distSeries.js +23 -22
- package/dist/partials/minifyFor.js +15 -15
- package/dist/partials/readmeTemplate.js +12 -12
- package/dist/partials/runOnChange.js +30 -30
- package/dist/partials/tsFor.js +15 -15
- package/dist/partials.js +26 -26
- package/dist/test-helpers/circularObject.js +45 -45
- package/dist/test-helpers/countMatches.js +8 -8
- package/dist/test-helpers/deepReferenceObject.js +15 -15
- package/dist/test-helpers/domItem.js +28 -28
- package/dist/test-helpers/jsonDom.js +15 -15
- package/dist/test-helpers/linkedList.js +18 -18
- package/dist/test-helpers/logObject.js +15 -15
- package/dist/test-helpers/multiReferenceObject.js +15 -15
- package/dist/test-helpers/nodeTree.js +23 -23
- package/dist/test-helpers/setUp.js +105 -105
- package/dist/testFull.js +17 -17
- package/dist/testHelpers.js +26 -26
- package/dist/testQuick.js +19 -19
- package/dist/typeScript.js +9 -9
- package/dist/watchFull.js +11 -11
- package/dist/watchTest.js +14 -14
- package/functions/build.js +1 -1
- package/functions/build.test.js +1 -1
- package/functions/partials/distFor.js +1 -1
- package/functions/partials/distFor.test.js +1 -1
- package/functions/partials/distSeries.js +4 -4
- package/functions/partials/tsFor.js +3 -3
- package/package.json +2 -1
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
require("core-js/modules/es.object.define-property.js");
|
|
5
|
-
require("core-js/modules/es.symbol.js");
|
|
6
|
-
require("core-js/modules/es.symbol.description.js");
|
|
7
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
8
|
-
require("core-js/modules/es.array.iterator.js");
|
|
9
|
-
require("core-js/modules/es.string.iterator.js");
|
|
10
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
-
require("core-js/modules/es.symbol.async-iterator.js");
|
|
12
|
-
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
13
|
-
require("core-js/modules/es.json.to-string-tag.js");
|
|
14
|
-
require("core-js/modules/es.math.to-string-tag.js");
|
|
15
|
-
require("core-js/modules/es.object.get-prototype-of.js");
|
|
16
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
17
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
18
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
19
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
20
|
-
require("core-js/modules/es.object.set-prototype-of.js");
|
|
21
|
-
require("core-js/modules/es.array.slice.js");
|
|
22
|
-
require("core-js/modules/es.object.to-string.js");
|
|
23
|
-
require("core-js/modules/es.promise.js");
|
|
24
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
25
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
26
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
27
|
-
var fs = require('fs');
|
|
28
|
-
var del = require('del');
|
|
29
|
-
// Import the configurations and override some of them in order to direct to the temp directory.
|
|
30
|
-
var gulpConfig = require('../../gulp.config.js');
|
|
31
|
-
var tempDir = 'test-temp/';
|
|
32
|
-
var srcPath = "".concat(tempDir, "src");
|
|
33
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
require("core-js/modules/es.object.define-property.js");
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
|
+
require("core-js/modules/es.symbol.description.js");
|
|
7
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.iterator.js");
|
|
9
|
+
require("core-js/modules/es.string.iterator.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
require("core-js/modules/es.symbol.async-iterator.js");
|
|
12
|
+
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
13
|
+
require("core-js/modules/es.json.to-string-tag.js");
|
|
14
|
+
require("core-js/modules/es.math.to-string-tag.js");
|
|
15
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
|
16
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
17
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
18
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
19
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
20
|
+
require("core-js/modules/es.object.set-prototype-of.js");
|
|
21
|
+
require("core-js/modules/es.array.slice.js");
|
|
22
|
+
require("core-js/modules/es.object.to-string.js");
|
|
23
|
+
require("core-js/modules/es.promise.js");
|
|
24
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
25
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
26
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
27
|
+
var fs = require('fs');
|
|
28
|
+
var del = require('del');
|
|
29
|
+
// Import the configurations and override some of them in order to direct to the temp directory.
|
|
30
|
+
var gulpConfig = require('../../gulp.config.js');
|
|
31
|
+
var tempDir = 'test-temp/';
|
|
32
|
+
var srcPath = "".concat(tempDir, "src");
|
|
33
|
+
|
|
34
34
|
/**
|
|
35
35
|
* Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
36
36
|
* @function
|
|
37
37
|
* @memberOf module:testHelpers
|
|
38
38
|
* @param {string} testDir
|
|
39
|
-
*/
|
|
40
|
-
var setDefaults = function setDefaults() {
|
|
41
|
-
var testDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'test-temp';
|
|
42
|
-
tempDir = "".concat(testDir, "/");
|
|
43
|
-
srcPath = "".concat(tempDir, "src");
|
|
44
|
-
gulpConfig.set('browserPath', "".concat(tempDir, "browser"));
|
|
45
|
-
gulpConfig.set('distMain', "".concat(tempDir, "dist/main"));
|
|
46
|
-
gulpConfig.set('distPath', "".concat(tempDir, "dist"));
|
|
47
|
-
gulpConfig.set('distSearch', "".concat(tempDir, "dist/**/*.js"));
|
|
48
|
-
gulpConfig.set('readmeTemplate', "".concat(tempDir, "MAIN.md"));
|
|
49
|
-
gulpConfig.set('readmePath', tempDir);
|
|
50
|
-
gulpConfig.set('rootPath', tempDir);
|
|
51
|
-
gulpConfig.set('srcPath', srcPath);
|
|
52
|
-
gulpConfig.set('srcSearch', "".concat(tempDir, "src/**/!(*.test).js"));
|
|
53
|
-
gulpConfig.set('tsSearch', "".concat(tempDir, "src/**/*.ts"));
|
|
54
|
-
gulpConfig.set('watchSearch', "".concat(tempDir, "src/**/*.js"));
|
|
55
|
-
};
|
|
56
|
-
exports.setDefaults = setDefaults;
|
|
57
|
-
exports.gulpConfig = gulpConfig;
|
|
58
|
-
|
|
39
|
+
*/
|
|
40
|
+
var setDefaults = function setDefaults() {
|
|
41
|
+
var testDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'test-temp';
|
|
42
|
+
tempDir = "".concat(testDir, "/");
|
|
43
|
+
srcPath = "".concat(tempDir, "src");
|
|
44
|
+
gulpConfig.set('browserPath', "".concat(tempDir, "browser"));
|
|
45
|
+
gulpConfig.set('distMain', "".concat(tempDir, "dist/main"));
|
|
46
|
+
gulpConfig.set('distPath', "".concat(tempDir, "dist"));
|
|
47
|
+
gulpConfig.set('distSearch', "".concat(tempDir, "dist/**/*.js"));
|
|
48
|
+
gulpConfig.set('readmeTemplate', "".concat(tempDir, "MAIN.md"));
|
|
49
|
+
gulpConfig.set('readmePath', tempDir);
|
|
50
|
+
gulpConfig.set('rootPath', tempDir);
|
|
51
|
+
gulpConfig.set('srcPath', srcPath);
|
|
52
|
+
gulpConfig.set('srcSearch', "".concat(tempDir, "src/**/!(*.test).js"));
|
|
53
|
+
gulpConfig.set('tsSearch', "".concat(tempDir, "src/**/*.ts"));
|
|
54
|
+
gulpConfig.set('watchSearch', "".concat(tempDir, "src/**/*.js"));
|
|
55
|
+
};
|
|
56
|
+
exports.setDefaults = setDefaults;
|
|
57
|
+
exports.gulpConfig = gulpConfig;
|
|
58
|
+
|
|
59
59
|
/**
|
|
60
60
|
* Ensure that the del has completed, recursively attempt to delete and recreate
|
|
61
61
|
* @function
|
|
62
62
|
* @memberOf module:testHelpers
|
|
63
63
|
* @param {boolean} [exists=true]
|
|
64
64
|
* @returns {Promise<*|void>}
|
|
65
|
-
*/
|
|
66
|
-
var createTempDir = /*#__PURE__*/function () {
|
|
67
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
68
|
-
var exists,
|
|
69
|
-
_args = arguments;
|
|
70
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
71
|
-
while (1) switch (_context.prev = _context.next) {
|
|
72
|
-
case 0:
|
|
73
|
-
exists = _args.length > 0 && _args[0] !== undefined ? _args[0] : true;
|
|
74
|
-
if (!exists) {
|
|
75
|
-
_context.next = 3;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
return _context.abrupt("return", del(tempDir).then(function () {
|
|
79
|
-
return createTempDir(fs.existsSync(tempDir));
|
|
80
|
-
}));
|
|
81
|
-
case 3:
|
|
82
|
-
_context.next = 5;
|
|
83
|
-
return fs.mkdirSync(tempDir);
|
|
84
|
-
case 5:
|
|
85
|
-
return _context.abrupt("return", fs.mkdirSync(srcPath));
|
|
86
|
-
case 6:
|
|
87
|
-
case "end":
|
|
88
|
-
return _context.stop();
|
|
89
|
-
}
|
|
90
|
-
}, _callee);
|
|
91
|
-
}));
|
|
92
|
-
return function createTempDir() {
|
|
93
|
-
return _ref.apply(this, arguments);
|
|
94
|
-
};
|
|
95
|
-
}();
|
|
96
|
-
exports.createTempDir = createTempDir;
|
|
97
|
-
|
|
65
|
+
*/
|
|
66
|
+
var createTempDir = /*#__PURE__*/function () {
|
|
67
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
68
|
+
var exists,
|
|
69
|
+
_args = arguments;
|
|
70
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
71
|
+
while (1) switch (_context.prev = _context.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
exists = _args.length > 0 && _args[0] !== undefined ? _args[0] : true;
|
|
74
|
+
if (!exists) {
|
|
75
|
+
_context.next = 3;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
return _context.abrupt("return", del(tempDir).then(function () {
|
|
79
|
+
return createTempDir(fs.existsSync(tempDir));
|
|
80
|
+
}));
|
|
81
|
+
case 3:
|
|
82
|
+
_context.next = 5;
|
|
83
|
+
return fs.mkdirSync(tempDir);
|
|
84
|
+
case 5:
|
|
85
|
+
return _context.abrupt("return", fs.mkdirSync(srcPath));
|
|
86
|
+
case 6:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context.stop();
|
|
89
|
+
}
|
|
90
|
+
}, _callee);
|
|
91
|
+
}));
|
|
92
|
+
return function createTempDir() {
|
|
93
|
+
return _ref.apply(this, arguments);
|
|
94
|
+
};
|
|
95
|
+
}();
|
|
96
|
+
exports.createTempDir = createTempDir;
|
|
97
|
+
|
|
98
98
|
/**
|
|
99
99
|
* In the Jest.beforeEach function call this one to set up the temp directory.
|
|
100
100
|
* @function
|
|
101
101
|
* @memberOf module:testHelpers
|
|
102
102
|
* @returns {Promise<*|void>}
|
|
103
|
-
*/
|
|
104
|
-
exports.beforeEach = function () {
|
|
105
|
-
return createTempDir();
|
|
106
|
-
};
|
|
107
|
-
|
|
103
|
+
*/
|
|
104
|
+
exports.beforeEach = function () {
|
|
105
|
+
return createTempDir();
|
|
106
|
+
};
|
|
107
|
+
|
|
108
108
|
/**
|
|
109
109
|
* In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
110
110
|
* @function
|
|
111
111
|
* @memberOf module:testHelpers
|
|
112
112
|
* @returns {Promise<*>}
|
|
113
|
-
*/
|
|
114
|
-
exports.afterEach = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
115
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
116
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
-
case 0:
|
|
118
|
-
_context2.next = 2;
|
|
119
|
-
return del(tempDir);
|
|
120
|
-
case 2:
|
|
121
|
-
return _context2.abrupt("return", _context2.sent);
|
|
122
|
-
case 3:
|
|
123
|
-
case "end":
|
|
124
|
-
return _context2.stop();
|
|
125
|
-
}
|
|
126
|
-
}, _callee2);
|
|
113
|
+
*/
|
|
114
|
+
exports.afterEach = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
115
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
116
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
_context2.next = 2;
|
|
119
|
+
return del(tempDir);
|
|
120
|
+
case 2:
|
|
121
|
+
return _context2.abrupt("return", _context2.sent);
|
|
122
|
+
case 3:
|
|
123
|
+
case "end":
|
|
124
|
+
return _context2.stop();
|
|
125
|
+
}
|
|
126
|
+
}, _callee2);
|
|
127
127
|
}));
|
package/dist/testFull.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var gulpConfig = require('../gulp.config.js')
|
|
4
|
-
var _require = require('jest')
|
|
5
|
-
var runCLI = _require.runCLI
|
|
6
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var gulpConfig = require('../gulp.config.js')
|
|
4
|
+
var _require = require('jest')
|
|
5
|
+
var runCLI = _require.runCLI
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Run all tests with jest.
|
|
9
9
|
* @function
|
|
@@ -11,14 +11,14 @@ var runCLI = _require.runCLI
|
|
|
11
11
|
* @param {function} [done=null]
|
|
12
12
|
* @param {Array.<string>|string} [testPath='path/config/test/files']
|
|
13
13
|
* @returns {Promise<*>}
|
|
14
|
-
*/
|
|
15
|
-
var testFull = function testFull () {
|
|
16
|
-
var done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
17
|
-
var testPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('testPath')
|
|
18
|
-
if (!Array.isArray(testPath)) {
|
|
19
|
-
// The testPath must be an array of strings
|
|
20
|
-
testPath = [testPath]
|
|
21
|
-
}
|
|
22
|
-
return runCLI(gulpConfig.get('testOptions'), testPath)
|
|
23
|
-
}
|
|
24
|
-
module.exports = testFull
|
|
14
|
+
*/
|
|
15
|
+
var testFull = function testFull () {
|
|
16
|
+
var done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
17
|
+
var testPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('testPath')
|
|
18
|
+
if (!Array.isArray(testPath)) {
|
|
19
|
+
// The testPath must be an array of strings
|
|
20
|
+
testPath = [testPath]
|
|
21
|
+
}
|
|
22
|
+
return runCLI(gulpConfig.get('testOptions'), testPath)
|
|
23
|
+
}
|
|
24
|
+
module.exports = testFull
|
package/dist/testHelpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
3
|
/**
|
|
4
4
|
* An assortment of objects that can be used in tests and some functions to help debug and write tests.
|
|
5
5
|
* @file
|
|
@@ -7,27 +7,27 @@
|
|
|
7
7
|
* @version 2.0.0
|
|
8
8
|
* @module testHelpers
|
|
9
9
|
* @memberOf module:js-build-tools
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
var circularObject = require('./test-helpers/circularObject')
|
|
13
|
-
var countMatches = require('./test-helpers/countMatches')
|
|
14
|
-
var deepReferenceObject = require('./test-helpers/deepReferenceObject')
|
|
15
|
-
var domItem = require('./test-helpers/domItem')
|
|
16
|
-
var jsonDom = require('./test-helpers/jsonDom')
|
|
17
|
-
var linkedList = require('./test-helpers/linkedList')
|
|
18
|
-
var logObject = require('./test-helpers/logObject')
|
|
19
|
-
var multiReferenceObject = require('./test-helpers/multiReferenceObject')
|
|
20
|
-
var nodeTree = require('./test-helpers/nodeTree')
|
|
21
|
-
var setUp = require('./test-helpers/setUp')
|
|
22
|
-
module.exports = {
|
|
23
|
-
circularObject: circularObject,
|
|
24
|
-
countMatches: countMatches,
|
|
25
|
-
deepReferenceObject: deepReferenceObject,
|
|
26
|
-
domItem: domItem,
|
|
27
|
-
jsonDom: jsonDom,
|
|
28
|
-
linkedList: linkedList,
|
|
29
|
-
logObject: logObject,
|
|
30
|
-
multiReferenceObject: multiReferenceObject,
|
|
31
|
-
nodeTree: nodeTree,
|
|
32
|
-
setUp: setUp
|
|
33
|
-
}
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var circularObject = require('./test-helpers/circularObject')
|
|
13
|
+
var countMatches = require('./test-helpers/countMatches')
|
|
14
|
+
var deepReferenceObject = require('./test-helpers/deepReferenceObject')
|
|
15
|
+
var domItem = require('./test-helpers/domItem')
|
|
16
|
+
var jsonDom = require('./test-helpers/jsonDom')
|
|
17
|
+
var linkedList = require('./test-helpers/linkedList')
|
|
18
|
+
var logObject = require('./test-helpers/logObject')
|
|
19
|
+
var multiReferenceObject = require('./test-helpers/multiReferenceObject')
|
|
20
|
+
var nodeTree = require('./test-helpers/nodeTree')
|
|
21
|
+
var setUp = require('./test-helpers/setUp')
|
|
22
|
+
module.exports = {
|
|
23
|
+
circularObject: circularObject,
|
|
24
|
+
countMatches: countMatches,
|
|
25
|
+
deepReferenceObject: deepReferenceObject,
|
|
26
|
+
domItem: domItem,
|
|
27
|
+
jsonDom: jsonDom,
|
|
28
|
+
linkedList: linkedList,
|
|
29
|
+
logObject: logObject,
|
|
30
|
+
multiReferenceObject: multiReferenceObject,
|
|
31
|
+
nodeTree: nodeTree,
|
|
32
|
+
setUp: setUp
|
|
33
|
+
}
|
package/dist/testQuick.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var gulpConfig = require('../gulp.config.js')
|
|
4
|
-
var _require = require('jest')
|
|
5
|
-
var runCLI = _require.runCLI
|
|
6
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var gulpConfig = require('../gulp.config.js')
|
|
4
|
+
var _require = require('jest')
|
|
5
|
+
var runCLI = _require.runCLI
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Run the Jest tests for files which have been modified (based on git status).
|
|
9
9
|
* @function
|
|
@@ -11,16 +11,16 @@ var runCLI = _require.runCLI
|
|
|
11
11
|
* @param {function} [done=null]
|
|
12
12
|
* @param {Array.<string>|string} [testPath='path/config/test/files']
|
|
13
13
|
* @returns {Promise<*>}
|
|
14
|
-
*/
|
|
15
|
-
var testQuick = function testQuick () {
|
|
16
|
-
var done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
17
|
-
var testPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('testPath')
|
|
18
|
-
if (!Array.isArray(testPath)) {
|
|
19
|
-
// The testPath must be an array of strings
|
|
20
|
-
testPath = [testPath]
|
|
21
|
-
}
|
|
22
|
-
return runCLI({
|
|
23
|
-
onlyChanged: true
|
|
24
|
-
}, testPath)
|
|
25
|
-
}
|
|
26
|
-
module.exports = testQuick
|
|
14
|
+
*/
|
|
15
|
+
var testQuick = function testQuick () {
|
|
16
|
+
var done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
17
|
+
var testPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('testPath')
|
|
18
|
+
if (!Array.isArray(testPath)) {
|
|
19
|
+
// The testPath must be an array of strings
|
|
20
|
+
testPath = [testPath]
|
|
21
|
+
}
|
|
22
|
+
return runCLI({
|
|
23
|
+
onlyChanged: true
|
|
24
|
+
}, testPath)
|
|
25
|
+
}
|
|
26
|
+
module.exports = testQuick
|
package/dist/typeScript.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var tsFor = require('./partials/tsFor')
|
|
4
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var tsFor = require('./partials/tsFor')
|
|
4
|
+
|
|
5
5
|
/**
|
|
6
6
|
* Simplified typescript task using tsFor.
|
|
7
7
|
* @function
|
|
8
8
|
* @memberOf module:js-build-tools
|
|
9
9
|
* @returns {stream.Stream}
|
|
10
|
-
*/
|
|
11
|
-
var typeScript = function typeScript () {
|
|
12
|
-
return tsFor()
|
|
13
|
-
}
|
|
14
|
-
module.exports = typeScript
|
|
10
|
+
*/
|
|
11
|
+
var typeScript = function typeScript () {
|
|
12
|
+
return tsFor()
|
|
13
|
+
}
|
|
14
|
+
module.exports = typeScript
|
package/dist/watchFull.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var _require = require('./partials')
|
|
4
|
-
var beginWatcher = _require.beginWatcher
|
|
5
|
-
var runOnChange = _require.runOnChange
|
|
6
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var _require = require('./partials')
|
|
4
|
+
var beginWatcher = _require.beginWatcher
|
|
5
|
+
var runOnChange = _require.runOnChange
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
9
9
|
* @function
|
|
10
10
|
* @memberOf module:js-build-tools
|
|
11
11
|
* @returns {FSWatcher}
|
|
12
|
-
*/
|
|
13
|
-
var watchFull = function watchFull () {
|
|
14
|
-
return beginWatcher().on('change', runOnChange)
|
|
15
|
-
}
|
|
16
|
-
module.exports = watchFull
|
|
12
|
+
*/
|
|
13
|
+
var watchFull = function watchFull () {
|
|
14
|
+
return beginWatcher().on('change', runOnChange)
|
|
15
|
+
}
|
|
16
|
+
module.exports = watchFull
|
package/dist/watchTest.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
var gulpConfig = require('../gulp.config.js')
|
|
4
|
-
var _require = require('gulp')
|
|
5
|
-
var watch = _require.watch
|
|
6
|
-
var testQuick = require('./testQuick')
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
var gulpConfig = require('../gulp.config.js')
|
|
4
|
+
var _require = require('gulp')
|
|
5
|
+
var watch = _require.watch
|
|
6
|
+
var testQuick = require('./testQuick')
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* Watch for changes and run the tests.
|
|
10
10
|
* @function
|
|
11
11
|
* @memberOf module:js-build-tools
|
|
12
12
|
* @returns {*}
|
|
13
|
-
*/
|
|
14
|
-
var watchTest = function watchTest () {
|
|
15
|
-
return watch(gulpConfig.get('watchSearch'), {
|
|
16
|
-
ignoreInitial: false
|
|
17
|
-
}, testQuick)
|
|
18
|
-
}
|
|
19
|
-
module.exports = watchTest
|
|
13
|
+
*/
|
|
14
|
+
var watchTest = function watchTest () {
|
|
15
|
+
return watch(gulpConfig.get('watchSearch'), {
|
|
16
|
+
ignoreInitial: false
|
|
17
|
+
}, testQuick)
|
|
18
|
+
}
|
|
19
|
+
module.exports = watchTest
|
package/functions/build.js
CHANGED
|
@@ -20,7 +20,7 @@ const testFull = require('./testFull')
|
|
|
20
20
|
const build = (done = null) => parallel(
|
|
21
21
|
gulpConfig.get('nodeOnly')
|
|
22
22
|
? series(clean, dist, parallel(distLint, distMinify))
|
|
23
|
-
: series(clean, distSeries, parallel(distLint, distMinify), bundle, parallel(bundleLint, bundleMinify)),
|
|
23
|
+
: series(clean, distSeries(), parallel(distLint, distMinify), bundle, parallel(bundleLint, bundleMinify)),
|
|
24
24
|
compileReadme,
|
|
25
25
|
testFull
|
|
26
26
|
)(done)
|
package/functions/build.test.js
CHANGED
|
@@ -20,7 +20,7 @@ jest.mock('./compileReadme', () => jest.fn(genericFunction))
|
|
|
20
20
|
jest.mock('./dist', () => jest.fn(genericFunction))
|
|
21
21
|
jest.mock('./distLint', () => jest.fn(genericFunction))
|
|
22
22
|
jest.mock('./distMinify', () => jest.fn(genericFunction))
|
|
23
|
-
jest.mock('./partials/distSeries', () => jest.fn(genericFunction))
|
|
23
|
+
jest.mock('./partials/distSeries', () => jest.fn(() => genericFunction))
|
|
24
24
|
jest.mock('./testFull', () => jest.fn(genericFunction))
|
|
25
25
|
|
|
26
26
|
describe('build', () => {
|
|
@@ -9,7 +9,7 @@ const gulpConfig = require('../../gulp.config.js')
|
|
|
9
9
|
* @memberOf module:partials
|
|
10
10
|
* @param {string|array} [srcPath='src/config/path/dist/for']
|
|
11
11
|
* @param {string} [destPath='dist/config/path']
|
|
12
|
-
* @returns {
|
|
12
|
+
* @returns {stream.Stream}
|
|
13
13
|
*/
|
|
14
14
|
const distFor = (srcPath = distForSrc(), destPath = gulpConfig.get('distPath')) => src(srcPath)
|
|
15
15
|
.pipe(babel())
|
|
@@ -78,7 +78,7 @@ describe('distFor', () => {
|
|
|
78
78
|
const babelifiedContents = fs.readFileSync(`${distPath}/distFor.js`).toString()
|
|
79
79
|
expect(countMatches(babelifiedContents, '"use strict"')).toEqual(1)
|
|
80
80
|
// If the below assertion fails it is because 'const' no longer is replaced with 'var'
|
|
81
|
-
// To fix, change `.browserslistrc` set `> 0.
|
|
81
|
+
// To fix, change `.browserslistrc` set `> 0.21%` to a lower number. For example, last fix changed from `> 0.24%`
|
|
82
82
|
expect(countMatches(babelifiedContents, 'const ')).toEqual(0)
|
|
83
83
|
expect(countMatches(babelifiedContents, 'var ')).toEqual(10)
|
|
84
84
|
expect(countMatches(babelifiedContents, 'function')).toEqual(1)
|
|
@@ -11,11 +11,11 @@ const tsFor = require('./tsFor')
|
|
|
11
11
|
* @param {string} [srcPath='src/config/path/dist/for']
|
|
12
12
|
* @param {string} [distFinalPath='dist/config/path']
|
|
13
13
|
* @param {string} [tsSearch='ts/search/config/path']
|
|
14
|
-
* @returns {
|
|
14
|
+
* @returns {function(null=): stream.Stream}
|
|
15
15
|
*/
|
|
16
16
|
const distSeries = (srcPath = distForSrc(), distFinalPath = gulpConfig.get('distPath'), tsSearch = gulpConfig.get('tsSearch')) =>
|
|
17
|
-
gulpConfig.get('useTsConfig')
|
|
18
|
-
? series(() => tsFor(tsSearch, distFinalPath), () => distFor(srcPath, distFinalPath))
|
|
19
|
-
:
|
|
17
|
+
(done = null) => gulpConfig.get('useTsConfig')
|
|
18
|
+
? series(() => tsFor(tsSearch, distFinalPath), () => distFor(srcPath, distFinalPath))(done)
|
|
19
|
+
: distFor(srcPath, distFinalPath)
|
|
20
20
|
|
|
21
21
|
module.exports = distSeries
|
|
@@ -14,8 +14,8 @@ const tsProject = ts.createProject(gulpConfig.get('useTsConfig'))
|
|
|
14
14
|
* @see `https://www.typescriptlang.org/docs/handbook/gulp.html` for more info
|
|
15
15
|
*/
|
|
16
16
|
const tsFor = (srcPath = gulpConfig.get('tsSearch'), distPath = gulpConfig.get('distPath')) => src(srcPath)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
.pipe(tsProject())
|
|
18
|
+
.js
|
|
19
|
+
.pipe(dest(distPath))
|
|
20
20
|
|
|
21
21
|
module.exports = tsFor
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-build-tools",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Standardised build process with gulp.",
|
|
5
5
|
"main": "gulpfile.base.js",
|
|
6
6
|
"scripts": {
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"gulp-babel": "^8.0.0",
|
|
48
48
|
"gulp-rename": "^2.0.0",
|
|
49
49
|
"gulp-standard": "^14.0.0",
|
|
50
|
+
"gulp-typescript": "^6.0.0-alpha.1",
|
|
50
51
|
"gulp-uglify-es": "^3.0.0",
|
|
51
52
|
"jest": "^29.6.4",
|
|
52
53
|
"jest-environment-jsdom": "^29.6.4",
|