js-build-tools 6.5.0 → 6.7.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/LICENSE +674 -674
- package/README.md +762 -692
- package/babel.config.js +28 -28
- package/dist/build.js +75 -75
- package/dist/bundle.js +19 -19
- package/dist/bundleMinify.js +7 -7
- package/dist/compileReadme.js +4 -4
- package/dist/copyFiles.js +17 -17
- package/dist/copyFonts.js +4 -4
- package/dist/default.js +5 -5
- package/dist/dist.js +4 -4
- package/dist/distMinify.js +4 -4
- package/dist/docs.js +7 -7
- package/dist/images.js +4 -4
- package/dist/jsdocDocs.js +6 -6
- package/dist/lint.js +16 -16
- package/dist/partials/addToReadme.js +9 -9
- package/dist/partials/beginWatcher.js +4 -4
- package/dist/partials/clean.js +5 -5
- package/dist/partials/copyFor.js +9 -9
- package/dist/partials/distFor.js +6 -6
- package/dist/partials/distForSrc.js +5 -5
- package/dist/partials/distSeries.js +7 -7
- package/dist/partials/imagesFor.js +93 -56
- package/dist/partials/jsdocDocsFor.js +46 -46
- package/dist/partials/lintSource.js +51 -51
- package/dist/partials/loadPeer.js +99 -99
- package/dist/partials/loadPlaywright.js +14 -14
- package/dist/partials/minifyFor.js +20 -20
- package/dist/partials/neostandardLint.js +175 -175
- package/dist/partials/readmeTemplate.js +4 -4
- package/dist/partials/removeDirectory.js +11 -11
- package/dist/partials/resolveDocsMethod.js +6 -6
- package/dist/partials/runOnChange.js +31 -31
- package/dist/partials/sassFor.js +6 -6
- package/dist/partials/serveStatic.js +9 -9
- package/dist/partials/tsFor.js +32 -32
- package/dist/partials/typeDocsFor.js +57 -51
- package/dist/partials.js +176 -176
- package/dist/sourceLint.js +18 -18
- package/dist/test-helpers/isolateGulpCache.js +24 -24
- package/dist/test-helpers/setUp.js +4 -4
- package/dist/testFull.js +5 -5
- package/dist/testQuick.js +5 -5
- package/dist/typeDocs.js +5 -5
- package/dist/typeScript.js +4 -4
- package/dist/utilities/convertMjsFilesForDocs.js +12 -12
- package/dist/utilities/dotGet.js +54 -54
- package/dist/utilities/dotNotate.js +79 -79
- package/dist/utilities/dotSet.js +45 -45
- package/dist/utilities/esmNamedExportsToCjs.js +15 -15
- package/dist/utilities/getBundleConfigs.js +9 -9
- package/dist/utilities/isObject.js +6 -6
- package/dist/utilities/strAfter.js +7 -7
- package/dist/utilities/strBefore.js +7 -7
- package/dist/watchFull.js +4 -4
- package/dist/watchTest.js +4 -4
- package/functions/build.mjs +72 -72
- package/functions/build.test.mjs +763 -759
- package/functions/bundle.mjs +44 -44
- package/functions/bundle.test.mjs +219 -219
- package/functions/bundleMinify.mjs +16 -16
- package/functions/bundleMinify.test.mjs +37 -37
- package/functions/compileReadme.mjs +9 -9
- package/functions/compileReadme.test.mjs +18 -18
- package/functions/copyFiles.mjs +32 -32
- package/functions/copyFiles.test.mjs +78 -78
- package/functions/copyFonts.mjs +9 -9
- package/functions/copyFonts.test.mjs +32 -32
- package/functions/default.mjs +12 -12
- package/functions/default.test.mjs +33 -33
- package/functions/dist.mjs +8 -8
- package/functions/dist.test.mjs +44 -44
- package/functions/distMinify.mjs +9 -9
- package/functions/distMinify.test.mjs +15 -15
- package/functions/docs.mjs +13 -13
- package/functions/docs.test.mjs +45 -45
- package/functions/gulpConfigEntries.test.mjs +23 -23
- package/functions/images.mjs +8 -8
- package/functions/images.test.mjs +142 -142
- package/functions/jsdocDocs.mjs +10 -10
- package/functions/jsdocEsmExports.test.mjs +24 -24
- package/functions/lint.mjs +9 -9
- package/functions/partials/addToReadme.mjs +25 -25
- package/functions/partials/addToReadme.test.mjs +34 -34
- package/functions/partials/beginWatcher.mjs +9 -9
- package/functions/partials/beginWatcher.test.mjs +19 -19
- package/functions/partials/clean.mjs +13 -13
- package/functions/partials/clean.test.mjs +22 -22
- package/functions/partials/copyFor.mjs +15 -15
- package/functions/partials/copyFor.test.mjs +53 -53
- package/functions/partials/distFor.mjs +22 -22
- package/functions/partials/distFor.test.mjs +195 -195
- package/functions/partials/distForSrc.mjs +11 -11
- package/functions/partials/distForSrc.test.mjs +18 -18
- package/functions/partials/distSeries.mjs +21 -21
- package/functions/partials/distSeries.test.mjs +34 -34
- package/functions/partials/imagesFor.mjs +83 -50
- package/functions/partials/imagesFor.test.mjs +287 -229
- package/functions/partials/jsdocDocsFor.mjs +163 -152
- package/functions/partials/jsdocDocsFor.test.mjs +182 -152
- package/functions/partials/lintSource.mjs +41 -41
- package/functions/partials/loadPeer.mjs +76 -76
- package/functions/partials/loadPeer.test.mjs +58 -58
- package/functions/partials/loadPlaywright.mjs +23 -23
- package/functions/partials/loadPlaywright.test.mjs +70 -70
- package/functions/partials/minifyFor.mjs +15 -15
- package/functions/partials/minifyFor.test.mjs +49 -49
- package/functions/partials/neostandardLint.mjs +142 -142
- package/functions/partials/neostandardLint.test.mjs +131 -131
- package/functions/partials/readmeTemplate.mjs +12 -12
- package/functions/partials/readmeTemplate.test.mjs +34 -34
- package/functions/partials/removeDirectory.mjs +34 -34
- package/functions/partials/removeDirectory.test.mjs +72 -72
- package/functions/partials/resolveDocsMethod.mjs +10 -10
- package/functions/partials/resolveDocsMethod.test.mjs +33 -33
- package/functions/partials/runOnChange.mjs +54 -54
- package/functions/partials/runOnChange.test.mjs +95 -95
- package/functions/partials/sassFor.mjs +25 -25
- package/functions/partials/sassFor.test.mjs +81 -81
- package/functions/partials/serveStatic.mjs +47 -47
- package/functions/partials/serveStatic.test.mjs +71 -71
- package/functions/partials/tsFor.mjs +92 -92
- package/functions/partials/tsFor.test.mjs +88 -88
- package/functions/partials/typeDocsFor.mjs +231 -227
- package/functions/partials/typeDocsFor.test.mjs +263 -252
- package/functions/partials.mjs +31 -31
- package/functions/partials.test.mjs +7 -7
- package/functions/sass.mjs +4 -4
- package/functions/sass.test.mjs +31 -31
- package/functions/sourceLint.mjs +13 -13
- package/functions/sourceLint.test.mjs +166 -166
- package/functions/test-helpers/isolateGulpCache.mjs +16 -16
- package/functions/test-helpers/neostandardLintWithRealNeostandard.mjs +40 -40
- package/functions/test-helpers/setUp.mjs +100 -100
- package/functions/test-helpers/setUp.test.mjs +19 -19
- package/functions/testFull.mjs +17 -17
- package/functions/testFull.test.mjs +17 -17
- package/functions/testHelpers.mjs +10 -10
- package/functions/testHelpers.test.mjs +7 -7
- package/functions/testQuick.mjs +17 -17
- package/functions/testQuick.test.mjs +17 -17
- package/functions/typeDocs.mjs +9 -9
- package/functions/typeDocs.test.mjs +11 -11
- package/functions/typeScript.mjs +8 -8
- package/functions/typeScript.test.mjs +11 -11
- package/functions/utilities/convertMjsFilesForDocs.mjs +34 -34
- package/functions/utilities/convertMjsFilesForDocs.test.mjs +58 -58
- package/functions/utilities/dotGet.mjs +49 -49
- package/functions/utilities/dotNotate.mjs +73 -73
- package/functions/utilities/dotNotate.test.mjs +41 -41
- package/functions/utilities/dotSet.mjs +40 -40
- package/functions/utilities/esmNamedExportsToCjs.mjs +30 -30
- package/functions/utilities/esmNamedExportsToCjs.test.mjs +47 -47
- package/functions/utilities/getBundleConfigs.mjs +30 -30
- package/functions/utilities/isObject.mjs +8 -8
- package/functions/utilities/strAfter.mjs +12 -12
- package/functions/utilities/strBefore.mjs +12 -12
- package/functions/watchFull.mjs +9 -9
- package/functions/watchFull.test.mjs +41 -41
- package/functions/watchTest.mjs +10 -10
- package/functions/watchTest.test.mjs +49 -49
- package/gulp.config.js +4 -4
- package/gulp.config.mjs +344 -327
- package/gulpfile.base.js +51 -51
- package/gulpfile.base.mjs +29 -29
- package/jsdoc.base.js +16 -16
- package/jsdoc.esmExports.js +17 -17
- package/package.json +146 -145
package/dist/partials/tsFor.js
CHANGED
|
@@ -15,21 +15,21 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
15
|
// gulp-ts-compile ships ESM-only (no CJS build - see its own package.json), see importModule for how it is imported.
|
|
16
16
|
const importGulpTsCompile = () => (0, _loadPeer.importModule)('gulp-ts-compile');
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Wrap a stream in a promise that resolves once it finishes writing.
|
|
20
|
-
* @memberOf module:partials
|
|
21
|
-
* @param {stream.Stream} stream
|
|
22
|
-
* @returns {Promise<void>}
|
|
18
|
+
/**
|
|
19
|
+
* Wrap a stream in a promise that resolves once it finishes writing.
|
|
20
|
+
* @memberOf module:partials
|
|
21
|
+
* @param {stream.Stream} stream
|
|
22
|
+
* @returns {Promise<void>}
|
|
23
23
|
*/
|
|
24
24
|
const installHint = 'Install it in your project with: npm install --save-dev typescript';
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Load the project's own copy of TypeScript (an optional peer dependency, only needed when the typescript task is
|
|
28
|
-
* enabled) from the project being built, so projects which do not use TypeScript never need it installed.
|
|
29
|
-
* @memberOf module:partials
|
|
30
|
-
* @param {string} [projectPath=process.cwd()] The folder of the project (which has the package.json) being built.
|
|
31
|
-
* @returns {Object} The TypeScript compiler API module.
|
|
32
|
-
* @throws {Error} With install instructions when typescript is not installed.
|
|
26
|
+
/**
|
|
27
|
+
* Load the project's own copy of TypeScript (an optional peer dependency, only needed when the typescript task is
|
|
28
|
+
* enabled) from the project being built, so projects which do not use TypeScript never need it installed.
|
|
29
|
+
* @memberOf module:partials
|
|
30
|
+
* @param {string} [projectPath=process.cwd()] The folder of the project (which has the package.json) being built.
|
|
31
|
+
* @returns {Object} The TypeScript compiler API module.
|
|
32
|
+
* @throws {Error} With install instructions when typescript is not installed.
|
|
33
33
|
*/
|
|
34
34
|
const loadTypescript = (projectPath = process.cwd()) => (0, _loadPeer.requirePeer)('typescript', {
|
|
35
35
|
task: 'typescript',
|
|
@@ -42,14 +42,14 @@ const streamToPromise = stream => new Promise((resolve, reject) => {
|
|
|
42
42
|
stream.on('error', reject);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Read a tsconfig.json file into real typescript.CompilerOptions values, using only TypeScript's stable, current,
|
|
47
|
-
* public config-reading API (the same one `tsc --project` itself uses internally) - never
|
|
48
|
-
* `ts.convertCompilerOptionsFromJson`, which is exactly the kind of internal/legacy surface that broke
|
|
49
|
-
* gulp-typescript when a removed API call started throwing under TypeScript 7.
|
|
50
|
-
* @memberOf module:partials
|
|
51
|
-
* @param {string} configPath - Path to a tsconfig.json file.
|
|
52
|
-
* @returns {ts.CompilerOptions} TypeScript's compiler options
|
|
45
|
+
/**
|
|
46
|
+
* Read a tsconfig.json file into real typescript.CompilerOptions values, using only TypeScript's stable, current,
|
|
47
|
+
* public config-reading API (the same one `tsc --project` itself uses internally) - never
|
|
48
|
+
* `ts.convertCompilerOptionsFromJson`, which is exactly the kind of internal/legacy surface that broke
|
|
49
|
+
* gulp-typescript when a removed API call started throwing under TypeScript 7.
|
|
50
|
+
* @memberOf module:partials
|
|
51
|
+
* @param {string} configPath - Path to a tsconfig.json file.
|
|
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);
|
|
@@ -57,18 +57,18 @@ const readCompilerOptions = (ts, configPath) => {
|
|
|
57
57
|
return parsedConfig.options;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* Starting at the source directory, find all the ts files and convert them into the distribution directory.
|
|
62
|
-
* @memberOf module:partials
|
|
63
|
-
* @param {string|array} [srcPath='']
|
|
64
|
-
* @param {string} [distPath='']
|
|
65
|
-
* @param {function(): Promise<Function>} [loadTsCompile] - Resolves the `gulp-ts-compile` default export. Real
|
|
66
|
-
* callers should never need to pass this - it exists so tests can inject a stand-in compiler, sidestepping the
|
|
67
|
-
* genuine dynamic `import()` above that this project's current CommonJS-transform-based Jest setup cannot
|
|
68
|
-
* execute without a broader (and riskier) migration to Jest's native ESM support. gulp-ts-compile's own test
|
|
69
|
-
* suite already covers real TypeScript-compile correctness - this function's own tests only need to verify its
|
|
70
|
-
* config resolution and stream wiring.
|
|
71
|
-
* @returns {Function}
|
|
60
|
+
/**
|
|
61
|
+
* Starting at the source directory, find all the ts files and convert them into the distribution directory.
|
|
62
|
+
* @memberOf module:partials
|
|
63
|
+
* @param {string|array} [srcPath='']
|
|
64
|
+
* @param {string} [distPath='']
|
|
65
|
+
* @param {function(): Promise<Function>} [loadTsCompile] - Resolves the `gulp-ts-compile` default export. Real
|
|
66
|
+
* callers should never need to pass this - it exists so tests can inject a stand-in compiler, sidestepping the
|
|
67
|
+
* genuine dynamic `import()` above that this project's current CommonJS-transform-based Jest setup cannot
|
|
68
|
+
* execute without a broader (and riskier) migration to Jest's native ESM support. gulp-ts-compile's own test
|
|
69
|
+
* suite already covers real TypeScript-compile correctness - this function's own tests only need to verify its
|
|
70
|
+
* config resolution and stream wiring.
|
|
71
|
+
* @returns {Function}
|
|
72
72
|
*/
|
|
73
73
|
const tsFor = (srcPath = gulpConfig.get('typescript.from'), distPath = gulpConfig.get('typescript.to'), loadTsCompile = () => importGulpTsCompile().then(({
|
|
74
74
|
default: tsCompile
|
|
@@ -26,13 +26,13 @@ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e;
|
|
|
26
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
27
|
const installHint = 'Install it in your project with: npm install --save-dev typedoc';
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* Find the TypeDoc of the project being built (an optional peer dependency, only needed when the docs task is
|
|
31
|
-
* enabled) and load it, so projects which do not document TypeScript never need it installed.
|
|
32
|
-
* @memberOf module:partials
|
|
33
|
-
* @param {string} [projectPath=process.cwd()] The folder of the project (which has the package.json) being built.
|
|
34
|
-
* @returns {Promise<Object>} The TypeDoc module.
|
|
35
|
-
* @throws {Error} With install instructions when typedoc is not installed.
|
|
29
|
+
/**
|
|
30
|
+
* Find the TypeDoc of the project being built (an optional peer dependency, only needed when the docs task is
|
|
31
|
+
* enabled) and load it, so projects which do not document TypeScript never need it installed.
|
|
32
|
+
* @memberOf module:partials
|
|
33
|
+
* @param {string} [projectPath=process.cwd()] The folder of the project (which has the package.json) being built.
|
|
34
|
+
* @returns {Promise<Object>} The TypeDoc module.
|
|
35
|
+
* @throws {Error} With install instructions when typedoc is not installed.
|
|
36
36
|
*/
|
|
37
37
|
const loadTypeDoc = (projectPath = process.cwd()) => (0, _loadPeer.importPeer)('typedoc', {
|
|
38
38
|
task: 'docs',
|
|
@@ -60,12 +60,12 @@ const listFolders = (dirPath, prefix = '') => _nodeFs.default.readdirSync(dirPat
|
|
|
60
60
|
const toIdentifier = fileName => fileName.replace(/[^\w$]+(\w)?/g, (match, letter) => (letter || '').toUpperCase()).replace(/^(\d)/, '_$1');
|
|
61
61
|
const toModulePath = filePath => filePath.replace(/\.[cm]?tsx?$/, '').split(_nodePath.default.sep).join('/');
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Describe what a source file exports: whether it has a default export, and whether it has any named exports.
|
|
65
|
-
* @memberOf module:partials
|
|
66
|
-
* @param {Object} ts - The TypeScript compiler API.
|
|
67
|
-
* @param {string} filePath
|
|
68
|
-
* @returns {{hasDefault: boolean, hasNamed: boolean}}
|
|
63
|
+
/**
|
|
64
|
+
* Describe what a source file exports: whether it has a default export, and whether it has any named exports.
|
|
65
|
+
* @memberOf module:partials
|
|
66
|
+
* @param {Object} ts - The TypeScript compiler API.
|
|
67
|
+
* @param {string} filePath
|
|
68
|
+
* @returns {{hasDefault: boolean, hasNamed: boolean}}
|
|
69
69
|
*/
|
|
70
70
|
const describeExports = (ts, filePath) => {
|
|
71
71
|
const source = ts.createSourceFile(filePath, _nodeFs.default.readFileSync(filePath, 'utf8'), ts.ScriptTarget.Latest);
|
|
@@ -101,12 +101,12 @@ const describeExports = (ts, filePath) => {
|
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
/**
|
|
105
|
-
* The description of a folder for its module: the first doc comment of the folder's index file, without its tags
|
|
106
|
-
* (@module, @file, ...), or an empty string when there is none.
|
|
107
|
-
* @memberOf module:partials
|
|
108
|
-
* @param {string} folderPath
|
|
109
|
-
* @returns {string}
|
|
104
|
+
/**
|
|
105
|
+
* The description of a folder for its module: the first doc comment of the folder's index file, without its tags
|
|
106
|
+
* (@module, @file, ...), or an empty string when there is none.
|
|
107
|
+
* @memberOf module:partials
|
|
108
|
+
* @param {string} folderPath
|
|
109
|
+
* @returns {string}
|
|
110
110
|
*/
|
|
111
111
|
exports.describeExports = describeExports;
|
|
112
112
|
const describeFolder = folderPath => {
|
|
@@ -114,13 +114,13 @@ const describeFolder = folderPath => {
|
|
|
114
114
|
return indexFile ? describeFile(indexFile) : '';
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* The description of a source file for its module: its first doc comment without the tags (@module, @file, ...), when
|
|
119
|
-
* that comment is a header (it is followed by an import or export, so it does not document a declaration itself), or
|
|
120
|
-
* an empty string.
|
|
121
|
-
* @memberOf module:partials
|
|
122
|
-
* @param {string} filePath
|
|
123
|
-
* @returns {string}
|
|
117
|
+
/**
|
|
118
|
+
* The description of a source file for its module: its first doc comment without the tags (@module, @file, ...), when
|
|
119
|
+
* that comment is a header (it is followed by an import or export, so it does not document a declaration itself), or
|
|
120
|
+
* an empty string.
|
|
121
|
+
* @memberOf module:partials
|
|
122
|
+
* @param {string} filePath
|
|
123
|
+
* @returns {string}
|
|
124
124
|
*/
|
|
125
125
|
exports.describeFolder = describeFolder;
|
|
126
126
|
const describeFile = filePath => {
|
|
@@ -133,20 +133,20 @@ const describeFile = filePath => {
|
|
|
133
133
|
return (tagAt === -1 ? lines : lines.slice(0, tagAt)).join('\n').trim();
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
/**
|
|
137
|
-
* Write one entry file per folder of the source directory into the entry directory. TypeDoc makes a module of every
|
|
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
|
|
140
|
-
* re-exported under the name of the file (the source files hold one function each), and anything else a file exports
|
|
141
|
-
* is re-exported as it is (that is where the types.ts files go). Index files (the barrels), tests and declaration
|
|
142
|
-
* files are left out, but the first doc comment of a folder's index file becomes the description of its module.
|
|
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
|
|
144
|
-
* comment. A source directory with no folders gets a single entry called index.
|
|
145
|
-
* @memberOf module:partials
|
|
146
|
-
* @param {Object} ts - The TypeScript compiler API.
|
|
147
|
-
* @param {string} srcDir - The directory holding the TypeScript source.
|
|
148
|
-
* @param {string} entryDir - The directory to write the entry files into.
|
|
149
|
-
* @returns {Array<string>} The paths of the entry files.
|
|
136
|
+
/**
|
|
137
|
+
* Write one entry file per folder of the source directory into the entry directory. TypeDoc makes a module of every
|
|
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
|
|
140
|
+
* re-exported under the name of the file (the source files hold one function each), and anything else a file exports
|
|
141
|
+
* is re-exported as it is (that is where the types.ts files go). Index files (the barrels), tests and declaration
|
|
142
|
+
* files are left out, but the first doc comment of a folder's index file becomes the description of its module.
|
|
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
|
|
144
|
+
* comment. A source directory with no folders gets a single entry called index.
|
|
145
|
+
* @memberOf module:partials
|
|
146
|
+
* @param {Object} ts - The TypeScript compiler API.
|
|
147
|
+
* @param {string} srcDir - The directory holding the TypeScript source.
|
|
148
|
+
* @param {string} entryDir - The directory to write the entry files into.
|
|
149
|
+
* @returns {Array<string>} The paths of the entry files.
|
|
150
150
|
*/
|
|
151
151
|
exports.describeFile = describeFile;
|
|
152
152
|
const writeDocEntries = (ts, srcDir, entryDir) => {
|
|
@@ -199,16 +199,16 @@ const projectName = () => {
|
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
/**
|
|
203
|
-
* Generate the HTML documentation of a TypeScript project with TypeDoc, straight from the TypeScript source, so the
|
|
204
|
-
* types (and the comments on them) are documented from where they are defined. The modules mirror the folders of the
|
|
205
|
-
* source, see {@link writeDocEntries}. Configure this with 'docs.from', 'docs.to', 'docs.index', 'docs.title',
|
|
206
|
-
* 'docs.tsconfig' and 'docs.logLevel'.
|
|
207
|
-
* @memberOf module:partials
|
|
208
|
-
* @param {string} [srcPath=gulpConfig.get('docs.from')] - The directory holding the TypeScript source.
|
|
209
|
-
* @param {string} [outPath=gulpConfig.get('docs.to')] - The directory the documentation is generated into (cleared first).
|
|
210
|
-
* @param {function(string): Promise<Object>} [loadDocs] - Resolves the TypeDoc module, tests can inject a stand-in.
|
|
211
|
-
* @returns {Function} A gulp task, it accepts an optional callback and returns a promise.
|
|
202
|
+
/**
|
|
203
|
+
* Generate the HTML documentation of a TypeScript project with TypeDoc, straight from the TypeScript source, so the
|
|
204
|
+
* types (and the comments on them) are documented from where they are defined. The modules mirror the folders of the
|
|
205
|
+
* source, see {@link writeDocEntries}. Configure this with 'docs.from', 'docs.to', 'docs.index', 'docs.title',
|
|
206
|
+
* 'docs.tsconfig' and 'docs.logLevel'.
|
|
207
|
+
* @memberOf module:partials
|
|
208
|
+
* @param {string} [srcPath=gulpConfig.get('docs.from')] - The directory holding the TypeScript source.
|
|
209
|
+
* @param {string} [outPath=gulpConfig.get('docs.to')] - The directory the documentation is generated into (cleared first).
|
|
210
|
+
* @param {function(string): Promise<Object>} [loadDocs] - Resolves the TypeDoc module, tests can inject a stand-in.
|
|
211
|
+
* @returns {Function} A gulp task, it accepts an optional callback and returns a promise.
|
|
212
212
|
*/
|
|
213
213
|
const typeDocsFor = (srcPath = gulpConfig.get('docs.from'), outPath = gulpConfig.get('docs.to'), loadDocs = loadTypeDoc) => {
|
|
214
214
|
if (gulpConfig.get('docs.enabled') === false) {
|
|
@@ -235,6 +235,7 @@ const typeDocsFor = (srcPath = gulpConfig.get('docs.from'), outPath = gulpConfig
|
|
|
235
235
|
exclude: [_nodePath.default.resolve(srcPath).split(_nodePath.default.sep).join('/') + '/**/*.test.*']
|
|
236
236
|
}));
|
|
237
237
|
const indexFile = gulpConfig.get('docs.index');
|
|
238
|
+
const gitRevision = gulpConfig.get('docs.gitRevision');
|
|
238
239
|
await (0, _removeDirectory.removeDirectory)(outPath);
|
|
239
240
|
const app = await Application.bootstrap({
|
|
240
241
|
entryPoints,
|
|
@@ -242,7 +243,12 @@ const typeDocsFor = (srcPath = gulpConfig.get('docs.from'), outPath = gulpConfig
|
|
|
242
243
|
name: gulpConfig.get('docs.title') || projectName(),
|
|
243
244
|
readme: indexFile && _nodeFs.default.existsSync(indexFile) ? indexFile : 'none',
|
|
244
245
|
logLevel: gulpConfig.get('docs.logLevel') || 'Warn',
|
|
245
|
-
skipErrorChecking: true
|
|
246
|
+
skipErrorChecking: true,
|
|
247
|
+
// Left out, TypeDoc links each declaration to its source at the current commit, so every commit changes
|
|
248
|
+
// every page; a branch name keeps the pages the same until the documentation itself changes.
|
|
249
|
+
...(gitRevision ? {
|
|
250
|
+
gitRevision
|
|
251
|
+
} : {})
|
|
246
252
|
});
|
|
247
253
|
const project = await app.convert();
|
|
248
254
|
if (!project) {
|
package/dist/partials.js
CHANGED
|
@@ -1,177 +1,177 @@
|
|
|
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, "lintSource", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _lintSource.lintSource;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "loadPlaywright", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _loadPlaywright.loadPlaywright;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "minifyFor", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _minifyFor.minifyFor;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "neostandardLint", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _neostandardLint.neostandardLint;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "readmeTemplate", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _readmeTemplate.readmeTemplate;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "removeDirectory", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _removeDirectory.removeDirectory;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "requirePeer", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _loadPeer.requirePeer;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "resolveDocsMethod", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _resolveDocsMethod.resolveDocsMethod;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "runOnChange", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _runOnChange.runOnChange;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "sassFor", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _sassFor.sassFor;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "serveStatic", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function () {
|
|
141
|
-
return _serveStatic.serveStatic;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "tsFor", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () {
|
|
147
|
-
return _tsFor.tsFor;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(exports, "typeDocsFor", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function () {
|
|
153
|
-
return _typeDocsFor.typeDocsFor;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
var _addToReadme = require("./partials/addToReadme.js");
|
|
157
|
-
var _beginWatcher = require("./partials/beginWatcher.js");
|
|
158
|
-
var _clean = require("./partials/clean.js");
|
|
159
|
-
var _copyFor = require("./partials/copyFor.js");
|
|
160
|
-
var _distFor = require("./partials/distFor.js");
|
|
161
|
-
var _distForSrc = require("./partials/distForSrc.js");
|
|
162
|
-
var _distSeries = require("./partials/distSeries.js");
|
|
163
|
-
var _imagesFor = require("./partials/imagesFor.js");
|
|
164
|
-
var _loadPeer = require("./partials/loadPeer.js");
|
|
165
|
-
var _jsdocDocsFor = require("./partials/jsdocDocsFor.js");
|
|
166
|
-
var _loadPlaywright = require("./partials/loadPlaywright.js");
|
|
167
|
-
var _lintSource = require("./partials/lintSource.js");
|
|
168
|
-
var _minifyFor = require("./partials/minifyFor.js");
|
|
169
|
-
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
170
|
-
var _readmeTemplate = require("./partials/readmeTemplate.js");
|
|
171
|
-
var _removeDirectory = require("./partials/removeDirectory.js");
|
|
172
|
-
var _resolveDocsMethod = require("./partials/resolveDocsMethod.js");
|
|
173
|
-
var _runOnChange = require("./partials/runOnChange.js");
|
|
174
|
-
var _sassFor = require("./partials/sassFor.js");
|
|
175
|
-
var _serveStatic = require("./partials/serveStatic.js");
|
|
176
|
-
var _tsFor = require("./partials/tsFor.js");
|
|
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, "lintSource", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _lintSource.lintSource;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "loadPlaywright", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _loadPlaywright.loadPlaywright;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "minifyFor", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _minifyFor.minifyFor;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "neostandardLint", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _neostandardLint.neostandardLint;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "readmeTemplate", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _readmeTemplate.readmeTemplate;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "removeDirectory", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _removeDirectory.removeDirectory;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "requirePeer", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _loadPeer.requirePeer;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "resolveDocsMethod", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _resolveDocsMethod.resolveDocsMethod;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "runOnChange", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _runOnChange.runOnChange;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "sassFor", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _sassFor.sassFor;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "serveStatic", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _serveStatic.serveStatic;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "tsFor", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _tsFor.tsFor;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "typeDocsFor", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _typeDocsFor.typeDocsFor;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var _addToReadme = require("./partials/addToReadme.js");
|
|
157
|
+
var _beginWatcher = require("./partials/beginWatcher.js");
|
|
158
|
+
var _clean = require("./partials/clean.js");
|
|
159
|
+
var _copyFor = require("./partials/copyFor.js");
|
|
160
|
+
var _distFor = require("./partials/distFor.js");
|
|
161
|
+
var _distForSrc = require("./partials/distForSrc.js");
|
|
162
|
+
var _distSeries = require("./partials/distSeries.js");
|
|
163
|
+
var _imagesFor = require("./partials/imagesFor.js");
|
|
164
|
+
var _loadPeer = require("./partials/loadPeer.js");
|
|
165
|
+
var _jsdocDocsFor = require("./partials/jsdocDocsFor.js");
|
|
166
|
+
var _loadPlaywright = require("./partials/loadPlaywright.js");
|
|
167
|
+
var _lintSource = require("./partials/lintSource.js");
|
|
168
|
+
var _minifyFor = require("./partials/minifyFor.js");
|
|
169
|
+
var _neostandardLint = require("./partials/neostandardLint.js");
|
|
170
|
+
var _readmeTemplate = require("./partials/readmeTemplate.js");
|
|
171
|
+
var _removeDirectory = require("./partials/removeDirectory.js");
|
|
172
|
+
var _resolveDocsMethod = require("./partials/resolveDocsMethod.js");
|
|
173
|
+
var _runOnChange = require("./partials/runOnChange.js");
|
|
174
|
+
var _sassFor = require("./partials/sassFor.js");
|
|
175
|
+
var _serveStatic = require("./partials/serveStatic.js");
|
|
176
|
+
var _tsFor = require("./partials/tsFor.js");
|
|
177
177
|
var _typeDocsFor = require("./partials/typeDocsFor.js");
|
package/dist/sourceLint.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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");
|
|
8
|
-
/**
|
|
9
|
-
* Applies neostandard linting (js-build-tools' chosen style) to the real, hand-written source - not the compiled
|
|
10
|
-
* dist/browser output, which is generated and so was never going to pass a hand-authored-code style check (every
|
|
11
|
-
* compiler/bundler emits its own boilerplate - import aliasing, interop headers - that only looks like a style
|
|
12
|
-
* violation). Includes test files: there is no reason to hold tests to a lower style bar than the rest of the
|
|
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.
|
|
15
|
-
* @memberOf module:js-build-tools
|
|
16
|
-
* @returns {*}
|
|
17
|
-
*/
|
|
18
|
-
const sourceLint = () => (0, _lintSource.lintSource)();
|
|
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");
|
|
8
|
+
/**
|
|
9
|
+
* Applies neostandard linting (js-build-tools' chosen style) to the real, hand-written source - not the compiled
|
|
10
|
+
* dist/browser output, which is generated and so was never going to pass a hand-authored-code style check (every
|
|
11
|
+
* compiler/bundler emits its own boilerplate - import aliasing, interop headers - that only looks like a style
|
|
12
|
+
* violation). Includes test files: there is no reason to hold tests to a lower style bar than the rest of the
|
|
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.
|
|
15
|
+
* @memberOf module:js-build-tools
|
|
16
|
+
* @returns {*}
|
|
17
|
+
*/
|
|
18
|
+
const sourceLint = () => (0, _lintSource.lintSource)();
|
|
19
19
|
exports.sourceLint = sourceLint;
|