js-build-tools 6.3.0 → 6.4.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.
- package/README.md +10 -3
- package/dist/lint.js +17 -0
- package/dist/lint.min.js +1 -0
- package/dist/partials/imagesFor.js +42 -43
- package/dist/partials/jsdocDocsFor.js +5 -3
- package/dist/partials/lintSource.js +41 -0
- package/dist/partials/loadPeer.js +71 -70
- package/dist/partials/minifyFor.js +16 -16
- package/dist/partials/neostandardLint.js +130 -122
- package/dist/partials.js +176 -169
- package/dist/partials.min.js +1 -1
- package/dist/sourceLint.js +11 -27
- package/dist/sourceLint.min.js +1 -1
- package/dist/test-helpers/isolateGulpCache.js +25 -0
- package/dist/utilities/dotGet.js +46 -46
- package/dist/utilities/dotNotate.js +48 -48
- package/dist/utilities/dotSet.js +37 -37
- package/functions/build.test.mjs +17 -7
- package/functions/bundle.test.mjs +0 -1
- package/functions/images.test.mjs +4 -1
- package/functions/lint.mjs +9 -0
- package/functions/partials/addToReadme.test.mjs +2 -1
- package/functions/partials/imagesFor.mjs +0 -1
- package/functions/partials/imagesFor.test.mjs +5 -2
- package/functions/partials/jsdocDocsFor.mjs +11 -3
- package/functions/partials/jsdocDocsFor.test.mjs +5 -2
- package/functions/partials/lintSource.mjs +27 -0
- package/functions/partials/loadPeer.mjs +1 -0
- package/functions/partials/loadPlaywright.test.mjs +1 -2
- package/functions/partials/minifyFor.mjs +1 -1
- package/functions/partials/neostandardLint.mjs +9 -2
- package/functions/partials/neostandardLint.test.mjs +14 -0
- package/functions/partials/runOnChange.test.mjs +5 -4
- package/functions/partials/tsFor.test.mjs +1 -0
- package/functions/partials.mjs +1 -0
- package/functions/partials.test.mjs +1 -1
- package/functions/sourceLint.mjs +4 -15
- package/functions/sourceLint.test.mjs +49 -0
- package/functions/test-helpers/isolateGulpCache.mjs +16 -0
- package/functions/test-helpers/setUp.mjs +7 -7
- package/functions/testFull.test.mjs +1 -1
- package/functions/testQuick.test.mjs +1 -1
- package/functions/utilities/convertMjsFilesForDocs.test.mjs +1 -0
- package/functions/utilities/dotGet.mjs +2 -2
- package/functions/utilities/dotNotate.mjs +2 -2
- package/functions/utilities/dotNotate.test.mjs +7 -0
- package/functions/utilities/dotSet.mjs +1 -1
- package/gulpfile.base.mjs +1 -0
- package/package.json +12 -2
package/dist/sourceLint.js
CHANGED
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
-
var _gulp = require("gulp");
|
|
10
|
-
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
11
|
-
var cache;
|
|
12
|
-
function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sourceLint = void 0;
|
|
7
|
+
var _lintSource = require("./partials/lintSource.js");
|
|
13
8
|
/**
|
|
14
9
|
* Applies neostandard linting (js-build-tools' chosen style) to the real, hand-written source - not the compiled
|
|
15
10
|
* dist/browser output, which is generated and so was never going to pass a hand-authored-code style check (every
|
|
16
11
|
* compiler/bundler emits its own boilerplate - import aliasing, interop headers - that only looks like a style
|
|
17
12
|
* violation). Includes test files: there is no reason to hold tests to a lower style bar than the rest of the
|
|
18
|
-
* source. When typescript.enabled, the real TypeScript source is linted too, with type-aware rules.
|
|
13
|
+
* source. When typescript.enabled, the real TypeScript source is linted too, with type-aware rules. Runs as part of
|
|
14
|
+
* `build`, where remaining errors are reported but never fail it.
|
|
19
15
|
* @memberOf module:js-build-tools
|
|
20
16
|
* @returns {*}
|
|
21
|
-
*/
|
|
22
|
-
const sourceLint = () =>
|
|
23
|
-
const srcPath = gulpConfig.get('srcPath');
|
|
24
|
-
const ts = gulpConfig.get('typescript.enabled');
|
|
25
|
-
const patterns = [`${srcPath}/**/*.js`];
|
|
26
|
-
if (ts) {
|
|
27
|
-
patterns.push(`${srcPath}/**/*.ts`);
|
|
28
|
-
}
|
|
29
|
-
return (0, _gulp.src)(patterns).pipe((0, _neostandardLint.neostandardLint)({
|
|
30
|
-
fix: true,
|
|
31
|
-
ts,
|
|
32
|
-
rules: gulpConfig.get('lint.rules')
|
|
33
|
-
})).pipe((0, _gulp.dest)(srcPath));
|
|
34
|
-
};
|
|
17
|
+
*/
|
|
18
|
+
const sourceLint = () => (0, _lintSource.lintSource)();
|
|
35
19
|
exports.sourceLint = sourceLint;
|
package/dist/sourceLint.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sourceLint=void 0;var _lintSource=require("./partials/lintSource.js");const sourceLint=()=>(0,_lintSource.lintSource)();exports.sourceLint=sourceLint;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isolateGulpCache = void 0;
|
|
7
|
+
var _gulpCache = _interopRequireDefault(require("gulp-cache"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* Give this test file its own gulp-cache folder, and return a function that clears only that folder. gulp-cache
|
|
11
|
+
* otherwise keeps one cache in os.tmpdir() for every process, so a cache.clearAll() in one Jest worker could wipe it
|
|
12
|
+
* while another worker's images task was still using it, and gulp-cache then silently dropped that worker's
|
|
13
|
+
* images. Jest loads gulp-cache separately for each test file, so this only changes the copy that file uses.
|
|
14
|
+
* @memberOf module:testHelpers
|
|
15
|
+
* @param {string} name - Unique per test file, used in the cache folder name.
|
|
16
|
+
* @returns {function(): Promise<void>} Clears this test file's cache.
|
|
17
|
+
*/
|
|
18
|
+
const isolateGulpCache = name => {
|
|
19
|
+
const fileCache = new _gulpCache.default.Cache({
|
|
20
|
+
cacheDirName: `js-build-tools-test-${name}`
|
|
21
|
+
});
|
|
22
|
+
_gulpCache.default.defaultOptions.fileCache = fileCache;
|
|
23
|
+
return () => new Promise((resolve, reject) => fileCache.clear(null, error => error ? reject(error) : resolve()));
|
|
24
|
+
};
|
|
25
|
+
exports.isolateGulpCache = isolateGulpCache;
|
package/dist/utilities/dotGet.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.dotGet = void 0;
|
|
7
|
-
var _isObject = require("./isObject.js");
|
|
8
|
-
var _strAfter = require("./strAfter.js");
|
|
9
|
-
var _strBefore = require("./strBefore.js");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dotGet = void 0;
|
|
7
|
+
var _isObject = require("./isObject.js");
|
|
8
|
+
var _strAfter = require("./strAfter.js");
|
|
9
|
+
var _strBefore = require("./strBefore.js");
|
|
10
10
|
/**
|
|
11
11
|
* Get a nested property value from an object.
|
|
12
12
|
* Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotGet.ts Sí, funciona}
|
|
@@ -15,41 +15,41 @@ var _strBefore = require("./strBefore.js");
|
|
|
15
15
|
* @param {string|null} [defaultValue=null] - The default value to return if the property is not found
|
|
16
16
|
* @returns {*} The value of the property
|
|
17
17
|
* @private
|
|
18
|
-
*/
|
|
19
|
-
const dotGet = (arrayObject = {}, dotNotation = '', defaultValue = null) => {
|
|
20
|
-
if (!dotNotation) {
|
|
21
|
-
return arrayObject;
|
|
22
|
-
}
|
|
23
|
-
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
24
|
-
const lastKey = !key;
|
|
25
|
-
if (lastKey) {
|
|
26
|
-
key = dotNotation;
|
|
27
|
-
}
|
|
28
|
-
if (key === '*') {
|
|
29
|
-
const result = [];
|
|
30
|
-
for (
|
|
31
|
-
const wildValue = arrayObject[wildKey];
|
|
32
|
-
if (lastKey) {
|
|
33
|
-
result[wildKey] = wildValue;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (!(0, _isObject.isObject)(wildValue)) {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
result[wildKey] = dotGet(wildValue, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
if (lastKey) {
|
|
44
|
-
return arrayObject[dotNotation] ?? defaultValue;
|
|
45
|
-
}
|
|
46
|
-
if (typeof arrayObject[key] === 'undefined') {
|
|
47
|
-
return defaultValue;
|
|
48
|
-
}
|
|
49
|
-
const next = arrayObject[key];
|
|
50
|
-
if (!(0, _isObject.isObject)(next)) {
|
|
51
|
-
return defaultValue;
|
|
52
|
-
}
|
|
53
|
-
return dotGet(next, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
54
|
-
};
|
|
18
|
+
*/
|
|
19
|
+
const dotGet = (arrayObject = {}, dotNotation = '', defaultValue = null) => {
|
|
20
|
+
if (!dotNotation) {
|
|
21
|
+
return arrayObject;
|
|
22
|
+
}
|
|
23
|
+
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
24
|
+
const lastKey = !key;
|
|
25
|
+
if (lastKey) {
|
|
26
|
+
key = dotNotation;
|
|
27
|
+
}
|
|
28
|
+
if (key === '*') {
|
|
29
|
+
const result = [];
|
|
30
|
+
for (const wildKey in arrayObject) {
|
|
31
|
+
const wildValue = arrayObject[wildKey];
|
|
32
|
+
if (lastKey) {
|
|
33
|
+
result[wildKey] = wildValue;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (!(0, _isObject.isObject)(wildValue)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
result[wildKey] = dotGet(wildValue, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
if (lastKey) {
|
|
44
|
+
return arrayObject[dotNotation] ?? defaultValue;
|
|
45
|
+
}
|
|
46
|
+
if (typeof arrayObject[key] === 'undefined') {
|
|
47
|
+
return defaultValue;
|
|
48
|
+
}
|
|
49
|
+
const next = arrayObject[key];
|
|
50
|
+
if (!(0, _isObject.isObject)(next)) {
|
|
51
|
+
return defaultValue;
|
|
52
|
+
}
|
|
53
|
+
return dotGet(next, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
54
|
+
};
|
|
55
55
|
exports.dotGet = dotGet;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.dotNotate = void 0;
|
|
7
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
9
|
-
var _isObject = require("./isObject.js");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dotNotate = void 0;
|
|
7
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
9
|
+
var _isObject = require("./isObject.js");
|
|
10
10
|
/**
|
|
11
11
|
* Convert an array of keys into a regex, return a function to test if incoming keys match.
|
|
12
12
|
* @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
|
|
13
13
|
* @returns {Function} The dot-notated array
|
|
14
14
|
* @private
|
|
15
|
-
*/
|
|
16
|
-
const handleRetainObjects = (retainObjects = []) => {
|
|
17
|
-
if (!retainObjects.length) {
|
|
15
|
+
*/
|
|
16
|
+
const handleRetainObjects = (retainObjects = []) => {
|
|
17
|
+
if (!retainObjects.length) {
|
|
18
18
|
/**
|
|
19
19
|
* Bypass the test function if there are no retainObjects.
|
|
20
20
|
* @returns {false}
|
|
21
21
|
* @private
|
|
22
|
-
*/
|
|
23
|
-
return (currentKey, value, results) => false;
|
|
24
|
-
}
|
|
25
|
-
retainObjects = retainObjects.map(key => key.
|
|
26
|
-
const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
|
|
22
|
+
*/
|
|
23
|
+
return (currentKey, value, results) => false;
|
|
24
|
+
}
|
|
25
|
+
retainObjects = retainObjects.map(key => key.replaceAll('.', '\\.'));
|
|
26
|
+
const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
|
|
27
27
|
/**
|
|
28
28
|
* Test if a key should be retained as an object.
|
|
29
29
|
* @param {string} currentKey - The key to test
|
|
@@ -31,16 +31,16 @@ const handleRetainObjects = (retainObjects = []) => {
|
|
|
31
31
|
* @param {Object} results - The result object to add to
|
|
32
32
|
* @returns {boolean}
|
|
33
33
|
* @private
|
|
34
|
-
*/
|
|
35
|
-
return (currentKey, value, results) => {
|
|
36
|
-
if (!currentKey.match(retainRegex)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
results[currentKey] = value;
|
|
40
|
-
return true;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
34
|
+
*/
|
|
35
|
+
return (currentKey, value, results) => {
|
|
36
|
+
if (!currentKey.match(retainRegex)) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
results[currentKey] = value;
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
44
|
/**
|
|
45
45
|
* The underlying logic function for converting arrays to dot-notation.
|
|
46
46
|
* @param {Object} arrayObject - The array or object to dot-notate
|
|
@@ -49,25 +49,25 @@ const handleRetainObjects = (retainObjects = []) => {
|
|
|
49
49
|
* @param {Object<string, *>} [results={}] - The final notated object to return
|
|
50
50
|
* @returns {Object<string, *>} The dot-notated object
|
|
51
51
|
* @private
|
|
52
|
-
*/
|
|
53
|
-
const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
|
|
54
|
-
for (
|
|
55
|
-
const value = arrayObject[key];
|
|
56
|
-
const currentKey = `${prepend}${key}`;
|
|
57
|
-
if (didRetain(currentKey, value, results)) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
// An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
|
|
61
|
-
// from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
|
|
62
|
-
if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
|
|
63
|
-
performDotNotate(value, didRetain, `${currentKey}.`, results);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
results[currentKey] = value;
|
|
67
|
-
}
|
|
68
|
-
return results;
|
|
69
|
-
};
|
|
70
|
-
|
|
52
|
+
*/
|
|
53
|
+
const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
|
|
54
|
+
for (const key in arrayObject) {
|
|
55
|
+
const value = arrayObject[key];
|
|
56
|
+
const currentKey = `${prepend}${key}`;
|
|
57
|
+
if (didRetain(currentKey, value, results)) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
// An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
|
|
61
|
+
// from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
|
|
62
|
+
if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
|
|
63
|
+
performDotNotate(value, didRetain, `${currentKey}.`, results);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
results[currentKey] = value;
|
|
67
|
+
}
|
|
68
|
+
return results;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
71
|
/**
|
|
72
72
|
* Convert an array or object to a single dimensional associative array with dot notation.
|
|
73
73
|
* Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotNotate.ts Sí, funciona}
|
|
@@ -75,6 +75,6 @@ const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) =>
|
|
|
75
75
|
* @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
|
|
76
76
|
* @returns {Object<string, *>} The dot-notated object
|
|
77
77
|
* @private
|
|
78
|
-
*/
|
|
79
|
-
const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
|
|
78
|
+
*/
|
|
79
|
+
const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
|
|
80
80
|
exports.dotNotate = dotNotate;
|
package/dist/utilities/dotSet.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.dotSet = void 0;
|
|
7
|
-
var _isObject = require("./isObject.js");
|
|
8
|
-
var _strAfter = require("./strAfter.js");
|
|
9
|
-
var _strBefore = require("./strBefore.js");
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dotSet = void 0;
|
|
7
|
+
var _isObject = require("./isObject.js");
|
|
8
|
+
var _strAfter = require("./strAfter.js");
|
|
9
|
+
var _strBefore = require("./strBefore.js");
|
|
10
10
|
/**
|
|
11
11
|
* Set a nested property value an object.
|
|
12
12
|
* Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotSet.ts Sí, funciona}
|
|
@@ -15,32 +15,32 @@ var _strBefore = require("./strBefore.js");
|
|
|
15
15
|
* @param {*} value - The default value to return if the property is not found
|
|
16
16
|
* @returns {Object} The modified object
|
|
17
17
|
* @private
|
|
18
|
-
*/
|
|
19
|
-
const dotSet = (arrayObject, dotNotation, value = null) => {
|
|
20
|
-
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
21
|
-
const lastKey = !key;
|
|
22
|
-
if (lastKey) {
|
|
23
|
-
key = dotNotation;
|
|
24
|
-
}
|
|
25
|
-
if (key === '*') {
|
|
26
|
-
for (
|
|
27
|
-
if (lastKey) {
|
|
28
|
-
arrayObject[wildKey] = value;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
if (!(0, _isObject.isObject)(arrayObject[wildKey])) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
dotSet(arrayObject[wildKey], (0, _strAfter.strAfter)(dotNotation, '.'), value);
|
|
35
|
-
}
|
|
36
|
-
return arrayObject;
|
|
37
|
-
}
|
|
38
|
-
if (lastKey) {
|
|
39
|
-
arrayObject[dotNotation] = value;
|
|
40
|
-
return arrayObject;
|
|
41
|
-
}
|
|
42
|
-
const next = arrayObject[key] ?? [];
|
|
43
|
-
arrayObject[key] = dotSet(next, (0, _strAfter.strAfter)(dotNotation, '.'), value);
|
|
44
|
-
return arrayObject;
|
|
45
|
-
};
|
|
18
|
+
*/
|
|
19
|
+
const dotSet = (arrayObject, dotNotation, value = null) => {
|
|
20
|
+
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
21
|
+
const lastKey = !key;
|
|
22
|
+
if (lastKey) {
|
|
23
|
+
key = dotNotation;
|
|
24
|
+
}
|
|
25
|
+
if (key === '*') {
|
|
26
|
+
for (const wildKey in arrayObject) {
|
|
27
|
+
if (lastKey) {
|
|
28
|
+
arrayObject[wildKey] = value;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!(0, _isObject.isObject)(arrayObject[wildKey])) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
dotSet(arrayObject[wildKey], (0, _strAfter.strAfter)(dotNotation, '.'), value);
|
|
35
|
+
}
|
|
36
|
+
return arrayObject;
|
|
37
|
+
}
|
|
38
|
+
if (lastKey) {
|
|
39
|
+
arrayObject[dotNotation] = value;
|
|
40
|
+
return arrayObject;
|
|
41
|
+
}
|
|
42
|
+
const next = arrayObject[key] ?? [];
|
|
43
|
+
arrayObject[key] = dotSet(next, (0, _strAfter.strAfter)(dotNotation, '.'), value);
|
|
44
|
+
return arrayObject;
|
|
45
|
+
};
|
|
46
46
|
exports.dotSet = dotSet;
|
package/functions/build.test.mjs
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
+
/* eslint-disable no-template-curly-in-string -- fixture source code, the ${...} is meant to stay literal */
|
|
1
2
|
import fs from 'fs'
|
|
2
3
|
import * as setUp from './test-helpers/setUp.mjs'
|
|
3
4
|
import { build } from './build.mjs'
|
|
4
5
|
import { clean } from './partials/clean.mjs'
|
|
6
|
+
import { sourceLint } from './sourceLint.mjs'
|
|
5
7
|
import { testFull } from './testFull.mjs'
|
|
6
8
|
import { typeDocs } from './typeDocs.mjs'
|
|
7
9
|
import { jsdocDocs } from './jsdocDocs.mjs'
|
|
8
10
|
import { countMatches } from 'test-filesystem'
|
|
9
|
-
|
|
10
|
-
// Run the real neostandard (in a subprocess) - Jest's CommonJS transform can't load the ESM-only package itself.
|
|
11
|
-
jest.mock('./partials/neostandardLint.mjs', () => require('./test-helpers/neostandardLintWithRealNeostandard.mjs'))
|
|
11
|
+
import { isolateGulpCache } from './test-helpers/isolateGulpCache.mjs'
|
|
12
12
|
|
|
13
13
|
setUp.setDefaults('test-build')
|
|
14
|
+
const clearImageCache = isolateGulpCache('build')
|
|
14
15
|
const gulpConfig = setUp.gulpConfig
|
|
15
16
|
|
|
16
17
|
const genericFunction = () => Promise.resolve(true)
|
|
17
18
|
|
|
18
19
|
jest.mock('./partials/clean.mjs', () => ({ clean: jest.fn(genericFunction) }))
|
|
19
20
|
jest.mock('./testFull.mjs', () => ({ testFull: jest.fn(genericFunction) }))
|
|
21
|
+
// Real linting is covered by sourceLint.test.mjs. Here it would run a fresh neostandard subprocess for every source
|
|
22
|
+
// file in every test, which pushed these tests past their timeout whenever the whole suite ran in parallel.
|
|
23
|
+
jest.mock('./sourceLint.mjs', () => ({ sourceLint: jest.fn(genericFunction) }))
|
|
20
24
|
// The documentation is generated by TypeDoc or jsdoc, whose own tests cover that (see typeDocsFor.test.mjs /
|
|
21
25
|
// jsdocDocsFor.test.mjs) - jsdocDocs in particular shells out to a real CLI, far too slow for a build.mjs unit
|
|
22
26
|
// test to actually run.
|
|
@@ -226,7 +230,7 @@ const imageContent = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
|
|
|
226
230
|
' inkscape:connector-curvature="0" />\n' +
|
|
227
231
|
'</svg>\n'
|
|
228
232
|
|
|
229
|
-
const imageCompressed = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"><image width="600" height="600" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAADsQAAA7EB9YPtSQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAhrSURB VHic7d3fi1x3Gcfx97M7TdKYYNPYbLaxlVZrUaK1iviToiIpeNFIwQuLBW8UEQTv9C/wSvDS+yKo CFopiFe2QVpqMKVYf0DaRmibZnfTRpNs9lez+3hxzq7T3ZnZmXO+3/PMmf284DDJzJznPGfOZ79n zpmzs+buiESZim5A9jYFUEIpgBJKAZRQCqC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T fPrxNvCzKgdAMv46Znac6uGD4tLu04n62e4m8ITCN7mmgLuimxjgyQpH3dIiHXZeqz8OHHjK3Z+P bkTy6pDuHF0qDvzG3c9GNyL5TQEXopvosg78QuHbOzrAq9FNlK4Cv3L3l6MbkeZ03P2qmV1mhC+U yeAcxQHHcmAPEmDzk5AzQcu/QXGa5ZcK395kxe9qg5mdAk41tNw14FngaXdfamiZMoa2AghgZl8H vphxee9Q/E7G0+6+mHE50hLbA2jA14CHSHt6Zg54EfiLu9f5ZRuZMO8K4NadxdeHPUzx7UZVP8+9 TBG6F919vnKHMtF6BnDrQbNZ4LMU3yY1w84v7naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF TkSuQmCC"/><path d="M19.04 494.382C2.001 482.76-2.83 468.022 5.006 451.587c3.27-6.858 10.156-15.228 15.3-18.599 8.904-5.834 9.948-5.675 21.728 3.31 28.014 21.367 44.09 18.882 51.548-7.971 5.951-21.426 5.252-305.141-.77-313.044-2.617-3.433-11.316-6.65-19.688-7.28-14.39-1.082-15.047-1.7-16.164-15.19L55.797 78.75h326.107l2.574 11.718c2.93 13.34-1.711 18.133-17.648 18.225-19.29.11-21.83 7.13-21.83 60.325V217.5h135v-48.169c0-41.902-.892-48.976-6.858-54.375-3.772-3.413-10.384-6.206-14.693-6.206-15.006 0-19.699-4.116-19.699-17.276V78.75h161.703l-1.164 14.063c-1.132 13.677-1.605 14.094-17.28 15.224-13.45.97-16.737 2.798-19.876 11.053-5.802 15.26-2.837 249.42 3.25 256.747 2.617 3.15 11.477 6.801 19.688 8.114C599.596 386.274 600 386.745 600 401.37v15.03l-79.687-1.012-79.688-1.012-1.137-13.607c-1.135-13.594-1.12-13.61 16.875-16.305 9.907-1.484 19.252-4.642 20.767-7.018 1.515-2.376 2.781-30.054 2.813-61.508L480 258.75H344.814l1.03 60.938 1.031 60.937 19.688 3.34c20.492 3.476 22.165 5.78 17.323 23.848-2.253 8.408-2.53 8.437-80.573 8.437H225v-14.956c0-14.536.418-15.022 14.93-17.343 8.21-1.313 17.07-4.966 19.687-8.119 3.637-4.381 4.758-35.56 4.758-132.343 0-69.636-1.23-127.842-2.735-129.348-9.738-9.743-68.924-8.348-79.154 1.866-3.087 3.081-4.993 46.77-6.525 149.486-1.455 97.609-3.646 149.68-6.69 159.02-13.551 41.573-61.403 74.912-111 77.337-22.755 1.112-28.167.082-39.232-7.468z"/></svg>'
|
|
233
|
+
const imageCompressed = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"><image width="600" height="600" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAADsQAAA7EB9YPtSQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAhrSURB VHic7d3fi1x3Gcfx97M7TdKYYNPYbLaxlVZrUaK1iviToiIpeNFIwQuLBW8UEQTv9C/wSvDS+yKo CFopiFe2QVpqMKVYf0DaRmibZnfTRpNs9lez+3hxzq7T3ZnZmXO+3/PMmf284DDJzJznPGfOZ79n zpmzs+buiESZim5A9jYFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBKqU2dmM5spa2wAXk4bXf/vd7/3eQ6AbZumdvl/931T2+6b6rOODtzs 00Ov3gY+7u5uZr2W36+33R6fBt509/XBW6A3M9sPHAPWh1ynXe/bZR0HbYN+6zwF3KgVQOBbwGzN Gq1XbJfkfgJcqTjvXcD3EvaSax2fr7sL3p+kDemlzmvblu2yXwEcX3Ve233JushLARxjB2rMO/kB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Ht6Zg54EfiLu9f5ZRuZMO8K4NadxdeHPUzx7UZVP8+9 TBG6F919vnKHMtF6BnDrQbNZ4LMU3yY1w84v7naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF TkSuQmCC"/><path style="fill:#000" d="M19.04 494.382C2.001 482.76-2.83 468.022 5.006 451.587c3.27-6.858 10.156-15.228 15.3-18.599 8.904-5.834 9.948-5.675 21.728 3.31 28.014 21.367 44.09 18.882 51.548-7.971 5.951-21.426 5.252-305.141-.77-313.044-2.617-3.433-11.316-6.65-19.688-7.28-14.39-1.082-15.047-1.7-16.164-15.19L55.797 78.75h326.107l2.574 11.718c2.93 13.34-1.711 18.133-17.648 18.225-19.29.11-21.83 7.13-21.83 60.325V217.5h135v-48.169c0-41.902-.892-48.976-6.858-54.375-3.772-3.413-10.384-6.206-14.693-6.206-15.006 0-19.699-4.116-19.699-17.276V78.75h161.703l-1.164 14.063c-1.132 13.677-1.605 14.094-17.28 15.224-13.45.97-16.737 2.798-19.876 11.053-5.802 15.26-2.837 249.42 3.25 256.747 2.617 3.15 11.477 6.801 19.688 8.114C599.596 386.274 600 386.745 600 401.37v15.03l-79.687-1.012-79.688-1.012-1.137-13.607c-1.135-13.594-1.12-13.61 16.875-16.305 9.907-1.484 19.252-4.642 20.767-7.018 1.515-2.376 2.781-30.054 2.813-61.508L480 258.75H344.814l1.03 60.938 1.031 60.937 19.688 3.34c20.492 3.476 22.165 5.78 17.323 23.848-2.253 8.408-2.53 8.437-80.573 8.437H225v-14.956c0-14.536.418-15.022 14.93-17.343 8.21-1.313 17.07-4.966 19.687-8.119 3.637-4.381 4.758-35.56 4.758-132.343 0-69.636-1.23-127.842-2.735-129.348-9.738-9.743-68.924-8.348-79.154 1.866-3.087 3.081-4.993 46.77-6.525 149.486-1.455 97.609-3.646 149.68-6.69 159.02-13.551 41.573-61.403 74.912-111 77.337-22.755 1.112-28.167.082-39.232-7.468z"/></svg>'
|
|
230
234
|
|
|
231
235
|
const imagePath = gulpConfig.get('srcPath') + '/img'
|
|
232
236
|
|
|
@@ -251,8 +255,10 @@ const sassContents = 'html\n' +
|
|
|
251
255
|
|
|
252
256
|
const sassPath = gulpConfig.get('sass.path')
|
|
253
257
|
|
|
258
|
+
// The cache outlives a run, so clear it or a stale result from an older imagemin can pass
|
|
254
259
|
beforeEach(
|
|
255
|
-
() =>
|
|
260
|
+
() => clearImageCache()
|
|
261
|
+
.then(setUp.beforeEach)
|
|
256
262
|
.then(
|
|
257
263
|
async () => {
|
|
258
264
|
const srcPath = gulpConfig.get('srcPath')
|
|
@@ -695,7 +701,7 @@ describe('build', () => {
|
|
|
695
701
|
})
|
|
696
702
|
}, 30000)
|
|
697
703
|
|
|
698
|
-
test('finishes clean before starting the tasks that write into the output folders', done => {
|
|
704
|
+
test('finishes clean and sourceLint before starting the tasks that write into the output folders', done => {
|
|
699
705
|
const srcPath = gulpConfig.get('srcPath')
|
|
700
706
|
const sourcesPath = `${srcPath}/sources`
|
|
701
707
|
fs.writeFileSync(`${sourcesPath}/file1.js`, file1Contents)
|
|
@@ -707,6 +713,10 @@ describe('build', () => {
|
|
|
707
713
|
events.push('clean finished')
|
|
708
714
|
resolve(true)
|
|
709
715
|
}, 100)))
|
|
716
|
+
sourceLint.mockImplementationOnce(() => new Promise(resolve => setTimeout(() => {
|
|
717
|
+
events.push('sourceLint finished')
|
|
718
|
+
resolve(true)
|
|
719
|
+
}, 50)))
|
|
710
720
|
testFull.mockImplementationOnce(() => {
|
|
711
721
|
events.push('testFull started')
|
|
712
722
|
return Promise.resolve(true)
|
|
@@ -719,7 +729,7 @@ describe('build', () => {
|
|
|
719
729
|
gulpConfig.set('typescript.enabled', false)
|
|
720
730
|
gulpConfig.set('docs.enabled', false)
|
|
721
731
|
build(() => {
|
|
722
|
-
expect(events).toEqual(['clean finished', 'testFull started'])
|
|
732
|
+
expect(events).toEqual(['sourceLint finished', 'clean finished', 'testFull started'])
|
|
723
733
|
done()
|
|
724
734
|
})
|
|
725
735
|
}, 30000)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import fs from 'fs'
|
|
2
2
|
import * as setUp from './test-helpers/setUp.mjs'
|
|
3
3
|
import { images } from './images.mjs'
|
|
4
|
+
import { isolateGulpCache } from './test-helpers/isolateGulpCache.mjs'
|
|
4
5
|
|
|
5
6
|
setUp.setDefaults('test-images')
|
|
7
|
+
const clearImageCache = isolateGulpCache('images')
|
|
6
8
|
const gulpConfig = setUp.gulpConfig
|
|
7
9
|
|
|
8
10
|
const imageContents = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' +
|
|
@@ -114,7 +116,8 @@ const imageContents = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
|
|
|
114
116
|
' inkscape:connector-curvature="0" />\n' +
|
|
115
117
|
'</svg>\n'
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
// The cache outlives a run, so clear it or a stale result from an older imagemin can pass
|
|
120
|
+
beforeEach(() => clearImageCache().then(setUp.beforeEach))
|
|
118
121
|
|
|
119
122
|
afterEach(setUp.afterEach)
|
|
120
123
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { lintSource } from './partials/lintSource.mjs'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The standalone lint command (`gulp lint`, or `npm run lint`): the same linting and fixing as sourceLint, but it
|
|
5
|
+
* fails (exits non-zero) when any errors remain that neostandard could not fix automatically.
|
|
6
|
+
* @memberOf module:js-build-tools
|
|
7
|
+
* @returns {*}
|
|
8
|
+
*/
|
|
9
|
+
export const lint = () => lintSource({ failOnError: true })
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-template-curly-in-string -- fixture source code, the ${...} is meant to stay literal */
|
|
1
2
|
import fs from 'fs'
|
|
2
3
|
import * as setUp from '../test-helpers/setUp.mjs'
|
|
3
4
|
import { addToReadme } from './addToReadme.mjs'
|
|
@@ -30,4 +31,4 @@ describe('addToReadme', () => {
|
|
|
30
31
|
// At least the documentation will have the addToReadme documentation
|
|
31
32
|
await expect(readme.includes('sayHello')).toBeTruthy()
|
|
32
33
|
})
|
|
33
|
-
})
|
|
34
|
+
})
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cache from 'gulp-cache'
|
|
2
2
|
import { requirePeer } from './loadPeer.mjs'
|
|
3
3
|
import { dest, src } from 'gulp'
|
|
4
|
-
import path from 'node:path'
|
|
5
4
|
import * as gulpConfig from '../../gulp.config.mjs'
|
|
6
5
|
|
|
7
6
|
const installHint = 'Add it to your project with: npm install --save-dev github:jheagle/gulp-imagemin#common-js-compatibility ' +
|
|
@@ -3,8 +3,10 @@ import * as setUp from '../test-helpers/setUp.mjs'
|
|
|
3
3
|
import os from 'os'
|
|
4
4
|
import zlib from 'zlib'
|
|
5
5
|
import { imagesFor, loadImagemin } from './imagesFor.mjs'
|
|
6
|
+
import { isolateGulpCache } from '../test-helpers/isolateGulpCache.mjs'
|
|
6
7
|
|
|
7
8
|
setUp.setDefaults('test-images-for')
|
|
9
|
+
const clearImageCache = isolateGulpCache('images-for')
|
|
8
10
|
const gulpConfig = setUp.gulpConfig
|
|
9
11
|
|
|
10
12
|
const imageContents = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n' +
|
|
@@ -116,7 +118,7 @@ const imageContents = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'
|
|
|
116
118
|
' inkscape:connector-curvature="0" />\n' +
|
|
117
119
|
'</svg>\n'
|
|
118
120
|
|
|
119
|
-
const imageCompressed = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"><image width="600" height="600" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA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jqfeAKQP4 lrsvJKwngZoKYMprzv6RsJYEGxhAM7vXzD6dYDkfT1Bj098T1pJgO94DlkesJ4EvAXeX930U+LW7 j3xqoLzm7MP12txy0d3/naiWjIF3BbAM32PsvBjzY8CdZvaEu4/6925PUu9zzW5/TFRHxsTWLri8 gvVx+l8JfBT4gZl9fsRlpLqy+DV3/1eiWjImut8DnqYY6QbpAI+a2eNmtn+34uWu+/4a/XXT6DeB OgDlZeKfG2G+B4ATZvZbdz/f6wlmdj/F7jyFl/otR9rN3B0z+z5wb8Ual4CzwBvAMsWVxg9S7HpT fPrxNvCzKgdAMv46Znac6uGD4tLu04n62e4m8ITCN7mmgLuimxjgyQpH3dIiHXZeqz8OHHjK3Z+P bkTy6pDuHF0qDvzG3c9GNyL5TQEXopvosg78QuHbOzrAq9FNlK4Cv3L3l6MbkeZ03P2qmV1mhC+U yeAcxQHHcmAPEmDzk5AzQcu/QXGa5ZcK395kxe9qg5mdAk41tNw14FngaXdfamiZMoa2AghgZl8H vphxee9Q/E7G0+6+mHE50hLbA2jA14CHSHt6Zg54EfiLu9f5ZRuZMO8K4NadxdeHPUzx7UZVP8+9 TBG6F919vnKHMtF6BnDrQbNZ4LMU3yY1w84v7naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF TkSuQmCC"/><path d="M19.04 494.382C2.001 482.76-2.83 468.022 5.006 451.587c3.27-6.858 10.156-15.228 15.3-18.599 8.904-5.834 9.948-5.675 21.728 3.31 28.014 21.367 44.09 18.882 51.548-7.971 5.951-21.426 5.252-305.141-.77-313.044-2.617-3.433-11.316-6.65-19.688-7.28-14.39-1.082-15.047-1.7-16.164-15.19L55.797 78.75h326.107l2.574 11.718c2.93 13.34-1.711 18.133-17.648 18.225-19.29.11-21.83 7.13-21.83 60.325V217.5h135v-48.169c0-41.902-.892-48.976-6.858-54.375-3.772-3.413-10.384-6.206-14.693-6.206-15.006 0-19.699-4.116-19.699-17.276V78.75h161.703l-1.164 14.063c-1.132 13.677-1.605 14.094-17.28 15.224-13.45.97-16.737 2.798-19.876 11.053-5.802 15.26-2.837 249.42 3.25 256.747 2.617 3.15 11.477 6.801 19.688 8.114C599.596 386.274 600 386.745 600 401.37v15.03l-79.687-1.012-79.688-1.012-1.137-13.607c-1.135-13.594-1.12-13.61 16.875-16.305 9.907-1.484 19.252-4.642 20.767-7.018 1.515-2.376 2.781-30.054 2.813-61.508L480 258.75H344.814l1.03 60.938 1.031 60.937 19.688 3.34c20.492 3.476 22.165 5.78 17.323 23.848-2.253 8.408-2.53 8.437-80.573 8.437H225v-14.956c0-14.536.418-15.022 14.93-17.343 8.21-1.313 17.07-4.966 19.687-8.119 3.637-4.381 4.758-35.56 4.758-132.343 0-69.636-1.23-127.842-2.735-129.348-9.738-9.743-68.924-8.348-79.154 1.866-3.087 3.081-4.993 46.77-6.525 149.486-1.455 97.609-3.646 149.68-6.69 159.02-13.551 41.573-61.403 74.912-111 77.337-22.755 1.112-28.167.082-39.232-7.468z"/></svg>'
|
|
121
|
+
const imageCompressed = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600"><image width="600" height="600" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAADsQAAA7EB9YPtSQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAhrSURB VHic7d3fi1x3Gcfx97M7TdKYYNPYbLaxlVZrUaK1iviToiIpeNFIwQuLBW8UEQTv9C/wSvDS+yKo CFopiFe2QVpqMKVYf0DaRmibZnfTRpNs9lez+3hxzq7T3ZnZmXO+3/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f6wlmdj/F7jyFl/otR9rN3B0z+z5wb8Ual4CzwBvAMsWVxg9S7HpT fPrxNvCzKgdAMv46Znac6uGD4tLu04n62e4m8ITCN7mmgLuimxjgyQpH3dIiHXZeqz8OHHjK3Z+P bkTy6pDuHF0qDvzG3c9GNyL5TQEXopvosg78QuHbOzrAq9FNlK4Cv3L3l6MbkeZ03P2qmV1mhC+U yeAcxQHHcmAPEmDzk5AzQcu/QXGa5ZcK395kxe9qg5mdAk41tNw14FngaXdfamiZMoa2AghgZl8H vphxee9Q/E7G0+6+mHE50hLbA2jA14CHSHt6Zg54EfiLu9f5ZRuZMO8K4NadxdeHPUzx7UZVP8+9 TBG6F919vnKHMtF6BnDrQbNZ4LMU3yY1w84v7naKX6C+QXFRwhubk7vfyNGwTJaBAdzxZLMDwBGK g4glYMVHKSCyzUgBFEmtzd+OJRNAAZRQCqCEUgAllAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAl lAIooRRACaUASigFUEIpgBJKAZRQCqCEUgAllAIooRRACaUASigFUEL9D1MqMi7YkUEVAAAAAElF TkSuQmCC"/><path style="fill:#000" d="M19.04 494.382C2.001 482.76-2.83 468.022 5.006 451.587c3.27-6.858 10.156-15.228 15.3-18.599 8.904-5.834 9.948-5.675 21.728 3.31 28.014 21.367 44.09 18.882 51.548-7.971 5.951-21.426 5.252-305.141-.77-313.044-2.617-3.433-11.316-6.65-19.688-7.28-14.39-1.082-15.047-1.7-16.164-15.19L55.797 78.75h326.107l2.574 11.718c2.93 13.34-1.711 18.133-17.648 18.225-19.29.11-21.83 7.13-21.83 60.325V217.5h135v-48.169c0-41.902-.892-48.976-6.858-54.375-3.772-3.413-10.384-6.206-14.693-6.206-15.006 0-19.699-4.116-19.699-17.276V78.75h161.703l-1.164 14.063c-1.132 13.677-1.605 14.094-17.28 15.224-13.45.97-16.737 2.798-19.876 11.053-5.802 15.26-2.837 249.42 3.25 256.747 2.617 3.15 11.477 6.801 19.688 8.114C599.596 386.274 600 386.745 600 401.37v15.03l-79.687-1.012-79.688-1.012-1.137-13.607c-1.135-13.594-1.12-13.61 16.875-16.305 9.907-1.484 19.252-4.642 20.767-7.018 1.515-2.376 2.781-30.054 2.813-61.508L480 258.75H344.814l1.03 60.938 1.031 60.937 19.688 3.34c20.492 3.476 22.165 5.78 17.323 23.848-2.253 8.408-2.53 8.437-80.573 8.437H225v-14.956c0-14.536.418-15.022 14.93-17.343 8.21-1.313 17.07-4.966 19.687-8.119 3.637-4.381 4.758-35.56 4.758-132.343 0-69.636-1.23-127.842-2.735-129.348-9.738-9.743-68.924-8.348-79.154 1.866-3.087 3.081-4.993 46.77-6.525 149.486-1.455 97.609-3.646 149.68-6.69 159.02-13.551 41.573-61.403 74.912-111 77.337-22.755 1.112-28.167.082-39.232-7.468z"/></svg>'
|
|
120
122
|
|
|
121
123
|
// Build a small but real PNG so the test exercises binary data (a text-only SVG hid Gulp 5's utf8 corruption of images).
|
|
122
124
|
const crc32 = buffer => {
|
|
@@ -156,7 +158,8 @@ const makePng = (size = 32) => {
|
|
|
156
158
|
])
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
// The cache outlives a run, so clear it or a stale result from an older imagemin can pass
|
|
162
|
+
beforeEach(() => clearImageCache().then(setUp.beforeEach))
|
|
160
163
|
|
|
161
164
|
afterEach(setUp.afterEach)
|
|
162
165
|
|
|
@@ -117,9 +117,17 @@ export const jsdocDocsFor = (
|
|
|
117
117
|
// quick-start example, which sets this explicitly, not assumed from jsdoc's own classic defaults.
|
|
118
118
|
recurse: true,
|
|
119
119
|
template: themeDir,
|
|
120
|
-
// clean-jsdoc-theme's own
|
|
121
|
-
// site root ("/"), while every page is in one
|
|
122
|
-
|
|
120
|
+
// clean-jsdoc-theme's own options for the name in its header and the home page's <title> (otherwise "Home").
|
|
121
|
+
// The header is given as a link: a plain-text title links to the site root ("/"), while every page is in one
|
|
122
|
+
// folder, so index.html is the home page wherever they are served. Both are printed unescaped by the theme.
|
|
123
|
+
...(title
|
|
124
|
+
? {
|
|
125
|
+
theme_opts: {
|
|
126
|
+
title: `<a href="index.html" class="sidebar-title sidebar-title-anchor">${escapeHtml(title)}</a>`,
|
|
127
|
+
homepageTitle: escapeHtml(title)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
: {}),
|
|
123
131
|
...(indexFile && fs.existsSync(indexFile) ? { readme: path.resolve(indexFile) } : {})
|
|
124
132
|
}
|
|
125
133
|
}
|