js-build-tools 6.2.2 → 6.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.
- package/README.md +180 -9
- package/dist/build.js +66 -66
- package/dist/bundle.js +1 -1
- package/dist/docs.js +11 -11
- package/dist/partials/jsdocDocsFor.js +31 -13
- package/dist/partials/loadPlaywright.js +34 -0
- package/dist/partials/neostandardLint.js +5 -3
- package/dist/partials/resolveDocsMethod.js +12 -12
- package/dist/partials/serveStatic.js +57 -0
- package/dist/partials/tsFor.js +2 -2
- package/dist/partials/typeDocsFor.js +28 -22
- package/dist/partials.js +169 -149
- package/dist/partials.min.js +1 -1
- package/dist/test-helpers/setUp.js +6 -0
- package/dist/utilities/convertMjsFilesForDocs.js +1 -0
- package/dist/utilities/dotGet.js +1 -0
- package/dist/utilities/dotNotate.js +5 -0
- package/dist/utilities/dotSet.js +1 -0
- package/dist/utilities/esmNamedExportsToCjs.js +1 -0
- package/dist/utilities/getBundleConfigs.js +1 -0
- package/dist/utilities/isObject.js +1 -0
- package/dist/utilities/strAfter.js +1 -0
- package/dist/utilities/strBefore.js +1 -0
- package/functions/bundle.mjs +1 -1
- package/functions/jsdocEsmExports.test.mjs +24 -0
- package/functions/partials/jsdocDocsFor.mjs +25 -13
- package/functions/partials/jsdocDocsFor.test.mjs +48 -0
- package/functions/partials/loadPlaywright.mjs +23 -0
- package/functions/partials/loadPlaywright.test.mjs +71 -0
- package/functions/partials/neostandardLint.mjs +5 -3
- package/functions/partials/serveStatic.mjs +47 -0
- package/functions/partials/serveStatic.test.mjs +71 -0
- package/functions/partials/tsFor.mjs +2 -2
- package/functions/partials/typeDocsFor.mjs +24 -20
- package/functions/partials/typeDocsFor.test.mjs +23 -0
- package/functions/partials.mjs +2 -0
- package/functions/partials.test.mjs +1 -1
- package/functions/test-helpers/setUp.mjs +6 -0
- package/functions/utilities/convertMjsFilesForDocs.mjs +1 -0
- package/functions/utilities/dotGet.mjs +1 -0
- package/functions/utilities/dotNotate.mjs +5 -0
- package/functions/utilities/dotSet.mjs +1 -0
- package/functions/utilities/esmNamedExportsToCjs.mjs +1 -0
- package/functions/utilities/getBundleConfigs.mjs +1 -0
- package/functions/utilities/isObject.mjs +1 -0
- package/functions/utilities/strAfter.mjs +1 -0
- package/functions/utilities/strBefore.mjs +1 -0
- package/gulp.config.mjs +2 -2
- package/gulpfile.base.mjs +1 -3
- package/jsdoc.base.js +9 -3
- package/jsdoc.esmExports.js +17 -0
- package/package.json +16 -10
|
@@ -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.resolveDocsMethod = void 0;
|
|
8
|
-
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
9
|
-
var cache;
|
|
10
|
-
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.resolveDocsMethod = void 0;
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
9
|
+
var cache;
|
|
10
|
+
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; }
|
|
11
11
|
/**
|
|
12
12
|
* Pick which engine generates the HTML documentation: docs.method picks it explicitly; left unset (false, the
|
|
13
13
|
* default), it's inferred from typescript.enabled - every existing TypeScript project's config, which never
|
|
14
14
|
* sets method, keeps producing TypeDoc output exactly as it always has.
|
|
15
15
|
* @memberOf module:partials
|
|
16
16
|
* @returns {'typedoc'|'jsdoc'}
|
|
17
|
-
*/
|
|
18
|
-
const resolveDocsMethod = () => gulpConfig.get('docs.method') || (gulpConfig.get('typescript.enabled') ? 'typedoc' : 'jsdoc');
|
|
17
|
+
*/
|
|
18
|
+
const resolveDocsMethod = () => gulpConfig.get('docs.method') || (gulpConfig.get('typescript.enabled') ? 'typedoc' : 'jsdoc');
|
|
19
19
|
exports.resolveDocsMethod = resolveDocsMethod;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.serveStatic = void 0;
|
|
7
|
+
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
8
|
+
var _nodeHttp = _interopRequireDefault(require("node:http"));
|
|
9
|
+
var _nodePath = _interopRequireDefault(require("node:path"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
// A real, previously-undiscovered bug fixed here: without a Content-Type header, a browser enforces strict MIME
|
|
12
|
+
// checking on <script type="module"> and refuses to load it at all - exactly the case this partial exists for.
|
|
13
|
+
const contentTypes = {
|
|
14
|
+
'.css': 'text/css',
|
|
15
|
+
'.gif': 'image/gif',
|
|
16
|
+
'.html': 'text/html',
|
|
17
|
+
'.ico': 'image/x-icon',
|
|
18
|
+
'.jpeg': 'image/jpeg',
|
|
19
|
+
'.jpg': 'image/jpeg',
|
|
20
|
+
'.js': 'text/javascript',
|
|
21
|
+
'.json': 'application/json',
|
|
22
|
+
'.mjs': 'text/javascript',
|
|
23
|
+
'.png': 'image/png',
|
|
24
|
+
'.svg': 'image/svg+xml',
|
|
25
|
+
'.woff': 'font/woff',
|
|
26
|
+
'.woff2': 'font/woff2'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Serve a directory's real files over plain HTTP, for anything that needs a page loaded from a real URL rather
|
|
31
|
+
* than a bare file:// path - most commonly, a page using root-relative asset paths (/browser/...), which a
|
|
32
|
+
* file:// load resolves against the filesystem root instead of the page's own directory.
|
|
33
|
+
* @memberOf module:partials
|
|
34
|
+
* @param {string} rootDir - The directory to serve.
|
|
35
|
+
* @param {number} [port=0] - The port to listen on; 0 picks any free port.
|
|
36
|
+
* @returns {Promise<{server: http.Server, url: string}>} The running server, and its base URL - close the
|
|
37
|
+
* server yourself (server.close()) once done with it.
|
|
38
|
+
*/
|
|
39
|
+
const serveStatic = (rootDir, port = 0) => new Promise((resolve, reject) => {
|
|
40
|
+
const server = _nodeHttp.default.createServer((req, res) => {
|
|
41
|
+
const filePath = _nodePath.default.join(rootDir, decodeURIComponent(req.url.split('?')[0]));
|
|
42
|
+
_nodeFs.default.readFile(filePath, (error, data) => {
|
|
43
|
+
if (error) {
|
|
44
|
+
res.statusCode = 404;
|
|
45
|
+
return res.end(`Not found: ${req.url}`);
|
|
46
|
+
}
|
|
47
|
+
res.setHeader('Content-Type', contentTypes[_nodePath.default.extname(filePath)] || 'application/octet-stream');
|
|
48
|
+
res.end(data);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
server.once('error', reject);
|
|
52
|
+
server.listen(port, '127.0.0.1', () => resolve({
|
|
53
|
+
server,
|
|
54
|
+
url: `http://127.0.0.1:${server.address().port}`
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
exports.serveStatic = serveStatic;
|
package/dist/partials/tsFor.js
CHANGED
|
@@ -18,7 +18,7 @@ const importGulpTsCompile = () => (0, _loadPeer.importModule)('gulp-ts-compile')
|
|
|
18
18
|
/**
|
|
19
19
|
* Wrap a stream in a promise that resolves once it finishes writing.
|
|
20
20
|
* @memberOf module:partials
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {stream.Stream} stream
|
|
22
22
|
* @returns {Promise<void>}
|
|
23
23
|
*/
|
|
24
24
|
const installHint = 'Install it in your project with: npm install --save-dev typescript';
|
|
@@ -49,7 +49,7 @@ const streamToPromise = stream => new Promise((resolve, reject) => {
|
|
|
49
49
|
* gulp-typescript when a removed API call started throwing under TypeScript 7.
|
|
50
50
|
* @memberOf module:partials
|
|
51
51
|
* @param {string} configPath - Path to a tsconfig.json file.
|
|
52
|
-
* @returns {
|
|
52
|
+
* @returns {ts.CompilerOptions} TypeScript's compiler options
|
|
53
53
|
*/
|
|
54
54
|
const readCompilerOptions = (ts, configPath) => {
|
|
55
55
|
const configFile = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.writeDocEntries = exports.typeDocsFor = exports.loadTypeDoc = exports.describeFolder = exports.describeFile = exports.describeExports = void 0;
|
|
8
|
+
require("core-js/modules/es.array.includes.js");
|
|
8
9
|
require("core-js/modules/es.json.stringify.js");
|
|
9
10
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
10
11
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
@@ -42,12 +43,19 @@ exports.loadTypeDoc = loadTypeDoc;
|
|
|
42
43
|
const isSource = fileName => /\.(ts|tsx|mts|cts)$/.test(fileName) && !/\.d\.[cm]?ts$/.test(fileName) && !/\.(test|spec)\./.test(fileName);
|
|
43
44
|
const listSources = dirPath => _nodeFs.default.readdirSync(dirPath, {
|
|
44
45
|
withFileTypes: true
|
|
45
|
-
}).
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
}).filter(entry => entry.isFile() && isSource(entry.name)).map(entry => _nodePath.default.join(dirPath, entry.name));
|
|
47
|
+
|
|
48
|
+
// Every folder below dirPath (at any depth), named by its path from dirPath, with the source files directly in it
|
|
49
|
+
const listFolders = (dirPath, prefix = '') => _nodeFs.default.readdirSync(dirPath, {
|
|
50
|
+
withFileTypes: true
|
|
51
|
+
}).filter(entry => entry.isDirectory() && entry.name !== 'node_modules').flatMap(entry => {
|
|
52
|
+
const folderPath = _nodePath.default.join(dirPath, entry.name);
|
|
53
|
+
const name = `${prefix}${entry.name}`;
|
|
54
|
+
return [{
|
|
55
|
+
name,
|
|
56
|
+
path: folderPath,
|
|
57
|
+
files: listSources(folderPath)
|
|
58
|
+
}, ...listFolders(folderPath, `${name}/`)];
|
|
51
59
|
});
|
|
52
60
|
const toIdentifier = fileName => fileName.replace(/[^\w$]+(\w)?/g, (match, letter) => (letter || '').toUpperCase()).replace(/^(\d)/, '_$1');
|
|
53
61
|
const toModulePath = filePath => filePath.replace(/\.[cm]?tsx?$/, '').split(_nodePath.default.sep).join('/');
|
|
@@ -127,11 +135,12 @@ const describeFile = filePath => {
|
|
|
127
135
|
|
|
128
136
|
/**
|
|
129
137
|
* Write one entry file per folder of the source directory into the entry directory. TypeDoc makes a module of every
|
|
130
|
-
* entry file, so the modules of the documentation mirror the folders.
|
|
138
|
+
* entry file, so the modules of the documentation mirror the folders. Nested folders are modules of their own, named
|
|
139
|
+
* by their path (utilities/parsers), and a folder's module holds only the files directly in it. The default export of each source file is
|
|
131
140
|
* re-exported under the name of the file (the source files hold one function each), and anything else a file exports
|
|
132
141
|
* is re-exported as it is (that is where the types.ts files go). Index files (the barrels), tests and declaration
|
|
133
142
|
* files are left out, but the first doc comment of a folder's index file becomes the description of its module.
|
|
134
|
-
* A file which sits beside the folders (not an index or
|
|
143
|
+
* A file which sits beside the folders (not an index, main or browser file) is a module of its own, described by its header
|
|
135
144
|
* comment. A source directory with no folders gets a single entry called index.
|
|
136
145
|
* @memberOf module:partials
|
|
137
146
|
* @param {Object} ts - The TypeScript compiler API.
|
|
@@ -145,18 +154,10 @@ const writeDocEntries = (ts, srcDir, entryDir) => {
|
|
|
145
154
|
_nodeFs.default.mkdirSync(entryDir, {
|
|
146
155
|
recursive: true
|
|
147
156
|
});
|
|
148
|
-
const folders =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
path: _nodePath.default.join(absoluteSrc, entry.name),
|
|
153
|
-
files: listSources(_nodePath.default.join(absoluteSrc, entry.name))
|
|
154
|
-
})).filter(folder => folder.files.length);
|
|
155
|
-
const rootFiles = _nodeFs.default.readdirSync(absoluteSrc, {
|
|
156
|
-
withFileTypes: true
|
|
157
|
-
}).filter(entry => entry.isFile() && isSource(entry.name) && !/^(index|main)\./.test(entry.name)).map(entry => _nodePath.default.join(absoluteSrc, entry.name));
|
|
158
|
-
// Folders make modules, and so do the files which sit beside them (except the barrel: index and main). A source
|
|
159
|
-
// directory with no folders gets a single module called index which holds its files.
|
|
157
|
+
const folders = listFolders(absoluteSrc).filter(folder => folder.files.some(file => !/^index\./.test(_nodePath.default.basename(file))));
|
|
158
|
+
const rootFiles = listSources(absoluteSrc).filter(file => !/^(index|main|browser)\./.test(_nodePath.default.basename(file)));
|
|
159
|
+
// Folders make modules, and so do the files which sit beside them (except the barrels: index, main and browser, the
|
|
160
|
+
// browser bundle's entry). A source directory with no folders gets a single module called index which holds its files.
|
|
160
161
|
const groups = folders.length ? [...folders, ...rootFiles.map(file => ({
|
|
161
162
|
name: toIdentifier(_nodePath.default.basename(file).replace(/\.[cm]?tsx?$/, '')),
|
|
162
163
|
files: [file],
|
|
@@ -178,8 +179,13 @@ const writeDocEntries = (ts, srcDir, entryDir) => {
|
|
|
178
179
|
});
|
|
179
180
|
const description = group.description ?? (group.path ? describeFolder(group.path) : '');
|
|
180
181
|
// TypeDoc takes the first comment of an entry file which has the @module tag as the description of the module
|
|
181
|
-
|
|
182
|
+
// A nested folder's module is named by its path (utilities/parsers), so it is not mistaken for its parent's
|
|
183
|
+
const moduleName = group.name.includes('/') ? ` ${group.name}` : '';
|
|
184
|
+
const moduleComment = description || moduleName ? `/**\n${description ? description.split('\n').map(line => ` * ${line}`.trimEnd()).join('\n') + '\n' : ''} * @module${moduleName}\n */\n\n` : '';
|
|
182
185
|
const entryPath = _nodePath.default.join(entryDir, `${group.name}.ts`);
|
|
186
|
+
_nodeFs.default.mkdirSync(_nodePath.default.dirname(entryPath), {
|
|
187
|
+
recursive: true
|
|
188
|
+
});
|
|
183
189
|
_nodeFs.default.writeFileSync(entryPath, moduleComment + lines.join('\n') + '\n');
|
|
184
190
|
return entryPath;
|
|
185
191
|
});
|
|
@@ -225,7 +231,7 @@ const typeDocsFor = (srcPath = gulpConfig.get('docs.from'), outPath = gulpConfig
|
|
|
225
231
|
...(projectConfig ? {
|
|
226
232
|
extends: _nodePath.default.resolve(projectConfig)
|
|
227
233
|
} : {}),
|
|
228
|
-
include: [_nodePath.default.join(workDir, 'entries', '*.ts').split(_nodePath.default.sep).join('/'), _nodePath.default.resolve(srcPath).split(_nodePath.default.sep).join('/') + '/**/*.ts'],
|
|
234
|
+
include: [_nodePath.default.join(workDir, 'entries', '**', '*.ts').split(_nodePath.default.sep).join('/'), _nodePath.default.resolve(srcPath).split(_nodePath.default.sep).join('/') + '/**/*.ts'],
|
|
229
235
|
exclude: [_nodePath.default.resolve(srcPath).split(_nodePath.default.sep).join('/') + '/**/*.test.*']
|
|
230
236
|
}));
|
|
231
237
|
const indexFile = gulpConfig.get('docs.index');
|
package/dist/partials.js
CHANGED
|
@@ -1,150 +1,170 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "addToReadme", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _addToReadme.addToReadme;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "beginWatcher", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _beginWatcher.beginWatcher;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "clean", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _clean.clean;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "copyFor", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _copyFor.copyFor;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "distFor", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _distFor.distFor;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "distForSrc", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _distForSrc.distForSrc;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "distSeries", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _distSeries.distSeries;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "imagesFor", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _imagesFor.imagesFor;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "importModule", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _loadPeer.importModule;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "importPeer", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _loadPeer.importPeer;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "jsdocDocsFor", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _jsdocDocsFor.jsdocDocsFor;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "addToReadme", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _addToReadme.addToReadme;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "beginWatcher", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _beginWatcher.beginWatcher;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "clean", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _clean.clean;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "copyFor", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _copyFor.copyFor;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "distFor", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _distFor.distFor;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "distForSrc", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _distForSrc.distForSrc;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "distSeries", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _distSeries.distSeries;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "imagesFor", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _imagesFor.imagesFor;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "importModule", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _loadPeer.importModule;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "importPeer", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _loadPeer.importPeer;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "jsdocDocsFor", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _jsdocDocsFor.jsdocDocsFor;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "launchBrowser", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _loadPlaywright.launchBrowser;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "loadPlaywright", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _loadPlaywright.loadPlaywright;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "minifyFor", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _minifyFor.minifyFor;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "neostandardLint", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _neostandardLint.neostandardLint;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "readmeTemplate", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _readmeTemplate.readmeTemplate;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _removeDirectory.removeDirectory;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "requirePeer", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _loadPeer.requirePeer;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "resolveDocsMethod", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _resolveDocsMethod.resolveDocsMethod;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "runOnChange", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _runOnChange.runOnChange;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "sassFor", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _sassFor.sassFor;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "serveStatic", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _serveStatic.serveStatic;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "tsFor", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _tsFor.tsFor;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "typeDocsFor", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _typeDocsFor.typeDocsFor;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
var _addToReadme = require("./partials/addToReadme.js");
|
|
151
|
+
var _beginWatcher = require("./partials/beginWatcher.js");
|
|
152
|
+
var _clean = require("./partials/clean.js");
|
|
153
|
+
var _copyFor = require("./partials/copyFor.js");
|
|
154
|
+
var _distFor = require("./partials/distFor.js");
|
|
155
|
+
var _distForSrc = require("./partials/distForSrc.js");
|
|
156
|
+
var _distSeries = require("./partials/distSeries.js");
|
|
157
|
+
var _imagesFor = require("./partials/imagesFor.js");
|
|
158
|
+
var _loadPeer = require("./partials/loadPeer.js");
|
|
159
|
+
var _jsdocDocsFor = require("./partials/jsdocDocsFor.js");
|
|
160
|
+
var _loadPlaywright = require("./partials/loadPlaywright.js");
|
|
161
|
+
var _minifyFor = require("./partials/minifyFor.js");
|
|
162
|
+
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
163
|
+
var _readmeTemplate = require("./partials/readmeTemplate.js");
|
|
164
|
+
var _removeDirectory = require("./partials/removeDirectory.js");
|
|
165
|
+
var _resolveDocsMethod = require("./partials/resolveDocsMethod.js");
|
|
166
|
+
var _runOnChange = require("./partials/runOnChange.js");
|
|
167
|
+
var _sassFor = require("./partials/sassFor.js");
|
|
168
|
+
var _serveStatic = require("./partials/serveStatic.js");
|
|
169
|
+
var _tsFor = require("./partials/tsFor.js");
|
|
150
170
|
var _typeDocsFor = require("./partials/typeDocsFor.js");
|
package/dist/partials.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"addToReadme",{enumerable:!0,get:function(){return _addToReadme.addToReadme}}),Object.defineProperty(exports,"beginWatcher",{enumerable:!0,get:function(){return _beginWatcher.beginWatcher}}),Object.defineProperty(exports,"clean",{enumerable:!0,get:function(){return _clean.clean}}),Object.defineProperty(exports,"copyFor",{enumerable:!0,get:function(){return _copyFor.copyFor}}),Object.defineProperty(exports,"distFor",{enumerable:!0,get:function(){return _distFor.distFor}}),Object.defineProperty(exports,"distForSrc",{enumerable:!0,get:function(){return _distForSrc.distForSrc}}),Object.defineProperty(exports,"distSeries",{enumerable:!0,get:function(){return _distSeries.distSeries}}),Object.defineProperty(exports,"imagesFor",{enumerable:!0,get:function(){return _imagesFor.imagesFor}}),Object.defineProperty(exports,"importModule",{enumerable:!0,get:function(){return _loadPeer.importModule}}),Object.defineProperty(exports,"importPeer",{enumerable:!0,get:function(){return _loadPeer.importPeer}}),Object.defineProperty(exports,"jsdocDocsFor",{enumerable:!0,get:function(){return _jsdocDocsFor.jsdocDocsFor}}),Object.defineProperty(exports,"minifyFor",{enumerable:!0,get:function(){return _minifyFor.minifyFor}}),Object.defineProperty(exports,"neostandardLint",{enumerable:!0,get:function(){return _neostandardLint.neostandardLint}}),Object.defineProperty(exports,"readmeTemplate",{enumerable:!0,get:function(){return _readmeTemplate.readmeTemplate}}),Object.defineProperty(exports,"removeDirectory",{enumerable:!0,get:function(){return _removeDirectory.removeDirectory}}),Object.defineProperty(exports,"requirePeer",{enumerable:!0,get:function(){return _loadPeer.requirePeer}}),Object.defineProperty(exports,"resolveDocsMethod",{enumerable:!0,get:function(){return _resolveDocsMethod.resolveDocsMethod}}),Object.defineProperty(exports,"runOnChange",{enumerable:!0,get:function(){return _runOnChange.runOnChange}}),Object.defineProperty(exports,"sassFor",{enumerable:!0,get:function(){return _sassFor.sassFor}}),Object.defineProperty(exports,"tsFor",{enumerable:!0,get:function(){return _tsFor.tsFor}}),Object.defineProperty(exports,"typeDocsFor",{enumerable:!0,get:function(){return _typeDocsFor.typeDocsFor}});var _addToReadme=require("./partials/addToReadme.js"),_beginWatcher=require("./partials/beginWatcher.js"),_clean=require("./partials/clean.js"),_copyFor=require("./partials/copyFor.js"),_distFor=require("./partials/distFor.js"),_distForSrc=require("./partials/distForSrc.js"),_distSeries=require("./partials/distSeries.js"),_imagesFor=require("./partials/imagesFor.js"),_loadPeer=require("./partials/loadPeer.js"),_jsdocDocsFor=require("./partials/jsdocDocsFor.js"),_minifyFor=require("./partials/minifyFor.js"),_neostandardLint=require("./partials/neostandardLint.js"),_readmeTemplate=require("./partials/readmeTemplate.js"),_removeDirectory=require("./partials/removeDirectory.js"),_resolveDocsMethod=require("./partials/resolveDocsMethod.js"),_runOnChange=require("./partials/runOnChange.js"),_sassFor=require("./partials/sassFor.js"),_tsFor=require("./partials/tsFor.js"),_typeDocsFor=require("./partials/typeDocsFor.js");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"addToReadme",{enumerable:!0,get:function(){return _addToReadme.addToReadme}}),Object.defineProperty(exports,"beginWatcher",{enumerable:!0,get:function(){return _beginWatcher.beginWatcher}}),Object.defineProperty(exports,"clean",{enumerable:!0,get:function(){return _clean.clean}}),Object.defineProperty(exports,"copyFor",{enumerable:!0,get:function(){return _copyFor.copyFor}}),Object.defineProperty(exports,"distFor",{enumerable:!0,get:function(){return _distFor.distFor}}),Object.defineProperty(exports,"distForSrc",{enumerable:!0,get:function(){return _distForSrc.distForSrc}}),Object.defineProperty(exports,"distSeries",{enumerable:!0,get:function(){return _distSeries.distSeries}}),Object.defineProperty(exports,"imagesFor",{enumerable:!0,get:function(){return _imagesFor.imagesFor}}),Object.defineProperty(exports,"importModule",{enumerable:!0,get:function(){return _loadPeer.importModule}}),Object.defineProperty(exports,"importPeer",{enumerable:!0,get:function(){return _loadPeer.importPeer}}),Object.defineProperty(exports,"jsdocDocsFor",{enumerable:!0,get:function(){return _jsdocDocsFor.jsdocDocsFor}}),Object.defineProperty(exports,"launchBrowser",{enumerable:!0,get:function(){return _loadPlaywright.launchBrowser}}),Object.defineProperty(exports,"loadPlaywright",{enumerable:!0,get:function(){return _loadPlaywright.loadPlaywright}}),Object.defineProperty(exports,"minifyFor",{enumerable:!0,get:function(){return _minifyFor.minifyFor}}),Object.defineProperty(exports,"neostandardLint",{enumerable:!0,get:function(){return _neostandardLint.neostandardLint}}),Object.defineProperty(exports,"readmeTemplate",{enumerable:!0,get:function(){return _readmeTemplate.readmeTemplate}}),Object.defineProperty(exports,"removeDirectory",{enumerable:!0,get:function(){return _removeDirectory.removeDirectory}}),Object.defineProperty(exports,"requirePeer",{enumerable:!0,get:function(){return _loadPeer.requirePeer}}),Object.defineProperty(exports,"resolveDocsMethod",{enumerable:!0,get:function(){return _resolveDocsMethod.resolveDocsMethod}}),Object.defineProperty(exports,"runOnChange",{enumerable:!0,get:function(){return _runOnChange.runOnChange}}),Object.defineProperty(exports,"sassFor",{enumerable:!0,get:function(){return _sassFor.sassFor}}),Object.defineProperty(exports,"serveStatic",{enumerable:!0,get:function(){return _serveStatic.serveStatic}}),Object.defineProperty(exports,"tsFor",{enumerable:!0,get:function(){return _tsFor.tsFor}}),Object.defineProperty(exports,"typeDocsFor",{enumerable:!0,get:function(){return _typeDocsFor.typeDocsFor}});var _addToReadme=require("./partials/addToReadme.js"),_beginWatcher=require("./partials/beginWatcher.js"),_clean=require("./partials/clean.js"),_copyFor=require("./partials/copyFor.js"),_distFor=require("./partials/distFor.js"),_distForSrc=require("./partials/distForSrc.js"),_distSeries=require("./partials/distSeries.js"),_imagesFor=require("./partials/imagesFor.js"),_loadPeer=require("./partials/loadPeer.js"),_jsdocDocsFor=require("./partials/jsdocDocsFor.js"),_loadPlaywright=require("./partials/loadPlaywright.js"),_minifyFor=require("./partials/minifyFor.js"),_neostandardLint=require("./partials/neostandardLint.js"),_readmeTemplate=require("./partials/readmeTemplate.js"),_removeDirectory=require("./partials/removeDirectory.js"),_resolveDocsMethod=require("./partials/resolveDocsMethod.js"),_runOnChange=require("./partials/runOnChange.js"),_sassFor=require("./partials/sassFor.js"),_serveStatic=require("./partials/serveStatic.js"),_tsFor=require("./partials/tsFor.js"),_typeDocsFor=require("./partials/typeDocsFor.js");
|
|
@@ -76,6 +76,12 @@ const setDefaults = (testDir = 'test-temp') => {
|
|
|
76
76
|
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
77
77
|
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
78
78
|
gulpConfig.set('dist.to', distPath);
|
|
79
|
+
// Reset explicitly, for the same reason as readme.fromEsm below: this project's own build-tools.config.json turns
|
|
80
|
+
// docs on and points them at the website checkout, which would leak into every test that never sets these itself.
|
|
81
|
+
gulpConfig.set('docs.enabled', false);
|
|
82
|
+
gulpConfig.set('docs.from', srcPath);
|
|
83
|
+
gulpConfig.set('docs.to', `${tempDir}docs`);
|
|
84
|
+
gulpConfig.set('docs.title', '');
|
|
79
85
|
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
80
86
|
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
81
87
|
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
@@ -22,6 +22,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
22
22
|
* @param {Array<string>} mjsFilePaths - Real `.mjs` files to convert. An empty array is a safe, cheap no-op.
|
|
23
23
|
* @returns {{filePaths: Array<string>, cleanUp: function(): void}} The temp `.js` file paths to pass to
|
|
24
24
|
* jsdoc-to-markdown instead of the real `.mjs` ones, and a function to remove the temp directory afterward.
|
|
25
|
+
* @private
|
|
25
26
|
*/
|
|
26
27
|
const convertMjsFilesForDocs = (mjsFilePaths = []) => {
|
|
27
28
|
if (mjsFilePaths.length === 0) {
|
package/dist/utilities/dotGet.js
CHANGED
|
@@ -14,6 +14,7 @@ var _strBefore = require("./strBefore.js");
|
|
|
14
14
|
* @param {string} [dotNotation=''] - The path to the property
|
|
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
|
+
* @private
|
|
17
18
|
*/
|
|
18
19
|
const dotGet = (arrayObject = {}, dotNotation = '', defaultValue = null) => {
|
|
19
20
|
if (!dotNotation) {
|
|
@@ -11,12 +11,14 @@ var _isObject = require("./isObject.js");
|
|
|
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
|
+
* @private
|
|
14
15
|
*/
|
|
15
16
|
const handleRetainObjects = (retainObjects = []) => {
|
|
16
17
|
if (!retainObjects.length) {
|
|
17
18
|
/**
|
|
18
19
|
* Bypass the test function if there are no retainObjects.
|
|
19
20
|
* @returns {false}
|
|
21
|
+
* @private
|
|
20
22
|
*/
|
|
21
23
|
return (currentKey, value, results) => false;
|
|
22
24
|
}
|
|
@@ -28,6 +30,7 @@ const handleRetainObjects = (retainObjects = []) => {
|
|
|
28
30
|
* @param {*} value - The value of the key
|
|
29
31
|
* @param {Object} results - The result object to add to
|
|
30
32
|
* @returns {boolean}
|
|
33
|
+
* @private
|
|
31
34
|
*/
|
|
32
35
|
return (currentKey, value, results) => {
|
|
33
36
|
if (!currentKey.match(retainRegex)) {
|
|
@@ -45,6 +48,7 @@ const handleRetainObjects = (retainObjects = []) => {
|
|
|
45
48
|
* @param {string} [prepend=''] - The path for the property being processed
|
|
46
49
|
* @param {Object<string, *>} [results={}] - The final notated object to return
|
|
47
50
|
* @returns {Object<string, *>} The dot-notated object
|
|
51
|
+
* @private
|
|
48
52
|
*/
|
|
49
53
|
const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
|
|
50
54
|
for (let key in arrayObject) {
|
|
@@ -70,6 +74,7 @@ const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) =>
|
|
|
70
74
|
* @param {Object} arrayObject - The array or object to dot-notate
|
|
71
75
|
* @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
|
|
72
76
|
* @returns {Object<string, *>} The dot-notated object
|
|
77
|
+
* @private
|
|
73
78
|
*/
|
|
74
79
|
const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
|
|
75
80
|
exports.dotNotate = dotNotate;
|
package/dist/utilities/dotSet.js
CHANGED
|
@@ -14,6 +14,7 @@ var _strBefore = require("./strBefore.js");
|
|
|
14
14
|
* @param {string} dotNotation - The path for the property
|
|
15
15
|
* @param {*} value - The default value to return if the property is not found
|
|
16
16
|
* @returns {Object} The modified object
|
|
17
|
+
* @private
|
|
17
18
|
*/
|
|
18
19
|
const dotSet = (arrayObject, dotNotation, value = null) => {
|
|
19
20
|
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
@@ -18,6 +18,7 @@ exports.esmNamedExportsToCjs = void 0;
|
|
|
18
18
|
* @memberOf module:utilities
|
|
19
19
|
* @param {string} source - The raw ESM source text (never executed, just rewritten as text).
|
|
20
20
|
* @returns {string} The rewritten text, safe to write out with a `.js` extension for jsdoc-to-markdown to read.
|
|
21
|
+
* @private
|
|
21
22
|
*/
|
|
22
23
|
const esmNamedExportsToCjs = source => {
|
|
23
24
|
const exportedNames = [];
|
|
@@ -18,6 +18,7 @@ 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
|
+
* @private
|
|
21
22
|
*/
|
|
22
23
|
const getBundleConfigs = () => {
|
|
23
24
|
const primary = {
|