js-build-tools 5.6.0 → 6.0.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.
Files changed (65) hide show
  1. package/README.md +98 -3
  2. package/dist/build.js +65 -64
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +40 -40
  5. package/dist/bundleMinify.js +18 -18
  6. package/dist/compileReadme.js +7 -7
  7. package/dist/copyFonts.js +10 -10
  8. package/dist/default.js +12 -12
  9. package/dist/dist.js +7 -7
  10. package/dist/distMinify.js +10 -10
  11. package/dist/images.js +7 -7
  12. package/dist/partials/addToReadme.js +14 -3
  13. package/dist/partials/imagesFor.js +42 -42
  14. package/dist/partials/loadPeer.js +70 -70
  15. package/dist/partials/neostandardLint.js +144 -0
  16. package/dist/partials/tsFor.js +70 -70
  17. package/dist/partials/typeDocsFor.js +202 -202
  18. package/dist/partials.js +136 -136
  19. package/dist/partials.min.js +1 -1
  20. package/dist/sass.js +7 -7
  21. package/dist/sourceLint.js +33 -0
  22. package/dist/sourceLint.min.js +1 -0
  23. package/dist/test-helpers/neostandardLintWithRealNeostandard.js +48 -0
  24. package/dist/test-helpers/setUp.js +5 -0
  25. package/dist/testFull.js +13 -13
  26. package/dist/testHelpers.js +8 -8
  27. package/dist/testQuick.js +13 -13
  28. package/dist/typeDocs.js +9 -9
  29. package/dist/typeScript.js +6 -6
  30. package/dist/utilities/convertMjsFilesForDocs.js +48 -0
  31. package/dist/utilities/esmNamedExportsToCjs.js +33 -0
  32. package/dist/utilities/getBundleConfigs.js +27 -27
  33. package/dist/watchFull.js +7 -7
  34. package/dist/watchTest.js +11 -11
  35. package/functions/build.mjs +9 -8
  36. package/functions/build.test.mjs +18 -25
  37. package/functions/partials/addToReadme.mjs +14 -5
  38. package/functions/partials/neostandardLint.mjs +118 -0
  39. package/functions/partials/neostandardLint.test.mjs +109 -0
  40. package/functions/partials.mjs +1 -1
  41. package/functions/sourceLint.mjs +24 -0
  42. package/functions/sourceLint.test.mjs +73 -0
  43. package/functions/test-helpers/neostandardLintWithRealNeostandard.mjs +38 -0
  44. package/functions/test-helpers/setUp.mjs +5 -0
  45. package/functions/utilities/convertMjsFilesForDocs.mjs +33 -0
  46. package/functions/utilities/convertMjsFilesForDocs.test.mjs +57 -0
  47. package/functions/utilities/esmNamedExportsToCjs.mjs +29 -0
  48. package/functions/utilities/esmNamedExportsToCjs.test.mjs +47 -0
  49. package/gulp.config.mjs +4 -0
  50. package/gulpfile.base.js +2 -4
  51. package/gulpfile.base.mjs +1 -2
  52. package/package.json +7 -6
  53. package/dist/bundleLint.js +0 -28
  54. package/dist/bundleLint.min.js +0 -1
  55. package/dist/distLint.js +0 -20
  56. package/dist/distLint.min.js +0 -1
  57. package/dist/partials/standardLint.js +0 -94
  58. package/dist/test-helpers/standardLintWithRealStandard.js +0 -28
  59. package/functions/bundleLint.mjs +0 -18
  60. package/functions/bundleLint.test.mjs +0 -85
  61. package/functions/distLint.mjs +0 -12
  62. package/functions/distLint.test.mjs +0 -62
  63. package/functions/partials/standardLint.mjs +0 -78
  64. package/functions/partials/standardLint.test.mjs +0 -99
  65. package/functions/test-helpers/standardLintWithRealStandard.mjs +0 -21
package/README.md CHANGED
@@ -40,6 +40,8 @@ provided are the defaults):
40
40
  // Module names or file paths left out of the bundle entirely (requiring one at runtime throws, unless something
41
41
  // else provides it, for example a script tag which loads it separately).
42
42
  "exclude": [],
43
+ // Additional bundles to produce alongside the primary one above (see 'Configure additional browser bundles').
44
+ "bundles": [],
43
45
  // The output directory for browser-bundled files.
44
46
  "to": "browser"
45
47
  },
@@ -100,6 +102,9 @@ provided are the defaults):
100
102
  "from": [
101
103
  "src/**/!(*.test).js"
102
104
  ],
105
+ // Additional .mjs files to document alongside 'from' (see 'Configure including ESM files in the generated
106
+ // readme'). Empty by default: a project that never sets this gets exactly the readme it always did.
107
+ "fromEsm": [],
103
108
  // The directory to output the readme file in.
104
109
  "to": "./"
105
110
  },
@@ -316,6 +321,56 @@ Two settings in `browser` handle this, both take module names or file paths (see
316
321
  }
317
322
  ```
318
323
 
324
+ ### Configure additional browser bundles (optional)
325
+
326
+ By default a project produces exactly one browser bundle, from `dist.main`/`browser.name`/`browser.ignore`/
327
+ `browser.exclude` above. `browser.bundles` adds more bundles alongside it - for example a render-only variant built
328
+ from a different entry point than the full bundle. Each entry only needs to specify what's actually different about
329
+ that bundle; anything left out falls back to the primary bundle's own value:
330
+
331
+ ```json
332
+ {
333
+ "browser": {
334
+ "bundles": [
335
+ {
336
+ // Required, and must be unique among all of a project's bundles: the name for this bundle's own output file
337
+ // and standalone export.
338
+ "name": "render-only",
339
+ // This bundle's own entry point. Falls back to dist.main when omitted.
340
+ "main": "dist/renderOnly.js",
341
+ // This bundle's own ignore list. Falls back to browser.ignore when omitted.
342
+ "ignore": [],
343
+ // This bundle's own exclude list. Falls back to browser.exclude when omitted.
344
+ "exclude": []
345
+ }
346
+ ]
347
+ }
348
+ }
349
+ ```
350
+
351
+ For the `gulpConfig` module's own `get`/`set` functions (read or override a resolved configuration value from your
352
+ own code, by the same dot-notation path a setting has in the JSON above), see the generated reference below.
353
+
354
+ ### Configure including ESM files in the generated readme (optional)
355
+
356
+ The readme generator (`jsdoc-to-markdown`) only recognizes `.js` files, even though it parses real ESM `import`/
357
+ `export` syntax just fine once it reads one - the file extension is the only thing it filters on, not the content.
358
+ `readme.fromEsm` names `.mjs` files to document anyway: each one is read, rewritten (every top-level `export const`/
359
+ `export function`/`export class` becomes a plain declaration plus a trailing `module.exports = { ... }` - the same
360
+ shape `jsdoc-to-markdown` already documents cleanly, since that rewrite is exactly what this project's own
361
+ `gulp.config.mjs` needs it for) and written to a temp `.js` file outside your project entirely, which is cleaned up
362
+ again once the readme generator has read it. Other export forms (`export default`, re-exports, `export { a, b }`
363
+ lists) are left untouched in whatever way `jsdoc-to-markdown` already handles ESM - restructure a file to use named
364
+ exports if you want it documented this cleanly:
365
+
366
+ ```json
367
+ {
368
+ "readme": {
369
+ "fromEsm": ["src/myEsmOnlyModule.mjs"]
370
+ }
371
+ }
372
+ ```
373
+
319
374
  ### Configure move fonts (optional)
320
375
 
321
376
  Be able to copy a source directory of fonts into the distribution path.
@@ -522,7 +577,7 @@ Export these functions to your own project to customize your build pipeline.
522
577
  <a name="module_js-build-tools.build"></a>
523
578
 
524
579
  ### js-build-tools.build() ⇒ <code>stream.Stream</code>
525
- Runs several processes to build and validate the project.
580
+ Runs several processes to build and validate the project.
526
581
 
527
582
  **Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
528
583
  <a name="module_gulpConfig"></a>
@@ -546,10 +601,12 @@ Modify these configurations to match your project specifications.
546
601
  * [~StringSetting](#module_gulpConfig..StringSetting) : <code>string</code>
547
602
  * [~Setting](#module_gulpConfig..Setting) : <code>ArrayableSetting</code> \| <code>BooleanSetting</code> \| <code>FlagsSetting</code> \| <code>StringSetting</code>
548
603
  * [~BrowserConfig](#module_gulpConfig..BrowserConfig) : <code>Object.&lt;string, Setting&gt;</code>
604
+ * [~AdditionalBundleConfig](#module_gulpConfig..AdditionalBundleConfig) : <code>Object.&lt;string, Setting&gt;</code>
549
605
  * [~DistConfig](#module_gulpConfig..DistConfig) : <code>Object.&lt;string, Setting&gt;</code>
550
606
  * [~FontConfig](#module_gulpConfig..FontConfig) : <code>Object.&lt;string, Setting&gt;</code>
551
607
  * [~ImageConfig](#module_gulpConfig..ImageConfig) : <code>Object.&lt;string, Setting&gt;</code>
552
608
  * [~ReadmeConfig](#module_gulpConfig..ReadmeConfig) : <code>Object.&lt;string, Setting&gt;</code>
609
+ * [~DocsConfig](#module_gulpConfig..DocsConfig) : <code>Object.&lt;string, Setting&gt;</code>
553
610
  * [~SassConfig](#module_gulpConfig..SassConfig) : <code>Object.&lt;string, Setting&gt;</code>
554
611
  * [~TestConfig](#module_gulpConfig..TestConfig) : <code>Object.&lt;string, Setting&gt;</code>
555
612
  * [~TsConfig](#module_gulpConfig..TsConfig) : <code>Object.&lt;string, Setting&gt;</code>
@@ -646,9 +703,27 @@ Configurations for building the browser files.
646
703
  | Name | Type | Description |
647
704
  | --- | --- | --- |
648
705
  | enabled | <code>BooleanSetting</code> | 'true' to generate browser bundled files; 'false' for node environment only |
649
- | from | <code>StringSetting</code> | The name to use for the browser-bundled output file (.js will be appended). |
650
- | name | <code>StringSetting</code> | The search pattern used for retrieving compiled distribution files. |
706
+ | from | <code>StringSetting</code> | The search pattern used for retrieving compiled distribution files. |
707
+ | name | <code>StringSetting</code> | The name to use for the browser-bundled output file (.js will be appended). |
651
708
  | to | <code>StringSetting</code> | The output directory for browser-bundled files. |
709
+ | ignore | <code>ArrayableSetting</code> | Module names or file paths which resolve to an empty object ({}) in the bundle instead of their real contents. For a dependency which is only reached because it is the default value of an option you always override (for example a selector engine's default DOM adapter, when you always pass your own), this keeps it (and anything only it requires) out of the bundle, as long as your code never actually reaches the real module by not overriding that option. See browserify's b.ignore(file). |
710
+ | exclude | <code>ArrayableSetting</code> | Module names or file paths left out of the bundle entirely; requiring one at runtime throws unless something else provides it (for example a script tag loading it separately). See browserify's b.exclude(file). |
711
+ | bundles | [<code>Array.&lt;AdditionalBundleConfig&gt;</code>](#module_gulpConfig..AdditionalBundleConfig) | Additional bundles to produce alongside the primary one (name/dist.main/ignore/exclude above) - for example a render-only variant built from a different entry point than the full bundle. Empty by default: a project that never sets this gets exactly the one bundle it always did. |
712
+
713
+ <a name="module_gulpConfig..AdditionalBundleConfig"></a>
714
+
715
+ ### gulpConfig~AdditionalBundleConfig : <code>Object.&lt;string, Setting&gt;</code>
716
+ One additional bundle - everything but `name` falls back to the primary bundle's own value when omitted, so an
717
+
718
+ **Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
719
+ **Properties**
720
+
721
+ | Name | Type | Description |
722
+ | --- | --- | --- |
723
+ | name | <code>StringSetting</code> | The name for this bundle's output file and standalone export - must be unique among all of a project's bundles. |
724
+ | [main] | <code>StringSetting</code> | This bundle's own entry point. Falls back to dist.main when omitted. |
725
+ | [ignore] | <code>ArrayableSetting</code> | This bundle's own ignore list. Falls back to browser.ignore when omitted. |
726
+ | [exclude] | <code>ArrayableSetting</code> | This bundle's own exclude list. Falls back to browser.exclude when omitted. |
652
727
 
653
728
  <a name="module_gulpConfig..DistConfig"></a>
654
729
 
@@ -704,10 +779,29 @@ Configurations to compile and generate the Readme file.
704
779
  | --- | --- | --- |
705
780
  | file | <code>StringSetting</code> | The name of the output documentation markdown file. |
706
781
  | from | <code>StringSetting</code> | Location of files to use for compiling documentation into the readme. |
782
+ | fromEsm | <code>ArrayableSetting</code> | Additional `.mjs` files to document alongside `from`, converted on the fly since the readme generator only recognizes `.js` files - see 'Configure including ESM files in the generated readme'. Empty by default: a project that never sets this gets exactly the readme it always did. |
707
783
  | options | <code>ArrayableSetting</code> | Options for formatting the output readme. |
708
784
  | template | <code>StringSetting</code> | The file which will be pre-fixed to your README.md output. |
709
785
  | to | <code>StringSetting</code> | The directory to output the readme file in. |
710
786
 
787
+ <a name="module_gulpConfig..DocsConfig"></a>
788
+
789
+ ### gulpConfig~DocsConfig : <code>Object.&lt;string, Setting&gt;</code>
790
+ Configurations for generating the HTML documentation of a TypeScript project (with TypeDoc, from the source).
791
+
792
+ **Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
793
+ **Properties**
794
+
795
+ | Name | Type | Description |
796
+ | --- | --- | --- |
797
+ | enabled | <code>BooleanSetting</code> | Toggle generating the documentation from the TypeScript source. When it is on the build does this instead of generating the readme from the jsdoc comments of the compiled files. |
798
+ | from | <code>StringSetting</code> | The directory holding the TypeScript source, each folder in it becomes a module. |
799
+ | index | <code>StringSetting</code> | The markdown file used as the front page of the documentation. |
800
+ | logLevel | <code>StringSetting</code> | How much TypeDoc reports: Verbose, Info, Warn, Error or None. |
801
+ | title | <code>StringSetting</code> | The name of the documentation, defaults to the name in the package.json. |
802
+ | to | <code>StringSetting</code> | The directory to generate the documentation in (it is cleared first). |
803
+ | tsconfig | <code>FlagStringSetting</code> | The tsconfig file to read the source with, defaults to the one of typescript.config. |
804
+
711
805
  <a name="module_gulpConfig..SassConfig"></a>
712
806
 
713
807
  ### gulpConfig~SassConfig : <code>Object.&lt;string, Setting&gt;</code>
@@ -765,6 +859,7 @@ A set of Configurations options defined by Settings.
765
859
  | browser | <code>BrowserConfig</code> | Browser bundling configuration group. |
766
860
  | cleanPaths | <code>ArrayableSetting</code> | The paths for directories to delete before build. |
767
861
  | dist | <code>DistConfig</code> | Distribution file generation configuration group. |
862
+ | docs | <code>DocsConfig</code> | Generate the documentation of a TypeScript project configuration group. |
768
863
  | fonts | <code>FontConfig</code> | Fonts copy configuration group. |
769
864
  | images | <code>ImageConfig</code> | Minify and copy the images configuration. |
770
865
  | readme | <code>ReadmeConfig</code> | Build readme files configuration. |
package/dist/build.js CHANGED
@@ -1,68 +1,69 @@
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.build = void 0
8
- const _bundle = require('./bundle.js')
9
- const _bundleLint = require('./bundleLint.js')
10
- const _bundleMinify = require('./bundleMinify.js')
11
- const _partials = require('./partials.js')
12
- const _compileReadme = require('./compileReadme.js')
13
- const _typeDocs = require('./typeDocs.js')
14
- const _distLint = require('./distLint.js')
15
- const _distMinify = require('./distMinify.js')
16
- const _gulp = require('gulp')
17
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
18
- const _copyFonts = require('./copyFonts.js')
19
- const _images = require('./images.js')
20
- const _sass = require('./sass.js')
21
- const _testFull = require('./testFull.js')
22
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
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.build = void 0;
8
+ var _bundle = require("./bundle.js");
9
+ var _bundleMinify = require("./bundleMinify.js");
10
+ var _partials = require("./partials.js");
11
+ var _compileReadme = require("./compileReadme.js");
12
+ var _typeDocs = require("./typeDocs.js");
13
+ var _distMinify = require("./distMinify.js");
14
+ var _sourceLint = require("./sourceLint.js");
15
+ var _gulp = require("gulp");
16
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
17
+ var _copyFonts = require("./copyFonts.js");
18
+ var _images = require("./images.js");
19
+ var _sass = require("./sass.js");
20
+ var _testFull = require("./testFull.js");
21
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
23
22
  /**
24
23
  * Runs several processes to build and validate the project.
25
- * Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
24
+ * Cleans and lints the source, distributes and minifies, bundles and minifies, creates the readme, then runs the
25
+ * tests.
26
26
  * @memberOf module:js-build-tools
27
27
  * @returns {stream.Stream}
28
- */
29
- const build = (done = null) => {
30
- const distLintMinify = (0, _gulp.parallel)(_distLint.distLint, _distMinify.distMinify)
31
- const bundleLintMinify = (0, _gulp.parallel)(_bundleLint.bundleLint, _bundleMinify.bundleMinify)
32
- const buildActions = [(0, _partials.distSeries)(), distLintMinify]
33
- const generateDocs = gulpConfig.get('docs.enabled')
34
- if (generateDocs) {
35
- // The documentation is generated from the TypeScript source itself, the readme is written by hand
36
- buildActions.push(_typeDocs.typeDocs)
37
- } else if (gulpConfig.get('typescript.enabled')) {
38
- // For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
39
- buildActions.push(_compileReadme.compileReadme)
40
- }
41
- if (gulpConfig.get('browser.enabled')) {
42
- // If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
43
- buildActions.push(_bundle.bundle)
44
- buildActions.push(bundleLintMinify)
45
- }
46
- const runActions = [(0, _gulp.series)(...buildActions)]
47
- if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
48
- // Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
49
- runActions.push(_compileReadme.compileReadme)
50
- }
51
- runActions.push(_testFull.testFull)
52
- if (gulpConfig.get('fonts.enabled')) {
53
- // Conditionally add Fonts process
54
- runActions.push(_copyFonts.copyFonts)
55
- }
56
- if (gulpConfig.get('images.enabled')) {
57
- // Conditionally add Images process
58
- runActions.push(_images.images)
59
- }
60
- if (gulpConfig.get('sass.enabled')) {
61
- // Conditionally add SASS process
62
- runActions.push(_sass.sass)
63
- }
64
- // clean has to finish before anything writes into the output folders - images, fonts and sass all write into
65
- // browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
66
- return (0, _gulp.series)(_partials.clean, (0, _gulp.parallel)(...runActions))(done)
67
- }
68
- exports.build = build
28
+ */
29
+ const build = (done = null) => {
30
+ const buildActions = [(0, _partials.distSeries)(), _distMinify.distMinify];
31
+ const generateDocs = gulpConfig.get('docs.enabled');
32
+ if (generateDocs) {
33
+ // The documentation is generated from the TypeScript source itself, the readme is written by hand
34
+ buildActions.push(_typeDocs.typeDocs);
35
+ } else if (gulpConfig.get('typescript.enabled')) {
36
+ // For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
37
+ buildActions.push(_compileReadme.compileReadme);
38
+ }
39
+ if (gulpConfig.get('browser.enabled')) {
40
+ // If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
41
+ buildActions.push(_bundle.bundle);
42
+ buildActions.push(_bundleMinify.bundleMinify);
43
+ }
44
+ const runActions = [(0, _gulp.series)(...buildActions)];
45
+ if (!generateDocs && !gulpConfig.get('typescript.enabled')) {
46
+ // Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
47
+ runActions.push(_compileReadme.compileReadme);
48
+ }
49
+ runActions.push(_testFull.testFull);
50
+ if (gulpConfig.get('fonts.enabled')) {
51
+ // Conditionally add Fonts process
52
+ runActions.push(_copyFonts.copyFonts);
53
+ }
54
+ if (gulpConfig.get('images.enabled')) {
55
+ // Conditionally add Images process
56
+ runActions.push(_images.images);
57
+ }
58
+ if (gulpConfig.get('sass.enabled')) {
59
+ // Conditionally add SASS process
60
+ runActions.push(_sass.sass);
61
+ }
62
+ // clean has to finish before anything writes into the output folders - images, fonts and sass all write into
63
+ // browser/, so running clean in parallel with them races (ENOTEMPTY errors from clean, or output deleted mid-write).
64
+ // sourceLint fixes the real source in place before anything compiles from it (distSeries, tsFor inside it), so a
65
+ // build never reads a mix of pre- and post-fix content; clean only touches dist/browser output, so the two can
66
+ // run alongside each other.
67
+ return (0, _gulp.series)((0, _gulp.parallel)(_partials.clean, _sourceLint.sourceLint), (0, _gulp.parallel)(...runActions))(done);
68
+ };
69
+ exports.build = build;
package/dist/build.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=void 0;var _bundle=require("./bundle.js"),_bundleLint=require("./bundleLint.js"),_bundleMinify=require("./bundleMinify.js"),_partials=require("./partials.js"),_compileReadme=require("./compileReadme.js"),_typeDocs=require("./typeDocs.js"),_distLint=require("./distLint.js"),_distMinify=require("./distMinify.js"),_gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_copyFonts=require("./copyFonts.js"),_images=require("./images.js"),_sass=require("./sass.js"),_testFull=require("./testFull.js");function _interopRequireWildcard(e,i){if("function"==typeof WeakMap)var s=new WeakMap,t=new WeakMap;return(_interopRequireWildcard=function(e,i){if(!i&&e&&e.__esModule)return e;var l,r,u={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return u;if(l=i?t:s){if(l.has(e))return l.get(e);l.set(e,u)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((r=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(r.get||r.set)?l(u,i,r):u[i]=e[i]);return u})(e,i)}const build=(e=null)=>{const i=(0,_gulp.parallel)(_distLint.distLint,_distMinify.distMinify),s=(0,_gulp.parallel)(_bundleLint.bundleLint,_bundleMinify.bundleMinify),t=[(0,_partials.distSeries)(),i],l=gulpConfig.get("docs.enabled");l?t.push(_typeDocs.typeDocs):gulpConfig.get("typescript.enabled")&&t.push(_compileReadme.compileReadme),gulpConfig.get("browser.enabled")&&(t.push(_bundle.bundle),t.push(s));const r=[(0,_gulp.series)(...t)];return l||gulpConfig.get("typescript.enabled")||r.push(_compileReadme.compileReadme),r.push(_testFull.testFull),gulpConfig.get("fonts.enabled")&&r.push(_copyFonts.copyFonts),gulpConfig.get("images.enabled")&&r.push(_images.images),gulpConfig.get("sass.enabled")&&r.push(_sass.sass),(0,_gulp.series)(_partials.clean,(0,_gulp.parallel)(...r))(e)};exports.build=build;
1
+ "use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=void 0;var _bundle=require("./bundle.js"),_bundleMinify=require("./bundleMinify.js"),_partials=require("./partials.js"),_compileReadme=require("./compileReadme.js"),_typeDocs=require("./typeDocs.js"),_distMinify=require("./distMinify.js"),_sourceLint=require("./sourceLint.js"),_gulp=require("gulp"),gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_copyFonts=require("./copyFonts.js"),_images=require("./images.js"),_sass=require("./sass.js"),_testFull=require("./testFull.js");function _interopRequireWildcard(e,i){if("function"==typeof WeakMap)var s=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,i){if(!i&&e&&e.__esModule)return e;var t,u,l={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return l;if(t=i?r:s){if(t.has(e))return t.get(e);t.set(e,l)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((u=(t=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(u.get||u.set)?t(l,i,u):l[i]=e[i]);return l})(e,i)}const build=(e=null)=>{const i=[(0,_partials.distSeries)(),_distMinify.distMinify],s=gulpConfig.get("docs.enabled");s?i.push(_typeDocs.typeDocs):gulpConfig.get("typescript.enabled")&&i.push(_compileReadme.compileReadme),gulpConfig.get("browser.enabled")&&(i.push(_bundle.bundle),i.push(_bundleMinify.bundleMinify));const r=[(0,_gulp.series)(...i)];return s||gulpConfig.get("typescript.enabled")||r.push(_compileReadme.compileReadme),r.push(_testFull.testFull),gulpConfig.get("fonts.enabled")&&r.push(_copyFonts.copyFonts),gulpConfig.get("images.enabled")&&r.push(_images.images),gulpConfig.get("sass.enabled")&&r.push(_sass.sass),(0,_gulp.series)((0,_gulp.parallel)(_partials.clean,_sourceLint.sourceLint),(0,_gulp.parallel)(...r))(e)};exports.build=build;
package/dist/bundle.js CHANGED
@@ -1,20 +1,20 @@
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.bundle = void 0
8
- require('core-js/modules/esnext.iterator.constructor.js')
9
- require('core-js/modules/esnext.iterator.map.js')
10
- const _browserify = _interopRequireDefault(require('browserify'))
11
- const _gulp = require('gulp')
12
- const _mergeStream = _interopRequireDefault(require('merge-stream'))
13
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
14
- const _vinylSourceStream = _interopRequireDefault(require('vinyl-source-stream'))
15
- const _getBundleConfigs = require('./utilities/getBundleConfigs.js')
16
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
17
- function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
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.bundle = void 0;
8
+ require("core-js/modules/esnext.iterator.constructor.js");
9
+ require("core-js/modules/esnext.iterator.map.js");
10
+ var _browserify = _interopRequireDefault(require("browserify"));
11
+ var _gulp = require("gulp");
12
+ var _mergeStream = _interopRequireDefault(require("merge-stream"));
13
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
14
+ var _vinylSourceStream = _interopRequireDefault(require("vinyl-source-stream"));
15
+ var _getBundleConfigs = require("./utilities/getBundleConfigs.js");
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  /**
19
19
  * Starting at each bundle's own entry point (dist.main for the primary bundle, or its own
20
20
  * override from browser.bundles), bundle all the reachable files into a single file per bundle and
@@ -34,26 +34,26 @@ function _interopRequireDefault (e) { return e && e.__esModule ? e : { default:
34
34
  * code must not require it, or provide it another way, such as a separate script tag).
35
35
  * @memberOf module:js-build-tools
36
36
  * @returns {stream.Stream}
37
- */
38
- const bundle = () => (0, _mergeStream.default)((0, _getBundleConfigs.getBundleConfigs)().map(({
39
- name,
40
- main,
41
- ignore,
42
- exclude
43
- }) => {
44
- const bundler = (0, _browserify.default)(main, {
45
- standalone: name
46
- })
47
- if (ignore && ignore.length) {
48
- bundler.ignore(ignore)
49
- }
50
- if (exclude && exclude.length) {
51
- bundler.exclude(exclude)
52
- }
53
- return bundler.bundle().pipe((0, _vinylSourceStream.default)(`${name}.js`))
54
- })
55
- // One shared dest() for every bundle, not one per bundle - vinyl-fs's dest() races against
56
- // itself (a real "write after end" failure) when two separate dest() streams target the same
57
- // directory concurrently, which every additional bundle's own dest() call otherwise would.
58
- ).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')))
59
- exports.bundle = bundle
37
+ */
38
+ const bundle = () => (0, _mergeStream.default)((0, _getBundleConfigs.getBundleConfigs)().map(({
39
+ name,
40
+ main,
41
+ ignore,
42
+ exclude
43
+ }) => {
44
+ const bundler = (0, _browserify.default)(main, {
45
+ standalone: name
46
+ });
47
+ if (ignore && ignore.length) {
48
+ bundler.ignore(ignore);
49
+ }
50
+ if (exclude && exclude.length) {
51
+ bundler.exclude(exclude);
52
+ }
53
+ return bundler.bundle().pipe((0, _vinylSourceStream.default)(`${name}.js`));
54
+ })
55
+ // One shared dest() for every bundle, not one per bundle - vinyl-fs's dest() races against
56
+ // itself (a real "write after end" failure) when two separate dest() streams target the same
57
+ // directory concurrently, which every additional bundle's own dest() call otherwise would.
58
+ ).pipe((0, _gulp.dest)(gulpConfig.get('browser.to')));
59
+ exports.bundle = bundle;
@@ -1,16 +1,16 @@
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.bundleMinify = void 0
8
- require('core-js/modules/esnext.iterator.constructor.js')
9
- require('core-js/modules/esnext.iterator.map.js')
10
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
11
- const _minifyFor = require('./partials/minifyFor.js')
12
- const _getBundleConfigs = require('./utilities/getBundleConfigs.js')
13
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
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.bundleMinify = void 0;
8
+ require("core-js/modules/esnext.iterator.constructor.js");
9
+ require("core-js/modules/esnext.iterator.map.js");
10
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
11
+ var _minifyFor = require("./partials/minifyFor.js");
12
+ var _getBundleConfigs = require("./utilities/getBundleConfigs.js");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
14
  /**
15
15
  * Creates the minified file for every bundle (the primary bundle, plus any additional ones from
16
16
  * browser.bundles). The minify step itself never varies per bundle, so this is one shared
@@ -18,8 +18,8 @@ function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var
18
18
  * pipeline per bundle - gulp's src() accepts an array of paths natively.
19
19
  * @memberOf module:js-build-tools
20
20
  * @returns {*}
21
- */
22
- const bundleMinify = () => (0, _minifyFor.minifyFor)((0, _getBundleConfigs.getBundleConfigs)().map(({
23
- name
24
- }) => `${gulpConfig.get('browser.to')}/${name}.js`), gulpConfig.get('browser.to'))
25
- exports.bundleMinify = bundleMinify
21
+ */
22
+ const bundleMinify = () => (0, _minifyFor.minifyFor)((0, _getBundleConfigs.getBundleConfigs)().map(({
23
+ name
24
+ }) => `${gulpConfig.get('browser.to')}/${name}.js`), gulpConfig.get('browser.to'));
25
+ exports.bundleMinify = bundleMinify;
@@ -1,14 +1,14 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
3
+ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- })
6
- exports.compileReadme = void 0
7
- const _partials = require('./partials.js')
8
- const _gulp = require('gulp')
5
+ });
6
+ exports.compileReadme = void 0;
7
+ var _partials = require("./partials.js");
8
+ var _gulp = require("gulp");
9
9
  /**
10
10
  * Generate the README.md file based off of the template, then append the generated documentation.
11
11
  * @memberOf module:js-build-tools
12
12
  * @returns {stream.Stream}
13
13
  */
14
- const compileReadme = exports.compileReadme = (0, _gulp.series)(_partials.readmeTemplate, _partials.addToReadme)
14
+ const compileReadme = exports.compileReadme = (0, _gulp.series)(_partials.readmeTemplate, _partials.addToReadme);
package/dist/copyFonts.js CHANGED
@@ -1,17 +1,17 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
- require('core-js/modules/esnext.weak-map.delete-all.js')
4
- Object.defineProperty(exports, '__esModule', {
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
- })
7
- exports.copyFonts = void 0
8
- const _copyFor = require('./partials/copyFor.js')
9
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
10
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
6
+ });
7
+ exports.copyFonts = void 0;
8
+ var _copyFor = require("./partials/copyFor.js");
9
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
11
  /**
12
12
  * Move the font files into the browser directory.
13
13
  * @memberOf module:js-build-tools
14
14
  * @return {stream.Stream}
15
15
  */
16
- const copyFonts = () => (0, _copyFor.copyFor)(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'))
17
- exports.copyFonts = copyFonts
16
+ const copyFonts = () => (0, _copyFor.copyFor)(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'));
17
+ exports.copyFonts = copyFonts;
package/dist/default.js CHANGED
@@ -1,20 +1,20 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
- require('core-js/modules/esnext.weak-map.delete-all.js')
4
- Object.defineProperty(exports, '__esModule', {
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
- })
7
- exports.defaultCmd = void 0
8
- const _dist = require('./dist.js')
9
- const _bundle = require('./bundle.js')
10
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
11
- const _gulp = require('gulp')
12
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
6
+ });
7
+ exports.defaultCmd = void 0;
8
+ var _dist = require("./dist.js");
9
+ var _bundle = require("./bundle.js");
10
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
11
+ var _gulp = require("gulp");
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
13
  /**
14
14
  * Recommended as the default task, runs the simple dist and bundle tasks.
15
15
  * @memberOf module:js-build-tools
16
16
  * @param {function} [done=null]
17
17
  * @returns {stream.Stream}
18
18
  */
19
- const defaultCmd = (done = null) => gulpConfig.get('browser.enabled') ? (0, _gulp.series)(_dist.dist, _bundle.bundle)(done) : (0, _gulp.series)(_dist.dist)(done)
20
- exports.defaultCmd = defaultCmd
19
+ const defaultCmd = (done = null) => gulpConfig.get('browser.enabled') ? (0, _gulp.series)(_dist.dist, _bundle.bundle)(done) : (0, _gulp.series)(_dist.dist)(done);
20
+ exports.defaultCmd = defaultCmd;
package/dist/dist.js CHANGED
@@ -1,14 +1,14 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
- Object.defineProperty(exports, '__esModule', {
3
+ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- })
6
- exports.dist = void 0
7
- const _distFor = require('./partials/distFor.js')
5
+ });
6
+ exports.dist = void 0;
7
+ var _distFor = require("./partials/distFor.js");
8
8
  /**
9
9
  * Simplified distribution tasks which will use arguments from distFor.
10
10
  * @memberOf module:js-build-tools
11
11
  * @returns {*}
12
12
  */
13
- const dist = () => (0, _distFor.distFor)()
14
- exports.dist = dist
13
+ const dist = () => (0, _distFor.distFor)();
14
+ exports.dist = dist;
@@ -1,17 +1,17 @@
1
- 'use strict'
1
+ "use strict";
2
2
 
3
- require('core-js/modules/esnext.weak-map.delete-all.js')
4
- Object.defineProperty(exports, '__esModule', {
3
+ require("core-js/modules/esnext.weak-map.delete-all.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
- })
7
- exports.distMinify = void 0
8
- const gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
9
- const _minifyFor = require('./partials/minifyFor.js')
10
- function _interopRequireWildcard (e, t) { if (typeof WeakMap === 'function') var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; let o; let i; const f = { __proto__: null, default: e }; if (e === null || typeof e !== 'object' && typeof e !== 'function') return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f) } for (const t in e) t !== 'default' && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f })(e, t) }
6
+ });
7
+ exports.distMinify = void 0;
8
+ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
9
+ var _minifyFor = require("./partials/minifyFor.js");
10
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
11
  /**
12
12
  * Creates minified versions of the dist files.
13
13
  * @memberOf module:js-build-tools
14
14
  * @returns {*}
15
15
  */
16
- const distMinify = () => (0, _minifyFor.minifyFor)(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'))
17
- exports.distMinify = distMinify
16
+ const distMinify = () => (0, _minifyFor.minifyFor)(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'));
17
+ exports.distMinify = distMinify;