js-build-tools 2.4.0 → 3.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.
- package/README.md +334 -205
- package/dist/build.js +16 -5
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +1 -2
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +2 -3
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +1 -2
- package/dist/bundleMinify.min.js +1 -1
- package/dist/copyFonts.js +12 -0
- package/dist/copyFonts.min.js +1 -0
- package/dist/default.js +15 -15
- package/dist/default.min.js +1 -1
- package/dist/dist.js +7 -8
- package/dist/distLint.js +2 -3
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +1 -2
- package/dist/distMinify.min.js +1 -1
- package/dist/images.js +11 -0
- package/dist/images.min.js +1 -0
- package/dist/partials/addToReadme.js +2 -3
- package/dist/partials/beginWatcher.js +1 -2
- package/dist/partials/clean.js +10 -11
- package/dist/partials/copyFor.js +16 -0
- package/dist/partials/distFor.js +1 -2
- package/dist/partials/distForSrc.js +2 -3
- package/dist/partials/distSeries.js +3 -4
- package/dist/partials/imagesFor.js +34 -0
- package/dist/partials/minifyFor.js +15 -16
- package/dist/partials/readmeTemplate.js +1 -2
- package/dist/partials/removeDirectory.js +11 -12
- package/dist/partials/runOnChange.js +7 -7
- package/dist/partials/sassFor.js +2 -3
- package/dist/partials/tsFor.js +4 -5
- package/dist/partials.js +5 -1
- package/dist/partials.min.js +1 -1
- package/dist/test-helpers/setUp.js +31 -39
- package/dist/testFull.js +2 -3
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +2 -20
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +1 -2
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +7 -8
- package/dist/utilities/dotGet.js +50 -0
- package/dist/utilities/dotNotate.js +77 -0
- package/dist/utilities/dotSet.js +44 -0
- package/dist/utilities/isObject.js +10 -0
- package/dist/watchFull.js +10 -11
- package/dist/watchTest.js +1 -2
- package/dist/watchTest.min.js +1 -1
- package/functions/build.js +15 -5
- package/functions/build.test.js +278 -42
- package/functions/bundle.js +3 -4
- package/functions/bundle.test.js +6 -6
- package/functions/bundleLint.js +2 -3
- package/functions/bundleLint.test.js +5 -5
- package/functions/bundleMinify.js +1 -2
- package/functions/bundleMinify.test.js +1 -1
- package/functions/copyFonts.js +11 -0
- package/functions/copyFonts.test.js +31 -0
- package/functions/default.js +1 -1
- package/functions/default.test.js +2 -2
- package/functions/dist.js +0 -1
- package/functions/dist.test.js +1 -1
- package/functions/distLint.js +2 -3
- package/functions/distLint.test.js +3 -3
- package/functions/distMinify.js +1 -2
- package/functions/distMinify.test.js +1 -1
- package/functions/images.js +10 -0
- package/functions/images.test.js +138 -0
- package/functions/partials/addToReadme.js +2 -3
- package/functions/partials/addToReadme.test.js +2 -2
- package/functions/partials/beginWatcher.js +1 -2
- package/functions/partials/beginWatcher.test.js +1 -1
- package/functions/partials/clean.js +0 -1
- package/functions/partials/copyFor.js +13 -0
- package/functions/partials/copyFor.test.js +34 -0
- package/functions/partials/distFor.js +1 -2
- package/functions/partials/distFor.test.js +4 -4
- package/functions/partials/distForSrc.js +3 -4
- package/functions/partials/distForSrc.test.js +6 -6
- package/functions/partials/distSeries.js +2 -3
- package/functions/partials/distSeries.test.js +5 -5
- package/functions/partials/imagesFor.js +33 -0
- package/functions/partials/imagesFor.test.js +143 -0
- package/functions/partials/minifyFor.js +0 -1
- package/functions/partials/minifyFor.test.js +1 -1
- package/functions/partials/readmeTemplate.js +3 -4
- package/functions/partials/readmeTemplate.test.js +2 -2
- package/functions/partials/removeDirectory.js +0 -1
- package/functions/partials/runOnChange.js +5 -6
- package/functions/partials/runOnChange.test.js +9 -9
- package/functions/partials/sassFor.js +1 -2
- package/functions/partials/sassFor.test.js +3 -3
- package/functions/partials/tsFor.js +3 -4
- package/functions/partials/tsFor.test.js +2 -2
- package/functions/partials.js +5 -1
- package/functions/partials.test.js +1 -1
- package/functions/sass.test.js +2 -2
- package/functions/test-helpers/setUp.js +24 -32
- package/functions/testFull.js +2 -3
- package/functions/testFull.test.js +1 -1
- package/functions/testHelpers.js +3 -20
- package/functions/testHelpers.test.js +1 -1
- package/functions/testQuick.js +1 -2
- package/functions/testQuick.test.js +1 -1
- package/functions/typeScript.js +0 -1
- package/functions/typeScript.test.js +0 -2
- package/functions/utilities/dotGet.js +47 -0
- package/functions/utilities/dotNotate.js +68 -0
- package/functions/utilities/dotSet.js +41 -0
- package/functions/utilities/isObject.js +9 -0
- package/functions/watchFull.js +0 -1
- package/functions/watchFull.test.js +1 -1
- package/functions/watchTest.js +1 -2
- package/functions/watchTest.test.js +1 -1
- package/gulp.config.js +153 -79
- package/gulpfile.base.js +5 -1
- package/jsdoc.base.js +1 -1
- package/package.json +13 -9
- package/vendor/array-union/index.js +31 -0
- package/vendor/easy-transform-stream/index.js +58 -0
- package/vendor/globby/gitignore.js +100 -0
- package/vendor/globby/index.js +195 -0
- package/vendor/globby/node_modules/slash/index.js +16 -0
- package/vendor/globby/stream-utils.js +58 -0
- package/vendor/globby/to-path.js +20 -0
- package/vendor/gulp-imagemin/index.js +128 -0
- package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +265 -0
- package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +36 -0
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
- package/vendor/gulp-plugin-extras/index.js +46 -0
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +265 -0
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +36 -0
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +217 -0
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +154 -0
- package/vendor/gulp-plugin-extras/plugin-error.js +145 -0
- package/vendor/ignore/index.js +468 -0
- package/vendor/imagemin/index.js +94 -0
- package/vendor/imagemin-gifsicle/index.js +37 -0
- package/vendor/imagemin-mozjpeg/index.js +104 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +264 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +47 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +102 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +123 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +47 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +50 -0
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +128 -0
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +238 -0
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +89 -0
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +24 -0
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +44 -0
- package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +25 -0
- package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +70 -0
- package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +52 -0
- package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +43 -0
- package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +20 -0
- package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +17 -0
- package/vendor/imagemin-optipng/index.js +44 -0
- package/vendor/imagemin-svgo/index.js +27 -0
- package/vendor/is-jpg/index.js +12 -0
- package/vendor/junk/index.js +49 -0
- package/vendor/mozjpeg/index.js +9 -0
- package/vendor/mozjpeg/lib/index.js +18 -0
- package/vendor/mozjpeg/package.json +50 -0
- package/vendor/p-pipe/index.js +26 -0
- package/vendor/plur/index.js +32 -0
- package/vendor/pretty-bytes/index.js +71 -0
- package/vendor/slash/index.js +12 -0
- package/dist/test-helpers/circularObject.js +0 -50
- package/dist/test-helpers/countMatches.js +0 -12
- package/dist/test-helpers/deepReferenceObject.js +0 -20
- package/dist/test-helpers/domItem.js +0 -33
- package/dist/test-helpers/jsonDom.js +0 -20
- package/dist/test-helpers/linkedList.js +0 -23
- package/dist/test-helpers/logObject.js +0 -21
- package/dist/test-helpers/multiReferenceObject.js +0 -20
- package/dist/test-helpers/nodeTree.js +0 -28
- package/functions/test-helpers/circularObject.js +0 -28
- package/functions/test-helpers/circularObject.test.js +0 -14
- package/functions/test-helpers/countMatches.js +0 -11
- package/functions/test-helpers/countMatches.test.js +0 -9
- package/functions/test-helpers/deepReferenceObject.js +0 -25
- package/functions/test-helpers/deepReferenceObject.test.js +0 -7
- package/functions/test-helpers/domItem.js +0 -31
- package/functions/test-helpers/domItem.test.js +0 -12
- package/functions/test-helpers/jsonDom.js +0 -16
- package/functions/test-helpers/jsonDom.test.js +0 -12
- package/functions/test-helpers/linkedList.js +0 -10
- package/functions/test-helpers/linkedList.test.js +0 -22
- package/functions/test-helpers/logObject.js +0 -18
- package/functions/test-helpers/logObject.test.js +0 -20
- package/functions/test-helpers/multiReferenceObject.js +0 -25
- package/functions/test-helpers/multiReferenceObject.test.js +0 -14
- package/functions/test-helpers/nodeTree.js +0 -11
- package/functions/test-helpers/nodeTree.test.js +0 -18
package/README.md
CHANGED
|
@@ -27,78 +27,87 @@ provided are the defaults):
|
|
|
27
27
|
|
|
28
28
|
```js
|
|
29
29
|
module.exports = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
browser: {
|
|
31
|
+
// 'true' to generate browser bundled files; 'false' for node environment only
|
|
32
|
+
enabled: true,
|
|
33
|
+
// The name to use for the browser-bundled output file (.js will be appended).
|
|
34
|
+
name: 'my-package',
|
|
35
|
+
// The search pattern used for retrieving compiled distribution files.
|
|
36
|
+
from: 'dist/**/*.js',
|
|
37
|
+
// The output directory for browser-bundled files.
|
|
38
|
+
to: 'browser',
|
|
39
|
+
},
|
|
36
40
|
// The paths for directories to delete before build.
|
|
37
41
|
cleanPaths: ['dist', 'browser'],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
dist: {
|
|
43
|
+
// Name of the entry the distribution file.
|
|
44
|
+
main: 'dist/main',
|
|
45
|
+
// The search pattern used for gathering source files for distribution.
|
|
46
|
+
from: 'src/**/!(*.test).js',
|
|
47
|
+
// The output directory for the distribution files.
|
|
48
|
+
to: 'dist',
|
|
49
|
+
},
|
|
50
|
+
fonts: {
|
|
51
|
+
// Toggle copy directory of fonts on
|
|
52
|
+
enabled: false,
|
|
53
|
+
// Path to search for fonts
|
|
54
|
+
from: 'src/fonts/**/*',
|
|
55
|
+
// Path to output fonts
|
|
56
|
+
to: 'browser/fonts',
|
|
57
|
+
},
|
|
58
|
+
images: {
|
|
59
|
+
// Toggle image minify and copy process
|
|
60
|
+
enabled: false,
|
|
61
|
+
// Path to search for images
|
|
62
|
+
from: 'src/img/**/*.+(png|jpg|jpeg|gif|svg)',
|
|
63
|
+
// Path to output images
|
|
64
|
+
to: 'browser/img',
|
|
65
|
+
},
|
|
66
|
+
readme: {
|
|
67
|
+
// The file which will be pre-fixed to your README.md output.
|
|
68
|
+
template: 'MAIN.md',
|
|
69
|
+
// Options for formatting the output readme.
|
|
70
|
+
options: 'utf8',
|
|
71
|
+
// The name of the output documentation markdown file.
|
|
72
|
+
file: 'README.md',
|
|
73
|
+
// Location of files to use for compiling documentation into the readme.
|
|
74
|
+
from: ['gulpfile.base.js', 'gulp.config.js', 'functions/**/!(*.test).js'],
|
|
75
|
+
// The directory to output the readme file in.
|
|
76
|
+
to: './'
|
|
77
|
+
},
|
|
69
78
|
// Base directory of the project.
|
|
70
79
|
rootPath: './',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
sass: {
|
|
81
|
+
// Toggle SASS to CSS process on.
|
|
82
|
+
enabled: false,
|
|
83
|
+
// The pattern for finding all sass files.
|
|
84
|
+
from: 'sass/**/*.+(scss|sass)',
|
|
85
|
+
// The directory were sass files will be stored.
|
|
86
|
+
path: 'sass',
|
|
87
|
+
// The destination path for where generated CSS (from SASS files) should go.
|
|
88
|
+
to: 'browser/css',
|
|
89
|
+
},
|
|
78
90
|
// The directory where your source files are stored (the files you manually created).
|
|
79
91
|
srcPath: 'src',
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// The search pattern for watching files for changes.
|
|
101
|
-
watchSearch: 'src/**/*.js',
|
|
92
|
+
test: {
|
|
93
|
+
// Additional flags for programmatically running Jest Cli.
|
|
94
|
+
options: null,
|
|
95
|
+
// The directory where Jest test files are stored.
|
|
96
|
+
// By default, stored as *.test.js adjacent to the files they are testing.
|
|
97
|
+
path: ['src'],
|
|
98
|
+
// The search pattern for watching files for changes.
|
|
99
|
+
watch: 'src/**/*.js'
|
|
100
|
+
},
|
|
101
|
+
typescript: {
|
|
102
|
+
// The path the tsconfig file for running typescript or false if no ts file given.
|
|
103
|
+
config: false,
|
|
104
|
+
// Toggle usage of typescript parsing.
|
|
105
|
+
enabled: false,
|
|
106
|
+
// Pattern for finding the TypeScript files.
|
|
107
|
+
from: 'src/**/*.ts',
|
|
108
|
+
// Directory where parsed typescript files go.
|
|
109
|
+
to: 'dist',
|
|
110
|
+
},
|
|
102
111
|
}
|
|
103
112
|
```
|
|
104
113
|
|
|
@@ -173,6 +182,44 @@ const jsDocBase = require('js-build-tools/jsdoc.base')
|
|
|
173
182
|
module.exports = jsDocBase
|
|
174
183
|
```
|
|
175
184
|
|
|
185
|
+
### Configure move fonts (optional)
|
|
186
|
+
|
|
187
|
+
Be able to copy a source directory of fonts into the distribution path.
|
|
188
|
+
|
|
189
|
+
Add the following to the exports in your `build-tools.config.js`:
|
|
190
|
+
|
|
191
|
+
```js
|
|
192
|
+
module.exports = {
|
|
193
|
+
fonts: {
|
|
194
|
+
// Enable fonts process
|
|
195
|
+
enabled: false,
|
|
196
|
+
// Search pattern to find your font files
|
|
197
|
+
from: 'src/fonts/**/*',
|
|
198
|
+
// Output directory for your font files
|
|
199
|
+
to: 'browser/fonts',
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Configure move and minify images (optional)
|
|
205
|
+
|
|
206
|
+
Be able to copy and reduce the file size of images into an output path.
|
|
207
|
+
|
|
208
|
+
Add the following to the exports in your `build-tools.config.js`:
|
|
209
|
+
|
|
210
|
+
```js
|
|
211
|
+
module.exports = {
|
|
212
|
+
images: {
|
|
213
|
+
// Enable image process
|
|
214
|
+
enabled: false,
|
|
215
|
+
// Search pattern to find your images
|
|
216
|
+
from: 'src/img/**/*.+(png|jpg|jpeg|gif|svg)',
|
|
217
|
+
// Output directory for your images files
|
|
218
|
+
to: 'browser/img',
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
176
223
|
### Configure SASS (optional)
|
|
177
224
|
|
|
178
225
|
SASS support is built-in, this enables conversion of SASS files to CSS for web projects.
|
|
@@ -181,14 +228,16 @@ Add the following to the exports in your `build-tools.config.js`:
|
|
|
181
228
|
|
|
182
229
|
```js
|
|
183
230
|
module.exports = {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
231
|
+
sass: {
|
|
232
|
+
// Enable SASS process
|
|
233
|
+
enabled: false,
|
|
234
|
+
// Search pattern to find your SASS files (the below would be files ending in .scss or .sass in a directory called 'sass')
|
|
235
|
+
from: 'sass/**/*.+(scss|sass)',
|
|
236
|
+
// Optional but nice to add (future support), add the directory where your sass files exist
|
|
237
|
+
path: 'sass',
|
|
238
|
+
// Output directory for your compiled css files, recommend css directory within your browser output directory
|
|
239
|
+
to: 'browser/css',
|
|
240
|
+
}
|
|
192
241
|
}
|
|
193
242
|
```
|
|
194
243
|
|
|
@@ -211,15 +260,27 @@ Create a `tsconfig.json` file in your project root with the following:
|
|
|
211
260
|
```
|
|
212
261
|
|
|
213
262
|
The pattern for `"files"` should match your .ts files, but the essential thing is that it is wrapped in an array.
|
|
214
|
-
The actual pattern used comes from `build-tools.config.js` as `'
|
|
215
|
-
files you must add the `"declaration": true`.
|
|
263
|
+
The actual pattern used comes from `build-tools.config.js` as `'typescript.from'` setting.
|
|
264
|
+
To create the ts declaration files, you must add the `"declaration": true`.
|
|
216
265
|
|
|
217
266
|
Add the following to the exports in your `build-tools.config.js`:
|
|
218
267
|
|
|
219
268
|
```js
|
|
220
269
|
module.exports = {
|
|
221
|
-
|
|
222
|
-
|
|
270
|
+
readme: {
|
|
271
|
+
// Location of files to use for compiling documentation into the readme.
|
|
272
|
+
from: 'dist/**/!(*.min).js',
|
|
273
|
+
},
|
|
274
|
+
typescript: {
|
|
275
|
+
// The path the tsconfig file for running typescript or false if no ts file given.
|
|
276
|
+
config: 'tsconfig.json',
|
|
277
|
+
// Toggle usage of typescript parsing
|
|
278
|
+
enabled: true,
|
|
279
|
+
// Pattern for finding the TypeScript files
|
|
280
|
+
from: 'src/**/*.ts',
|
|
281
|
+
// Directory where parsed typescript files go
|
|
282
|
+
to: 'dist',
|
|
283
|
+
},
|
|
223
284
|
}
|
|
224
285
|
```
|
|
225
286
|
|
|
@@ -271,7 +332,7 @@ Run any of the above commands with `gulp` or `npm run`.
|
|
|
271
332
|
<dd><p>Modify these configurations to match your project specifications.</p>
|
|
272
333
|
</dd>
|
|
273
334
|
<dt><a href="#module_testHelpers">testHelpers</a></dt>
|
|
274
|
-
<dd><p>
|
|
335
|
+
<dd><p>Export the setUp helper.</p>
|
|
275
336
|
</dd>
|
|
276
337
|
<dt><a href="#module_partials">partials</a></dt>
|
|
277
338
|
<dd><p>Micro-functions used as components for the main gulp functions.</p>
|
|
@@ -283,25 +344,33 @@ Run any of the above commands with `gulp` or `npm run`.
|
|
|
283
344
|
## js-build-tools
|
|
284
345
|
Export these functions to your own project in order to customize your build pipeline.
|
|
285
346
|
|
|
286
|
-
**Version**:
|
|
347
|
+
**Version**: 3.0.0
|
|
287
348
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
288
349
|
|
|
289
350
|
* [js-build-tools](#module_js-build-tools)
|
|
351
|
+
* [.typeScript](#module_js-build-tools.typeScript) ⇒ <code>function</code>
|
|
290
352
|
* [.compileReadme](#module_js-build-tools.compileReadme) ⇒ <code>stream.Stream</code>
|
|
291
353
|
* [.watchTest()](#module_js-build-tools.watchTest) ⇒ <code>\*</code>
|
|
292
354
|
* [.watchFull()](#module_js-build-tools.watchFull) ⇒ <code>FSWatcher</code>
|
|
293
|
-
* [.typeScript()](#module_js-build-tools.typeScript) ⇒ <code>function</code>
|
|
294
355
|
* [.testQuick()](#module_js-build-tools.testQuick) ⇒ <code>Promise.<\*></code>
|
|
295
356
|
* [.testFull()](#module_js-build-tools.testFull) ⇒ <code>Promise.<\*></code>
|
|
357
|
+
* [.images()](#module_js-build-tools.images) ⇒ <code>stream.Stream</code>
|
|
296
358
|
* [.distMinify()](#module_js-build-tools.distMinify) ⇒ <code>\*</code>
|
|
297
359
|
* [.distLint()](#module_js-build-tools.distLint) ⇒ <code>\*</code>
|
|
298
360
|
* [.dist()](#module_js-build-tools.dist) ⇒ <code>\*</code>
|
|
299
361
|
* [.defaultCmd([done])](#module_js-build-tools.defaultCmd) ⇒ <code>stream.Stream</code>
|
|
362
|
+
* [.copyFonts()](#module_js-build-tools.copyFonts) ⇒ <code>stream.Stream</code>
|
|
300
363
|
* [.bundleMinify()](#module_js-build-tools.bundleMinify) ⇒ <code>\*</code>
|
|
301
364
|
* [.bundleLint()](#module_js-build-tools.bundleLint) ⇒ <code>stream.Stream</code>
|
|
302
365
|
* [.bundle()](#module_js-build-tools.bundle) ⇒ <code>stream.Stream</code>
|
|
303
366
|
* [.build()](#module_js-build-tools.build) ⇒ <code>stream.Stream</code>
|
|
304
367
|
|
|
368
|
+
<a name="module_js-build-tools.typeScript"></a>
|
|
369
|
+
|
|
370
|
+
### js-build-tools.typeScript ⇒ <code>function</code>
|
|
371
|
+
Simplified typescript task using tsFor.
|
|
372
|
+
|
|
373
|
+
**Kind**: static constant of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
305
374
|
<a name="module_js-build-tools.compileReadme"></a>
|
|
306
375
|
|
|
307
376
|
### js-build-tools.compileReadme ⇒ <code>stream.Stream</code>
|
|
@@ -319,12 +388,6 @@ Watch for changes and run the tests.
|
|
|
319
388
|
### js-build-tools.watchFull() ⇒ <code>FSWatcher</code>
|
|
320
389
|
Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
321
390
|
|
|
322
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
323
|
-
<a name="module_js-build-tools.typeScript"></a>
|
|
324
|
-
|
|
325
|
-
### js-build-tools.typeScript() ⇒ <code>function</code>
|
|
326
|
-
Simplified typescript task using tsFor.
|
|
327
|
-
|
|
328
391
|
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
329
392
|
<a name="module_js-build-tools.testQuick"></a>
|
|
330
393
|
|
|
@@ -337,6 +400,12 @@ Run the Jest tests for files which have been modified (based on git status).
|
|
|
337
400
|
### js-build-tools.testFull() ⇒ <code>Promise.<\*></code>
|
|
338
401
|
Run all tests with jest.
|
|
339
402
|
|
|
403
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
404
|
+
<a name="module_js-build-tools.images"></a>
|
|
405
|
+
|
|
406
|
+
### js-build-tools.images() ⇒ <code>stream.Stream</code>
|
|
407
|
+
Move and optimize the images into the browser folder using configured settings.
|
|
408
|
+
|
|
340
409
|
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
341
410
|
<a name="module_js-build-tools.distMinify"></a>
|
|
342
411
|
|
|
@@ -367,6 +436,12 @@ Recommended as the default task, runs the simple dist and bundle tasks.
|
|
|
367
436
|
| --- | --- | --- |
|
|
368
437
|
| [done] | <code>function</code> | <code></code> |
|
|
369
438
|
|
|
439
|
+
<a name="module_js-build-tools.copyFonts"></a>
|
|
440
|
+
|
|
441
|
+
### js-build-tools.copyFonts() ⇒ <code>stream.Stream</code>
|
|
442
|
+
Move the font files into the browser directory.
|
|
443
|
+
|
|
444
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
370
445
|
<a name="module_js-build-tools.bundleMinify"></a>
|
|
371
446
|
|
|
372
447
|
### js-build-tools.bundleMinify() ⇒ <code>\*</code>
|
|
@@ -396,12 +471,11 @@ Runs several processes to build and validate the project.
|
|
|
396
471
|
## gulpConfig
|
|
397
472
|
Modify these configurations to match your project specifications.
|
|
398
473
|
|
|
399
|
-
**Version**:
|
|
474
|
+
**Version**: 3.0.0
|
|
400
475
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
401
476
|
|
|
402
477
|
* [gulpConfig](#module_gulpConfig)
|
|
403
478
|
* _static_
|
|
404
|
-
* [.defaultConfig([config], [path], [defaultValue])](#module_gulpConfig.defaultConfig) ⇒ <code>\*</code> \| <code>null</code>
|
|
405
479
|
* [.get(path, defaultValue)](#module_gulpConfig.get) ⇒ <code>\*</code> \| <code>null</code>
|
|
406
480
|
* [.set(path, value)](#module_gulpConfig.set) ⇒ <code>\*</code>
|
|
407
481
|
* _inner_
|
|
@@ -412,25 +486,20 @@ Modify these configurations to match your project specifications.
|
|
|
412
486
|
* [~JestTestFlags](#module_gulpConfig..JestTestFlags) : <code>FlagsSetting</code>
|
|
413
487
|
* [~StringSetting](#module_gulpConfig..StringSetting) : <code>string</code>
|
|
414
488
|
* [~Setting](#module_gulpConfig..Setting) : <code>ArrayableSetting</code> \| <code>BooleanSetting</code> \| <code>FlagsSetting</code> \| <code>StringSetting</code>
|
|
489
|
+
* [~BrowserConfig](#module_gulpConfig..BrowserConfig) : <code>Object.<string, Setting></code>
|
|
490
|
+
* [~DistConfig](#module_gulpConfig..DistConfig) : <code>Object.<string, Setting></code>
|
|
491
|
+
* [~FontConfig](#module_gulpConfig..FontConfig) : <code>Object.<string, Setting></code>
|
|
492
|
+
* [~ImageConfig](#module_gulpConfig..ImageConfig) : <code>Object.<string, Setting></code>
|
|
493
|
+
* [~ReadmeConfig](#module_gulpConfig..ReadmeConfig) : <code>Object.<string, Setting></code>
|
|
494
|
+
* [~SassConfig](#module_gulpConfig..SassConfig) : <code>Object.<string, Setting></code>
|
|
495
|
+
* [~TestConfig](#module_gulpConfig..TestConfig) : <code>Object.<string, Setting></code>
|
|
496
|
+
* [~TsConfig](#module_gulpConfig..TsConfig) : <code>Object.<string, Setting></code>
|
|
415
497
|
* [~Configurations](#module_gulpConfig..Configurations) : <code>Object.<string, Setting></code>
|
|
416
498
|
|
|
417
|
-
<a name="module_gulpConfig.defaultConfig"></a>
|
|
418
|
-
|
|
419
|
-
### gulpConfig.defaultConfig([config], [path], [defaultValue]) ⇒ <code>\*</code> \| <code>null</code>
|
|
420
|
-
Retrieve a value from an object with the path (key), return a given default if the key is not found.
|
|
421
|
-
|
|
422
|
-
**Kind**: static method of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
423
|
-
|
|
424
|
-
| Param | Type | Default |
|
|
425
|
-
| --- | --- | --- |
|
|
426
|
-
| [config] | <code>Object.<string, \*></code> | <code>[]</code> |
|
|
427
|
-
| [path] | <code>string</code> \| <code>null</code> | <code>null</code> |
|
|
428
|
-
| [defaultValue] | <code>\*</code> | <code></code> |
|
|
429
|
-
|
|
430
499
|
<a name="module_gulpConfig.get"></a>
|
|
431
500
|
|
|
432
501
|
### gulpConfig.get(path, defaultValue) ⇒ <code>\*</code> \| <code>null</code>
|
|
433
|
-
Retrieve a value from
|
|
502
|
+
Retrieve a value from the configurations, default may be returned.
|
|
434
503
|
|
|
435
504
|
**Kind**: static method of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
436
505
|
|
|
@@ -507,117 +576,165 @@ A setting that may only be a string.
|
|
|
507
576
|
Any single configuration option is a Setting.
|
|
508
577
|
|
|
509
578
|
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
510
|
-
<a name="module_gulpConfig..
|
|
579
|
+
<a name="module_gulpConfig..BrowserConfig"></a>
|
|
511
580
|
|
|
512
|
-
### gulpConfig~
|
|
513
|
-
|
|
581
|
+
### gulpConfig~BrowserConfig : <code>Object.<string, Setting></code>
|
|
582
|
+
Configurations for building the browser files.
|
|
514
583
|
|
|
515
584
|
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
516
585
|
**Properties**
|
|
517
586
|
|
|
518
|
-
| Name | Type |
|
|
519
|
-
| --- | --- |
|
|
520
|
-
|
|
|
521
|
-
|
|
|
522
|
-
|
|
|
523
|
-
|
|
|
524
|
-
| distSearch | <code>ArrayableSetting</code> |
|
|
525
|
-
| nodeOnly | <code>BooleanSetting</code> |
|
|
526
|
-
| readmeTemplate | <code>StringSetting</code> |
|
|
527
|
-
| readmeOptions | <code>ArrayableSetting</code> |
|
|
528
|
-
| readmeFile | <code>StringSetting</code> |
|
|
529
|
-
| readmePath | <code>StringSetting</code> |
|
|
530
|
-
| readmeSearch | <code>ArrayableSetting</code> |
|
|
531
|
-
| rootPath | <code>StringSetting</code> |
|
|
532
|
-
| srcPath | <code>StringSetting</code> |
|
|
533
|
-
| srcSearch | <code>ArrayableSetting</code> |
|
|
534
|
-
| testOptions | <code>JestTestFlags</code> |
|
|
535
|
-
| testPath | <code>ArrayableSetting</code> |
|
|
536
|
-
| useTsConfig | <code>FlagStringSetting</code> |
|
|
537
|
-
| watchSearch | <code>ArrayableSetting</code> |
|
|
587
|
+
| Name | Type | Description |
|
|
588
|
+
| --- | --- | --- |
|
|
589
|
+
| enabled | <code>BooleanSetting</code> | 'true' to generate browser bundled files; 'false' for node environment only |
|
|
590
|
+
| from | <code>StringSetting</code> | The name to use for the browser-bundled output file (.js will be appended). |
|
|
591
|
+
| name | <code>StringSetting</code> | The search pattern used for retrieving compiled distribution files. |
|
|
592
|
+
| to | <code>StringSetting</code> | The output directory for browser-bundled files. |
|
|
538
593
|
|
|
539
|
-
<a name="
|
|
594
|
+
<a name="module_gulpConfig..DistConfig"></a>
|
|
540
595
|
|
|
541
|
-
|
|
542
|
-
|
|
596
|
+
### gulpConfig~DistConfig : <code>Object.<string, Setting></code>
|
|
597
|
+
Configurations for building the node distribution files.
|
|
543
598
|
|
|
544
|
-
**
|
|
545
|
-
**
|
|
599
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
600
|
+
**Properties**
|
|
546
601
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
* [.domItem](#module_testHelpers.domItem) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
553
|
-
* [.deepReferenceObject](#module_testHelpers.deepReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
554
|
-
* [.circularObject](#module_testHelpers.circularObject) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
555
|
-
* [.setDefaults(testDir)](#module_testHelpers.setDefaults)
|
|
556
|
-
* [.createTempDir([exists])](#module_testHelpers.createTempDir) ⇒ <code>Promise.<(\*\|void)></code>
|
|
557
|
-
* [.exports.beforeEach()](#module_testHelpers.exports.beforeEach) ⇒ <code>Promise.<(\*\|void)></code>
|
|
558
|
-
* [.exports.afterEach()](#module_testHelpers.exports.afterEach) ⇒ <code>Promise.<\*></code>
|
|
559
|
-
* [.logObject(object, [label], [outputType])](#module_testHelpers.logObject) ⇒ <code>string</code> \| <code>undefined</code>
|
|
560
|
-
* [.countMatches(content, search)](#module_testHelpers.countMatches) ⇒ <code>number</code>
|
|
602
|
+
| Name | Type | Description |
|
|
603
|
+
| --- | --- | --- |
|
|
604
|
+
| from | <code>StringSetting</code> | The search pattern used for gathering source files for distribution. |
|
|
605
|
+
| main | <code>StringSetting</code> | Name of the entry the distribution file. |
|
|
606
|
+
| to | <code>StringSetting</code> | The output directory for the distribution files. |
|
|
561
607
|
|
|
562
|
-
<a name="
|
|
608
|
+
<a name="module_gulpConfig..FontConfig"></a>
|
|
563
609
|
|
|
564
|
-
###
|
|
565
|
-
|
|
610
|
+
### gulpConfig~FontConfig : <code>Object.<string, Setting></code>
|
|
611
|
+
Configurations for copying the font files.
|
|
566
612
|
|
|
567
|
-
**Kind**:
|
|
568
|
-
|
|
613
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
614
|
+
**Properties**
|
|
615
|
+
|
|
616
|
+
| Name | Type | Description |
|
|
617
|
+
| --- | --- | --- |
|
|
618
|
+
| enabled | <code>BooleanSetting</code> | Toggle copy directory of fonts on. |
|
|
619
|
+
| from | <code>StringSetting</code> | Path to search for fonts. |
|
|
620
|
+
| to | <code>StringSetting</code> | Path to output fonts. |
|
|
569
621
|
|
|
570
|
-
|
|
571
|
-
Sample of object containing multiple references.
|
|
622
|
+
<a name="module_gulpConfig..ImageConfig"></a>
|
|
572
623
|
|
|
573
|
-
|
|
574
|
-
|
|
624
|
+
### gulpConfig~ImageConfig : <code>Object.<string, Setting></code>
|
|
625
|
+
Configurations to minify and copy the images.
|
|
575
626
|
|
|
576
|
-
|
|
577
|
-
|
|
627
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
628
|
+
**Properties**
|
|
578
629
|
|
|
579
|
-
|
|
580
|
-
|
|
630
|
+
| Name | Type | Description |
|
|
631
|
+
| --- | --- | --- |
|
|
632
|
+
| enabled | <code>BooleanSetting</code> | Toggle image minify and copy process. |
|
|
633
|
+
| from | <code>StringSetting</code> | Path to search for images. |
|
|
634
|
+
| to | <code>StringSetting</code> | Path to output images. |
|
|
581
635
|
|
|
582
|
-
|
|
583
|
-
Sample of jsonDom object containing empty nested array and objects
|
|
636
|
+
<a name="module_gulpConfig..ReadmeConfig"></a>
|
|
584
637
|
|
|
585
|
-
|
|
586
|
-
|
|
638
|
+
### gulpConfig~ReadmeConfig : <code>Object.<string, Setting></code>
|
|
639
|
+
Configurations to compile and generate the Readme file.
|
|
587
640
|
|
|
588
|
-
|
|
589
|
-
|
|
641
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
642
|
+
**Properties**
|
|
590
643
|
|
|
591
|
-
|
|
592
|
-
|
|
644
|
+
| Name | Type | Description |
|
|
645
|
+
| --- | --- | --- |
|
|
646
|
+
| file | <code>StringSetting</code> | The name of the output documentation markdown file. |
|
|
647
|
+
| from | <code>StringSetting</code> | Location of files to use for compiling documentation into the readme. |
|
|
648
|
+
| options | <code>ArrayableSetting</code> | Options for formatting the output readme. |
|
|
649
|
+
| template | <code>StringSetting</code> | The file which will be pre-fixed to your README.md output. |
|
|
650
|
+
| to | <code>StringSetting</code> | The directory to output the readme file in. |
|
|
593
651
|
|
|
594
|
-
|
|
595
|
-
Sample object with deep references.
|
|
652
|
+
<a name="module_gulpConfig..SassConfig"></a>
|
|
596
653
|
|
|
597
|
-
|
|
598
|
-
|
|
654
|
+
### gulpConfig~SassConfig : <code>Object.<string, Setting></code>
|
|
655
|
+
Configurations to compile and copy the sass files into css.
|
|
599
656
|
|
|
600
|
-
|
|
601
|
-
|
|
657
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
658
|
+
**Properties**
|
|
602
659
|
|
|
603
|
-
|
|
604
|
-
|
|
660
|
+
| Name | Type | Description |
|
|
661
|
+
| --- | --- | --- |
|
|
662
|
+
| enabled | <code>BooleanSetting</code> | Toggle SASS to CSS process on. |
|
|
663
|
+
| from | <code>StringSetting</code> | The pattern for finding all sass files. |
|
|
664
|
+
| path | <code>StringSetting</code> | The directory were sass files will be stored. |
|
|
665
|
+
| to | <code>StringSetting</code> | The destination path for where generated CSS (from SASS files) should go. |
|
|
605
666
|
|
|
606
|
-
|
|
607
|
-
Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
667
|
+
<a name="module_gulpConfig..TestConfig"></a>
|
|
608
668
|
|
|
609
|
-
|
|
669
|
+
### gulpConfig~TestConfig : <code>Object.<string, Setting></code>
|
|
670
|
+
Configurations for running the test suite.
|
|
610
671
|
|
|
611
|
-
|
|
672
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
673
|
+
**Properties**
|
|
674
|
+
|
|
675
|
+
| Name | Type | Description |
|
|
612
676
|
| --- | --- | --- |
|
|
613
|
-
|
|
|
677
|
+
| options | <code>JestTestFlags</code> | Additional flags for programmatically running Jest Cli. |
|
|
678
|
+
| path | <code>ArrayableSetting</code> | The directory where Jest test files are stored. By default, stored as *.test.js adjacent to the files they are testing. |
|
|
679
|
+
| watch | <code>ArrayableSetting</code> | The search pattern for watching files for changes. |
|
|
680
|
+
|
|
681
|
+
<a name="module_gulpConfig..TsConfig"></a>
|
|
682
|
+
|
|
683
|
+
### gulpConfig~TsConfig : <code>Object.<string, Setting></code>
|
|
684
|
+
Configurations for compiling typescript into JS files.
|
|
685
|
+
|
|
686
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
687
|
+
**Properties**
|
|
688
|
+
|
|
689
|
+
| Name | Type | Description |
|
|
690
|
+
| --- | --- | --- |
|
|
691
|
+
| config | <code>FlagStringSetting</code> | The path the tsconfig file for running typescript or false if no ts file given. |
|
|
692
|
+
| enabled | <code>BooleanSetting</code> | Toggle usage of typescript parsing. |
|
|
693
|
+
| from | <code>StringSetting</code> | Pattern for finding the TypeScript files. |
|
|
694
|
+
| to | <code>StringSetting</code> | Directory where parsed typescript files go. |
|
|
614
695
|
|
|
615
|
-
<a name="
|
|
696
|
+
<a name="module_gulpConfig..Configurations"></a>
|
|
697
|
+
|
|
698
|
+
### gulpConfig~Configurations : <code>Object.<string, Setting></code>
|
|
699
|
+
A set of Configurations options defined by Settings.
|
|
700
|
+
|
|
701
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
702
|
+
**Properties**
|
|
703
|
+
|
|
704
|
+
| Name | Type | Description |
|
|
705
|
+
| --- | --- | --- |
|
|
706
|
+
| browser | <code>BrowserConfig</code> | Browser bundling configuration group. |
|
|
707
|
+
| cleanPaths | <code>ArrayableSetting</code> | The paths for directories to delete before build. |
|
|
708
|
+
| dist | <code>DistConfig</code> | Distribution file generation configuration group. |
|
|
709
|
+
| fonts | <code>FontConfig</code> | Fonts copy configuration group. |
|
|
710
|
+
| images | <code>ImageConfig</code> | Minify and copy the images configuration. |
|
|
711
|
+
| readme | <code>ReadmeConfig</code> | Build readme files configuration. |
|
|
712
|
+
| rootPath | <code>StringSetting</code> | Base directory of the project. |
|
|
713
|
+
| sass | <code>SassConfig</code> | Compile CSS from SASS configuration. |
|
|
714
|
+
| srcPath | <code>StringSetting</code> | The directory where your source files are stored (the files you manually created). |
|
|
715
|
+
| test | <code>TestConfig</code> | Run test suite configuration. |
|
|
716
|
+
| typescript | <code>TsConfig</code> | Compile from typescript configuration. |
|
|
616
717
|
|
|
617
|
-
|
|
718
|
+
<a name="module_testHelpers"></a>
|
|
719
|
+
|
|
720
|
+
## testHelpers
|
|
721
|
+
Export the setUp helper.
|
|
722
|
+
|
|
723
|
+
**Version**: 3.0.0
|
|
724
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
725
|
+
|
|
726
|
+
* [testHelpers](#module_testHelpers)
|
|
727
|
+
* [.exports.createTempDir](#module_testHelpers.exports.createTempDir) ⇒ <code>Promise.<(\*\|void)></code>
|
|
728
|
+
* [.exports.beforeEach](#module_testHelpers.exports.beforeEach) ⇒ <code>Promise.<(\*\|void)></code>
|
|
729
|
+
* [.exports.afterEach](#module_testHelpers.exports.afterEach) ⇒ <code>Promise.<\*></code>
|
|
730
|
+
* [.setDefaults(testDir)](#module_testHelpers.setDefaults)
|
|
731
|
+
|
|
732
|
+
<a name="module_testHelpers.exports.createTempDir"></a>
|
|
733
|
+
|
|
734
|
+
### testHelpers.exports.createTempDir ⇒ <code>Promise.<(\*\|void)></code>
|
|
618
735
|
Ensure that the del has completed, recursively attempt to delete and recreate
|
|
619
736
|
|
|
620
|
-
**Kind**: static
|
|
737
|
+
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
621
738
|
|
|
622
739
|
| Param | Type | Default |
|
|
623
740
|
| --- | --- | --- |
|
|
@@ -625,47 +742,33 @@ Ensure that the del has completed, recursively attempt to delete and recreate
|
|
|
625
742
|
|
|
626
743
|
<a name="module_testHelpers.exports.beforeEach"></a>
|
|
627
744
|
|
|
628
|
-
### testHelpers.exports.beforeEach
|
|
745
|
+
### testHelpers.exports.beforeEach ⇒ <code>Promise.<(\*\|void)></code>
|
|
629
746
|
In the Jest.beforeEach function call this one to set up the temp directory.
|
|
630
747
|
|
|
631
|
-
**Kind**: static
|
|
748
|
+
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
632
749
|
<a name="module_testHelpers.exports.afterEach"></a>
|
|
633
750
|
|
|
634
|
-
### testHelpers.exports.afterEach
|
|
751
|
+
### testHelpers.exports.afterEach ⇒ <code>Promise.<\*></code>
|
|
635
752
|
In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
636
753
|
|
|
637
|
-
**Kind**: static
|
|
638
|
-
<a name="module_testHelpers.
|
|
754
|
+
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
755
|
+
<a name="module_testHelpers.setDefaults"></a>
|
|
639
756
|
|
|
640
|
-
### testHelpers.
|
|
641
|
-
|
|
757
|
+
### testHelpers.setDefaults(testDir)
|
|
758
|
+
Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
642
759
|
|
|
643
760
|
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
644
761
|
|
|
645
762
|
| Param | Type | Default |
|
|
646
763
|
| --- | --- | --- |
|
|
647
|
-
|
|
|
648
|
-
| [label] | <code>string</code> | <code>"logging"</code> |
|
|
649
|
-
| [outputType] | <code>string</code> | <code>"log"</code> |
|
|
650
|
-
|
|
651
|
-
<a name="module_testHelpers.countMatches"></a>
|
|
652
|
-
|
|
653
|
-
### testHelpers.countMatches(content, search) ⇒ <code>number</code>
|
|
654
|
-
Simple way to count string occurrences for testing.
|
|
655
|
-
|
|
656
|
-
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
657
|
-
|
|
658
|
-
| Param | Type |
|
|
659
|
-
| --- | --- |
|
|
660
|
-
| content | <code>string</code> |
|
|
661
|
-
| search | <code>string</code> |
|
|
764
|
+
| testDir | <code>string</code> | <code>"test-temp"</code> |
|
|
662
765
|
|
|
663
766
|
<a name="module_partials"></a>
|
|
664
767
|
|
|
665
768
|
## partials
|
|
666
769
|
Micro-functions used as components for the main gulp functions.
|
|
667
770
|
|
|
668
|
-
**Version**:
|
|
771
|
+
**Version**: 3.0.0
|
|
669
772
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
670
773
|
|
|
671
774
|
* [partials](#module_partials)
|
|
@@ -676,9 +779,11 @@ Micro-functions used as components for the main gulp functions.
|
|
|
676
779
|
* [.removeDirectory(dirPath)](#module_partials.removeDirectory) ⇒ <code>Promise.<\*></code>
|
|
677
780
|
* [.readmeTemplate()](#module_partials.readmeTemplate) ⇒ <code>\*</code>
|
|
678
781
|
* [.minifyFor()](#module_partials.minifyFor) ⇒ <code>\*</code>
|
|
782
|
+
* [.imagesFor([imageSrc], [imageDest])](#module_partials.imagesFor) ⇒ <code>stream.Stream</code>
|
|
679
783
|
* [.distSeries([srcPath], [distFinalPath], [tsSearch])](#module_partials.distSeries) ⇒ <code>function</code>
|
|
680
784
|
* [.distForSrc([useTs])](#module_partials.distForSrc) ⇒ <code>string</code>
|
|
681
785
|
* [.distFor([srcPath], [destPath])](#module_partials.distFor) ⇒ <code>stream.Stream</code>
|
|
786
|
+
* [.copyFor(srcPath, destPath)](#module_partials.copyFor) ⇒ <code>stream.Stream</code>
|
|
682
787
|
* [.clean()](#module_partials.clean) ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
683
788
|
* [.beginWatcher()](#module_partials.beginWatcher) ⇒ <code>FSWatcher</code>
|
|
684
789
|
* [.addToReadme()](#module_partials.addToReadme) ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
@@ -752,6 +857,18 @@ Copy a readme template into the README.md file.
|
|
|
752
857
|
Minify files and rename the output with '.min' extension.
|
|
753
858
|
|
|
754
859
|
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
860
|
+
<a name="module_partials.imagesFor"></a>
|
|
861
|
+
|
|
862
|
+
### partials.imagesFor([imageSrc], [imageDest]) ⇒ <code>stream.Stream</code>
|
|
863
|
+
Move and optimize images into the browser directory.
|
|
864
|
+
|
|
865
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
866
|
+
|
|
867
|
+
| Param | Type | Default |
|
|
868
|
+
| --- | --- | --- |
|
|
869
|
+
| [imageSrc] | <code>string</code> \| <code>array</code> | <code>"src/images/pattern"</code> |
|
|
870
|
+
| [imageDest] | <code>string</code> | <code>"dest/image/folder"</code> |
|
|
871
|
+
|
|
755
872
|
<a name="module_partials.distSeries"></a>
|
|
756
873
|
|
|
757
874
|
### partials.distSeries([srcPath], [distFinalPath], [tsSearch]) ⇒ <code>function</code>
|
|
@@ -788,6 +905,18 @@ Build the distribution for a given source pattern.
|
|
|
788
905
|
| [srcPath] | <code>string</code> \| <code>array</code> | <code>"'src/config/path/dist/for'"</code> |
|
|
789
906
|
| [destPath] | <code>string</code> | <code>"'dist/config/path'"</code> |
|
|
790
907
|
|
|
908
|
+
<a name="module_partials.copyFor"></a>
|
|
909
|
+
|
|
910
|
+
### partials.copyFor(srcPath, destPath) ⇒ <code>stream.Stream</code>
|
|
911
|
+
Copy some files to a different location.
|
|
912
|
+
|
|
913
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
914
|
+
|
|
915
|
+
| Param | Type |
|
|
916
|
+
| --- | --- |
|
|
917
|
+
| srcPath | <code>string</code> \| <code>array</code> |
|
|
918
|
+
| destPath | <code>string</code> |
|
|
919
|
+
|
|
791
920
|
<a name="module_partials.clean"></a>
|
|
792
921
|
|
|
793
922
|
### partials.clean() ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|