js-build-tools 2.4.0 → 3.0.1

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.
Files changed (204) hide show
  1. package/README.md +334 -205
  2. package/dist/build.js +59 -48
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +12 -13
  5. package/dist/bundle.min.js +1 -1
  6. package/dist/bundleLint.js +17 -18
  7. package/dist/bundleLint.min.js +1 -1
  8. package/dist/bundleMinify.js +8 -9
  9. package/dist/bundleMinify.min.js +1 -1
  10. package/dist/copyFonts.js +12 -0
  11. package/dist/copyFonts.min.js +1 -0
  12. package/dist/default.js +1 -1
  13. package/dist/default.min.js +1 -1
  14. package/dist/dist.js +7 -8
  15. package/dist/distLint.js +17 -18
  16. package/dist/distLint.min.js +1 -1
  17. package/dist/distMinify.js +8 -9
  18. package/dist/distMinify.min.js +1 -1
  19. package/dist/images.js +11 -0
  20. package/dist/images.min.js +1 -0
  21. package/dist/partials/addToReadme.js +13 -14
  22. package/dist/partials/beginWatcher.js +9 -10
  23. package/dist/partials/clean.js +10 -11
  24. package/dist/partials/copyFor.js +16 -0
  25. package/dist/partials/distFor.js +16 -17
  26. package/dist/partials/distForSrc.js +9 -10
  27. package/dist/partials/distSeries.js +19 -20
  28. package/dist/partials/imagesFor.js +34 -0
  29. package/dist/partials/minifyFor.js +15 -16
  30. package/dist/partials/readmeTemplate.js +11 -12
  31. package/dist/partials/removeDirectory.js +11 -12
  32. package/dist/partials/runOnChange.js +27 -27
  33. package/dist/partials/sassFor.js +20 -21
  34. package/dist/partials/tsFor.js +20 -21
  35. package/dist/partials.js +35 -31
  36. package/dist/partials.min.js +1 -1
  37. package/dist/test-helpers/setUp.js +52 -60
  38. package/dist/testFull.js +17 -18
  39. package/dist/testFull.min.js +1 -1
  40. package/dist/testHelpers.js +10 -28
  41. package/dist/testHelpers.min.js +1 -1
  42. package/dist/testQuick.js +19 -20
  43. package/dist/testQuick.min.js +1 -1
  44. package/dist/typeScript.js +7 -8
  45. package/dist/utilities/dotGet.js +50 -0
  46. package/dist/utilities/dotNotate.js +77 -0
  47. package/dist/utilities/dotSet.js +44 -0
  48. package/dist/utilities/isObject.js +10 -0
  49. package/dist/utilities/strAfter.js +14 -0
  50. package/dist/utilities/strBefore.js +14 -0
  51. package/dist/watchFull.js +10 -11
  52. package/dist/watchTest.js +13 -14
  53. package/dist/watchTest.min.js +1 -1
  54. package/functions/build.js +15 -5
  55. package/functions/build.test.js +278 -42
  56. package/functions/bundle.js +3 -4
  57. package/functions/bundle.test.js +6 -6
  58. package/functions/bundleLint.js +2 -3
  59. package/functions/bundleLint.test.js +5 -5
  60. package/functions/bundleMinify.js +1 -2
  61. package/functions/bundleMinify.test.js +1 -1
  62. package/functions/copyFonts.js +11 -0
  63. package/functions/copyFonts.test.js +31 -0
  64. package/functions/default.js +1 -1
  65. package/functions/default.test.js +2 -2
  66. package/functions/dist.js +0 -1
  67. package/functions/dist.test.js +1 -1
  68. package/functions/distLint.js +2 -3
  69. package/functions/distLint.test.js +3 -3
  70. package/functions/distMinify.js +1 -2
  71. package/functions/distMinify.test.js +1 -1
  72. package/functions/images.js +10 -0
  73. package/functions/images.test.js +138 -0
  74. package/functions/partials/addToReadme.js +2 -3
  75. package/functions/partials/addToReadme.test.js +2 -2
  76. package/functions/partials/beginWatcher.js +1 -2
  77. package/functions/partials/beginWatcher.test.js +1 -1
  78. package/functions/partials/clean.js +0 -1
  79. package/functions/partials/copyFor.js +13 -0
  80. package/functions/partials/copyFor.test.js +34 -0
  81. package/functions/partials/distFor.js +1 -2
  82. package/functions/partials/distFor.test.js +4 -4
  83. package/functions/partials/distForSrc.js +3 -4
  84. package/functions/partials/distForSrc.test.js +6 -6
  85. package/functions/partials/distSeries.js +2 -3
  86. package/functions/partials/distSeries.test.js +5 -5
  87. package/functions/partials/imagesFor.js +33 -0
  88. package/functions/partials/imagesFor.test.js +143 -0
  89. package/functions/partials/minifyFor.js +0 -1
  90. package/functions/partials/minifyFor.test.js +1 -1
  91. package/functions/partials/readmeTemplate.js +3 -4
  92. package/functions/partials/readmeTemplate.test.js +2 -2
  93. package/functions/partials/removeDirectory.js +0 -1
  94. package/functions/partials/runOnChange.js +5 -6
  95. package/functions/partials/runOnChange.test.js +9 -9
  96. package/functions/partials/sassFor.js +1 -2
  97. package/functions/partials/sassFor.test.js +3 -3
  98. package/functions/partials/tsFor.js +3 -4
  99. package/functions/partials/tsFor.test.js +2 -2
  100. package/functions/partials.js +5 -1
  101. package/functions/partials.test.js +1 -1
  102. package/functions/sass.test.js +2 -2
  103. package/functions/test-helpers/setUp.js +24 -32
  104. package/functions/testFull.js +2 -3
  105. package/functions/testFull.test.js +1 -1
  106. package/functions/testHelpers.js +3 -20
  107. package/functions/testHelpers.test.js +1 -1
  108. package/functions/testQuick.js +1 -2
  109. package/functions/testQuick.test.js +1 -1
  110. package/functions/typeScript.js +0 -1
  111. package/functions/typeScript.test.js +0 -2
  112. package/functions/utilities/dotGet.js +47 -0
  113. package/functions/utilities/dotNotate.js +68 -0
  114. package/functions/utilities/dotSet.js +41 -0
  115. package/functions/utilities/isObject.js +9 -0
  116. package/functions/utilities/strAfter.js +13 -0
  117. package/functions/utilities/strBefore.js +13 -0
  118. package/functions/watchFull.js +0 -1
  119. package/functions/watchFull.test.js +1 -1
  120. package/functions/watchTest.js +1 -2
  121. package/functions/watchTest.test.js +1 -1
  122. package/gulp.config.js +153 -79
  123. package/gulpfile.base.js +5 -1
  124. package/jsdoc.base.js +1 -1
  125. package/package.json +13 -9
  126. package/vendor/array-union/index.js +31 -0
  127. package/vendor/easy-transform-stream/index.js +54 -0
  128. package/vendor/globby/gitignore.js +96 -0
  129. package/vendor/globby/index.js +191 -0
  130. package/vendor/globby/node_modules/slash/index.js +16 -0
  131. package/vendor/globby/stream-utils.js +58 -0
  132. package/vendor/globby/to-path.js +20 -0
  133. package/vendor/gulp-imagemin/index.js +128 -0
  134. package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +265 -0
  135. package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +36 -0
  136. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  137. package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  138. package/vendor/gulp-plugin-extras/index.js +42 -0
  139. package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +265 -0
  140. package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +36 -0
  141. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
  142. package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
  143. package/vendor/gulp-plugin-extras/plugin-error.js +145 -0
  144. package/vendor/ignore/index.js +468 -0
  145. package/vendor/imagemin/index.js +90 -0
  146. package/vendor/imagemin-gifsicle/index.js +33 -0
  147. package/vendor/imagemin-mozjpeg/index.js +100 -0
  148. package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +260 -0
  149. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +47 -0
  150. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +102 -0
  151. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +123 -0
  152. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +47 -0
  153. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +50 -0
  154. package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +124 -0
  155. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +238 -0
  156. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +89 -0
  157. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +24 -0
  158. package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +44 -0
  159. package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +25 -0
  160. package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +70 -0
  161. package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +52 -0
  162. package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +43 -0
  163. package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +20 -0
  164. package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +17 -0
  165. package/vendor/imagemin-optipng/index.js +44 -0
  166. package/vendor/imagemin-svgo/index.js +27 -0
  167. package/vendor/is-jpg/index.js +12 -0
  168. package/vendor/junk/index.js +49 -0
  169. package/vendor/mozjpeg/index.js +9 -0
  170. package/vendor/mozjpeg/lib/index.js +18 -0
  171. package/vendor/mozjpeg/package.json +49 -0
  172. package/vendor/mozjpeg/vendor/cjpeg +0 -0
  173. package/vendor/mozjpeg/vendor/source/mozjpeg.tar.gz +0 -0
  174. package/vendor/p-pipe/index.js +22 -0
  175. package/vendor/plur/index.js +32 -0
  176. package/vendor/pretty-bytes/index.js +71 -0
  177. package/vendor/slash/index.js +12 -0
  178. package/dist/test-helpers/circularObject.js +0 -50
  179. package/dist/test-helpers/countMatches.js +0 -12
  180. package/dist/test-helpers/deepReferenceObject.js +0 -20
  181. package/dist/test-helpers/domItem.js +0 -33
  182. package/dist/test-helpers/jsonDom.js +0 -20
  183. package/dist/test-helpers/linkedList.js +0 -23
  184. package/dist/test-helpers/logObject.js +0 -21
  185. package/dist/test-helpers/multiReferenceObject.js +0 -20
  186. package/dist/test-helpers/nodeTree.js +0 -28
  187. package/functions/test-helpers/circularObject.js +0 -28
  188. package/functions/test-helpers/circularObject.test.js +0 -14
  189. package/functions/test-helpers/countMatches.js +0 -11
  190. package/functions/test-helpers/countMatches.test.js +0 -9
  191. package/functions/test-helpers/deepReferenceObject.js +0 -25
  192. package/functions/test-helpers/deepReferenceObject.test.js +0 -7
  193. package/functions/test-helpers/domItem.js +0 -31
  194. package/functions/test-helpers/domItem.test.js +0 -12
  195. package/functions/test-helpers/jsonDom.js +0 -16
  196. package/functions/test-helpers/jsonDom.test.js +0 -12
  197. package/functions/test-helpers/linkedList.js +0 -10
  198. package/functions/test-helpers/linkedList.test.js +0 -22
  199. package/functions/test-helpers/logObject.js +0 -18
  200. package/functions/test-helpers/logObject.test.js +0 -20
  201. package/functions/test-helpers/multiReferenceObject.js +0 -25
  202. package/functions/test-helpers/multiReferenceObject.test.js +0 -14
  203. package/functions/test-helpers/nodeTree.js +0 -11
  204. package/functions/test-helpers/nodeTree.test.js +0 -18
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ const isObject = require('./isObject');
4
+ const strAfter = require('./strAfter');
5
+ const strBefore = require('./strBefore');
6
+
7
+ /**
8
+ * Get a nested property value from an object.
9
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotGet.ts Sí, funciona}
10
+ * @param {Object} arrayObject - The array or object to get the property from
11
+ * @param {string} dotNotation - The path to the property
12
+ * @param {string|null} [defaultValue=null] - The default value to return if the property is not found
13
+ * @returns {*} The value of the property
14
+ */
15
+ const dotGet = function (arrayObject, dotNotation) {
16
+ let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
17
+ let key = strBefore(dotNotation, '.');
18
+ const lastKey = !key;
19
+ if (lastKey) {
20
+ key = dotNotation;
21
+ }
22
+ if (key === '*') {
23
+ const result = [];
24
+ for (let wildKey in arrayObject) {
25
+ const wildValue = arrayObject[wildKey];
26
+ if (lastKey) {
27
+ result[wildKey] = wildValue;
28
+ continue;
29
+ }
30
+ if (!isObject(wildValue)) {
31
+ continue;
32
+ }
33
+ result[wildKey] = dotGet(wildValue, strAfter(dotNotation, '.'), defaultValue);
34
+ }
35
+ return result;
36
+ }
37
+ if (lastKey) {
38
+ var _arrayObject$dotNotat;
39
+ return (_arrayObject$dotNotat = arrayObject[dotNotation]) !== null && _arrayObject$dotNotat !== void 0 ? _arrayObject$dotNotat : defaultValue;
40
+ }
41
+ if (typeof arrayObject[key] === 'undefined') {
42
+ return defaultValue;
43
+ }
44
+ const next = arrayObject[key];
45
+ if (!isObject(next)) {
46
+ return defaultValue;
47
+ }
48
+ return dotGet(next, strAfter(dotNotation, '.'), defaultValue);
49
+ };
50
+ module.exports = dotGet;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.string.replace.js");
4
+ require("core-js/modules/esnext.async-iterator.map.js");
5
+ require("core-js/modules/esnext.iterator.map.js");
6
+ const isObject = require('./isObject');
7
+
8
+ /**
9
+ * Convert an array of keys into a regex, return a function to test if incoming keys match.
10
+ * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
11
+ * @returns {Function} The dot-notated array
12
+ */
13
+ const handleRetainObjects = function () {
14
+ let retainObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15
+ if (!retainObjects.length) {
16
+ /**
17
+ * Bypass the test function if there are no retainObjects.
18
+ * @returns {false}
19
+ */
20
+ return (currentKey, value, results) => false;
21
+ }
22
+ retainObjects = retainObjects.map(key => key.replace('\.', '\\.'));
23
+ const retainRegex = new RegExp("(".concat(retainObjects.join('|'), ")$"));
24
+ /**
25
+ * Test if a key should be retained as an object.
26
+ * @param {string} currentKey - The key to test
27
+ * @param {*} value - The value of the key
28
+ * @param {Object} results - The result object to add to
29
+ * @returns {boolean}
30
+ */
31
+ return (currentKey, value, results) => {
32
+ if (!currentKey.match(retainRegex)) {
33
+ return false;
34
+ }
35
+ results[currentKey] = value;
36
+ return true;
37
+ };
38
+ };
39
+
40
+ /**
41
+ * The underlying logic function for converting arrays to dot-notation.
42
+ * @param {Object} arrayObject - The array or object to dot-notate
43
+ * @param {Function} didRetain - The test function to see if a key should be retained
44
+ * @param {string} [prepend=''] - The path for the property being processed
45
+ * @param {Object<string, *>} [results={}] - The final notated object to return
46
+ * @returns {Object<string, *>} The dot-notated object
47
+ */
48
+ const performDotNotate = function (arrayObject, didRetain) {
49
+ let prepend = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
50
+ let results = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
51
+ for (let key in arrayObject) {
52
+ const value = arrayObject[key];
53
+ const currentKey = "".concat(prepend).concat(key);
54
+ if (didRetain(currentKey, value, results)) {
55
+ continue;
56
+ }
57
+ if (isObject(value)) {
58
+ performDotNotate(value, didRetain, "".concat(currentKey, "."), results);
59
+ continue;
60
+ }
61
+ results[currentKey] = value;
62
+ }
63
+ return results;
64
+ };
65
+
66
+ /**
67
+ * Convert an array or object to a single dimensional associative array with dot notation.
68
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotNotate.ts Sí, funciona}
69
+ * @param {Object} arrayObject - The array or object to dot-notate
70
+ * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
71
+ * @returns {Object<string, *>} The dot-notated object
72
+ */
73
+ const dotNotate = function (arrayObject) {
74
+ let retainObjects = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
75
+ return performDotNotate(arrayObject, handleRetainObjects(retainObjects));
76
+ };
77
+ module.exports = dotNotate;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ const isObject = require('./isObject');
4
+ const strAfter = require('./strAfter');
5
+ const strBefore = require('./strBefore');
6
+
7
+ /**
8
+ * Set a nested property value an object.
9
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotSet.ts Sí, funciona}
10
+ * @param {Object} arrayObject - The array or object to set the property on
11
+ * @param {string} dotNotation - The path for the property
12
+ * @param {*} value - The default value to return if the property is not found
13
+ * @returns {Object} The modified object
14
+ */
15
+ const dotSet = function (arrayObject, dotNotation) {
16
+ var _arrayObject$key;
17
+ let value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
18
+ let key = strBefore(dotNotation, '.');
19
+ const lastKey = !key;
20
+ if (lastKey) {
21
+ key = dotNotation;
22
+ }
23
+ if (key === '*') {
24
+ for (let wildKey in arrayObject) {
25
+ if (lastKey) {
26
+ arrayObject[wildKey] = value;
27
+ continue;
28
+ }
29
+ if (!isObject(arrayObject[wildKey])) {
30
+ continue;
31
+ }
32
+ dotSet(arrayObject[wildKey], strAfter(dotNotation, '.'), value);
33
+ }
34
+ return arrayObject;
35
+ }
36
+ if (lastKey) {
37
+ arrayObject[dotNotation] = value;
38
+ return arrayObject;
39
+ }
40
+ const next = (_arrayObject$key = arrayObject[key]) !== null && _arrayObject$key !== void 0 ? _arrayObject$key : [];
41
+ arrayObject[key] = dotSet(next, strAfter(dotNotation, '.'), value);
42
+ return arrayObject;
43
+ };
44
+ module.exports = dotSet;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Check if the provided thing is an object / array.
5
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/isObject.ts Sí, funciona}
6
+ * @param {*} object
7
+ * @returns {boolean}
8
+ */
9
+ const isObject = object => typeof object === 'object' && object !== null;
10
+ module.exports = isObject;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Retrieve the string part after the search match.
5
+ * Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strAfter.ts Sí, funciona}
6
+ * @param {string} str
7
+ * @param {string} search
8
+ * @returns {string}
9
+ */
10
+ const strAfter = (str, search) => {
11
+ const index = str.indexOf(search);
12
+ return index === -1 ? '' : str.substring(index + search.length);
13
+ };
14
+ module.exports = strAfter;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Retrieve the string part before the search match.
5
+ * Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strBefore.ts Sí, funciona}
6
+ * @param {string} str
7
+ * @param {string} search
8
+ * @returns {string}
9
+ */
10
+ const strBefore = (str, search) => {
11
+ const index = str.indexOf(search);
12
+ return index === -1 ? '' : str.slice(0, index);
13
+ };
14
+ module.exports = strBefore;
package/dist/watchFull.js CHANGED
@@ -1,15 +1,14 @@
1
- 'use strict'
2
-
3
- const {
4
- beginWatcher,
5
- runOnChange
6
- } = require('./partials')
7
-
1
+ 'use strict'
2
+
3
+ const {
4
+ beginWatcher,
5
+ runOnChange
6
+ } = require('./partials')
7
+
8
8
  /**
9
9
  * Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
10
- * @function
11
10
  * @memberOf module:js-build-tools
12
11
  * @returns {FSWatcher}
13
- */
14
- const watchFull = () => beginWatcher().on('change', runOnChange)
15
- module.exports = watchFull
12
+ */
13
+ const watchFull = () => beginWatcher().on('change', runOnChange)
14
+ module.exports = watchFull
package/dist/watchTest.js CHANGED
@@ -1,18 +1,17 @@
1
- 'use strict'
2
-
3
- const gulpConfig = require('../gulp.config.js')
4
- const {
5
- watch
6
- } = require('gulp')
7
- const testQuick = require('./testQuick')
8
-
1
+ 'use strict'
2
+
3
+ const gulpConfig = require('../gulp.config.js')
4
+ const {
5
+ watch
6
+ } = require('gulp')
7
+ const testQuick = require('./testQuick')
8
+
9
9
  /**
10
10
  * Watch for changes and run the tests.
11
- * @function
12
11
  * @memberOf module:js-build-tools
13
12
  * @returns {*}
14
- */
15
- const watchTest = () => watch(gulpConfig.get('watchSearch'), {
16
- ignoreInitial: false
17
- }, testQuick)
18
- module.exports = watchTest
13
+ */
14
+ const watchTest = () => watch(gulpConfig.get('test.watch'), {
15
+ ignoreInitial: false
16
+ }, testQuick)
17
+ module.exports = watchTest
@@ -1 +1 @@
1
- "use strict";const gulpConfig=require("../gulp.config.js"),{watch:watch}=require("gulp"),testQuick=require("./testQuick"),watchTest=()=>watch(gulpConfig.get("watchSearch"),{ignoreInitial:!1},testQuick);module.exports=watchTest;
1
+ "use strict";const gulpConfig=require("../gulp.config.js"),{watch:watch}=require("gulp"),testQuick=require("./testQuick"),watchTest=()=>watch(gulpConfig.get("test.watch"),{ignoreInitial:!1},testQuick);module.exports=watchTest;
@@ -7,6 +7,8 @@ const distLint = require('./distLint')
7
7
  const distMinify = require('./distMinify')
8
8
  const { parallel, series } = require('gulp')
9
9
  const gulpConfig = require('../gulp.config.js')
10
+ const copyFonts = require('./copyFonts.js')
11
+ const images = require('./images.js')
10
12
  const sass = require('./sass.js')
11
13
  const testFull = require('./testFull')
12
14
 
@@ -20,11 +22,11 @@ const build = (done = null) => {
20
22
  const distLintMinify = parallel(distLint, distMinify)
21
23
  const bundleLintMinify = parallel(bundleLint, bundleMinify)
22
24
  const buildActions = [clean, distSeries(), distLintMinify]
23
- if (gulpConfig.get('useTsConfig')) {
25
+ if (gulpConfig.get('typescript.enabled')) {
24
26
  // For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
25
27
  buildActions.push(compileReadme)
26
28
  }
27
- if (!gulpConfig.get('nodeOnly')) {
29
+ if (gulpConfig.get('browser.enabled')) {
28
30
  // If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
29
31
  buildActions.push(bundle)
30
32
  buildActions.push(bundleLintMinify)
@@ -32,13 +34,21 @@ const build = (done = null) => {
32
34
  const runActions = [
33
35
  series(...buildActions),
34
36
  ]
35
- if (!gulpConfig.get('useTsConfig')) {
37
+ if (!gulpConfig.get('typescript.enabled')) {
36
38
  // Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
37
39
  runActions.push(compileReadme)
38
40
  }
39
41
  runActions.push(testFull)
40
- if (gulpConfig.get('useSass')) {
41
- // Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
42
+ if (gulpConfig.get('fonts.enabled')) {
43
+ // Conditionally add Fonts process
44
+ runActions.push(copyFonts)
45
+ }
46
+ if (gulpConfig.get('images.enabled')) {
47
+ // Conditionally add Images process
48
+ runActions.push(images)
49
+ }
50
+ if (gulpConfig.get('sass.enabled')) {
51
+ // Conditionally add SASS process
42
52
  runActions.push(sass)
43
53
  }
44
54
  return parallel(