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
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strBefore = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Retrieve the string part before the search match.
|
|
9
|
-
* Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strBefore.ts Sí, funciona}
|
|
10
|
-
* @param {string} str
|
|
11
|
-
* @param {string} search
|
|
12
|
-
* @returns {string}
|
|
13
|
-
* @private
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the string part before the search match.
|
|
9
|
+
* Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strBefore.ts Sí, funciona}
|
|
10
|
+
* @param {string} str
|
|
11
|
+
* @param {string} search
|
|
12
|
+
* @returns {string}
|
|
13
|
+
* @private
|
|
14
14
|
*/
|
|
15
15
|
const strBefore = (str, search) => {
|
|
16
16
|
const index = str.indexOf(search);
|
package/dist/watchFull.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.watchFull = void 0;
|
|
7
7
|
var _partials = require("./partials.js");
|
|
8
|
-
/**
|
|
9
|
-
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
10
|
-
* @memberOf module:js-build-tools
|
|
11
|
-
* @returns {FSWatcher}
|
|
8
|
+
/**
|
|
9
|
+
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
10
|
+
* @memberOf module:js-build-tools
|
|
11
|
+
* @returns {FSWatcher}
|
|
12
12
|
*/
|
|
13
13
|
const watchFull = () => (0, _partials.beginWatcher)().on('change', _partials.runOnChange);
|
|
14
14
|
exports.watchFull = watchFull;
|
package/dist/watchTest.js
CHANGED
|
@@ -10,10 +10,10 @@ var _gulp = require("gulp");
|
|
|
10
10
|
var _testQuick = require("./testQuick.js");
|
|
11
11
|
var cache;
|
|
12
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
|
-
/**
|
|
14
|
-
* Watch for changes and run the tests.
|
|
15
|
-
* @memberOf module:js-build-tools
|
|
16
|
-
* @returns {*}
|
|
13
|
+
/**
|
|
14
|
+
* Watch for changes and run the tests.
|
|
15
|
+
* @memberOf module:js-build-tools
|
|
16
|
+
* @returns {*}
|
|
17
17
|
*/
|
|
18
18
|
const watchTest = () => (0, _gulp.watch)(gulpConfig.get('test.watch'), {
|
|
19
19
|
ignoreInitial: false
|
package/functions/build.mjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { bundle } from './bundle.mjs'
|
|
2
|
-
import { bundleMinify } from './bundleMinify.mjs'
|
|
3
|
-
import { clean, distSeries } from './partials.mjs'
|
|
4
|
-
import { compileReadme } from './compileReadme.mjs'
|
|
5
|
-
import { typeDocs } from './typeDocs.mjs'
|
|
6
|
-
import { jsdocDocs } from './jsdocDocs.mjs'
|
|
7
|
-
import { distMinify } from './distMinify.mjs'
|
|
8
|
-
import { sourceLint } from './sourceLint.mjs'
|
|
9
|
-
import { parallel, series } from 'gulp'
|
|
10
|
-
import * as gulpConfig from '../gulp.config.mjs'
|
|
11
|
-
import { copyFonts } from './copyFonts.mjs'
|
|
12
|
-
import { images } from './images.mjs'
|
|
13
|
-
import { resolveDocsMethod } from './partials/resolveDocsMethod.mjs'
|
|
14
|
-
import { sass } from './sass.mjs'
|
|
15
|
-
import { testFull } from './testFull.mjs'
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Runs several processes to build and validate the project.
|
|
19
|
-
* Cleans and lints the source, distributes and minifies, bundles and minifies, creates the readme, then runs the
|
|
20
|
-
* tests.
|
|
21
|
-
* @memberOf module:js-build-tools
|
|
22
|
-
* @returns {stream.Stream}
|
|
23
|
-
*/
|
|
24
|
-
export const build = (done = null) => {
|
|
25
|
-
const buildActions = [distSeries(), distMinify]
|
|
26
|
-
const generateDocs = gulpConfig.get('docs.enabled')
|
|
27
|
-
const docsMethod = resolveDocsMethod()
|
|
28
|
-
if (generateDocs) {
|
|
29
|
-
// The documentation is generated from the source itself, the readme is written by hand. With docs.inBuild off,
|
|
30
|
-
// generating it is left to the standalone docs task (gulp docs), so a build never rewrites it.
|
|
31
|
-
if (gulpConfig.get('docs.inBuild') !== false) {
|
|
32
|
-
buildActions.push(docsMethod === 'jsdoc' ? jsdocDocs : typeDocs)
|
|
33
|
-
}
|
|
34
|
-
} else if (gulpConfig.get('typescript.enabled')) {
|
|
35
|
-
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
36
|
-
buildActions.push(compileReadme)
|
|
37
|
-
}
|
|
38
|
-
if (gulpConfig.get('browser.enabled')) {
|
|
39
|
-
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
40
|
-
buildActions.push(bundle)
|
|
41
|
-
buildActions.push(bundleMinify)
|
|
42
|
-
}
|
|
43
|
-
const runActions = [
|
|
44
|
-
series(...buildActions),
|
|
45
|
-
]
|
|
46
|
-
if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
|
|
47
|
-
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
48
|
-
runActions.push(compileReadme)
|
|
49
|
-
}
|
|
50
|
-
runActions.push(testFull)
|
|
51
|
-
if (gulpConfig.get('fonts.enabled')) {
|
|
52
|
-
// Conditionally add Fonts process
|
|
53
|
-
runActions.push(copyFonts)
|
|
54
|
-
}
|
|
55
|
-
if (gulpConfig.get('images.enabled')) {
|
|
56
|
-
// Conditionally add Images process
|
|
57
|
-
runActions.push(images)
|
|
58
|
-
}
|
|
59
|
-
if (gulpConfig.get('sass.enabled')) {
|
|
60
|
-
// Conditionally add SASS process
|
|
61
|
-
runActions.push(sass)
|
|
62
|
-
}
|
|
63
|
-
// clean has to finish before anything writes into the output folders - images, fonts and sass all write into
|
|
64
|
-
// browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
|
|
65
|
-
// sourceLint fixes the real source in place before anything compiles from it (distSeries, tsFor inside it), so a
|
|
66
|
-
// build never reads a mix of pre- and post-fix content; clean only touches dist/browser output, so the two can
|
|
67
|
-
// run alongside each other.
|
|
68
|
-
return series(
|
|
69
|
-
parallel(clean, sourceLint),
|
|
70
|
-
parallel(...runActions)
|
|
71
|
-
)(done)
|
|
72
|
-
}
|
|
1
|
+
import { bundle } from './bundle.mjs'
|
|
2
|
+
import { bundleMinify } from './bundleMinify.mjs'
|
|
3
|
+
import { clean, distSeries } from './partials.mjs'
|
|
4
|
+
import { compileReadme } from './compileReadme.mjs'
|
|
5
|
+
import { typeDocs } from './typeDocs.mjs'
|
|
6
|
+
import { jsdocDocs } from './jsdocDocs.mjs'
|
|
7
|
+
import { distMinify } from './distMinify.mjs'
|
|
8
|
+
import { sourceLint } from './sourceLint.mjs'
|
|
9
|
+
import { parallel, series } from 'gulp'
|
|
10
|
+
import * as gulpConfig from '../gulp.config.mjs'
|
|
11
|
+
import { copyFonts } from './copyFonts.mjs'
|
|
12
|
+
import { images } from './images.mjs'
|
|
13
|
+
import { resolveDocsMethod } from './partials/resolveDocsMethod.mjs'
|
|
14
|
+
import { sass } from './sass.mjs'
|
|
15
|
+
import { testFull } from './testFull.mjs'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Runs several processes to build and validate the project.
|
|
19
|
+
* Cleans and lints the source, distributes and minifies, bundles and minifies, creates the readme, then runs the
|
|
20
|
+
* tests.
|
|
21
|
+
* @memberOf module:js-build-tools
|
|
22
|
+
* @returns {stream.Stream}
|
|
23
|
+
*/
|
|
24
|
+
export const build = (done = null) => {
|
|
25
|
+
const buildActions = [distSeries(), distMinify]
|
|
26
|
+
const generateDocs = gulpConfig.get('docs.enabled')
|
|
27
|
+
const docsMethod = resolveDocsMethod()
|
|
28
|
+
if (generateDocs) {
|
|
29
|
+
// The documentation is generated from the source itself, the readme is written by hand. With docs.inBuild off,
|
|
30
|
+
// generating it is left to the standalone docs task (gulp docs), so a build never rewrites it.
|
|
31
|
+
if (gulpConfig.get('docs.inBuild') !== false) {
|
|
32
|
+
buildActions.push(docsMethod === 'jsdoc' ? jsdocDocs : typeDocs)
|
|
33
|
+
}
|
|
34
|
+
} else if (gulpConfig.get('typescript.enabled')) {
|
|
35
|
+
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
36
|
+
buildActions.push(compileReadme)
|
|
37
|
+
}
|
|
38
|
+
if (gulpConfig.get('browser.enabled')) {
|
|
39
|
+
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
40
|
+
buildActions.push(bundle)
|
|
41
|
+
buildActions.push(bundleMinify)
|
|
42
|
+
}
|
|
43
|
+
const runActions = [
|
|
44
|
+
series(...buildActions),
|
|
45
|
+
]
|
|
46
|
+
if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
|
|
47
|
+
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
48
|
+
runActions.push(compileReadme)
|
|
49
|
+
}
|
|
50
|
+
runActions.push(testFull)
|
|
51
|
+
if (gulpConfig.get('fonts.enabled')) {
|
|
52
|
+
// Conditionally add Fonts process
|
|
53
|
+
runActions.push(copyFonts)
|
|
54
|
+
}
|
|
55
|
+
if (gulpConfig.get('images.enabled')) {
|
|
56
|
+
// Conditionally add Images process
|
|
57
|
+
runActions.push(images)
|
|
58
|
+
}
|
|
59
|
+
if (gulpConfig.get('sass.enabled')) {
|
|
60
|
+
// Conditionally add SASS process
|
|
61
|
+
runActions.push(sass)
|
|
62
|
+
}
|
|
63
|
+
// clean has to finish before anything writes into the output folders - images, fonts and sass all write into
|
|
64
|
+
// browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
|
|
65
|
+
// sourceLint fixes the real source in place before anything compiles from it (distSeries, tsFor inside it), so a
|
|
66
|
+
// build never reads a mix of pre- and post-fix content; clean only touches dist/browser output, so the two can
|
|
67
|
+
// run alongside each other.
|
|
68
|
+
return series(
|
|
69
|
+
parallel(clean, sourceLint),
|
|
70
|
+
parallel(...runActions)
|
|
71
|
+
)(done)
|
|
72
|
+
}
|