js-build-tools 3.0.4 → 4.0.1
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 +166 -426
- package/babel.config.js +1 -1
- package/dist/build.js +33 -34
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +14 -9
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +15 -11
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +11 -5
- package/dist/bundleMinify.min.js +1 -1
- package/dist/compileReadme.js +7 -10
- package/dist/compileReadme.min.js +1 -1
- package/dist/copyFonts.js +11 -5
- package/dist/copyFonts.min.js +1 -1
- package/dist/default.js +13 -9
- package/dist/default.min.js +1 -1
- package/dist/dist.js +7 -4
- package/dist/dist.min.js +1 -1
- package/dist/distLint.js +15 -11
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +11 -5
- package/dist/distMinify.min.js +1 -1
- package/dist/images.js +7 -4
- package/dist/images.min.js +1 -1
- package/dist/partials/addToReadme.js +16 -11
- package/dist/partials/beginWatcher.js +11 -7
- package/dist/partials/clean.js +11 -5
- package/dist/partials/copyFor.js +7 -7
- package/dist/partials/distFor.js +21 -11
- package/dist/partials/distForSrc.js +9 -3
- package/dist/partials/distSeries.js +17 -13
- package/dist/partials/imagesFor.js +16 -17
- package/dist/partials/minifyFor.js +12 -11
- package/dist/partials/readmeTemplate.js +13 -9
- package/dist/partials/removeDirectory.js +7 -7
- package/dist/partials/runOnChange.js +18 -16
- package/dist/partials/sassFor.js +19 -12
- package/dist/partials/tsFor.js +17 -14
- package/dist/partials.js +101 -39
- package/dist/partials.min.js +1 -1
- package/dist/sass.js +7 -4
- package/dist/sass.min.js +1 -1
- package/dist/test-helpers/setUp.js +50 -47
- package/dist/testFull.js +12 -7
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +9 -13
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +12 -7
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +6 -4
- package/dist/typeScript.min.js +1 -1
- package/dist/utilities/dotGet.js +14 -12
- package/dist/utilities/dotNotate.js +10 -8
- package/dist/utilities/dotSet.js +13 -11
- package/dist/utilities/isObject.js +5 -1
- package/dist/utilities/strAfter.js +11 -7
- package/dist/utilities/strBefore.js +11 -7
- package/dist/watchFull.js +7 -7
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +13 -9
- package/dist/watchTest.min.js +1 -1
- package/functions/{build.js → build.mjs} +14 -16
- package/functions/{build.test.js → build.test.mjs} +9 -8
- package/functions/{bundle.js → bundle.mjs} +5 -7
- package/functions/{bundle.test.js → bundle.test.mjs} +5 -4
- package/functions/{bundleLint.js → bundleLint.mjs} +4 -6
- package/functions/{bundleLint.test.js → bundleLint.test.mjs} +5 -4
- package/functions/bundleMinify.mjs +9 -0
- package/functions/bundleMinify.test.mjs +15 -0
- package/functions/compileReadme.mjs +9 -0
- package/functions/{compileReadme.test.js → compileReadme.test.mjs} +4 -4
- package/functions/copyFonts.mjs +9 -0
- package/functions/{copyFonts.test.js → copyFonts.test.mjs} +4 -3
- package/functions/default.mjs +12 -0
- package/functions/{default.test.js → default.test.mjs} +8 -7
- package/functions/{dist.js → dist.mjs} +2 -4
- package/functions/{dist.test.js → dist.test.mjs} +4 -3
- package/functions/{distLint.js → distLint.mjs} +4 -6
- package/functions/{distLint.test.js → distLint.test.mjs} +5 -4
- package/functions/distMinify.mjs +9 -0
- package/functions/distMinify.test.mjs +15 -0
- package/functions/{images.js → images.mjs} +2 -4
- package/functions/{images.test.js → images.test.mjs} +4 -3
- package/functions/partials/{addToReadme.js → addToReadme.mjs} +5 -7
- package/functions/partials/{addToReadme.test.js → addToReadme.test.mjs} +4 -3
- package/functions/partials/beginWatcher.mjs +9 -0
- package/functions/partials/{beginWatcher.test.js → beginWatcher.test.mjs} +4 -3
- package/functions/partials/clean.mjs +13 -0
- package/functions/partials/{clean.test.js → clean.test.mjs} +4 -3
- package/functions/partials/{copyFor.js → copyFor.mjs} +2 -4
- package/functions/partials/{copyFor.test.js → copyFor.test.mjs} +4 -3
- package/functions/partials/distFor.mjs +22 -0
- package/functions/partials/{distFor.test.js → distFor.test.mjs} +49 -8
- package/functions/partials/{distForSrc.js → distForSrc.mjs} +2 -4
- package/functions/partials/{distForSrc.test.js → distForSrc.test.mjs} +3 -2
- package/functions/partials/{distSeries.js → distSeries.mjs} +6 -8
- package/functions/partials/{distSeries.test.js → distSeries.test.mjs} +7 -6
- package/functions/partials/{imagesFor.js → imagesFor.mjs} +5 -13
- package/functions/partials/{imagesFor.test.js → imagesFor.test.mjs} +4 -3
- package/functions/partials/minifyFor.mjs +15 -0
- package/functions/partials/{minifyFor.test.js → minifyFor.test.mjs} +5 -4
- package/functions/partials/readmeTemplate.mjs +12 -0
- package/functions/partials/{readmeTemplate.test.js → readmeTemplate.test.mjs} +4 -3
- package/functions/partials/{removeDirectory.js → removeDirectory.mjs} +2 -4
- package/functions/partials/{removeDirectory.test.js → removeDirectory.test.mjs} +28 -28
- package/functions/partials/{runOnChange.js → runOnChange.mjs} +6 -8
- package/functions/partials/{runOnChange.test.js → runOnChange.test.mjs} +12 -11
- package/functions/partials/sassFor.mjs +22 -0
- package/functions/partials/{sassFor.test.js → sassFor.test.mjs} +5 -4
- package/functions/partials/{tsFor.js → tsFor.mjs} +4 -6
- package/functions/partials/{tsFor.test.js → tsFor.test.mjs} +5 -4
- package/functions/partials.mjs +23 -0
- package/functions/{partials.test.js → partials.test.mjs} +1 -1
- package/functions/sass.mjs +4 -0
- package/functions/{sass.test.js → sass.test.mjs} +4 -3
- package/functions/test-helpers/{setUp.js → setUp.mjs} +25 -27
- package/functions/test-helpers/setUp.test.mjs +19 -0
- package/functions/{testFull.js → testFull.mjs} +4 -6
- package/functions/testFull.test.mjs +17 -0
- package/functions/{testHelpers.js → testHelpers.mjs} +1 -6
- package/functions/testHelpers.test.mjs +7 -0
- package/functions/{testQuick.js → testQuick.mjs} +4 -6
- package/functions/testQuick.test.mjs +17 -0
- package/functions/{typeScript.js → typeScript.mjs} +2 -4
- package/functions/typeScript.test.mjs +11 -0
- package/functions/utilities/{dotGet.js → dotGet.mjs} +4 -6
- package/functions/utilities/{dotNotate.js → dotNotate.mjs} +2 -4
- package/functions/utilities/{dotSet.js → dotSet.mjs} +4 -6
- package/functions/utilities/{isObject.js → isObject.mjs} +1 -3
- package/functions/utilities/{strAfter.js → strAfter.mjs} +11 -13
- package/functions/utilities/{strBefore.js → strBefore.mjs} +11 -13
- package/functions/{watchFull.js → watchFull.mjs} +2 -4
- package/functions/{watchFull.test.js → watchFull.test.mjs} +8 -7
- package/functions/watchTest.mjs +10 -0
- package/functions/{watchTest.test.js → watchTest.test.mjs} +7 -6
- package/gulp.config.js +20 -19
- package/gulp.config.mjs +252 -0
- package/gulpfile.base.js +20 -20
- package/gulpfile.base.mjs +27 -0
- package/package.json +27 -13
- package/functions/bundleMinify.js +0 -11
- package/functions/bundleMinify.test.js +0 -14
- package/functions/compileReadme.js +0 -11
- package/functions/copyFonts.js +0 -11
- package/functions/default.js +0 -14
- package/functions/distMinify.js +0 -11
- package/functions/distMinify.test.js +0 -14
- package/functions/partials/beginWatcher.js +0 -11
- package/functions/partials/clean.js +0 -15
- package/functions/partials/distFor.js +0 -17
- package/functions/partials/minifyFor.js +0 -15
- package/functions/partials/readmeTemplate.js +0 -14
- package/functions/partials/sassFor.js +0 -21
- package/functions/partials.js +0 -40
- package/functions/sass.js +0 -6
- package/functions/test-helpers/setUp.test.js +0 -18
- package/functions/testFull.test.js +0 -16
- package/functions/testHelpers.test.js +0 -7
- package/functions/testQuick.test.js +0 -16
- package/functions/typeScript.test.js +0 -10
- package/functions/watchTest.js +0 -12
- package/vendor/array-union/index.js +0 -31
- package/vendor/easy-transform-stream/index.js +0 -54
- package/vendor/globby/gitignore.js +0 -96
- package/vendor/globby/index.js +0 -191
- package/vendor/globby/node_modules/slash/index.js +0 -16
- package/vendor/globby/stream-utils.js +0 -58
- package/vendor/globby/to-path.js +0 -20
- package/vendor/gulp-imagemin/index.js +0 -124
- package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +0 -265
- package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +0 -36
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -217
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +0 -154
- package/vendor/gulp-plugin-extras/index.js +0 -42
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +0 -265
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +0 -36
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -217
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +0 -154
- package/vendor/gulp-plugin-extras/plugin-error.js +0 -145
- package/vendor/ignore/index.js +0 -468
- package/vendor/imagemin/index.js +0 -90
- package/vendor/imagemin-gifsicle/index.js +0 -33
- package/vendor/imagemin-mozjpeg/index.js +0 -100
- package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +0 -260
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +0 -47
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +0 -102
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +0 -123
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +0 -47
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +0 -50
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +0 -124
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +0 -238
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +0 -89
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +0 -24
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +0 -44
- package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +0 -25
- package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +0 -70
- package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +0 -52
- package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +0 -43
- package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +0 -20
- package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +0 -17
- package/vendor/imagemin-optipng/index.js +0 -44
- package/vendor/imagemin-svgo/index.js +0 -27
- package/vendor/is-jpg/index.js +0 -12
- package/vendor/junk/index.js +0 -49
- package/vendor/mozjpeg/index.js +0 -9
- package/vendor/mozjpeg/lib/index.js +0 -18
- package/vendor/mozjpeg/package.json +0 -49
- package/vendor/mozjpeg/vendor/cjpeg +0 -0
- package/vendor/mozjpeg/vendor/source/mozjpeg.tar.gz +0 -0
- package/vendor/p-pipe/index.js +0 -22
- package/vendor/plur/index.js +0 -32
- package/vendor/pretty-bytes/index.js +0 -71
- package/vendor/slash/index.js +0 -12
package/README.md
CHANGED
|
@@ -22,92 +22,99 @@ of `node_modules/.bin/gulp`.
|
|
|
22
22
|
|
|
23
23
|
## Configuration
|
|
24
24
|
|
|
25
|
-
In your project's root directory, create a `build-tools.config.
|
|
25
|
+
In your project's root directory, create a `build-tools.config.json` file. This can contain any of the following (values
|
|
26
26
|
provided are the defaults):
|
|
27
27
|
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
browser: {
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"browser": {
|
|
31
31
|
// 'true' to generate browser bundled files; 'false' for node environment only
|
|
32
|
-
enabled: true,
|
|
32
|
+
"enabled": true,
|
|
33
33
|
// The name to use for the browser-bundled output file (.js will be appended).
|
|
34
|
-
name:
|
|
34
|
+
"name": "my-package",
|
|
35
35
|
// The search pattern used for retrieving compiled distribution files.
|
|
36
|
-
from:
|
|
36
|
+
"from": "dist/**/*.js",
|
|
37
37
|
// The output directory for browser-bundled files.
|
|
38
|
-
to:
|
|
38
|
+
"to": "browser"
|
|
39
39
|
},
|
|
40
40
|
// The paths for directories to delete before build.
|
|
41
|
-
cleanPaths: [
|
|
42
|
-
|
|
41
|
+
"cleanPaths": [
|
|
42
|
+
"dist",
|
|
43
|
+
"browser"
|
|
44
|
+
],
|
|
45
|
+
"dist": {
|
|
43
46
|
// Name of the entry the distribution file.
|
|
44
|
-
main:
|
|
47
|
+
"main": "dist/main",
|
|
45
48
|
// The search pattern used for gathering source files for distribution.
|
|
46
|
-
from:
|
|
49
|
+
"from": "src/**/!(*.test).js",
|
|
47
50
|
// The output directory for the distribution files.
|
|
48
|
-
to:
|
|
51
|
+
"to": "dist"
|
|
49
52
|
},
|
|
50
|
-
fonts: {
|
|
53
|
+
"fonts": {
|
|
51
54
|
// Toggle copy directory of fonts on
|
|
52
|
-
enabled: false,
|
|
55
|
+
"enabled": false,
|
|
53
56
|
// Path to search for fonts
|
|
54
|
-
from:
|
|
57
|
+
"from": "src/fonts/**/*",
|
|
55
58
|
// Path to output fonts
|
|
56
|
-
to:
|
|
59
|
+
"to": "browser/fonts"
|
|
57
60
|
},
|
|
58
|
-
images: {
|
|
61
|
+
"images": {
|
|
59
62
|
// Toggle image minify and copy process
|
|
60
|
-
enabled: false,
|
|
63
|
+
"enabled": false,
|
|
61
64
|
// Path to search for images
|
|
62
|
-
from:
|
|
65
|
+
"from": "src/img/**/*.+(png|jpg|jpeg|gif|svg)",
|
|
63
66
|
// Path to output images
|
|
64
|
-
to:
|
|
67
|
+
"to": "browser/img"
|
|
65
68
|
},
|
|
66
|
-
readme: {
|
|
69
|
+
"readme": {
|
|
67
70
|
// The file which will be pre-fixed to your README.md output.
|
|
68
|
-
template:
|
|
71
|
+
"template": "MAIN.md",
|
|
69
72
|
// Options for formatting the output readme.
|
|
70
|
-
options:
|
|
73
|
+
"options": "utf8",
|
|
71
74
|
// The name of the output documentation markdown file.
|
|
72
|
-
file:
|
|
75
|
+
"file": "README.md",
|
|
73
76
|
// Location of files to use for compiling documentation into the readme.
|
|
74
|
-
from: [
|
|
77
|
+
"from": [
|
|
78
|
+
"src/**/!(*.test).js"
|
|
79
|
+
],
|
|
75
80
|
// The directory to output the readme file in.
|
|
76
|
-
to:
|
|
81
|
+
"to": "./"
|
|
77
82
|
},
|
|
78
83
|
// Base directory of the project.
|
|
79
|
-
rootPath:
|
|
80
|
-
sass: {
|
|
84
|
+
"rootPath": "./",
|
|
85
|
+
"sass": {
|
|
81
86
|
// Toggle SASS to CSS process on.
|
|
82
|
-
enabled: false,
|
|
87
|
+
"enabled": false,
|
|
83
88
|
// The pattern for finding all sass files.
|
|
84
|
-
from:
|
|
89
|
+
"from": "sass/**/*.+(scss|sass)",
|
|
85
90
|
// The directory were sass files will be stored.
|
|
86
|
-
path:
|
|
91
|
+
"path": "sass",
|
|
87
92
|
// The destination path for where generated CSS (from SASS files) should go.
|
|
88
|
-
to:
|
|
93
|
+
"to": "browser/css"
|
|
89
94
|
},
|
|
90
95
|
// The directory where your source files are stored (the files you manually created).
|
|
91
|
-
srcPath:
|
|
92
|
-
test: {
|
|
96
|
+
"srcPath": "src",
|
|
97
|
+
"test": {
|
|
93
98
|
// Additional flags for programmatically running Jest Cli.
|
|
94
|
-
options: null,
|
|
99
|
+
"options": null,
|
|
95
100
|
// The directory where Jest test files are stored.
|
|
96
101
|
// By default, stored as *.test.js adjacent to the files they are testing.
|
|
97
|
-
path: [
|
|
102
|
+
"path": [
|
|
103
|
+
"src"
|
|
104
|
+
],
|
|
98
105
|
// The search pattern for watching files for changes.
|
|
99
|
-
watch:
|
|
106
|
+
"watch": "src/**/*.js"
|
|
100
107
|
},
|
|
101
|
-
typescript: {
|
|
108
|
+
"typescript": {
|
|
102
109
|
// The path the tsconfig file for running typescript or false if no ts file given.
|
|
103
|
-
config: false,
|
|
110
|
+
"config": false,
|
|
104
111
|
// Toggle usage of typescript parsing.
|
|
105
|
-
enabled: false,
|
|
112
|
+
"enabled": false,
|
|
106
113
|
// Pattern for finding the TypeScript files.
|
|
107
|
-
from:
|
|
114
|
+
"from": "src/**/*.ts",
|
|
108
115
|
// Directory where parsed typescript files go.
|
|
109
|
-
to:
|
|
110
|
-
}
|
|
116
|
+
"to": "dist"
|
|
117
|
+
}
|
|
111
118
|
}
|
|
112
119
|
```
|
|
113
120
|
|
|
@@ -116,6 +123,8 @@ module.exports = {
|
|
|
116
123
|
In your project's root directory, create a `gulpfile.js` file, in here you can require any of the functions you need.
|
|
117
124
|
For example:
|
|
118
125
|
|
|
126
|
+
#### Common JS
|
|
127
|
+
|
|
119
128
|
```js
|
|
120
129
|
// Your local gulpfile.js
|
|
121
130
|
const {
|
|
@@ -144,6 +153,29 @@ exports.watchFull = watchFull
|
|
|
144
153
|
exports.watchTest = watchTest
|
|
145
154
|
```
|
|
146
155
|
|
|
156
|
+
#### ES Module
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
// Your local gulpfile.mjs
|
|
160
|
+
// Everything you export will be created as a gulp task.
|
|
161
|
+
export {
|
|
162
|
+
build,
|
|
163
|
+
defaultCmd,
|
|
164
|
+
partials,
|
|
165
|
+
readme,
|
|
166
|
+
sass,
|
|
167
|
+
testFull,
|
|
168
|
+
testQuick,
|
|
169
|
+
typescript,
|
|
170
|
+
watchFull,
|
|
171
|
+
watchTest
|
|
172
|
+
} from 'js-build-tools'
|
|
173
|
+
|
|
174
|
+
// You can build your own tasks here as well by using some of the functions `js-build-tools/functions`.
|
|
175
|
+
// You can list your available tasks by running `gulp --tasks`.
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
|
|
147
179
|
Verify your tasks are available by running `gulp --tasks`.
|
|
148
180
|
|
|
149
181
|
### Configure Babel
|
|
@@ -159,6 +191,60 @@ const babelConfig = require('js-build-tools/babel.config')
|
|
|
159
191
|
module.exports = babelConfig
|
|
160
192
|
```
|
|
161
193
|
|
|
194
|
+
### Configure ES Modules (.mjs)
|
|
195
|
+
|
|
196
|
+
It is not recommended to use `"type": "module"` in the `package.json` to enable ES Modules.
|
|
197
|
+
This is because some dependencies still rely on common JS syntax (ex: babel, jest, jsdoc).
|
|
198
|
+
So, to use ES Modules, you can use the `.mjs` extension on your files instead.
|
|
199
|
+
There are different downsides to using the `.mjs` extension to consider.
|
|
200
|
+
The `jsdoc` generation can only read `.js` files, and the provided test runner `Jest` will need to be configured.
|
|
201
|
+
Update the test config as follows:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"dist": {
|
|
206
|
+
// Use .mjs files for from and main
|
|
207
|
+
"main": "src/main.mjs",
|
|
208
|
+
"from": "src/**/!(*.test).mjs",
|
|
209
|
+
"to": "dist"
|
|
210
|
+
},
|
|
211
|
+
"readme": {
|
|
212
|
+
"template": "MAIN.md",
|
|
213
|
+
"options": "utf8",
|
|
214
|
+
"toFile": "README.md",
|
|
215
|
+
"from": [
|
|
216
|
+
// Use the dist directory files to generate the jsdocs
|
|
217
|
+
"dist/!(*.test).js"
|
|
218
|
+
],
|
|
219
|
+
"to": "./"
|
|
220
|
+
},
|
|
221
|
+
"test": {
|
|
222
|
+
"options": {
|
|
223
|
+
// The below helps to find the .mjs files (rather than default .js files)
|
|
224
|
+
"testMatch": [
|
|
225
|
+
"**/?(*.)+(spec|test).mjs?(x)"
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"path": "functions",
|
|
229
|
+
// Include watching for .mjs files
|
|
230
|
+
"watch": "functions/**/*.[cm]?[jt]s"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
There is an additional file you need to get Jest working, add a `jest.config.js` file.
|
|
236
|
+
While we have already added these configurations above in the "options",
|
|
237
|
+
there seems to be a bug where the "transform" does not work in that context. Add the following to your `jest.config.js`:
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
module.exports = {
|
|
241
|
+
// The transform will instruct jest to run the files through babel so it can interpret them
|
|
242
|
+
transform: {
|
|
243
|
+
'^.+\\.[cm]?[jt]sx?$': 'babel-jest'
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
162
248
|
### Configure HTML JS Documentation (optional)
|
|
163
249
|
|
|
164
250
|
It may be desirable to generate HTML documentation for your JS files.
|
|
@@ -186,17 +272,17 @@ module.exports = jsDocBase
|
|
|
186
272
|
|
|
187
273
|
Be able to copy a source directory of fonts into the distribution path.
|
|
188
274
|
|
|
189
|
-
Add the following to the exports in your `build-tools.config.
|
|
275
|
+
Add the following to the exports in your `build-tools.config.json`:
|
|
190
276
|
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
fonts: {
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"fonts": {
|
|
194
280
|
// Enable fonts process
|
|
195
|
-
enabled: false,
|
|
281
|
+
"enabled": false,
|
|
196
282
|
// Search pattern to find your font files
|
|
197
|
-
from:
|
|
283
|
+
"from": "src/fonts/**/*",
|
|
198
284
|
// Output directory for your font files
|
|
199
|
-
to:
|
|
285
|
+
"to": "browser/fonts"
|
|
200
286
|
}
|
|
201
287
|
}
|
|
202
288
|
```
|
|
@@ -205,17 +291,17 @@ module.exports = {
|
|
|
205
291
|
|
|
206
292
|
Be able to copy and reduce the file size of images into an output path.
|
|
207
293
|
|
|
208
|
-
Add the following to the exports in your `build-tools.config.
|
|
294
|
+
Add the following to the exports in your `build-tools.config.json`:
|
|
209
295
|
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
images: {
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"images": {
|
|
213
299
|
// Enable image process
|
|
214
|
-
enabled: false,
|
|
300
|
+
"enabled": false,
|
|
215
301
|
// Search pattern to find your images
|
|
216
|
-
from:
|
|
302
|
+
"from": "src/img/**/*.+(png|jpg|jpeg|gif|svg)",
|
|
217
303
|
// Output directory for your images files
|
|
218
|
-
to:
|
|
304
|
+
"to": "browser/img"
|
|
219
305
|
}
|
|
220
306
|
}
|
|
221
307
|
```
|
|
@@ -224,19 +310,19 @@ module.exports = {
|
|
|
224
310
|
|
|
225
311
|
SASS support is built-in, this enables conversion of SASS files to CSS for web projects.
|
|
226
312
|
|
|
227
|
-
Add the following to the exports in your `build-tools.config.
|
|
313
|
+
Add the following to the exports in your `build-tools.config.json`:
|
|
228
314
|
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
sass: {
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"sass": {
|
|
232
318
|
// Enable SASS process
|
|
233
|
-
enabled: false,
|
|
319
|
+
"enabled": false,
|
|
234
320
|
// Search pattern to find your SASS files (the below would be files ending in .scss or .sass in a directory called 'sass')
|
|
235
|
-
from:
|
|
321
|
+
"from": "sass/**/*.+(scss|sass)",
|
|
236
322
|
// Optional but nice to add (future support), add the directory where your sass files exist
|
|
237
|
-
path:
|
|
323
|
+
"path": "sass",
|
|
238
324
|
// Output directory for your compiled css files, recommend css directory within your browser output directory
|
|
239
|
-
to:
|
|
325
|
+
"to": "browser/css"
|
|
240
326
|
}
|
|
241
327
|
}
|
|
242
328
|
```
|
|
@@ -260,27 +346,27 @@ Create a `tsconfig.json` file in your project root with the following:
|
|
|
260
346
|
```
|
|
261
347
|
|
|
262
348
|
The pattern for `"files"` should match your .ts files, but the essential thing is that it is wrapped in an array.
|
|
263
|
-
The actual pattern used comes from `build-tools.config.
|
|
349
|
+
The actual pattern used comes from `build-tools.config.json` as `'typescript.from'` setting.
|
|
264
350
|
To create the ts declaration files, you must add the `"declaration": true`.
|
|
265
351
|
|
|
266
|
-
Add the following to the exports in your `build-tools.config.
|
|
352
|
+
Add the following to the exports in your `build-tools.config.json`:
|
|
267
353
|
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
readme: {
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"readme": {
|
|
271
357
|
// Location of files to use for compiling documentation into the readme.
|
|
272
|
-
from:
|
|
358
|
+
"from": "dist/**/!(*.min).js"
|
|
273
359
|
},
|
|
274
|
-
typescript: {
|
|
360
|
+
"typescript": {
|
|
275
361
|
// The path the tsconfig file for running typescript or false if no ts file given.
|
|
276
|
-
config:
|
|
362
|
+
"config": "tsconfig.json",
|
|
277
363
|
// Toggle usage of typescript parsing
|
|
278
|
-
enabled: true,
|
|
364
|
+
"enabled": true,
|
|
279
365
|
// Pattern for finding the TypeScript files
|
|
280
|
-
from:
|
|
366
|
+
"from": "src/**/*.ts",
|
|
281
367
|
// Directory where parsed typescript files go
|
|
282
|
-
to:
|
|
283
|
-
}
|
|
368
|
+
"to": "dist"
|
|
369
|
+
}
|
|
284
370
|
}
|
|
285
371
|
```
|
|
286
372
|
|
|
@@ -326,146 +412,20 @@ Run any of the above commands with `gulp` or `npm run`.
|
|
|
326
412
|
|
|
327
413
|
<dl>
|
|
328
414
|
<dt><a href="#module_js-build-tools">js-build-tools</a></dt>
|
|
329
|
-
<dd><p>Export these functions to your own project
|
|
415
|
+
<dd><p>Export these functions to your own project to customize your build pipeline.</p>
|
|
330
416
|
</dd>
|
|
331
417
|
<dt><a href="#module_gulpConfig">gulpConfig</a></dt>
|
|
332
418
|
<dd><p>Modify these configurations to match your project specifications.</p>
|
|
333
419
|
</dd>
|
|
334
|
-
<dt><a href="#module_testHelpers">testHelpers</a></dt>
|
|
335
|
-
<dd><p>Export the setUp helper.</p>
|
|
336
|
-
</dd>
|
|
337
|
-
<dt><a href="#module_partials">partials</a></dt>
|
|
338
|
-
<dd><p>Micro-functions used as components for the main gulp functions.</p>
|
|
339
|
-
</dd>
|
|
340
420
|
</dl>
|
|
341
421
|
|
|
342
422
|
<a name="module_js-build-tools"></a>
|
|
343
423
|
|
|
344
424
|
## js-build-tools
|
|
345
|
-
Export these functions to your own project
|
|
425
|
+
Export these functions to your own project to customize your build pipeline.
|
|
346
426
|
|
|
347
427
|
**Version**: 3.0.0
|
|
348
428
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
349
|
-
|
|
350
|
-
* [js-build-tools](#module_js-build-tools)
|
|
351
|
-
* [.typeScript](#module_js-build-tools.typeScript) ⇒ <code>function</code>
|
|
352
|
-
* [.compileReadme](#module_js-build-tools.compileReadme) ⇒ <code>stream.Stream</code>
|
|
353
|
-
* [.watchTest()](#module_js-build-tools.watchTest) ⇒ <code>\*</code>
|
|
354
|
-
* [.watchFull()](#module_js-build-tools.watchFull) ⇒ <code>FSWatcher</code>
|
|
355
|
-
* [.testQuick()](#module_js-build-tools.testQuick) ⇒ <code>Promise.<\*></code>
|
|
356
|
-
* [.testFull()](#module_js-build-tools.testFull) ⇒ <code>Promise.<\*></code>
|
|
357
|
-
* [.images()](#module_js-build-tools.images) ⇒ <code>stream.Stream</code>
|
|
358
|
-
* [.distMinify()](#module_js-build-tools.distMinify) ⇒ <code>\*</code>
|
|
359
|
-
* [.distLint()](#module_js-build-tools.distLint) ⇒ <code>\*</code>
|
|
360
|
-
* [.dist()](#module_js-build-tools.dist) ⇒ <code>\*</code>
|
|
361
|
-
* [.defaultCmd([done])](#module_js-build-tools.defaultCmd) ⇒ <code>stream.Stream</code>
|
|
362
|
-
* [.copyFonts()](#module_js-build-tools.copyFonts) ⇒ <code>stream.Stream</code>
|
|
363
|
-
* [.bundleMinify()](#module_js-build-tools.bundleMinify) ⇒ <code>\*</code>
|
|
364
|
-
* [.bundleLint()](#module_js-build-tools.bundleLint) ⇒ <code>stream.Stream</code>
|
|
365
|
-
* [.bundle()](#module_js-build-tools.bundle) ⇒ <code>stream.Stream</code>
|
|
366
|
-
* [.build()](#module_js-build-tools.build) ⇒ <code>stream.Stream</code>
|
|
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)
|
|
374
|
-
<a name="module_js-build-tools.compileReadme"></a>
|
|
375
|
-
|
|
376
|
-
### js-build-tools.compileReadme ⇒ <code>stream.Stream</code>
|
|
377
|
-
Generate the README.md file based off of the template, then append the generated documentation.
|
|
378
|
-
|
|
379
|
-
**Kind**: static constant of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
380
|
-
<a name="module_js-build-tools.watchTest"></a>
|
|
381
|
-
|
|
382
|
-
### js-build-tools.watchTest() ⇒ <code>\*</code>
|
|
383
|
-
Watch for changes and run the tests.
|
|
384
|
-
|
|
385
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
386
|
-
<a name="module_js-build-tools.watchFull"></a>
|
|
387
|
-
|
|
388
|
-
### js-build-tools.watchFull() ⇒ <code>FSWatcher</code>
|
|
389
|
-
Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
390
|
-
|
|
391
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
392
|
-
<a name="module_js-build-tools.testQuick"></a>
|
|
393
|
-
|
|
394
|
-
### js-build-tools.testQuick() ⇒ <code>Promise.<\*></code>
|
|
395
|
-
Run the Jest tests for files which have been modified (based on git status).
|
|
396
|
-
|
|
397
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
398
|
-
<a name="module_js-build-tools.testFull"></a>
|
|
399
|
-
|
|
400
|
-
### js-build-tools.testFull() ⇒ <code>Promise.<\*></code>
|
|
401
|
-
Run all tests with jest.
|
|
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
|
-
|
|
409
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
410
|
-
<a name="module_js-build-tools.distMinify"></a>
|
|
411
|
-
|
|
412
|
-
### js-build-tools.distMinify() ⇒ <code>\*</code>
|
|
413
|
-
Creates minified versions of the dist files.
|
|
414
|
-
|
|
415
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
416
|
-
<a name="module_js-build-tools.distLint"></a>
|
|
417
|
-
|
|
418
|
-
### js-build-tools.distLint() ⇒ <code>\*</code>
|
|
419
|
-
Applies Standard code style linting to distribution files.
|
|
420
|
-
|
|
421
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
422
|
-
<a name="module_js-build-tools.dist"></a>
|
|
423
|
-
|
|
424
|
-
### js-build-tools.dist() ⇒ <code>\*</code>
|
|
425
|
-
Simplified distribution tasks which will use arguments from distFor.
|
|
426
|
-
|
|
427
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
428
|
-
<a name="module_js-build-tools.defaultCmd"></a>
|
|
429
|
-
|
|
430
|
-
### js-build-tools.defaultCmd([done]) ⇒ <code>stream.Stream</code>
|
|
431
|
-
Recommended as the default task, runs the simple dist and bundle tasks.
|
|
432
|
-
|
|
433
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
434
|
-
|
|
435
|
-
| Param | Type | Default |
|
|
436
|
-
| --- | --- | --- |
|
|
437
|
-
| [done] | <code>function</code> | <code></code> |
|
|
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)
|
|
445
|
-
<a name="module_js-build-tools.bundleMinify"></a>
|
|
446
|
-
|
|
447
|
-
### js-build-tools.bundleMinify() ⇒ <code>\*</code>
|
|
448
|
-
Creates the minified bundle file.
|
|
449
|
-
|
|
450
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
451
|
-
<a name="module_js-build-tools.bundleLint"></a>
|
|
452
|
-
|
|
453
|
-
### js-build-tools.bundleLint() ⇒ <code>stream.Stream</code>
|
|
454
|
-
Applies Standard code style linting to bundled file.
|
|
455
|
-
|
|
456
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
457
|
-
<a name="module_js-build-tools.bundle"></a>
|
|
458
|
-
|
|
459
|
-
### js-build-tools.bundle() ⇒ <code>stream.Stream</code>
|
|
460
|
-
Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
461
|
-
|
|
462
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
463
|
-
<a name="module_js-build-tools.build"></a>
|
|
464
|
-
|
|
465
|
-
### js-build-tools.build() ⇒ <code>stream.Stream</code>
|
|
466
|
-
Runs several processes to build and validate the project.
|
|
467
|
-
|
|
468
|
-
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
469
429
|
<a name="module_gulpConfig"></a>
|
|
470
430
|
|
|
471
431
|
## gulpConfig
|
|
@@ -715,223 +675,3 @@ A set of Configurations options defined by Settings.
|
|
|
715
675
|
| test | <code>TestConfig</code> | Run test suite configuration. |
|
|
716
676
|
| typescript | <code>TsConfig</code> | Compile from typescript configuration. |
|
|
717
677
|
|
|
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>
|
|
735
|
-
Ensure that the del has completed, recursively attempt to delete and recreate
|
|
736
|
-
|
|
737
|
-
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
738
|
-
|
|
739
|
-
| Param | Type | Default |
|
|
740
|
-
| --- | --- | --- |
|
|
741
|
-
| [exists] | <code>boolean</code> | <code>true</code> |
|
|
742
|
-
|
|
743
|
-
<a name="module_testHelpers.exports.beforeEach"></a>
|
|
744
|
-
|
|
745
|
-
### testHelpers.exports.beforeEach ⇒ <code>Promise.<(\*\|void)></code>
|
|
746
|
-
In the Jest.beforeEach function call this one to set up the temp directory.
|
|
747
|
-
|
|
748
|
-
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
749
|
-
<a name="module_testHelpers.exports.afterEach"></a>
|
|
750
|
-
|
|
751
|
-
### testHelpers.exports.afterEach ⇒ <code>Promise.<\*></code>
|
|
752
|
-
In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
753
|
-
|
|
754
|
-
**Kind**: static property of [<code>testHelpers</code>](#module_testHelpers)
|
|
755
|
-
<a name="module_testHelpers.setDefaults"></a>
|
|
756
|
-
|
|
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.
|
|
759
|
-
|
|
760
|
-
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
761
|
-
|
|
762
|
-
| Param | Type | Default |
|
|
763
|
-
| --- | --- | --- |
|
|
764
|
-
| testDir | <code>string</code> | <code>"test-temp"</code> |
|
|
765
|
-
|
|
766
|
-
<a name="module_partials"></a>
|
|
767
|
-
|
|
768
|
-
## partials
|
|
769
|
-
Micro-functions used as components for the main gulp functions.
|
|
770
|
-
|
|
771
|
-
**Version**: 3.0.0
|
|
772
|
-
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
773
|
-
|
|
774
|
-
* [partials](#module_partials)
|
|
775
|
-
* [.tsFor([srcPath], [distPath])](#module_partials.tsFor) ⇒ <code>function</code>
|
|
776
|
-
* [.sassFor([srcSearch], [cssPath])](#module_partials.sassFor) ⇒ <code>stream.Stream</code>
|
|
777
|
-
* [.runOnChange(path)](#module_partials.runOnChange) ⇒ <code>stream.Stream</code>
|
|
778
|
-
* [~pathRegex](#module_partials.runOnChange..pathRegex)
|
|
779
|
-
* [.removeDirectory(dirPath)](#module_partials.removeDirectory) ⇒ <code>Promise.<\*></code>
|
|
780
|
-
* [.readmeTemplate()](#module_partials.readmeTemplate) ⇒ <code>\*</code>
|
|
781
|
-
* [.minifyFor()](#module_partials.minifyFor) ⇒ <code>\*</code>
|
|
782
|
-
* [.imagesFor([imageSrc], [imageDest])](#module_partials.imagesFor) ⇒ <code>stream.Stream</code>
|
|
783
|
-
* [.distSeries([srcPath], [distFinalPath], [tsSearch])](#module_partials.distSeries) ⇒ <code>function</code>
|
|
784
|
-
* [.distForSrc([useTs])](#module_partials.distForSrc) ⇒ <code>string</code>
|
|
785
|
-
* [.distFor([srcPath], [destPath])](#module_partials.distFor) ⇒ <code>stream.Stream</code>
|
|
786
|
-
* [.copyFor(srcPath, destPath)](#module_partials.copyFor) ⇒ <code>stream.Stream</code>
|
|
787
|
-
* [.clean()](#module_partials.clean) ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
788
|
-
* [.beginWatcher()](#module_partials.beginWatcher) ⇒ <code>FSWatcher</code>
|
|
789
|
-
* [.addToReadme()](#module_partials.addToReadme) ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
790
|
-
|
|
791
|
-
<a name="module_partials.tsFor"></a>
|
|
792
|
-
|
|
793
|
-
### partials.tsFor([srcPath], [distPath]) ⇒ <code>function</code>
|
|
794
|
-
Starting at the source directory, find all the ts files and convert them into the distribution directory.
|
|
795
|
-
|
|
796
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
797
|
-
**See**: `https://www.typescriptlang.org/docs/handbook/gulp.html` for more info
|
|
798
|
-
|
|
799
|
-
| Param | Type | Default |
|
|
800
|
-
| --- | --- | --- |
|
|
801
|
-
| [srcPath] | <code>string</code> \| <code>array</code> | <code>"''"</code> |
|
|
802
|
-
| [distPath] | <code>string</code> | <code>"''"</code> |
|
|
803
|
-
|
|
804
|
-
<a name="module_partials.sassFor"></a>
|
|
805
|
-
|
|
806
|
-
### partials.sassFor([srcSearch], [cssPath]) ⇒ <code>stream.Stream</code>
|
|
807
|
-
Build the CSS for a given source pattern.
|
|
808
|
-
|
|
809
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
810
|
-
|
|
811
|
-
| Param | Type | Default |
|
|
812
|
-
| --- | --- | --- |
|
|
813
|
-
| [srcSearch] | <code>string</code> \| <code>array</code> | <code>"'src/config/path/sass/for'"</code> |
|
|
814
|
-
| [cssPath] | <code>string</code> | <code>"'css/config/path'"</code> |
|
|
815
|
-
|
|
816
|
-
<a name="module_partials.runOnChange"></a>
|
|
817
|
-
|
|
818
|
-
### partials.runOnChange(path) ⇒ <code>stream.Stream</code>
|
|
819
|
-
Run this function when the watched files are modified.
|
|
820
|
-
|
|
821
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
822
|
-
|
|
823
|
-
| Param | Type |
|
|
824
|
-
| --- | --- |
|
|
825
|
-
| path | <code>string</code> |
|
|
826
|
-
|
|
827
|
-
**Example**
|
|
828
|
-
```js
|
|
829
|
-
// Configured paths
|
|
830
|
-
```
|
|
831
|
-
<a name="module_partials.runOnChange..pathRegex"></a>
|
|
832
|
-
|
|
833
|
-
#### runOnChange~pathRegex
|
|
834
|
-
1. The original path comes in from src and is a .ts
|
|
835
|
-
|
|
836
|
-
**Kind**: inner constant of [<code>runOnChange</code>](#module_partials.runOnChange)
|
|
837
|
-
<a name="module_partials.removeDirectory"></a>
|
|
838
|
-
|
|
839
|
-
### partials.removeDirectory(dirPath) ⇒ <code>Promise.<\*></code>
|
|
840
|
-
Return a promise to be completed once the specified directory is deleted.
|
|
841
|
-
|
|
842
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
843
|
-
|
|
844
|
-
| Param | Type |
|
|
845
|
-
| --- | --- |
|
|
846
|
-
| dirPath | <code>string</code> |
|
|
847
|
-
|
|
848
|
-
<a name="module_partials.readmeTemplate"></a>
|
|
849
|
-
|
|
850
|
-
### partials.readmeTemplate() ⇒ <code>\*</code>
|
|
851
|
-
Copy a readme template into the README.md file.
|
|
852
|
-
|
|
853
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
854
|
-
<a name="module_partials.minifyFor"></a>
|
|
855
|
-
|
|
856
|
-
### partials.minifyFor() ⇒ <code>\*</code>
|
|
857
|
-
Minify files and rename the output with '.min' extension.
|
|
858
|
-
|
|
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
|
-
|
|
872
|
-
<a name="module_partials.distSeries"></a>
|
|
873
|
-
|
|
874
|
-
### partials.distSeries([srcPath], [distFinalPath], [tsSearch]) ⇒ <code>function</code>
|
|
875
|
-
When using TypeScript, ensure that we process the ts first then run babel (dist)
|
|
876
|
-
|
|
877
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
878
|
-
|
|
879
|
-
| Param | Type | Default |
|
|
880
|
-
| --- | --- | --- |
|
|
881
|
-
| [srcPath] | <code>string</code> | <code>"'src/config/path/dist/for'"</code> |
|
|
882
|
-
| [distFinalPath] | <code>string</code> | <code>"'dist/config/path'"</code> |
|
|
883
|
-
| [tsSearch] | <code>string</code> | <code>"'ts/search/config/path'"</code> |
|
|
884
|
-
|
|
885
|
-
<a name="module_partials.distForSrc"></a>
|
|
886
|
-
|
|
887
|
-
### partials.distForSrc([useTs]) ⇒ <code>string</code>
|
|
888
|
-
Retrieve the correct distFor search path based on TS Config.
|
|
889
|
-
|
|
890
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
891
|
-
|
|
892
|
-
| Param | Type | Default |
|
|
893
|
-
| --- | --- | --- |
|
|
894
|
-
| [useTs] | [<code>FlagStringSetting</code>](#module_gulpConfig..FlagStringSetting) | <code>'config/for/ts'</code> |
|
|
895
|
-
|
|
896
|
-
<a name="module_partials.distFor"></a>
|
|
897
|
-
|
|
898
|
-
### partials.distFor([srcPath], [destPath]) ⇒ <code>stream.Stream</code>
|
|
899
|
-
Build the distribution for a given source pattern.
|
|
900
|
-
|
|
901
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
902
|
-
|
|
903
|
-
| Param | Type | Default |
|
|
904
|
-
| --- | --- | --- |
|
|
905
|
-
| [srcPath] | <code>string</code> \| <code>array</code> | <code>"'src/config/path/dist/for'"</code> |
|
|
906
|
-
| [destPath] | <code>string</code> | <code>"'dist/config/path'"</code> |
|
|
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
|
-
|
|
920
|
-
<a name="module_partials.clean"></a>
|
|
921
|
-
|
|
922
|
-
### partials.clean() ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
923
|
-
Deletes all the distribution and browser files (used before create a new build).
|
|
924
|
-
|
|
925
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
926
|
-
<a name="module_partials.beginWatcher"></a>
|
|
927
|
-
|
|
928
|
-
### partials.beginWatcher() ⇒ <code>FSWatcher</code>
|
|
929
|
-
Create a chokidar instance which watches and triggers change when the globed files are modified.
|
|
930
|
-
|
|
931
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
932
|
-
<a name="module_partials.addToReadme"></a>
|
|
933
|
-
|
|
934
|
-
### partials.addToReadme() ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
935
|
-
Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
936
|
-
|
|
937
|
-
**Kind**: static method of [<code>partials</code>](#module_partials)
|