js-build-tools 5.1.1 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +348 -284
  2. package/dist/build.js +7 -2
  3. package/dist/build.min.js +1 -1
  4. package/dist/bundle.js +32 -16
  5. package/dist/bundle.min.js +1 -1
  6. package/dist/bundleLint.js +16 -16
  7. package/dist/bundleMinify.js +13 -13
  8. package/dist/compileReadme.js +10 -10
  9. package/dist/copyFonts.js +13 -13
  10. package/dist/default.js +15 -15
  11. package/dist/dist.js +10 -10
  12. package/dist/distLint.js +16 -16
  13. package/dist/distMinify.js +13 -13
  14. package/dist/images.js +10 -10
  15. package/dist/partials/addToReadme.js +17 -17
  16. package/dist/partials/beginWatcher.js +12 -12
  17. package/dist/partials/clean.js +14 -14
  18. package/dist/partials/copyFor.js +12 -12
  19. package/dist/partials/distFor.js +21 -21
  20. package/dist/partials/distForSrc.js +11 -11
  21. package/dist/partials/distSeries.js +19 -19
  22. package/dist/partials/imagesFor.js +48 -48
  23. package/dist/partials/minifyFor.js +16 -16
  24. package/dist/partials/readmeTemplate.js +14 -14
  25. package/dist/partials/removeDirectory.js +29 -29
  26. package/dist/partials/runOnChange.js +28 -28
  27. package/dist/partials/sassFor.js +28 -28
  28. package/dist/partials/standardLint.js +75 -75
  29. package/dist/partials/tsFor.js +82 -82
  30. package/dist/partials/typeDocsFor.js +214 -0
  31. package/dist/partials.js +7 -0
  32. package/dist/partials.min.js +1 -1
  33. package/dist/sass.js +10 -10
  34. package/dist/test-helpers/setUp.js +89 -89
  35. package/dist/test-helpers/standardLintWithRealStandard.js +27 -27
  36. package/dist/testFull.js +20 -20
  37. package/dist/testHelpers.js +10 -10
  38. package/dist/testQuick.js +22 -22
  39. package/dist/typeDocs.js +14 -0
  40. package/dist/typeDocs.min.js +1 -0
  41. package/dist/typeScript.js +9 -9
  42. package/dist/utilities/dotGet.js +46 -46
  43. package/dist/utilities/dotNotate.js +46 -46
  44. package/dist/utilities/dotSet.js +37 -37
  45. package/dist/utilities/isObject.js +8 -8
  46. package/dist/utilities/strAfter.js +11 -11
  47. package/dist/utilities/strBefore.js +11 -11
  48. package/dist/watchFull.js +10 -10
  49. package/dist/watchTest.js +16 -16
  50. package/functions/build.mjs +7 -2
  51. package/functions/build.test.mjs +29 -0
  52. package/functions/bundle.mjs +20 -4
  53. package/functions/bundle.test.mjs +74 -0
  54. package/functions/partials/typeDocsFor.mjs +194 -0
  55. package/functions/partials/typeDocsFor.test.mjs +183 -0
  56. package/functions/partials.mjs +1 -0
  57. package/functions/partials.test.mjs +1 -1
  58. package/functions/typeDocs.mjs +9 -0
  59. package/functions/typeDocs.test.mjs +11 -0
  60. package/gulp.config.mjs +32 -0
  61. package/gulpfile.base.js +2 -0
  62. package/gulpfile.base.mjs +1 -0
  63. package/package.json +12 -7
package/gulp.config.mjs CHANGED
@@ -52,6 +52,14 @@ import { fileExists } from 'test-filesystem'
52
52
  * @property {StringSetting} from - The name to use for the browser-bundled output file (.js will be appended).
53
53
  * @property {StringSetting} name - The search pattern used for retrieving compiled distribution files.
54
54
  * @property {StringSetting} to - The output directory for browser-bundled files.
55
+ * @property {ArrayableSetting} ignore - Module names or file paths which resolve to an empty object ({}) in the
56
+ * bundle instead of their real contents. For a dependency which is only reached because it is the default value of
57
+ * an option you always override (for example a selector engine's default DOM adapter, when you always pass your
58
+ * own), this keeps it (and anything only it requires) out of the bundle, as long as your code never actually reaches
59
+ * the real module by not overriding that option. See browserify's b.ignore(file).
60
+ * @property {ArrayableSetting} exclude - Module names or file paths left out of the bundle entirely; requiring one at
61
+ * runtime throws unless something else provides it (for example a script tag loading it separately). See
62
+ * browserify's b.exclude(file).
55
63
  */
56
64
  /**
57
65
  * Configurations for building the node distribution files.
@@ -83,6 +91,18 @@ import { fileExists } from 'test-filesystem'
83
91
  * @property {StringSetting} template - The file which will be pre-fixed to your README.md output.
84
92
  * @property {StringSetting} to - The directory to output the readme file in.
85
93
  */
94
+ /**
95
+ * Configurations for generating the HTML documentation of a TypeScript project (with TypeDoc, from the source).
96
+ * @typedef {Object<string, Setting>} module:gulpConfig~DocsConfig
97
+ * @property {BooleanSetting} enabled - Toggle generating the documentation from the TypeScript source. When it is on the
98
+ * build does this instead of generating the readme from the jsdoc comments of the compiled files.
99
+ * @property {StringSetting} from - The directory holding the TypeScript source, each folder in it becomes a module.
100
+ * @property {StringSetting} index - The markdown file used as the front page of the documentation.
101
+ * @property {StringSetting} logLevel - How much TypeDoc reports: Verbose, Info, Warn, Error or None.
102
+ * @property {StringSetting} title - The name of the documentation, defaults to the name in the package.json.
103
+ * @property {StringSetting} to - The directory to generate the documentation in (it is cleared first).
104
+ * @property {FlagStringSetting} tsconfig - The tsconfig file to read the source with, defaults to the one of typescript.config.
105
+ */
86
106
  /**
87
107
  * Configurations to compile and copy the sass files into css.
88
108
  * @typedef {Object<string, Setting>} module:gulpConfig~SassConfig
@@ -113,6 +133,7 @@ import { fileExists } from 'test-filesystem'
113
133
  * @property {BrowserConfig} browser - Browser bundling configuration group.
114
134
  * @property {ArrayableSetting} cleanPaths - The paths for directories to delete before build.
115
135
  * @property {DistConfig} dist - Distribution file generation configuration group.
136
+ * @property {DocsConfig} docs - Generate the documentation of a TypeScript project configuration group.
116
137
  * @property {FontConfig} fonts - Fonts copy configuration group.
117
138
  * @property {ImageConfig} images - Minify and copy the images configuration.
118
139
  * @property {ReadmeConfig} readme - Build readme files configuration.
@@ -130,7 +151,9 @@ import { readFileSync } from 'fs'
130
151
  const setDefaults = {
131
152
  browser: {
132
153
  enabled: true,
154
+ exclude: [],
133
155
  from: 'dist/**/*.js',
156
+ ignore: [],
134
157
  name: 'default',
135
158
  to: 'browser',
136
159
  },
@@ -140,6 +163,15 @@ const setDefaults = {
140
163
  main: 'dist/main',
141
164
  to: 'dist',
142
165
  },
166
+ docs: {
167
+ enabled: false,
168
+ from: 'src',
169
+ index: 'MAIN.md',
170
+ logLevel: 'Warn',
171
+ title: '',
172
+ to: 'docs',
173
+ tsconfig: false,
174
+ },
143
175
  fonts: {
144
176
  enabled: false,
145
177
  from: 'src/fonts/**/*',
package/gulpfile.base.js CHANGED
@@ -23,6 +23,7 @@ const sass = require('./dist/sass.js')
23
23
  const testFull = require('./dist/testFull.js')
24
24
  const testHelpers = require('./dist/testHelpers.js')
25
25
  const testQuick = require('./dist/testQuick.js')
26
+ const typeDocs = require('./dist/typeDocs.js')
26
27
  const typescript = require('./dist/typeScript')
27
28
  const watchFull = require('./dist/watchFull.js')
28
29
  const watchTest = require('./dist/watchTest.js')
@@ -34,6 +35,7 @@ module.exports = {
34
35
  bundleMinify,
35
36
  copyFonts,
36
37
  defaultCmd,
38
+ docs: typeDocs,
37
39
  dist,
38
40
  distLint,
39
41
  distMinify,
package/gulpfile.base.mjs CHANGED
@@ -22,6 +22,7 @@ export { sass } from './functions/sass.mjs'
22
22
  export { testFull } from './functions/testFull.mjs'
23
23
  export * as testHelpers from './functions/testHelpers.mjs'
24
24
  export { testQuick } from './functions/testQuick.mjs'
25
+ export { typeDocs as docs } from './functions/typeDocs.mjs'
25
26
  export { typeScript as typescript } from './functions/typeScript.mjs'
26
27
  export { watchFull } from './functions/watchFull.mjs'
27
28
  export { watchTest } from './functions/watchTest.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-build-tools",
3
- "version": "5.1.1",
3
+ "version": "5.3.0",
4
4
  "description": "Standardised build process with gulp.",
5
5
  "main": "gulpfile.base.js",
6
6
  "exports": {
@@ -52,9 +52,9 @@
52
52
  "@babel/preset-typescript": "^7.29.7",
53
53
  "@babel/runtime-corejs3": "^8.0.6",
54
54
  "autoprefixer": "^10.6.1",
55
- "babel-jest": "^30.4.1",
55
+ "babel-jest": "^30.5.2",
56
56
  "browserify": "^17.0.1",
57
- "core-js": "^3.49.0",
57
+ "core-js": "^3.50.0",
58
58
  "cssnano": "^6.1.2",
59
59
  "glob": "^13.0.6",
60
60
  "gulp": "^5.0.1",
@@ -63,27 +63,31 @@
63
63
  "gulp-postcss": "^10.0.0",
64
64
  "gulp-rename": "^2.1.0",
65
65
  "gulp-sass": "^6.0.1",
66
- "gulp-ts-compile": "^1.0.0",
66
+ "gulp-ts-compile": "^1.0.1",
67
67
  "gulp-uglify-es": "^3.0.0",
68
68
  "jest": "^30.5.2",
69
- "jest-environment-jsdom": "^30.4.1",
69
+ "jest-environment-jsdom": "^30.5.2",
70
70
  "jsdoc-to-markdown": "^9.1.3",
71
71
  "postcss": "^8.5.28",
72
72
  "regenerator-runtime": "^0.14.1",
73
- "sass": "^1.101.0",
73
+ "sass": "^1.105.0",
74
74
  "standard": "^17.1.2",
75
- "test-filesystem": "^1.5.0",
75
+ "test-filesystem": "^1.5.1",
76
76
  "through2": "^4.0.2",
77
77
  "vinyl-source-stream": "^2.0.0"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "gulp-imagemin": ">=9.0.0",
81
+ "typedoc": ">=0.28.0",
81
82
  "typescript": ">=5.0.0 <7.0.0"
82
83
  },
83
84
  "peerDependenciesMeta": {
84
85
  "gulp-imagemin": {
85
86
  "optional": true
86
87
  },
88
+ "typedoc": {
89
+ "optional": true
90
+ },
87
91
  "typescript": {
88
92
  "optional": true
89
93
  }
@@ -101,6 +105,7 @@
101
105
  "funding": "https://www.paypal.com/donate/?business=LRYR6SZRWKXVY&no_recurring=0&item_name=Let%27s+build+together+today+to+simplify+our+jobs+tomorrow.&currency_code=CAD",
102
106
  "devDependencies": {
103
107
  "gulp-imagemin": "github:jheagle/gulp-imagemin#common-js-compatibility",
108
+ "typedoc": "^0.28.20",
104
109
  "typescript": "^6.0.3"
105
110
  }
106
111
  }