js-build-tools 6.1.0 → 6.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -25
- package/dist/build.js +5 -2
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +40 -40
- package/dist/bundleMinify.js +18 -18
- package/dist/copyFiles.js +47 -0
- package/dist/copyFiles.min.js +1 -0
- package/dist/copyFonts.js +13 -13
- package/dist/default.js +15 -15
- package/dist/distMinify.js +13 -13
- package/dist/docs.js +19 -0
- package/dist/docs.min.js +1 -0
- package/dist/jsdocDocs.js +15 -0
- package/dist/jsdocDocs.min.js +1 -0
- package/dist/partials/addToReadme.js +25 -25
- package/dist/partials/beginWatcher.js +13 -13
- package/dist/partials/clean.js +15 -15
- package/dist/partials/copyFor.js +10 -2
- package/dist/partials/distFor.js +22 -22
- package/dist/partials/distForSrc.js +12 -12
- package/dist/partials/distSeries.js +20 -20
- package/dist/partials/imagesFor.js +43 -43
- package/dist/partials/jsdocDocsFor.js +155 -0
- package/dist/partials/neostandardLint.js +121 -121
- package/dist/partials/readmeTemplate.js +15 -15
- package/dist/partials/resolveDocsMethod.js +19 -0
- package/dist/partials/runOnChange.js +29 -29
- package/dist/partials/sassFor.js +29 -29
- package/dist/partials/tsFor.js +71 -71
- package/dist/partials/typeDocsFor.js +203 -203
- package/dist/partials.js +149 -135
- package/dist/partials.min.js +1 -1
- package/dist/sourceLint.js +26 -26
- package/dist/test-helpers/neostandardLintWithRealNeostandard.js +49 -49
- package/dist/test-helpers/setUp.js +95 -95
- package/dist/testFull.js +20 -20
- package/dist/testHelpers.js +10 -10
- package/dist/testQuick.js +22 -22
- package/dist/utilities/dotNotate.js +48 -48
- package/dist/utilities/getBundleConfigs.js +28 -28
- package/dist/watchTest.js +16 -16
- package/functions/build.mjs +5 -2
- package/functions/build.test.mjs +50 -1
- package/functions/copyFiles.mjs +32 -0
- package/functions/copyFiles.test.mjs +78 -0
- package/functions/docs.mjs +13 -0
- package/functions/docs.test.mjs +45 -0
- package/functions/jsdocDocs.mjs +10 -0
- package/functions/partials/copyFor.mjs +4 -1
- package/functions/partials/jsdocDocsFor.mjs +132 -0
- package/functions/partials/jsdocDocsFor.test.mjs +101 -0
- package/functions/partials/resolveDocsMethod.mjs +10 -0
- package/functions/partials/resolveDocsMethod.test.mjs +33 -0
- package/functions/partials.mjs +2 -0
- package/functions/partials.test.mjs +1 -1
- package/gulp.config.mjs +28 -5
- package/gulpfile.base.mjs +4 -1
- package/package.json +14 -1
|
@@ -1,100 +1,100 @@
|
|
|
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
|
-
Object.defineProperty(exports, "afterEach", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _testFilesystem.afterEach;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "beforeEach", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _testFilesystem.beforeEach;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "countMatches", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _testFilesystem.countMatches;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "createTempDir", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _testFilesystem.createTempDir;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "fileExists", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return _testFilesystem.fileExists;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
exports.gulpConfig = void 0;
|
|
38
|
-
Object.defineProperty(exports, "logObject", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _testFilesystem.logObject;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
Object.defineProperty(exports, "removeDirectory", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () {
|
|
47
|
-
return _testFilesystem.removeDirectory;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
exports.setDefaults = void 0;
|
|
51
|
-
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
52
|
-
exports.gulpConfig = gulpConfig;
|
|
53
|
-
var _testFilesystem = require("test-filesystem");
|
|
54
|
-
var cache;
|
|
55
|
-
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; }
|
|
56
|
-
// Import the configurations and override some of them to direct to the temp directory.
|
|
57
|
-
|
|
58
|
-
let tempDir = 'test-temp/';
|
|
59
|
-
let srcPath = `${tempDir}src`;
|
|
60
|
-
|
|
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
|
+
Object.defineProperty(exports, "afterEach", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _testFilesystem.afterEach;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "beforeEach", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _testFilesystem.beforeEach;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "countMatches", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _testFilesystem.countMatches;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "createTempDir", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _testFilesystem.createTempDir;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "fileExists", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _testFilesystem.fileExists;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports.gulpConfig = void 0;
|
|
38
|
+
Object.defineProperty(exports, "logObject", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _testFilesystem.logObject;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _testFilesystem.removeDirectory;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
exports.setDefaults = void 0;
|
|
51
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
52
|
+
exports.gulpConfig = gulpConfig;
|
|
53
|
+
var _testFilesystem = require("test-filesystem");
|
|
54
|
+
var cache;
|
|
55
|
+
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; }
|
|
56
|
+
// Import the configurations and override some of them to direct to the temp directory.
|
|
57
|
+
|
|
58
|
+
let tempDir = 'test-temp/';
|
|
59
|
+
let srcPath = `${tempDir}src`;
|
|
60
|
+
|
|
61
61
|
/**
|
|
62
62
|
* Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
63
63
|
* @memberOf module:testHelpers
|
|
64
64
|
* @param {string} testDir
|
|
65
|
-
*/
|
|
66
|
-
const setDefaults = (testDir = 'test-temp') => {
|
|
67
|
-
tempDir = `${testDir}/`;
|
|
68
|
-
srcPath = `${tempDir}src`;
|
|
69
|
-
_testFilesystem.setUp.setDefaults(tempDir);
|
|
70
|
-
const distPath = `${tempDir}dist`;
|
|
71
|
-
const browserPath = `${tempDir}browser`;
|
|
72
|
-
const sassPath = `${tempDir}sass`;
|
|
73
|
-
gulpConfig.set('browser.from', `${distPath}/**/*.js`);
|
|
74
|
-
gulpConfig.set('browser.to', browserPath);
|
|
75
|
-
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
76
|
-
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
77
|
-
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
78
|
-
gulpConfig.set('dist.to', distPath);
|
|
79
|
-
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
80
|
-
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
81
|
-
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
82
|
-
gulpConfig.set('images.to', `${browserPath}/img`);
|
|
83
|
-
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
84
|
-
gulpConfig.set('readme.to', tempDir);
|
|
85
|
-
gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`);
|
|
86
|
-
// Reset explicitly: gulpConfig is a process-wide singleton seeded once from this real project's own
|
|
87
|
-
// build-tools.config.json, so without this, this project's own real readme.fromEsm value (gulp.config.mjs)
|
|
88
|
-
// would leak into every test that exercises addToReadme/compileReadme but never sets this path itself -
|
|
89
|
-
// doing real file I/O and a real jsdoc-to-markdown parse of this project's own, much larger, config file.
|
|
90
|
-
gulpConfig.set('readme.fromEsm', []);
|
|
91
|
-
gulpConfig.set('rootPath', tempDir);
|
|
92
|
-
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
93
|
-
gulpConfig.set('sass.path', sassPath);
|
|
94
|
-
gulpConfig.set('sass.to', `${browserPath}/css`);
|
|
95
|
-
gulpConfig.set('srcPath', srcPath);
|
|
96
|
-
gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`);
|
|
97
|
-
gulpConfig.set('typescript.to', distPath);
|
|
98
|
-
gulpConfig.set('test.watch', `${srcPath}/**/*.js`);
|
|
99
|
-
};
|
|
65
|
+
*/
|
|
66
|
+
const setDefaults = (testDir = 'test-temp') => {
|
|
67
|
+
tempDir = `${testDir}/`;
|
|
68
|
+
srcPath = `${tempDir}src`;
|
|
69
|
+
_testFilesystem.setUp.setDefaults(tempDir);
|
|
70
|
+
const distPath = `${tempDir}dist`;
|
|
71
|
+
const browserPath = `${tempDir}browser`;
|
|
72
|
+
const sassPath = `${tempDir}sass`;
|
|
73
|
+
gulpConfig.set('browser.from', `${distPath}/**/*.js`);
|
|
74
|
+
gulpConfig.set('browser.to', browserPath);
|
|
75
|
+
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
76
|
+
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
77
|
+
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
78
|
+
gulpConfig.set('dist.to', distPath);
|
|
79
|
+
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
80
|
+
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
81
|
+
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
82
|
+
gulpConfig.set('images.to', `${browserPath}/img`);
|
|
83
|
+
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
84
|
+
gulpConfig.set('readme.to', tempDir);
|
|
85
|
+
gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`);
|
|
86
|
+
// Reset explicitly: gulpConfig is a process-wide singleton seeded once from this real project's own
|
|
87
|
+
// build-tools.config.json, so without this, this project's own real readme.fromEsm value (gulp.config.mjs)
|
|
88
|
+
// would leak into every test that exercises addToReadme/compileReadme but never sets this path itself -
|
|
89
|
+
// doing real file I/O and a real jsdoc-to-markdown parse of this project's own, much larger, config file.
|
|
90
|
+
gulpConfig.set('readme.fromEsm', []);
|
|
91
|
+
gulpConfig.set('rootPath', tempDir);
|
|
92
|
+
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
93
|
+
gulpConfig.set('sass.path', sassPath);
|
|
94
|
+
gulpConfig.set('sass.to', `${browserPath}/css`);
|
|
95
|
+
gulpConfig.set('srcPath', srcPath);
|
|
96
|
+
gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`);
|
|
97
|
+
gulpConfig.set('typescript.to', distPath);
|
|
98
|
+
gulpConfig.set('test.watch', `${srcPath}/**/*.js`);
|
|
99
|
+
};
|
|
100
100
|
exports.setDefaults = setDefaults;
|
package/dist/testFull.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
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.testFull = void 0;
|
|
8
|
-
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
-
var _jest = require("jest");
|
|
10
|
-
var cache;
|
|
11
|
-
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
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.testFull = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
+
var _jest = require("jest");
|
|
10
|
+
var cache;
|
|
11
|
+
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; }
|
|
12
12
|
/**
|
|
13
13
|
* Run all tests with jest.
|
|
14
14
|
* Configure where tests are located by using 'testPath'.
|
|
15
15
|
* @memberOf module:js-build-tools
|
|
16
16
|
* @returns {Promise<*>}
|
|
17
|
-
*/
|
|
18
|
-
const testFull = () => {
|
|
19
|
-
let testPath = gulpConfig.get('test.path');
|
|
20
|
-
if (!Array.isArray(testPath)) {
|
|
21
|
-
// The testPath must be an array of strings
|
|
22
|
-
testPath = [testPath];
|
|
23
|
-
}
|
|
24
|
-
return (0, _jest.runCLI)(gulpConfig.get('test.options'), testPath);
|
|
25
|
-
};
|
|
17
|
+
*/
|
|
18
|
+
const testFull = () => {
|
|
19
|
+
let testPath = gulpConfig.get('test.path');
|
|
20
|
+
if (!Array.isArray(testPath)) {
|
|
21
|
+
// The testPath must be an array of strings
|
|
22
|
+
testPath = [testPath];
|
|
23
|
+
}
|
|
24
|
+
return (0, _jest.runCLI)(gulpConfig.get('test.options'), testPath);
|
|
25
|
+
};
|
|
26
26
|
exports.testFull = testFull;
|
package/dist/testHelpers.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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.testHelpers = void 0;
|
|
8
|
-
var _testHelpers = _interopRequireWildcard(require("./test-helpers/setUp.js"));
|
|
9
|
-
exports.testHelpers = _testHelpers;
|
|
10
|
-
var cache;
|
|
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.testHelpers = void 0;
|
|
8
|
+
var _testHelpers = _interopRequireWildcard(require("./test-helpers/setUp.js"));
|
|
9
|
+
exports.testHelpers = _testHelpers;
|
|
10
|
+
var cache;
|
|
11
11
|
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; }
|
package/dist/testQuick.js
CHANGED
|
@@ -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.testQuick = void 0;
|
|
8
|
-
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
-
var _jest = require("jest");
|
|
10
|
-
var cache;
|
|
11
|
-
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
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.testQuick = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
+
var _jest = require("jest");
|
|
10
|
+
var cache;
|
|
11
|
+
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; }
|
|
12
12
|
/**
|
|
13
13
|
* Run the Jest tests for files which have been modified (based on git status).
|
|
14
14
|
* Configure where tests are located by using 'testPath'.
|
|
15
15
|
* @memberOf module:js-build-tools
|
|
16
16
|
* @returns {Promise<*>}
|
|
17
|
-
*/
|
|
18
|
-
const testQuick = () => {
|
|
19
|
-
let testPath = gulpConfig.get('test.path');
|
|
20
|
-
if (!Array.isArray(testPath)) {
|
|
21
|
-
// The testPath must be an array of strings
|
|
22
|
-
testPath = [testPath];
|
|
23
|
-
}
|
|
24
|
-
return (0, _jest.runCLI)({
|
|
25
|
-
onlyChanged: true
|
|
26
|
-
}, testPath);
|
|
27
|
-
};
|
|
17
|
+
*/
|
|
18
|
+
const testQuick = () => {
|
|
19
|
+
let testPath = gulpConfig.get('test.path');
|
|
20
|
+
if (!Array.isArray(testPath)) {
|
|
21
|
+
// The testPath must be an array of strings
|
|
22
|
+
testPath = [testPath];
|
|
23
|
+
}
|
|
24
|
+
return (0, _jest.runCLI)({
|
|
25
|
+
onlyChanged: true
|
|
26
|
+
}, testPath);
|
|
27
|
+
};
|
|
28
28
|
exports.testQuick = testQuick;
|
|
@@ -1,43 +1,43 @@
|
|
|
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
|
-
*/
|
|
15
|
-
const handleRetainObjects = (retainObjects = []) => {
|
|
16
|
-
if (!retainObjects.length) {
|
|
14
|
+
*/
|
|
15
|
+
const handleRetainObjects = (retainObjects = []) => {
|
|
16
|
+
if (!retainObjects.length) {
|
|
17
17
|
/**
|
|
18
18
|
* Bypass the test function if there are no retainObjects.
|
|
19
19
|
* @returns {false}
|
|
20
|
-
*/
|
|
21
|
-
return (currentKey, value, results) => false;
|
|
22
|
-
}
|
|
23
|
-
retainObjects = retainObjects.map(key => key.replace('\.', '\\.'));
|
|
24
|
-
const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
|
|
20
|
+
*/
|
|
21
|
+
return (currentKey, value, results) => false;
|
|
22
|
+
}
|
|
23
|
+
retainObjects = retainObjects.map(key => key.replace('\.', '\\.'));
|
|
24
|
+
const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
|
|
25
25
|
/**
|
|
26
26
|
* Test if a key should be retained as an object.
|
|
27
27
|
* @param {string} currentKey - The key to test
|
|
28
28
|
* @param {*} value - The value of the key
|
|
29
29
|
* @param {Object} results - The result object to add to
|
|
30
30
|
* @returns {boolean}
|
|
31
|
-
*/
|
|
32
|
-
return (currentKey, value, results) => {
|
|
33
|
-
if (!currentKey.match(retainRegex)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
results[currentKey] = value;
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
31
|
+
*/
|
|
32
|
+
return (currentKey, value, results) => {
|
|
33
|
+
if (!currentKey.match(retainRegex)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
results[currentKey] = value;
|
|
37
|
+
return true;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
41
|
/**
|
|
42
42
|
* The underlying logic function for converting arrays to dot-notation.
|
|
43
43
|
* @param {Object} arrayObject - The array or object to dot-notate
|
|
@@ -45,31 +45,31 @@ const handleRetainObjects = (retainObjects = []) => {
|
|
|
45
45
|
* @param {string} [prepend=''] - The path for the property being processed
|
|
46
46
|
* @param {Object<string, *>} [results={}] - The final notated object to return
|
|
47
47
|
* @returns {Object<string, *>} The dot-notated object
|
|
48
|
-
*/
|
|
49
|
-
const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
|
|
50
|
-
for (let key in arrayObject) {
|
|
51
|
-
const value = arrayObject[key];
|
|
52
|
-
const currentKey = `${prepend}${key}`;
|
|
53
|
-
if (didRetain(currentKey, value, results)) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
// An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
|
|
57
|
-
// from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
|
|
58
|
-
if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
|
|
59
|
-
performDotNotate(value, didRetain, `${currentKey}.`, results);
|
|
60
|
-
continue;
|
|
61
|
-
}
|
|
62
|
-
results[currentKey] = value;
|
|
63
|
-
}
|
|
64
|
-
return results;
|
|
65
|
-
};
|
|
66
|
-
|
|
48
|
+
*/
|
|
49
|
+
const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
|
|
50
|
+
for (let key in arrayObject) {
|
|
51
|
+
const value = arrayObject[key];
|
|
52
|
+
const currentKey = `${prepend}${key}`;
|
|
53
|
+
if (didRetain(currentKey, value, results)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
// An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
|
|
57
|
+
// from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
|
|
58
|
+
if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
|
|
59
|
+
performDotNotate(value, didRetain, `${currentKey}.`, results);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
results[currentKey] = value;
|
|
63
|
+
}
|
|
64
|
+
return results;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
67
|
/**
|
|
68
68
|
* Convert an array or object to a single dimensional associative array with dot notation.
|
|
69
69
|
* Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotNotate.ts Sí, funciona}
|
|
70
70
|
* @param {Object} arrayObject - The array or object to dot-notate
|
|
71
71
|
* @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
|
|
72
72
|
* @returns {Object<string, *>} The dot-notated object
|
|
73
|
-
*/
|
|
74
|
-
const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
|
|
73
|
+
*/
|
|
74
|
+
const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
|
|
75
75
|
exports.dotNotate = dotNotate;
|
|
@@ -1,15 +1,15 @@
|
|
|
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.getBundleConfigs = void 0;
|
|
8
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
10
|
-
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.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
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getBundleConfigs = void 0;
|
|
8
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
9
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
10
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.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; }
|
|
13
13
|
/**
|
|
14
14
|
* Build the full list of bundles to produce for this project: the primary bundle (browser.name /
|
|
15
15
|
* dist.main / browser.ignore / browser.exclude, exactly as before browser.bundles existed) plus
|
|
@@ -18,20 +18,20 @@ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e;
|
|
|
18
18
|
* specify what's actually different about it.
|
|
19
19
|
* @memberOf module:utilities
|
|
20
20
|
* @returns {Array<{name: string, main: string, ignore: Array, exclude: Array}>}
|
|
21
|
-
*/
|
|
22
|
-
const getBundleConfigs = () => {
|
|
23
|
-
const primary = {
|
|
24
|
-
name: gulpConfig.get('browser.name'),
|
|
25
|
-
main: gulpConfig.get('dist.main'),
|
|
26
|
-
ignore: gulpConfig.get('browser.ignore'),
|
|
27
|
-
exclude: gulpConfig.get('browser.exclude')
|
|
28
|
-
};
|
|
29
|
-
const additional = gulpConfig.get('browser.bundles');
|
|
30
|
-
return [primary, ...additional.map(bundleConfig => ({
|
|
31
|
-
name: bundleConfig.name,
|
|
32
|
-
main: bundleConfig.main || primary.main,
|
|
33
|
-
ignore: bundleConfig.ignore || primary.ignore,
|
|
34
|
-
exclude: bundleConfig.exclude || primary.exclude
|
|
35
|
-
}))];
|
|
36
|
-
};
|
|
21
|
+
*/
|
|
22
|
+
const getBundleConfigs = () => {
|
|
23
|
+
const primary = {
|
|
24
|
+
name: gulpConfig.get('browser.name'),
|
|
25
|
+
main: gulpConfig.get('dist.main'),
|
|
26
|
+
ignore: gulpConfig.get('browser.ignore'),
|
|
27
|
+
exclude: gulpConfig.get('browser.exclude')
|
|
28
|
+
};
|
|
29
|
+
const additional = gulpConfig.get('browser.bundles');
|
|
30
|
+
return [primary, ...additional.map(bundleConfig => ({
|
|
31
|
+
name: bundleConfig.name,
|
|
32
|
+
main: bundleConfig.main || primary.main,
|
|
33
|
+
ignore: bundleConfig.ignore || primary.ignore,
|
|
34
|
+
exclude: bundleConfig.exclude || primary.exclude
|
|
35
|
+
}))];
|
|
36
|
+
};
|
|
37
37
|
exports.getBundleConfigs = getBundleConfigs;
|
package/dist/watchTest.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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.watchTest = void 0;
|
|
8
|
-
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
-
var _gulp = require("gulp");
|
|
10
|
-
var _testQuick = require("./testQuick.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
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.watchTest = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
|
|
9
|
+
var _gulp = require("gulp");
|
|
10
|
+
var _testQuick = require("./testQuick.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; }
|
|
13
13
|
/**
|
|
14
14
|
* Watch for changes and run the tests.
|
|
15
15
|
* @memberOf module:js-build-tools
|
|
16
16
|
* @returns {*}
|
|
17
|
-
*/
|
|
18
|
-
const watchTest = () => (0, _gulp.watch)(gulpConfig.get('test.watch'), {
|
|
19
|
-
ignoreInitial: false
|
|
20
|
-
}, _testQuick.testQuick);
|
|
17
|
+
*/
|
|
18
|
+
const watchTest = () => (0, _gulp.watch)(gulpConfig.get('test.watch'), {
|
|
19
|
+
ignoreInitial: false
|
|
20
|
+
}, _testQuick.testQuick);
|
|
21
21
|
exports.watchTest = watchTest;
|
package/functions/build.mjs
CHANGED
|
@@ -3,12 +3,14 @@ import { bundleMinify } from './bundleMinify.mjs'
|
|
|
3
3
|
import { clean, distSeries } from './partials.mjs'
|
|
4
4
|
import { compileReadme } from './compileReadme.mjs'
|
|
5
5
|
import { typeDocs } from './typeDocs.mjs'
|
|
6
|
+
import { jsdocDocs } from './jsdocDocs.mjs'
|
|
6
7
|
import { distMinify } from './distMinify.mjs'
|
|
7
8
|
import { sourceLint } from './sourceLint.mjs'
|
|
8
9
|
import { parallel, series } from 'gulp'
|
|
9
10
|
import * as gulpConfig from '../gulp.config.mjs'
|
|
10
11
|
import { copyFonts } from './copyFonts.mjs'
|
|
11
12
|
import { images } from './images.mjs'
|
|
13
|
+
import { resolveDocsMethod } from './partials/resolveDocsMethod.mjs'
|
|
12
14
|
import { sass } from './sass.mjs'
|
|
13
15
|
import { testFull } from './testFull.mjs'
|
|
14
16
|
|
|
@@ -22,9 +24,10 @@ import { testFull } from './testFull.mjs'
|
|
|
22
24
|
export const build = (done = null) => {
|
|
23
25
|
const buildActions = [distSeries(), distMinify]
|
|
24
26
|
const generateDocs = gulpConfig.get('docs.enabled')
|
|
27
|
+
const docsMethod = resolveDocsMethod()
|
|
25
28
|
if (generateDocs) {
|
|
26
|
-
// The documentation is generated from the
|
|
27
|
-
buildActions.push(typeDocs)
|
|
29
|
+
// The documentation is generated from the source itself, the readme is written by hand
|
|
30
|
+
buildActions.push(docsMethod === 'jsdoc' ? jsdocDocs : typeDocs)
|
|
28
31
|
} else if (gulpConfig.get('typescript.enabled')) {
|
|
29
32
|
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
30
33
|
buildActions.push(compileReadme)
|