js-build-tools 5.2.0 → 5.3.0

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 (60) hide show
  1. package/README.md +75 -10
  2. package/dist/build.js +7 -2
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +27 -27
  5. package/dist/bundleLint.js +16 -16
  6. package/dist/bundleMinify.js +13 -13
  7. package/dist/compileReadme.js +10 -10
  8. package/dist/copyFonts.js +13 -13
  9. package/dist/default.js +15 -15
  10. package/dist/dist.js +10 -10
  11. package/dist/distLint.js +16 -16
  12. package/dist/distMinify.js +13 -13
  13. package/dist/images.js +10 -10
  14. package/dist/partials/addToReadme.js +17 -17
  15. package/dist/partials/beginWatcher.js +12 -12
  16. package/dist/partials/clean.js +14 -14
  17. package/dist/partials/copyFor.js +12 -12
  18. package/dist/partials/distFor.js +21 -21
  19. package/dist/partials/distForSrc.js +11 -11
  20. package/dist/partials/distSeries.js +19 -19
  21. package/dist/partials/imagesFor.js +48 -48
  22. package/dist/partials/minifyFor.js +16 -16
  23. package/dist/partials/readmeTemplate.js +14 -14
  24. package/dist/partials/removeDirectory.js +29 -29
  25. package/dist/partials/runOnChange.js +28 -28
  26. package/dist/partials/sassFor.js +28 -28
  27. package/dist/partials/standardLint.js +75 -75
  28. package/dist/partials/tsFor.js +82 -82
  29. package/dist/partials/typeDocsFor.js +214 -0
  30. package/dist/partials.js +7 -0
  31. package/dist/partials.min.js +1 -1
  32. package/dist/sass.js +10 -10
  33. package/dist/test-helpers/setUp.js +89 -89
  34. package/dist/test-helpers/standardLintWithRealStandard.js +27 -27
  35. package/dist/testFull.js +20 -20
  36. package/dist/testHelpers.js +10 -10
  37. package/dist/testQuick.js +22 -22
  38. package/dist/typeDocs.js +14 -0
  39. package/dist/typeDocs.min.js +1 -0
  40. package/dist/typeScript.js +9 -9
  41. package/dist/utilities/dotGet.js +46 -46
  42. package/dist/utilities/dotNotate.js +46 -46
  43. package/dist/utilities/dotSet.js +37 -37
  44. package/dist/utilities/isObject.js +8 -8
  45. package/dist/utilities/strAfter.js +11 -11
  46. package/dist/utilities/strBefore.js +11 -11
  47. package/dist/watchFull.js +10 -10
  48. package/dist/watchTest.js +16 -16
  49. package/functions/build.mjs +7 -2
  50. package/functions/build.test.mjs +29 -0
  51. package/functions/partials/typeDocsFor.mjs +194 -0
  52. package/functions/partials/typeDocsFor.test.mjs +183 -0
  53. package/functions/partials.mjs +1 -0
  54. package/functions/partials.test.mjs +1 -1
  55. package/functions/typeDocs.mjs +9 -0
  56. package/functions/typeDocs.test.mjs +11 -0
  57. package/gulp.config.mjs +22 -0
  58. package/gulpfile.base.js +2 -0
  59. package/gulpfile.base.mjs +1 -0
  60. package/package.json +12 -7
@@ -1,20 +1,20 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.clean = void 0;
8
- require("core-js/modules/esnext.iterator.constructor.js");
9
- require("core-js/modules/esnext.iterator.reduce.js");
10
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
11
- var _removeDirectory = require("./removeDirectory.js");
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.clean = void 0;
8
+ require("core-js/modules/esnext.iterator.constructor.js");
9
+ require("core-js/modules/esnext.iterator.reduce.js");
10
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
11
+ var _removeDirectory = require("./removeDirectory.js");
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
13
  /**
14
14
  * Deletes all the distribution and browser files (used before create a new build).
15
15
  * Configure array of directories to remove with 'cleanPaths'.
16
16
  * @memberOf module:partials
17
17
  * @returns {Promise<string[]> | *}
18
- */
19
- const clean = () => gulpConfig.get('cleanPaths').reduce((promise, path) => promise.then(() => (0, _removeDirectory.removeDirectory)(path)), Promise.resolve());
18
+ */
19
+ const clean = () => gulpConfig.get('cleanPaths').reduce((promise, path) => promise.then(() => (0, _removeDirectory.removeDirectory)(path)), Promise.resolve());
20
20
  exports.clean = clean;
@@ -1,19 +1,19 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.copyFor = void 0;
7
- var _gulp = require("gulp");
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.copyFor = void 0;
7
+ var _gulp = require("gulp");
8
8
  /**
9
9
  * Copy some files to a different location.
10
10
  * @memberOf module:partials
11
11
  * @param {string|array} srcPath
12
12
  * @param {string} destPath
13
13
  * @returns {stream.Stream}
14
- */
15
- // encoding: false copies the bytes untouched - Gulp 5's default utf8 handling corrupts binary files such as fonts.
16
- const copyFor = (srcPath, destPath) => (0, _gulp.src)(srcPath, {
17
- encoding: false
18
- }).pipe((0, _gulp.dest)(destPath));
14
+ */
15
+ // encoding: false copies the bytes untouched - Gulp 5's default utf8 handling corrupts binary files such as fonts.
16
+ const copyFor = (srcPath, destPath) => (0, _gulp.src)(srcPath, {
17
+ encoding: false
18
+ }).pipe((0, _gulp.dest)(destPath));
19
19
  exports.copyFor = copyFor;
@@ -1,28 +1,28 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.distFor = void 0;
8
- var _gulpBabel = _interopRequireDefault(require("gulp-babel"));
9
- var _gulp = require("gulp");
10
- var _distForSrc = require("./distForSrc.js");
11
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
12
- var _through = _interopRequireDefault(require("through2"));
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.distFor = void 0;
8
+ var _gulpBabel = _interopRequireDefault(require("gulp-babel"));
9
+ var _gulp = require("gulp");
10
+ var _distForSrc = require("./distForSrc.js");
11
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
12
+ var _through = _interopRequireDefault(require("through2"));
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  /**
16
16
  * Build the distribution for a given source pattern.
17
17
  * @memberOf module:partials
18
18
  * @param {string|array} [srcPath='src/config/path/dist/for']
19
19
  * @param {string} [destPath='dist/config/path']
20
20
  * @returns {stream.Stream}
21
- */
22
- const distFor = (srcPath = (0, _distForSrc.distForSrc)(), destPath = gulpConfig.get('dist.to')) => (0, _gulp.src)(srcPath).pipe((0, _gulpBabel.default)()).pipe(_through.default.obj(function (file, enc, callback) {
23
- const regex = /\.mjs(['"]\s*\))/gi;
24
- file.contents = Buffer.from(file.contents.toString().replaceAll(regex, '.js$1'));
25
- this.push(file);
26
- callback();
27
- })).pipe((0, _gulp.dest)(destPath));
21
+ */
22
+ const distFor = (srcPath = (0, _distForSrc.distForSrc)(), destPath = gulpConfig.get('dist.to')) => (0, _gulp.src)(srcPath).pipe((0, _gulpBabel.default)()).pipe(_through.default.obj(function (file, enc, callback) {
23
+ const regex = /\.mjs(['"]\s*\))/gi;
24
+ file.contents = Buffer.from(file.contents.toString().replaceAll(regex, '.js$1'));
25
+ this.push(file);
26
+ callback();
27
+ })).pipe((0, _gulp.dest)(destPath));
28
28
  exports.distFor = distFor;
@@ -1,17 +1,17 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.distForSrc = void 0;
8
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.distForSrc = void 0;
8
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
10
  /**
11
11
  * Retrieve the correct distFor search path based on TS Config.
12
12
  * @memberOf module:partials
13
13
  * @param {module:gulpConfig~FlagStringSetting} [useTs='config/for/ts']
14
14
  * @returns {string}
15
- */
16
- const distForSrc = (useTs = gulpConfig.get('typescript.enabled')) => useTs ? gulpConfig.get('browser.from') : gulpConfig.get('dist.from');
15
+ */
16
+ const distForSrc = (useTs = gulpConfig.get('typescript.enabled')) => useTs ? gulpConfig.get('browser.from') : gulpConfig.get('dist.from');
17
17
  exports.distForSrc = distForSrc;
@@ -1,16 +1,16 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.distSeries = void 0;
8
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
- var _distFor = require("./distFor.js");
10
- var _distForSrc = require("./distForSrc.js");
11
- var _gulp = require("gulp");
12
- var _tsFor = require("./tsFor.js");
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.distSeries = void 0;
8
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
+ var _distFor = require("./distFor.js");
10
+ var _distForSrc = require("./distForSrc.js");
11
+ var _gulp = require("gulp");
12
+ var _tsFor = require("./tsFor.js");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
14
  /**
15
15
  * When using TypeScript, ensure that we process the ts first then run babel (dist)
16
16
  * @memberOf module:partials
@@ -18,10 +18,10 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
18
18
  * @param {string} [distFinalPath='dist/config/path']
19
19
  * @param {string} [tsSearch='ts/search/config/path']
20
20
  * @returns {function(null=): stream.Stream}
21
- */
22
- const distSeries = (srcPath = (0, _distForSrc.distForSrc)(), distFinalPath = gulpConfig.get('dist.to'), tsSearch = gulpConfig.get('typescript.from')) => {
23
- const typescript = (0, _tsFor.tsFor)(tsSearch, distFinalPath);
24
- const dist = () => (0, _distFor.distFor)(srcPath, distFinalPath);
25
- return gulpConfig.get('typescript.enabled') ? (0, _gulp.series)(typescript, dist) : dist;
26
- };
21
+ */
22
+ const distSeries = (srcPath = (0, _distForSrc.distForSrc)(), distFinalPath = gulpConfig.get('dist.to'), tsSearch = gulpConfig.get('typescript.from')) => {
23
+ const typescript = (0, _tsFor.tsFor)(tsSearch, distFinalPath);
24
+ const dist = () => (0, _distFor.distFor)(srcPath, distFinalPath);
25
+ return gulpConfig.get('typescript.enabled') ? (0, _gulp.series)(typescript, dist) : dist;
26
+ };
27
27
  exports.distSeries = distSeries;
@@ -1,19 +1,19 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.loadImagemin = exports.imagesFor = void 0;
8
- var _gulpCache = _interopRequireDefault(require("gulp-cache"));
9
- var _nodeModule = require("node:module");
10
- var _gulp = require("gulp");
11
- var _nodePath = _interopRequireDefault(require("node:path"));
12
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- const installHint = 'Add it to your project with: npm install --save-dev github:jheagle/gulp-imagemin#common-js-compatibility ' + '(the CommonJS-compatible fork - upstream gulp-imagemin is ESM-only and cannot be require()d by this package\'s CommonJS build).';
16
-
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.loadImagemin = exports.imagesFor = void 0;
8
+ var _gulpCache = _interopRequireDefault(require("gulp-cache"));
9
+ var _nodeModule = require("node:module");
10
+ var _gulp = require("gulp");
11
+ var _nodePath = _interopRequireDefault(require("node:path"));
12
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ const installHint = 'Add it to your project with: npm install --save-dev github:jheagle/gulp-imagemin#common-js-compatibility ' + '(the CommonJS-compatible fork - upstream gulp-imagemin is ESM-only and cannot be require()d by this package\'s CommonJS build).';
16
+
17
17
  /**
18
18
  * Load `gulp-imagemin`, an optional peer dependency: image optimization is off by default and its binary-download
19
19
  * dependency chain is heavy, so it is only required once the images task actually runs, and it is resolved from the
@@ -22,42 +22,42 @@ const installHint = 'Add it to your project with: npm install --save-dev github:
22
22
  * @param {string} [projectPath=process.cwd()] - The project directory to resolve `gulp-imagemin` from.
23
23
  * @returns {Function} The gulp-imagemin plugin factory.
24
24
  * @throws {Error} With install instructions when gulp-imagemin is missing or is the ESM-only upstream release.
25
- */
26
- const loadImagemin = (projectPath = process.cwd()) => {
27
- let loaded;
28
- try {
29
- loaded = (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json'))('gulp-imagemin');
30
- } catch (error) {
31
- if (error.code === 'MODULE_NOT_FOUND' && /Cannot find module 'gulp-imagemin'/.test(error.message)) {
32
- throw new Error(`The images task needs the optional peer dependency gulp-imagemin, which is not installed. ${installHint}`);
33
- }
34
- if (error.code === 'ERR_REQUIRE_ESM') {
35
- throw new Error(`gulp-imagemin could not be loaded because it is ESM-only. ${installHint}`);
36
- }
37
- throw error;
38
- }
39
- return loaded && (loaded.__esModule || loaded.default) ? loaded.default : loaded;
40
- };
41
-
25
+ */
26
+ const loadImagemin = (projectPath = process.cwd()) => {
27
+ let loaded;
28
+ try {
29
+ loaded = (0, _nodeModule.createRequire)(_nodePath.default.join(projectPath, 'package.json'))('gulp-imagemin');
30
+ } catch (error) {
31
+ if (error.code === 'MODULE_NOT_FOUND' && /Cannot find module 'gulp-imagemin'/.test(error.message)) {
32
+ throw new Error(`The images task needs the optional peer dependency gulp-imagemin, which is not installed. ${installHint}`);
33
+ }
34
+ if (error.code === 'ERR_REQUIRE_ESM') {
35
+ throw new Error(`gulp-imagemin could not be loaded because it is ESM-only. ${installHint}`);
36
+ }
37
+ throw error;
38
+ }
39
+ return loaded && (loaded.__esModule || loaded.default) ? loaded.default : loaded;
40
+ };
41
+
42
42
  /**
43
43
  * Move and optimize images into the browser directory.
44
44
  * @memberOf module:partials
45
45
  * @param {string|array} [imageSrc=src/images/pattern]
46
46
  * @param {string} [imageDest=dest/image/folder]
47
47
  * @return {stream.Stream}
48
- */
49
- exports.loadImagemin = loadImagemin;
50
- const imagesFor = (imageSrc = gulpConfig.get('images.from'), imageDest = gulpConfig.get('images.to')) => {
51
- const imagemin = loadImagemin();
52
- // Gulp 5 reads files as utf8 text unless told otherwise, which corrupts binary images (and makes gulp-cache drop them).
53
- return (0, _gulp.src)(imageSrc, {
54
- encoding: false
55
- }).pipe(
56
- // Caching images that ran through imagemin
57
- (0, _gulpCache.default)(imagemin({
58
- interlaced: true,
59
- silent: true,
60
- verbose: false
61
- }))).pipe((0, _gulp.dest)(imageDest));
62
- };
48
+ */
49
+ exports.loadImagemin = loadImagemin;
50
+ const imagesFor = (imageSrc = gulpConfig.get('images.from'), imageDest = gulpConfig.get('images.to')) => {
51
+ const imagemin = loadImagemin();
52
+ // Gulp 5 reads files as utf8 text unless told otherwise, which corrupts binary images (and makes gulp-cache drop them).
53
+ return (0, _gulp.src)(imageSrc, {
54
+ encoding: false
55
+ }).pipe(
56
+ // Caching images that ran through imagemin
57
+ (0, _gulpCache.default)(imagemin({
58
+ interlaced: true,
59
+ silent: true,
60
+ verbose: false
61
+ }))).pipe((0, _gulp.dest)(imageDest));
62
+ };
63
63
  exports.imagesFor = imagesFor;
@@ -1,21 +1,21 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.minifyFor = void 0;
7
- var _gulp = require("gulp");
8
- var _gulpUglifyEs = _interopRequireDefault(require("gulp-uglify-es"));
9
- var _gulpRename = _interopRequireDefault(require("gulp-rename"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const uglify = _gulpUglifyEs.default.hasOwnProperty('default') ? _gulpUglifyEs.default.default : _gulpUglifyEs.default;
12
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.minifyFor = void 0;
7
+ var _gulp = require("gulp");
8
+ var _gulpUglifyEs = _interopRequireDefault(require("gulp-uglify-es"));
9
+ var _gulpRename = _interopRequireDefault(require("gulp-rename"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const uglify = _gulpUglifyEs.default.hasOwnProperty('default') ? _gulpUglifyEs.default.default : _gulpUglifyEs.default;
12
+
13
13
  /**
14
14
  * Minify files and rename the output with '.min' extension.
15
15
  * @memberOf module:partials
16
16
  * @returns {*}
17
- */
18
- const minifyFor = (srcSearch, destination) => (0, _gulp.src)(srcSearch).pipe(uglify()).pipe((0, _gulpRename.default)({
19
- extname: '.min.js'
20
- })).pipe((0, _gulp.dest)(destination));
17
+ */
18
+ const minifyFor = (srcSearch, destination) => (0, _gulp.src)(srcSearch).pipe(uglify()).pipe((0, _gulpRename.default)({
19
+ extname: '.min.js'
20
+ })).pipe((0, _gulp.dest)(destination));
21
21
  exports.minifyFor = minifyFor;
@@ -1,19 +1,19 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.readmeTemplate = void 0;
8
- var _gulp = require("gulp");
9
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
10
- var _gulpRename = _interopRequireDefault(require("gulp-rename"));
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.readmeTemplate = void 0;
8
+ var _gulp = require("gulp");
9
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
10
+ var _gulpRename = _interopRequireDefault(require("gulp-rename"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
13
  /**
14
14
  * Copy a readme template into the README.md file.
15
15
  * @memberOf module:partials
16
16
  * @returns {*}
17
- */
18
- const readmeTemplate = () => (0, _gulp.src)(gulpConfig.get('readme.template')).pipe((0, _gulpRename.default)(gulpConfig.get('readme.file'))).pipe((0, _gulp.dest)(gulpConfig.get('readme.to')));
17
+ */
18
+ const readmeTemplate = () => (0, _gulp.src)(gulpConfig.get('readme.template')).pipe((0, _gulpRename.default)(gulpConfig.get('readme.file'))).pipe((0, _gulp.dest)(gulpConfig.get('readme.to')));
19
19
  exports.readmeTemplate = readmeTemplate;
@@ -1,14 +1,14 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.removeDirectory = void 0;
7
- var _promises = require("node:fs/promises");
8
- var _promises2 = require("node:timers/promises");
9
- const attempts = 4;
10
- const exists = dirPath => (0, _promises.access)(dirPath).then(() => true, () => false);
11
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.removeDirectory = void 0;
7
+ var _promises = require("node:fs/promises");
8
+ var _promises2 = require("node:timers/promises");
9
+ const attempts = 4;
10
+ const exists = dirPath => (0, _promises.access)(dirPath).then(() => true, () => false);
11
+
12
12
  /**
13
13
  * Delete a directory and everything in it, resolving only once it is really gone.
14
14
  *
@@ -20,22 +20,22 @@ const exists = dirPath => (0, _promises.access)(dirPath).then(() => true, () =>
20
20
  * @param {string} dirPath
21
21
  * @returns {Promise<string>} Resolves with dirPath once the directory no longer exists (or already didn't).
22
22
  * @throws {Error} If the directory still exists after several attempts.
23
- */
24
- const removeDirectory = async dirPath => {
25
- for (let attempt = 1; attempt <= attempts; attempt++) {
26
- await (0, _promises.rm)(dirPath, {
27
- recursive: true,
28
- force: true,
29
- maxRetries: 5,
30
- retryDelay: 100
31
- });
32
- if (!(await exists(dirPath))) {
33
- return dirPath;
34
- }
35
- if (attempt < attempts) {
36
- await (0, _promises2.setTimeout)(200 * attempt);
37
- }
38
- }
39
- throw new Error(`Unable to remove "${dirPath}" - it was recreated or is locked. Stop anything that has it open or is writing ` + 'into it (watchers, dev servers, editors, other build tasks) and try again.');
40
- };
23
+ */
24
+ const removeDirectory = async dirPath => {
25
+ for (let attempt = 1; attempt <= attempts; attempt++) {
26
+ await (0, _promises.rm)(dirPath, {
27
+ recursive: true,
28
+ force: true,
29
+ maxRetries: 5,
30
+ retryDelay: 100
31
+ });
32
+ if (!(await exists(dirPath))) {
33
+ return dirPath;
34
+ }
35
+ if (attempt < attempts) {
36
+ await (0, _promises2.setTimeout)(200 * attempt);
37
+ }
38
+ }
39
+ throw new Error(`Unable to remove "${dirPath}" - it was recreated or is locked. Stop anything that has it open or is writing ` + 'into it (watchers, dev servers, editors, other build tasks) and try again.');
40
+ };
41
41
  exports.removeDirectory = removeDirectory;
@@ -1,16 +1,16 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.runOnChange = void 0;
8
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
- var _bundle = require("../bundle.js");
10
- var _distSeries = require("./distSeries.js");
11
- var _gulp = require("gulp");
12
- var _testQuick = require("../testQuick.js");
13
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.runOnChange = void 0;
8
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
9
+ var _bundle = require("../bundle.js");
10
+ var _distSeries = require("./distSeries.js");
11
+ var _gulp = require("gulp");
12
+ var _testQuick = require("../testQuick.js");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
14
  /**
15
15
  * Run this function when the watched files are modified.
16
16
  * 1. Find the sub-folders within src path
@@ -35,11 +35,11 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
35
35
  * @memberOf module:partials
36
36
  * @param {string} path
37
37
  * @returns {stream.Stream}
38
- */
39
- const runOnChange = path => {
40
- const useTs = gulpConfig.get('typescript.enabled');
41
- const distPath = gulpConfig.get('dist.to');
42
- const srcPath = gulpConfig.get('srcPath');
38
+ */
39
+ const runOnChange = path => {
40
+ const useTs = gulpConfig.get('typescript.enabled');
41
+ const distPath = gulpConfig.get('dist.to');
42
+ const srcPath = gulpConfig.get('srcPath');
43
43
  /**
44
44
  * 1. The original path comes in from src and is a .ts
45
45
  * 2. Discover the outgoing dist path where that file should go
@@ -47,14 +47,14 @@ const runOnChange = path => {
47
47
  * 4. Take the original path, convert to full file path in dist
48
48
  * 5. Use the dist path found previously in #2
49
49
  * 6. Use the full dist path and the dist outgoing path in distFor
50
- */
51
- const pathRegex = new RegExp(`^${srcPath}(.*\\/)(.+)\\.(js|ts)$`, 'i');
52
- const distPathResult = path.replace(pathRegex, `${distPath}$1`);
53
- let distSrcPath = path;
54
- if (useTs) {
55
- distSrcPath = path.replace(pathRegex, `${distPath}$1$2.js`);
56
- }
57
- const runSeries = (0, _distSeries.distSeries)(distSrcPath, distPathResult, path);
58
- return gulpConfig.get('browser.enabled') ? (0, _gulp.parallel)(_testQuick.testQuick, (0, _gulp.series)(runSeries, _bundle.bundle))() : (0, _gulp.series)(_testQuick.testQuick, runSeries)();
59
- };
50
+ */
51
+ const pathRegex = new RegExp(`^${srcPath}(.*\\/)(.+)\\.(js|ts)$`, 'i');
52
+ const distPathResult = path.replace(pathRegex, `${distPath}$1`);
53
+ let distSrcPath = path;
54
+ if (useTs) {
55
+ distSrcPath = path.replace(pathRegex, `${distPath}$1$2.js`);
56
+ }
57
+ const runSeries = (0, _distSeries.distSeries)(distSrcPath, distPathResult, path);
58
+ return gulpConfig.get('browser.enabled') ? (0, _gulp.parallel)(_testQuick.testQuick, (0, _gulp.series)(runSeries, _bundle.bundle))() : (0, _gulp.series)(_testQuick.testQuick, runSeries)();
59
+ };
60
60
  exports.runOnChange = runOnChange;
@@ -1,35 +1,35 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.weak-map.delete-all.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.sassFor = void 0;
8
- var _gulp = require("gulp");
9
- var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
10
- var _autoprefixer = _interopRequireDefault(require("autoprefixer"));
11
- var _cssnano = _interopRequireDefault(require("cssnano"));
12
- var _gulpPostcss = _interopRequireDefault(require("gulp-postcss"));
13
- var _gulpRename = _interopRequireDefault(require("gulp-rename"));
14
- var sass = _interopRequireWildcard(require("sass"));
15
- var _gulpSass = _interopRequireDefault(require("gulp-sass"));
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
- const runSass = (0, _gulpSass.default)(sass);
19
-
1
+ "use strict";
2
+
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.sassFor = void 0;
8
+ var _gulp = require("gulp");
9
+ var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
10
+ var _autoprefixer = _interopRequireDefault(require("autoprefixer"));
11
+ var _cssnano = _interopRequireDefault(require("cssnano"));
12
+ var _gulpPostcss = _interopRequireDefault(require("gulp-postcss"));
13
+ var _gulpRename = _interopRequireDefault(require("gulp-rename"));
14
+ var sass = _interopRequireWildcard(require("sass"));
15
+ var _gulpSass = _interopRequireDefault(require("gulp-sass"));
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
+ const runSass = (0, _gulpSass.default)(sass);
19
+
20
20
  /**
21
21
  * Build the CSS for a given source pattern.
22
22
  * @memberOf module:partials
23
23
  * @param {string|array} [srcSearch='src/config/path/sass/for']
24
24
  * @param {string} [cssPath='css/config/path']
25
25
  * @returns {stream.Stream}
26
- */
27
- const sassFor = (srcSearch = gulpConfig.get('sass.from'), cssPath = gulpConfig.get('sass.to')) => (0, _gulp.src)(srcSearch).pipe(runSass().on('error', runSass.logError)) // Passes it through a gulp-sass, log errors to console
28
- .pipe((0, _gulp.dest)(cssPath))
29
- // add: false - the old gulp-cssnano only ever removed obsolete vendor prefixes, never added any; keep that.
30
- .pipe((0, _gulpPostcss.default)([(0, _autoprefixer.default)({
31
- add: false
32
- }), (0, _cssnano.default)()])).pipe((0, _gulpRename.default)({
33
- extname: '.min.css'
34
- })).pipe((0, _gulp.dest)(cssPath));
26
+ */
27
+ const sassFor = (srcSearch = gulpConfig.get('sass.from'), cssPath = gulpConfig.get('sass.to')) => (0, _gulp.src)(srcSearch).pipe(runSass().on('error', runSass.logError)) // Passes it through a gulp-sass, log errors to console
28
+ .pipe((0, _gulp.dest)(cssPath))
29
+ // add: false - the old gulp-cssnano only ever removed obsolete vendor prefixes, never added any; keep that.
30
+ .pipe((0, _gulpPostcss.default)([(0, _autoprefixer.default)({
31
+ add: false
32
+ }), (0, _cssnano.default)()])).pipe((0, _gulpRename.default)({
33
+ extname: '.min.css'
34
+ })).pipe((0, _gulp.dest)(cssPath));
35
35
  exports.sassFor = sassFor;