js-build-tools 1.2.2 → 2.1.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 +590 -267
- package/dist/build.js +30 -23
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +18 -15
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +24 -20
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +16 -20
- package/dist/bundleMinify.min.js +1 -1
- package/dist/compileReadme.js +15 -13
- package/dist/compileReadme.min.js +1 -1
- package/dist/default.js +19 -14
- package/dist/default.min.js +1 -1
- package/dist/dist.js +14 -10
- package/dist/dist.min.js +1 -1
- package/dist/distLint.js +23 -20
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +15 -20
- package/dist/distMinify.min.js +1 -1
- package/dist/partials/addToReadme.js +25 -0
- package/dist/partials/beginWatcher.js +16 -0
- package/dist/partials/clean.js +21 -0
- package/dist/partials/distFor.js +23 -0
- package/dist/partials/distForSrc.js +16 -0
- package/dist/partials/distSeries.js +31 -0
- package/dist/partials/minifyFor.js +21 -0
- package/dist/partials/readmeTemplate.js +18 -0
- package/dist/partials/runOnChange.js +63 -0
- package/dist/partials/tsFor.js +24 -0
- package/dist/partials.js +33 -0
- package/dist/partials.min.js +1 -0
- package/dist/test-helpers/circularObject.js +50 -0
- package/dist/test-helpers/countMatches.js +16 -0
- package/dist/test-helpers/deepReferenceObject.js +20 -0
- package/dist/test-helpers/domItem.js +33 -0
- package/dist/test-helpers/jsonDom.js +20 -0
- package/dist/test-helpers/linkedList.js +23 -0
- package/dist/test-helpers/logObject.js +24 -0
- package/dist/test-helpers/multiReferenceObject.js +20 -0
- package/dist/test-helpers/nodeTree.js +28 -0
- package/dist/test-helpers/setUp.js +127 -0
- package/dist/testFull.js +24 -13
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +33 -198
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +26 -15
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +14 -0
- package/dist/typeScript.min.js +1 -0
- package/dist/watchFull.js +14 -21
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +16 -14
- package/dist/watchTest.min.js +1 -1
- package/functions/build.js +28 -25
- package/functions/build.test.js +59 -0
- package/functions/bundle.js +17 -15
- package/functions/bundle.test.js +68 -0
- package/functions/bundleLint.js +19 -17
- package/functions/bundleLint.test.js +61 -0
- package/functions/bundleMinify.js +12 -15
- package/functions/bundleMinify.test.js +14 -0
- package/functions/compileReadme.js +11 -10
- package/functions/compileReadme.test.js +18 -0
- package/functions/default.js +14 -11
- package/functions/default.test.js +32 -0
- package/functions/dist.js +11 -9
- package/functions/dist.test.js +43 -0
- package/functions/distLint.js +19 -17
- package/functions/distLint.test.js +58 -0
- package/functions/distMinify.js +12 -15
- package/functions/distMinify.test.js +14 -0
- package/functions/partials/addToReadme.js +20 -0
- package/functions/partials/addToReadme.test.js +28 -0
- package/functions/partials/beginWatcher.js +12 -0
- package/functions/partials/beginWatcher.test.js +18 -0
- package/functions/partials/clean.js +14 -0
- package/functions/partials/clean.test.js +20 -0
- package/functions/partials/distFor.js +18 -0
- package/functions/partials/distFor.test.js +125 -0
- package/functions/partials/distForSrc.js +14 -0
- package/functions/partials/distForSrc.test.js +17 -0
- package/functions/partials/distSeries.js +21 -0
- package/functions/partials/distSeries.test.js +33 -0
- package/functions/partials/minifyFor.js +16 -0
- package/functions/partials/minifyFor.test.js +48 -0
- package/functions/partials/readmeTemplate.js +15 -0
- package/functions/partials/readmeTemplate.test.js +33 -0
- package/functions/partials/runOnChange.js +57 -0
- package/functions/partials/runOnChange.test.js +93 -0
- package/functions/partials/tsFor.js +21 -0
- package/functions/partials/tsFor.test.js +44 -0
- package/functions/partials.js +32 -0
- package/functions/partials.test.js +7 -0
- package/functions/test-helpers/circularObject.js +28 -0
- package/functions/test-helpers/circularObject.test.js +14 -0
- package/functions/test-helpers/countMatches.js +11 -0
- package/functions/test-helpers/countMatches.test.js +9 -0
- package/functions/test-helpers/deepReferenceObject.js +25 -0
- package/functions/test-helpers/deepReferenceObject.test.js +7 -0
- package/functions/test-helpers/domItem.js +31 -0
- package/functions/test-helpers/domItem.test.js +12 -0
- package/functions/test-helpers/jsonDom.js +16 -0
- package/functions/test-helpers/jsonDom.test.js +12 -0
- package/functions/test-helpers/linkedList.js +10 -0
- package/functions/test-helpers/linkedList.test.js +22 -0
- package/functions/test-helpers/logObject.js +18 -0
- package/functions/test-helpers/logObject.test.js +20 -0
- package/functions/test-helpers/multiReferenceObject.js +25 -0
- package/functions/test-helpers/multiReferenceObject.test.js +14 -0
- package/functions/test-helpers/nodeTree.js +11 -0
- package/functions/test-helpers/nodeTree.test.js +18 -0
- package/functions/test-helpers/setUp.js +67 -0
- package/functions/test-helpers/setUp.test.js +18 -0
- package/functions/testFull.js +20 -10
- package/functions/testFull.test.js +16 -0
- package/functions/testHelpers.js +27 -137
- package/functions/testHelpers.test.js +7 -100
- package/functions/testQuick.js +20 -10
- package/functions/testQuick.test.js +16 -0
- package/functions/typeScript.js +11 -0
- package/functions/typeScript.test.js +10 -0
- package/functions/watchFull.js +6 -12
- package/functions/watchFull.test.js +40 -0
- package/functions/watchTest.js +4 -2
- package/functions/watchTest.test.js +48 -0
- package/gulp.config.js +161 -16
- package/gulpfile.base.js +9 -0
- package/package.json +11 -11
- package/dist/addToReadme.js +0 -22
- package/dist/addToReadme.min.js +0 -1
- package/dist/clean.js +0 -11
- package/dist/clean.min.js +0 -1
- package/dist/distFor.js +0 -21
- package/dist/distFor.min.js +0 -1
- package/dist/readmeTemplate.js +0 -15
- package/dist/readmeTemplate.min.js +0 -1
- package/functions/addToReadme.js +0 -17
- package/functions/clean.js +0 -10
- package/functions/distFor.js +0 -15
- package/functions/readmeTemplate.js +0 -13
package/README.md
CHANGED
|
@@ -1,353 +1,676 @@
|
|
|
1
|
-
# js-build-tools
|
|
2
|
-
Centralize the build process for node.js and JS projects into a single tool suite.
|
|
1
|
+
# js-build-tools
|
|
2
|
+
Centralize the build process for node.js and JS projects into a single tool suite.
|
|
3
|
+
|
|
4
|
+
### Goals
|
|
5
|
+
Using this tool suite, you can:
|
|
6
|
+
* Create formatted distribution files to be used in a node / commonjs environment.
|
|
7
|
+
* Bundle your distribution files to be used in a browser environment.
|
|
8
|
+
* Run tests and watch for changes.
|
|
9
|
+
* Generate jsdoc readme files.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
In your project's root directory, run: `npm install --save-dev gulp js-build-tools`
|
|
13
|
+
(or `yarn add --dev gulp js-build-tools` if you use Yarn).
|
|
14
|
+
|
|
15
|
+
It is recommended to install gulp with the `-g` flag, so that you can run it with `gulp` instead of `node_modules/.bin/gulp`.
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
In your project's root directory, create a `build-tools.config.js` file. This can contain any of the following (values provided are the defaults):
|
|
19
|
+
```
|
|
20
|
+
module.exports = {
|
|
21
|
+
// The name to use for the browser-bundled output file (.js will be appended).
|
|
22
|
+
browserName: 'my-package',
|
|
23
|
+
|
|
24
|
+
// The output directory for browser-bundled files.
|
|
25
|
+
browserPath: 'browser',
|
|
26
|
+
|
|
27
|
+
// The name of entry the distribution file.
|
|
28
|
+
distMain: 'dist/main',
|
|
29
|
+
|
|
30
|
+
// The output directory for the distribution files.
|
|
31
|
+
distPath: 'dist',
|
|
32
|
+
|
|
33
|
+
// The search pattern used for retrieving compiled distribution files.
|
|
34
|
+
distSearch: 'dist/**/*.js',]\
|
|
35
|
+
|
|
36
|
+
// 'true' to only generate node environment files.
|
|
37
|
+
nodeOnly: false,
|
|
38
|
+
|
|
39
|
+
// The name of the output documentation markdown file.
|
|
40
|
+
readmeFile: 'README.md',
|
|
41
|
+
|
|
42
|
+
// The directory to output the readme file in.
|
|
43
|
+
readmePath: './',
|
|
44
|
+
|
|
45
|
+
// Options for formatting the output readme.
|
|
46
|
+
readmeOptions: 'utf8',
|
|
47
|
+
|
|
48
|
+
// The file which will be pre-fixed to your README.md output.
|
|
49
|
+
readmeTemplate: 'MAIN.md',
|
|
50
|
+
|
|
51
|
+
// Location of files to use for compiling documentation into the readme.
|
|
52
|
+
readmeSearch: ['gulpfile.base.js', 'gulp.config.js', 'functions/**/!(*.test).js'],
|
|
53
|
+
|
|
54
|
+
// Base directory of the project.
|
|
55
|
+
rootPath: './',
|
|
56
|
+
|
|
57
|
+
// The directory where your source files are stored (the files you manually created).
|
|
58
|
+
srcPath: 'src',
|
|
59
|
+
|
|
60
|
+
// The search pattern used for gathering source files for distribution.
|
|
61
|
+
srcSearch: 'src/**/!(*.test).js',
|
|
62
|
+
|
|
63
|
+
// Additional flags for programatically running Jest Cli.
|
|
64
|
+
testOptions: null,
|
|
65
|
+
|
|
66
|
+
// The directory where Jest test files are stored.
|
|
67
|
+
// By default stored as *.test.js adjacent with the files they are testing).
|
|
68
|
+
testPath: 'src',
|
|
69
|
+
|
|
70
|
+
// The path the tsconfig file for running typescript or false if no ts file given.
|
|
71
|
+
useTsConfig: 'tsconfig.json',
|
|
72
|
+
|
|
73
|
+
// The search pattern for watching files for changes.
|
|
74
|
+
watchSearch: 'src/**/*.js',
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Create your local gulpfile.js
|
|
79
|
+
In your project's root directory, create a `gulpfile.js` file, in here you can require any of the functions you need. For example:
|
|
80
|
+
```
|
|
81
|
+
// Your local gulpfile.js
|
|
82
|
+
const { build, defaultCmd, readme, testFull, testQuick, watchFull, watchTest } = require('js-build-tools')
|
|
83
|
+
|
|
84
|
+
// Everything you export will be created as a gulp task.
|
|
85
|
+
// You can build your own tasks here as well by using some of the functions `js-build-tools/functions`.
|
|
86
|
+
// You can list your available tasks by running `gulp --tasks`.
|
|
87
|
+
exports.build = build
|
|
88
|
+
exports.default = defaultCmd
|
|
89
|
+
exports.readme = readme
|
|
90
|
+
exports.testFull = testFull
|
|
91
|
+
exports.testQuick = testQuick
|
|
92
|
+
exports.watchFull = watchFull
|
|
93
|
+
exports.watchTest = watchTest
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Verify your tasks are available by running `gulp --tasks`.
|
|
97
|
+
|
|
98
|
+
### Configure Babel
|
|
99
|
+
Depending on how you wrote your test files, Jest may require some Babel configuration.
|
|
100
|
+
Create a `babel.config.js` file in the root directory of your project.
|
|
101
|
+
You can then use the recommended configuration by requiring the babel.config.js file into your own configuration file.
|
|
102
|
+
Example:
|
|
103
|
+
```
|
|
104
|
+
const babelConfig = require('js-build-tools/babel.config')
|
|
105
|
+
// You may add additional configuration here. Example: babelConfig.presets.push('@babel/preset-env')
|
|
106
|
+
module.exports = babelConfig
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Configure Scripts
|
|
110
|
+
In your package.json file, add the following scripts:
|
|
111
|
+
```
|
|
112
|
+
"scripts": {
|
|
113
|
+
"build": "gulp build",
|
|
114
|
+
"dev": "gulp",
|
|
115
|
+
"readme": "gulp readme",
|
|
116
|
+
"test": "gulp testFull",
|
|
117
|
+
"test:quick": "gulp testQuick",
|
|
118
|
+
"watch": "gulp watchFull",
|
|
119
|
+
"watch:test": "gulp watchTest"
|
|
120
|
+
},
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Usage
|
|
124
|
+
Run any of the above commands with `gulp` or `npm run`.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# Available functions documentation
|
|
128
|
+
|
|
129
|
+
## Modules
|
|
3
130
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
131
|
+
<dl>
|
|
132
|
+
<dt><a href="#module_js-build-tools">js-build-tools</a></dt>
|
|
133
|
+
<dd><p>Export these functions to your own project in order to customize your build pipeline.</p>
|
|
134
|
+
</dd>
|
|
135
|
+
<dt><a href="#module_gulpConfig">gulpConfig</a></dt>
|
|
136
|
+
<dd><p>Modify these configurations to match your project specifications.</p>
|
|
137
|
+
</dd>
|
|
138
|
+
<dt><a href="#module_testHelpers">testHelpers</a></dt>
|
|
139
|
+
<dd><p>An assortment of objects that can be used in tests and some functions to help debug and write tests.</p>
|
|
140
|
+
</dd>
|
|
141
|
+
<dt><a href="#module_partials">partials</a></dt>
|
|
142
|
+
<dd><p>Micro-functions used as components for the main gulp functions.</p>
|
|
143
|
+
</dd>
|
|
144
|
+
</dl>
|
|
10
145
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
146
|
+
<a name="module_js-build-tools"></a>
|
|
147
|
+
|
|
148
|
+
## js-build-tools
|
|
149
|
+
Export these functions to your own project in order to customize your build pipeline.
|
|
150
|
+
|
|
151
|
+
**Version**: 2.0.0
|
|
152
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
153
|
+
|
|
154
|
+
* [js-build-tools](#module_js-build-tools)
|
|
155
|
+
* [.compileReadme](#module_js-build-tools.compileReadme) ⇒ <code>stream.Stream</code>
|
|
156
|
+
* [.watchTest()](#module_js-build-tools.watchTest) ⇒ <code>\*</code>
|
|
157
|
+
* [.watchFull()](#module_js-build-tools.watchFull) ⇒ <code>FSWatcher</code>
|
|
158
|
+
* [.typeScript()](#module_js-build-tools.typeScript) ⇒ <code>stream.Stream</code>
|
|
159
|
+
* [.testQuick([done], [testPath])](#module_js-build-tools.testQuick) ⇒ <code>Promise.<\*></code>
|
|
160
|
+
* [.testFull([done], [testPath])](#module_js-build-tools.testFull) ⇒ <code>Promise.<\*></code>
|
|
161
|
+
* [.distMinify()](#module_js-build-tools.distMinify) ⇒ <code>\*</code>
|
|
162
|
+
* [.distLint()](#module_js-build-tools.distLint) ⇒ <code>\*</code>
|
|
163
|
+
* [.dist()](#module_js-build-tools.dist) ⇒ <code>\*</code>
|
|
164
|
+
* [.defaultCmd([done])](#module_js-build-tools.defaultCmd) ⇒ <code>stream.Stream</code>
|
|
165
|
+
* [.bundleMinify()](#module_js-build-tools.bundleMinify) ⇒ <code>\*</code>
|
|
166
|
+
* [.bundleLint()](#module_js-build-tools.bundleLint) ⇒ <code>stream.Stream</code>
|
|
167
|
+
* [.bundle()](#module_js-build-tools.bundle) ⇒ <code>stream.Stream</code>
|
|
168
|
+
* [.build([done])](#module_js-build-tools.build) ⇒ <code>stream.Stream</code>
|
|
169
|
+
|
|
170
|
+
<a name="module_js-build-tools.compileReadme"></a>
|
|
171
|
+
|
|
172
|
+
### js-build-tools.compileReadme ⇒ <code>stream.Stream</code>
|
|
173
|
+
Generate the README.md file based off of the template, then append the generated documentation.
|
|
14
174
|
|
|
15
|
-
|
|
175
|
+
**Kind**: static constant of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
176
|
+
<a name="module_js-build-tools.watchTest"></a>
|
|
16
177
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
module.exports = {
|
|
21
|
-
// The name to use for the browser-bundled output file (.js will be appended).
|
|
22
|
-
browserName: 'my-package',
|
|
178
|
+
### js-build-tools.watchTest() ⇒ <code>\*</code>
|
|
179
|
+
Watch for changes and run the tests.
|
|
23
180
|
|
|
24
|
-
|
|
25
|
-
|
|
181
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
182
|
+
<a name="module_js-build-tools.watchFull"></a>
|
|
26
183
|
|
|
27
|
-
|
|
28
|
-
|
|
184
|
+
### js-build-tools.watchFull() ⇒ <code>FSWatcher</code>
|
|
185
|
+
Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
29
186
|
|
|
30
|
-
|
|
31
|
-
|
|
187
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
188
|
+
<a name="module_js-build-tools.typeScript"></a>
|
|
32
189
|
|
|
33
|
-
|
|
34
|
-
|
|
190
|
+
### js-build-tools.typeScript() ⇒ <code>stream.Stream</code>
|
|
191
|
+
Simplified typescript task using tsFor.
|
|
35
192
|
|
|
36
|
-
|
|
37
|
-
|
|
193
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
194
|
+
<a name="module_js-build-tools.testQuick"></a>
|
|
38
195
|
|
|
39
|
-
|
|
40
|
-
|
|
196
|
+
### js-build-tools.testQuick([done], [testPath]) ⇒ <code>Promise.<\*></code>
|
|
197
|
+
Run the Jest tests for files which have been modified (based on git status).
|
|
41
198
|
|
|
42
|
-
|
|
43
|
-
srcSearch: 'src/**/!(*.test).js',
|
|
199
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
44
200
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// The search pattern for watching files for changes.
|
|
50
|
-
watchSearch: 'src/**/*.js',
|
|
51
|
-
}
|
|
52
|
-
```
|
|
201
|
+
| Param | Type | Default |
|
|
202
|
+
| --- | --- | --- |
|
|
203
|
+
| [done] | <code>function</code> | <code></code> |
|
|
204
|
+
| [testPath] | <code>Array.<string></code> \| <code>string</code> | <code>'path/config/test/files'</code> |
|
|
53
205
|
|
|
54
|
-
|
|
55
|
-
In your project's root directory, create a `gulpfile.js` file, in here you can require any of the functions you need. For example:
|
|
56
|
-
```
|
|
57
|
-
// Your local gulpfile.js
|
|
58
|
-
const { build, defaultCmd, readme, testFull, testQuick, watchFull, watchTest } = require('js-build-tools')
|
|
59
|
-
|
|
60
|
-
// Everything you export will be created as a gulp task.
|
|
61
|
-
// You can build your own tasks here as well by using some of the functions `js-build-tools/functions`.
|
|
62
|
-
// You can list your available tasks by running `gulp --tasks`.
|
|
63
|
-
exports.build = build
|
|
64
|
-
exports.default = defaultCmd
|
|
65
|
-
exports.readme = readme
|
|
66
|
-
exports.testFull = testFull
|
|
67
|
-
exports.testQuick = testQuick
|
|
68
|
-
exports.watchFull = watchFull
|
|
69
|
-
exports.watchTest = watchTest
|
|
70
|
-
```
|
|
206
|
+
<a name="module_js-build-tools.testFull"></a>
|
|
71
207
|
|
|
72
|
-
|
|
208
|
+
### js-build-tools.testFull([done], [testPath]) ⇒ <code>Promise.<\*></code>
|
|
209
|
+
Run all tests with jest.
|
|
73
210
|
|
|
74
|
-
|
|
75
|
-
Depending on how you wrote your test files, Jest may require some Babel configuration.
|
|
76
|
-
Create a `babel.config.js` file in the root directory of your project.
|
|
77
|
-
You can then use the recommended configuration by requiring the babel.config.js file into your own configuration file.
|
|
78
|
-
Example:
|
|
79
|
-
```
|
|
80
|
-
const babelConfig = require('js-build-tools/babel.config')
|
|
81
|
-
// You may add additional configuration here. Example: babelConfig.presets.push('@babel/preset-env')
|
|
82
|
-
module.exports = babelConfig
|
|
83
|
-
```
|
|
211
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
84
212
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"build": "gulp build",
|
|
90
|
-
"dev": "gulp",
|
|
91
|
-
"readme": "gulp readme",
|
|
92
|
-
"test": "gulp testFull",
|
|
93
|
-
"test:quick": "gulp testQuick",
|
|
94
|
-
"watch": "gulp watchFull",
|
|
95
|
-
"watch:test": "gulp watchTest"
|
|
96
|
-
},
|
|
97
|
-
```
|
|
213
|
+
| Param | Type | Default |
|
|
214
|
+
| --- | --- | --- |
|
|
215
|
+
| [done] | <code>function</code> | <code></code> |
|
|
216
|
+
| [testPath] | <code>Array.<string></code> \| <code>string</code> | <code>'path/config/test/files'</code> |
|
|
98
217
|
|
|
99
|
-
|
|
100
|
-
Run any of the above commands with `gulp` or `npm run`.
|
|
218
|
+
<a name="module_js-build-tools.distMinify"></a>
|
|
101
219
|
|
|
220
|
+
### js-build-tools.distMinify() ⇒ <code>\*</code>
|
|
221
|
+
Creates minified versions of the dist files.
|
|
102
222
|
|
|
103
|
-
|
|
223
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
224
|
+
<a name="module_js-build-tools.distLint"></a>
|
|
104
225
|
|
|
105
|
-
|
|
226
|
+
### js-build-tools.distLint() ⇒ <code>\*</code>
|
|
227
|
+
Applies Standard code style linting to distribution files.
|
|
106
228
|
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
<dd><p>Log out an object in a nicely formatted way.</p>
|
|
110
|
-
</dd>
|
|
111
|
-
<dt><a href="#circularObject">circularObject</a> : <code>Object.<string, (string|Object|Array)></code></dt>
|
|
112
|
-
<dd><p>Multilayered node tree-like structure with parent references</p>
|
|
113
|
-
</dd>
|
|
114
|
-
<dt><a href="#deepReferenceObject">deepReferenceObject</a> : <code>Object.<string, (string|number|Object)></code></dt>
|
|
115
|
-
<dd><p>Sample object with deep references.</p>
|
|
116
|
-
</dd>
|
|
117
|
-
<dt><a href="#linkedList">linkedList</a> : <code>Object.<string, (string|Object)></code></dt>
|
|
118
|
-
<dd><p>Sample LinkedList for testing circular references.</p>
|
|
119
|
-
</dd>
|
|
120
|
-
<dt><a href="#jsonDom">jsonDom</a></dt>
|
|
121
|
-
<dd><p>Sample of jsonDom object containing empty nested array and objects</p>
|
|
122
|
-
</dd>
|
|
123
|
-
<dt><a href="#domItem">domItem</a></dt>
|
|
124
|
-
<dd><p>Sample of domItem child with nested child and optional details</p>
|
|
125
|
-
</dd>
|
|
126
|
-
<dt><a href="#multiReferenceObject">multiReferenceObject</a> : <code>Object.<string, (string|number|Object)></code></dt>
|
|
127
|
-
<dd><p>Sample of object containing multiple references.</p>
|
|
128
|
-
</dd>
|
|
129
|
-
<dt><a href="#nodeTree">nodeTree</a> : <code>Object.<string, (string|Object|Array)></code></dt>
|
|
130
|
-
<dd><p>Sample NodeTree for testing circular references and arrays.</p>
|
|
131
|
-
</dd>
|
|
132
|
-
<dt><a href="#defaultCmd">defaultCmd</a></dt>
|
|
133
|
-
<dd><p>Recommended as the default task, runs the simple dist and bundle tasks.</p>
|
|
134
|
-
</dd>
|
|
135
|
-
<dt><a href="#compileReadme">compileReadme</a></dt>
|
|
136
|
-
<dd><p>Generate the README.md file based off of the template, then append the generated documentation.</p>
|
|
137
|
-
</dd>
|
|
138
|
-
<dt><a href="#build">build</a></dt>
|
|
139
|
-
<dd><p>Runs several processes to build and validate the project.
|
|
140
|
-
Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.</p>
|
|
141
|
-
</dd>
|
|
142
|
-
</dl>
|
|
229
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
230
|
+
<a name="module_js-build-tools.dist"></a>
|
|
143
231
|
|
|
144
|
-
|
|
232
|
+
### js-build-tools.dist() ⇒ <code>\*</code>
|
|
233
|
+
Simplified distribution tasks which will use arguments from distFor.
|
|
145
234
|
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
</
|
|
150
|
-
|
|
151
|
-
<dd><p>Watch for changes and run the distribution for the changed files, then bundle and test the changed files.</p>
|
|
152
|
-
</dd>
|
|
153
|
-
<dt><a href="#testQuick">testQuick()</a> ⇒ <code>Promise.<*></code></dt>
|
|
154
|
-
<dd><p>Run the Jest tests for files which have been modified (based on git status).</p>
|
|
155
|
-
</dd>
|
|
156
|
-
<dt><a href="#testFull">testFull()</a> ⇒ <code>Promise.<*></code></dt>
|
|
157
|
-
<dd><p>Run all tests with jest.</p>
|
|
158
|
-
</dd>
|
|
159
|
-
<dt><a href="#readmeTemplate">readmeTemplate()</a> ⇒ <code>*</code></dt>
|
|
160
|
-
<dd><p>Copy a readme template into the README.md file.</p>
|
|
161
|
-
</dd>
|
|
162
|
-
<dt><a href="#distMinify">distMinify()</a> ⇒ <code>*</code></dt>
|
|
163
|
-
<dd><p>Creates minified versions of the dist files.</p>
|
|
164
|
-
</dd>
|
|
165
|
-
<dt><a href="#distLint">distLint()</a> ⇒ <code>*</code></dt>
|
|
166
|
-
<dd><p>Applies Standard code style linting to distribution files.</p>
|
|
167
|
-
</dd>
|
|
168
|
-
<dt><a href="#distFor">distFor(srcPath, destPath)</a> ⇒ <code>*</code></dt>
|
|
169
|
-
<dd><p>Build the distribution for a given source pattern.</p>
|
|
170
|
-
</dd>
|
|
171
|
-
<dt><a href="#dist">dist()</a> ⇒ <code>*</code></dt>
|
|
172
|
-
<dd><p>Simplified distribution tasks which will use arguments from distFor.</p>
|
|
173
|
-
</dd>
|
|
174
|
-
<dt><a href="#clean">clean()</a> ⇒ <code>Promise.<Array.<string>></code> | <code>*</code></dt>
|
|
175
|
-
<dd><p>Deletes all the distribution and browser files (used before create a new build).</p>
|
|
176
|
-
</dd>
|
|
177
|
-
<dt><a href="#bundleMinify">bundleMinify()</a> ⇒ <code>*</code></dt>
|
|
178
|
-
<dd><p>Creates the minified bundle file.</p>
|
|
179
|
-
</dd>
|
|
180
|
-
<dt><a href="#bundleLint">bundleLint()</a> ⇒ <code>*</code></dt>
|
|
181
|
-
<dd><p>Applies Standard code style linting to bundled file.</p>
|
|
182
|
-
</dd>
|
|
183
|
-
<dt><a href="#bundle">bundle()</a> ⇒ <code>*</code></dt>
|
|
184
|
-
<dd><p>Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.</p>
|
|
185
|
-
</dd>
|
|
186
|
-
<dt><a href="#addToReadme">addToReadme()</a> ⇒ <code>string</code> | <code>Uint8Array</code></dt>
|
|
187
|
-
<dd><p>Appends all the jsdoc comments to the readme file. Assumes empty or templated file.</p>
|
|
188
|
-
</dd>
|
|
189
|
-
</dl>
|
|
235
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
236
|
+
<a name="module_js-build-tools.defaultCmd"></a>
|
|
237
|
+
|
|
238
|
+
### js-build-tools.defaultCmd([done]) ⇒ <code>stream.Stream</code>
|
|
239
|
+
Recommended as the default task, runs the simple dist and bundle tasks.
|
|
190
240
|
|
|
191
|
-
<
|
|
241
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
192
242
|
|
|
193
|
-
|
|
194
|
-
|
|
243
|
+
| Param | Type | Default |
|
|
244
|
+
| --- | --- | --- |
|
|
245
|
+
| [done] | <code>function</code> | <code></code> |
|
|
246
|
+
|
|
247
|
+
<a name="module_js-build-tools.bundleMinify"></a>
|
|
248
|
+
|
|
249
|
+
### js-build-tools.bundleMinify() ⇒ <code>\*</code>
|
|
250
|
+
Creates the minified bundle file.
|
|
251
|
+
|
|
252
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
253
|
+
<a name="module_js-build-tools.bundleLint"></a>
|
|
254
|
+
|
|
255
|
+
### js-build-tools.bundleLint() ⇒ <code>stream.Stream</code>
|
|
256
|
+
Applies Standard code style linting to bundled file.
|
|
257
|
+
|
|
258
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
259
|
+
<a name="module_js-build-tools.bundle"></a>
|
|
260
|
+
|
|
261
|
+
### js-build-tools.bundle() ⇒ <code>stream.Stream</code>
|
|
262
|
+
Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
263
|
+
|
|
264
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
265
|
+
<a name="module_js-build-tools.build"></a>
|
|
195
266
|
|
|
196
|
-
|
|
267
|
+
### js-build-tools.build([done]) ⇒ <code>stream.Stream</code>
|
|
268
|
+
Runs several processes to build and validate the project.
|
|
269
|
+
|
|
270
|
+
**Kind**: static method of [<code>js-build-tools</code>](#module_js-build-tools)
|
|
197
271
|
|
|
198
272
|
| Param | Type | Default |
|
|
199
273
|
| --- | --- | --- |
|
|
200
|
-
|
|
|
201
|
-
| [label] | <code>string</code> | <code>"'logging'"</code> |
|
|
274
|
+
| [done] | <code>function</code> | <code></code> |
|
|
202
275
|
|
|
203
|
-
<a name="
|
|
276
|
+
<a name="module_gulpConfig"></a>
|
|
204
277
|
|
|
205
|
-
##
|
|
206
|
-
|
|
278
|
+
## gulpConfig
|
|
279
|
+
Modify these configurations to match your project specifications.
|
|
207
280
|
|
|
208
|
-
**
|
|
209
|
-
<
|
|
281
|
+
**Version**: 2.0.0
|
|
282
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
210
283
|
|
|
211
|
-
|
|
212
|
-
|
|
284
|
+
* [gulpConfig](#module_gulpConfig)
|
|
285
|
+
* _static_
|
|
286
|
+
* [.defaultConfig([config], [path], [defaultValue])](#module_gulpConfig.defaultConfig) ⇒ <code>\*</code> \| <code>null</code>
|
|
287
|
+
* [.get(path, defaultValue)](#module_gulpConfig.get) ⇒ <code>\*</code> \| <code>null</code>
|
|
288
|
+
* [.set(path, value)](#module_gulpConfig.set) ⇒ <code>\*</code>
|
|
289
|
+
* _inner_
|
|
290
|
+
* [~ArrayableSetting](#module_gulpConfig..ArrayableSetting) : <code>Array.<string></code> \| <code>string</code>
|
|
291
|
+
* [~BooleanSetting](#module_gulpConfig..BooleanSetting) : <code>boolean</code>
|
|
292
|
+
* [~FlagStringSetting](#module_gulpConfig..FlagStringSetting) : <code>false</code> \| <code>StringSetting</code>
|
|
293
|
+
* [~FlagsSetting](#module_gulpConfig..FlagsSetting) : <code>Object.<string, BooleanSetting></code>
|
|
294
|
+
* [~JestTestFlags](#module_gulpConfig..JestTestFlags) : <code>FlagsSetting</code>
|
|
295
|
+
* [~StringSetting](#module_gulpConfig..StringSetting) : <code>string</code>
|
|
296
|
+
* [~Setting](#module_gulpConfig..Setting) : <code>ArrayableSetting</code> \| <code>BooleanSetting</code> \| <code>FlagsSetting</code> \| <code>StringSetting</code>
|
|
297
|
+
* [~Configurations](#module_gulpConfig..Configurations) : <code>Object.<string, Setting></code>
|
|
298
|
+
|
|
299
|
+
<a name="module_gulpConfig.defaultConfig"></a>
|
|
300
|
+
|
|
301
|
+
### gulpConfig.defaultConfig([config], [path], [defaultValue]) ⇒ <code>\*</code> \| <code>null</code>
|
|
302
|
+
Retrieve a value from an object with the path (key), return a given default if the key is not found.
|
|
303
|
+
|
|
304
|
+
**Kind**: static method of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
305
|
+
|
|
306
|
+
| Param | Type | Default |
|
|
307
|
+
| --- | --- | --- |
|
|
308
|
+
| [config] | <code>Object.<string, \*></code> | <code>[]</code> |
|
|
309
|
+
| [path] | <code>string</code> \| <code>null</code> | <code>null</code> |
|
|
310
|
+
| [defaultValue] | <code>\*</code> | <code></code> |
|
|
311
|
+
|
|
312
|
+
<a name="module_gulpConfig.get"></a>
|
|
313
|
+
|
|
314
|
+
### gulpConfig.get(path, defaultValue) ⇒ <code>\*</code> \| <code>null</code>
|
|
315
|
+
Retrieve a value from teh configurations, default may be returned.
|
|
316
|
+
|
|
317
|
+
**Kind**: static method of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
318
|
+
|
|
319
|
+
| Param | Type | Default |
|
|
320
|
+
| --- | --- | --- |
|
|
321
|
+
| path | <code>string</code> \| <code>null</code> | <code>null</code> |
|
|
322
|
+
| defaultValue | <code>\*</code> | <code></code> |
|
|
323
|
+
|
|
324
|
+
<a name="module_gulpConfig.set"></a>
|
|
325
|
+
|
|
326
|
+
### gulpConfig.set(path, value) ⇒ <code>\*</code>
|
|
327
|
+
Specify a value for the configurations to use.
|
|
328
|
+
|
|
329
|
+
**Kind**: static method of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
330
|
+
|
|
331
|
+
| Param |
|
|
332
|
+
| --- |
|
|
333
|
+
| path |
|
|
334
|
+
| value |
|
|
335
|
+
|
|
336
|
+
<a name="module_gulpConfig..ArrayableSetting"></a>
|
|
337
|
+
|
|
338
|
+
### gulpConfig~ArrayableSetting : <code>Array.<string></code> \| <code>string</code>
|
|
339
|
+
A setting that may be an array of strings or a string only.
|
|
340
|
+
|
|
341
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
342
|
+
<a name="module_gulpConfig..BooleanSetting"></a>
|
|
213
343
|
|
|
214
|
-
|
|
215
|
-
|
|
344
|
+
### gulpConfig~BooleanSetting : <code>boolean</code>
|
|
345
|
+
A setting that may be true or false.
|
|
216
346
|
|
|
217
|
-
|
|
347
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
348
|
+
<a name="module_gulpConfig..FlagStringSetting"></a>
|
|
349
|
+
|
|
350
|
+
### gulpConfig~FlagStringSetting : <code>false</code> \| <code>StringSetting</code>
|
|
351
|
+
A setting that may be flag 'false' or provide a StringSetting
|
|
352
|
+
|
|
353
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
354
|
+
<a name="module_gulpConfig..FlagsSetting"></a>
|
|
355
|
+
|
|
356
|
+
### gulpConfig~FlagsSetting : <code>Object.<string, BooleanSetting></code>
|
|
357
|
+
An object of boolean settings used as flags.
|
|
358
|
+
|
|
359
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
360
|
+
<a name="module_gulpConfig..JestTestFlags"></a>
|
|
361
|
+
|
|
362
|
+
### gulpConfig~JestTestFlags : <code>FlagsSetting</code>
|
|
363
|
+
Configure cli options for running Jest.
|
|
364
|
+
|
|
365
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
366
|
+
**Properties**
|
|
367
|
+
|
|
368
|
+
| Name | Type |
|
|
369
|
+
| --- | --- |
|
|
370
|
+
| clearCache | <code>BooleanSetting</code> |
|
|
371
|
+
| debug | <code>BooleanSetting</code> |
|
|
372
|
+
| ignoreProjects: | <code>BooleanSetting</code> |
|
|
373
|
+
| json | <code>BooleanSetting</code> |
|
|
374
|
+
| selectProjects | <code>BooleanSetting</code> |
|
|
375
|
+
| showConfig | <code>BooleanSetting</code> |
|
|
376
|
+
| useStderr | <code>BooleanSetting</code> |
|
|
377
|
+
| watch | <code>BooleanSetting</code> |
|
|
378
|
+
| watchAll | <code>BooleanSetting</code> |
|
|
379
|
+
|
|
380
|
+
<a name="module_gulpConfig..StringSetting"></a>
|
|
381
|
+
|
|
382
|
+
### gulpConfig~StringSetting : <code>string</code>
|
|
383
|
+
A setting that may only be a string.
|
|
384
|
+
|
|
385
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
386
|
+
<a name="module_gulpConfig..Setting"></a>
|
|
387
|
+
|
|
388
|
+
### gulpConfig~Setting : <code>ArrayableSetting</code> \| <code>BooleanSetting</code> \| <code>FlagsSetting</code> \| <code>StringSetting</code>
|
|
389
|
+
Any single configuration option is a Setting.
|
|
390
|
+
|
|
391
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
392
|
+
<a name="module_gulpConfig..Configurations"></a>
|
|
393
|
+
|
|
394
|
+
### gulpConfig~Configurations : <code>Object.<string, Setting></code>
|
|
395
|
+
A set of Configurations options defined by Settings.
|
|
396
|
+
|
|
397
|
+
**Kind**: inner typedef of [<code>gulpConfig</code>](#module_gulpConfig)
|
|
398
|
+
**Properties**
|
|
399
|
+
|
|
400
|
+
| Name | Type |
|
|
401
|
+
| --- | --- |
|
|
402
|
+
| browserName | <code>StringSetting</code> |
|
|
403
|
+
| browserPath | <code>StringSetting</code> |
|
|
404
|
+
| distMain | <code>StringSetting</code> |
|
|
405
|
+
| distPath | <code>StringSetting</code> |
|
|
406
|
+
| distSearch | <code>ArrayableSetting</code> |
|
|
407
|
+
| nodeOnly | <code>BooleanSetting</code> |
|
|
408
|
+
| readmeTemplate | <code>StringSetting</code> |
|
|
409
|
+
| readmeOptions | <code>ArrayableSetting</code> |
|
|
410
|
+
| readmeFile | <code>StringSetting</code> |
|
|
411
|
+
| readmePath | <code>StringSetting</code> |
|
|
412
|
+
| readmeSearch | <code>ArrayableSetting</code> |
|
|
413
|
+
| rootPath | <code>StringSetting</code> |
|
|
414
|
+
| srcPath | <code>StringSetting</code> |
|
|
415
|
+
| srcSearch | <code>ArrayableSetting</code> |
|
|
416
|
+
| testOptions | <code>JestTestFlags</code> |
|
|
417
|
+
| testPath | <code>ArrayableSetting</code> |
|
|
418
|
+
| useTsConfig | <code>FlagStringSetting</code> |
|
|
419
|
+
| watchSearch | <code>ArrayableSetting</code> |
|
|
420
|
+
|
|
421
|
+
<a name="module_testHelpers"></a>
|
|
422
|
+
|
|
423
|
+
## testHelpers
|
|
424
|
+
An assortment of objects that can be used in tests and some functions to help debug and write tests.
|
|
425
|
+
|
|
426
|
+
**Version**: 2.0.0
|
|
427
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
428
|
+
|
|
429
|
+
* [testHelpers](#module_testHelpers)
|
|
430
|
+
* [.nodeTree](#module_testHelpers.nodeTree) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
431
|
+
* [.multiReferenceObject](#module_testHelpers.multiReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
432
|
+
* [.linkedList](#module_testHelpers.linkedList) : <code>Object.<string, (string\|Object)></code>
|
|
433
|
+
* [.jsonDom](#module_testHelpers.jsonDom) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
434
|
+
* [.domItem](#module_testHelpers.domItem) : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
435
|
+
* [.deepReferenceObject](#module_testHelpers.deepReferenceObject) : <code>Object.<string, (string\|number\|Object)></code>
|
|
436
|
+
* [.circularObject](#module_testHelpers.circularObject) : <code>Object.<string, (string\|Object\|Array)></code>
|
|
437
|
+
* [.setDefaults(testDir)](#module_testHelpers.setDefaults)
|
|
438
|
+
* [.createTempDir([exists])](#module_testHelpers.createTempDir) ⇒ <code>Promise.<(\*\|void)></code>
|
|
439
|
+
* [.exports.beforeEach()](#module_testHelpers.exports.beforeEach) ⇒ <code>Promise.<(\*\|void)></code>
|
|
440
|
+
* [.exports.afterEach()](#module_testHelpers.exports.afterEach) ⇒ <code>Promise.<\*></code>
|
|
441
|
+
* [.logObject(object, [label], [outputType])](#module_testHelpers.logObject) ⇒ <code>string</code> \| <code>undefined</code>
|
|
442
|
+
* [.countMatches(content, search)](#module_testHelpers.countMatches) ⇒ <code>number</code>
|
|
443
|
+
|
|
444
|
+
<a name="module_testHelpers.nodeTree"></a>
|
|
445
|
+
|
|
446
|
+
### testHelpers.nodeTree : <code>Object.<string, (string\|Object\|Array)></code>
|
|
447
|
+
Sample NodeTree for testing circular references and arrays.
|
|
448
|
+
|
|
449
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
450
|
+
<a name="module_testHelpers.multiReferenceObject"></a>
|
|
451
|
+
|
|
452
|
+
### testHelpers.multiReferenceObject : <code>Object.<string, (string\|number\|Object)></code>
|
|
453
|
+
Sample of object containing multiple references.
|
|
454
|
+
|
|
455
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
456
|
+
<a name="module_testHelpers.linkedList"></a>
|
|
457
|
+
|
|
458
|
+
### testHelpers.linkedList : <code>Object.<string, (string\|Object)></code>
|
|
218
459
|
Sample LinkedList for testing circular references.
|
|
219
460
|
|
|
220
|
-
**Kind**:
|
|
221
|
-
<a name="jsonDom"></a>
|
|
461
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
462
|
+
<a name="module_testHelpers.jsonDom"></a>
|
|
222
463
|
|
|
223
|
-
|
|
464
|
+
### testHelpers.jsonDom : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
224
465
|
Sample of jsonDom object containing empty nested array and objects
|
|
225
466
|
|
|
226
|
-
**Kind**:
|
|
227
|
-
<a name="domItem"></a>
|
|
467
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
468
|
+
<a name="module_testHelpers.domItem"></a>
|
|
228
469
|
|
|
229
|
-
|
|
470
|
+
### testHelpers.domItem : <code>Object.<string, (string\|number\|Array\|Object)></code>
|
|
230
471
|
Sample of domItem child with nested child and optional details
|
|
231
472
|
|
|
232
|
-
**Kind**:
|
|
233
|
-
<a name="
|
|
473
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
474
|
+
<a name="module_testHelpers.deepReferenceObject"></a>
|
|
234
475
|
|
|
235
|
-
|
|
236
|
-
Sample
|
|
476
|
+
### testHelpers.deepReferenceObject : <code>Object.<string, (string\|number\|Object)></code>
|
|
477
|
+
Sample object with deep references.
|
|
237
478
|
|
|
238
|
-
**Kind**:
|
|
239
|
-
<a name="
|
|
479
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
480
|
+
<a name="module_testHelpers.circularObject"></a>
|
|
240
481
|
|
|
241
|
-
|
|
242
|
-
|
|
482
|
+
### testHelpers.circularObject : <code>Object.<string, (string\|Object\|Array)></code>
|
|
483
|
+
Multilayered node tree-like structure with parent references
|
|
243
484
|
|
|
244
|
-
**Kind**:
|
|
245
|
-
<a name="
|
|
485
|
+
**Kind**: static constant of [<code>testHelpers</code>](#module_testHelpers)
|
|
486
|
+
<a name="module_testHelpers.setDefaults"></a>
|
|
246
487
|
|
|
247
|
-
|
|
248
|
-
|
|
488
|
+
### testHelpers.setDefaults(testDir)
|
|
489
|
+
Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
249
490
|
|
|
250
|
-
**Kind**:
|
|
251
|
-
<a name="compileReadme"></a>
|
|
491
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
252
492
|
|
|
253
|
-
|
|
254
|
-
|
|
493
|
+
| Param | Type | Default |
|
|
494
|
+
| --- | --- | --- |
|
|
495
|
+
| testDir | <code>string</code> | <code>"test-temp"</code> |
|
|
255
496
|
|
|
256
|
-
|
|
257
|
-
<a name="build"></a>
|
|
497
|
+
<a name="module_testHelpers.createTempDir"></a>
|
|
258
498
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
499
|
+
### testHelpers.createTempDir([exists]) ⇒ <code>Promise.<(\*\|void)></code>
|
|
500
|
+
Ensure that the del has completed, recursively attempt to delete and recreate
|
|
262
501
|
|
|
263
|
-
**Kind**:
|
|
264
|
-
<a name="watchTest"></a>
|
|
502
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
265
503
|
|
|
266
|
-
|
|
267
|
-
|
|
504
|
+
| Param | Type | Default |
|
|
505
|
+
| --- | --- | --- |
|
|
506
|
+
| [exists] | <code>boolean</code> | <code>true</code> |
|
|
268
507
|
|
|
269
|
-
|
|
270
|
-
<a name="watchFull"></a>
|
|
508
|
+
<a name="module_testHelpers.exports.beforeEach"></a>
|
|
271
509
|
|
|
272
|
-
|
|
273
|
-
|
|
510
|
+
### testHelpers.exports.beforeEach() ⇒ <code>Promise.<(\*\|void)></code>
|
|
511
|
+
In the Jest.beforeEach function call this one to set up the temp directory.
|
|
274
512
|
|
|
275
|
-
**Kind**:
|
|
276
|
-
<a name="
|
|
513
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
514
|
+
<a name="module_testHelpers.exports.afterEach"></a>
|
|
277
515
|
|
|
278
|
-
|
|
279
|
-
|
|
516
|
+
### testHelpers.exports.afterEach() ⇒ <code>Promise.<\*></code>
|
|
517
|
+
In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
280
518
|
|
|
281
|
-
**Kind**:
|
|
282
|
-
<a name="
|
|
519
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
520
|
+
<a name="module_testHelpers.logObject"></a>
|
|
283
521
|
|
|
284
|
-
|
|
285
|
-
|
|
522
|
+
### testHelpers.logObject(object, [label], [outputType]) ⇒ <code>string</code> \| <code>undefined</code>
|
|
523
|
+
Log out an object in a nicely formatted way.
|
|
286
524
|
|
|
287
|
-
**Kind**:
|
|
288
|
-
<a name="readmeTemplate"></a>
|
|
525
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
289
526
|
|
|
290
|
-
|
|
291
|
-
|
|
527
|
+
| Param | Type | Default |
|
|
528
|
+
| --- | --- | --- |
|
|
529
|
+
| object | <code>Object</code> | |
|
|
530
|
+
| [label] | <code>string</code> | <code>"logging"</code> |
|
|
531
|
+
| [outputType] | <code>string</code> | <code>"log"</code> |
|
|
292
532
|
|
|
293
|
-
|
|
294
|
-
<a name="distMinify"></a>
|
|
533
|
+
<a name="module_testHelpers.countMatches"></a>
|
|
295
534
|
|
|
296
|
-
|
|
297
|
-
|
|
535
|
+
### testHelpers.countMatches(content, search) ⇒ <code>number</code>
|
|
536
|
+
Simple way to count string occurrences for testing.
|
|
298
537
|
|
|
299
|
-
**Kind**:
|
|
300
|
-
<a name="distLint"></a>
|
|
538
|
+
**Kind**: static method of [<code>testHelpers</code>](#module_testHelpers)
|
|
301
539
|
|
|
302
|
-
|
|
303
|
-
|
|
540
|
+
| Param | Type |
|
|
541
|
+
| --- | --- |
|
|
542
|
+
| content | <code>string</code> |
|
|
543
|
+
| search | <code>string</code> |
|
|
304
544
|
|
|
305
|
-
|
|
306
|
-
<a name="distFor"></a>
|
|
545
|
+
<a name="module_partials"></a>
|
|
307
546
|
|
|
308
|
-
##
|
|
309
|
-
|
|
547
|
+
## partials
|
|
548
|
+
Micro-functions used as components for the main gulp functions.
|
|
549
|
+
|
|
550
|
+
**Version**: 2.0.0
|
|
551
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
552
|
+
|
|
553
|
+
* [partials](#module_partials)
|
|
554
|
+
* [.tsFor([srcPath], [distPath])](#module_partials.tsFor) ⇒ <code>stream.Stream</code>
|
|
555
|
+
* [.runOnChange(path)](#module_partials.runOnChange) ⇒ <code>stream.Stream</code>
|
|
556
|
+
* [~pathRegex](#module_partials.runOnChange..pathRegex)
|
|
557
|
+
* [.readmeTemplate()](#module_partials.readmeTemplate) ⇒ <code>\*</code>
|
|
558
|
+
* [.minifyFor()](#module_partials.minifyFor) ⇒ <code>\*</code>
|
|
559
|
+
* [.distSeries([srcPath], [distFinalPath], [tsSearch])](#module_partials.distSeries) ⇒ <code>function</code>
|
|
560
|
+
* [.distForSrc([useTs])](#module_partials.distForSrc) ⇒ <code>string</code>
|
|
561
|
+
* [.distFor([srcPath], [destPath])](#module_partials.distFor) ⇒ <code>\*</code>
|
|
562
|
+
* [.clean([done], [paths])](#module_partials.clean) ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
563
|
+
* [.beginWatcher()](#module_partials.beginWatcher) ⇒ <code>FSWatcher</code>
|
|
564
|
+
* [.addToReadme([done])](#module_partials.addToReadme) ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
565
|
+
|
|
566
|
+
<a name="module_partials.tsFor"></a>
|
|
567
|
+
|
|
568
|
+
### partials.tsFor([srcPath], [distPath]) ⇒ <code>stream.Stream</code>
|
|
569
|
+
Starting at the source directory, find all the ts files and convert them into the distribution directory.
|
|
570
|
+
|
|
571
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
572
|
+
**See**: `https://www.typescriptlang.org/docs/handbook/gulp.html` for more info
|
|
310
573
|
|
|
311
|
-
|
|
574
|
+
| Param | Type | Default |
|
|
575
|
+
| --- | --- | --- |
|
|
576
|
+
| [srcPath] | <code>string</code> \| <code>array</code> | <code>"''"</code> |
|
|
577
|
+
| [distPath] | <code>string</code> | <code>"''"</code> |
|
|
578
|
+
|
|
579
|
+
<a name="module_partials.runOnChange"></a>
|
|
580
|
+
|
|
581
|
+
### partials.runOnChange(path) ⇒ <code>stream.Stream</code>
|
|
582
|
+
Run this function when the watched files are modified.
|
|
583
|
+
|
|
584
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
312
585
|
|
|
313
586
|
| Param | Type |
|
|
314
587
|
| --- | --- |
|
|
315
|
-
|
|
|
316
|
-
| destPath | <code>string</code> |
|
|
588
|
+
| path | <code>string</code> |
|
|
317
589
|
|
|
318
|
-
|
|
590
|
+
**Example**
|
|
591
|
+
```js
|
|
592
|
+
// Configured paths
|
|
593
|
+
```
|
|
594
|
+
<a name="module_partials.runOnChange..pathRegex"></a>
|
|
319
595
|
|
|
320
|
-
|
|
321
|
-
|
|
596
|
+
#### runOnChange~pathRegex
|
|
597
|
+
1. The original path comes in from src and is a .ts
|
|
322
598
|
|
|
323
|
-
**Kind**:
|
|
324
|
-
<a name="
|
|
599
|
+
**Kind**: inner constant of [<code>runOnChange</code>](#module_partials.runOnChange)
|
|
600
|
+
<a name="module_partials.readmeTemplate"></a>
|
|
325
601
|
|
|
326
|
-
|
|
327
|
-
|
|
602
|
+
### partials.readmeTemplate() ⇒ <code>\*</code>
|
|
603
|
+
Copy a readme template into the README.md file.
|
|
328
604
|
|
|
329
|
-
**Kind**:
|
|
330
|
-
<a name="
|
|
605
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
606
|
+
<a name="module_partials.minifyFor"></a>
|
|
331
607
|
|
|
332
|
-
|
|
333
|
-
|
|
608
|
+
### partials.minifyFor() ⇒ <code>\*</code>
|
|
609
|
+
Minify files and rename the output with '.min' extension.
|
|
334
610
|
|
|
335
|
-
**Kind**:
|
|
336
|
-
<a name="
|
|
611
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
612
|
+
<a name="module_partials.distSeries"></a>
|
|
337
613
|
|
|
338
|
-
|
|
339
|
-
|
|
614
|
+
### partials.distSeries([srcPath], [distFinalPath], [tsSearch]) ⇒ <code>function</code>
|
|
615
|
+
When using TypeScript, ensure that we process the ts first then run babel (dist)
|
|
340
616
|
|
|
341
|
-
**Kind**:
|
|
342
|
-
<a name="bundle"></a>
|
|
617
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
343
618
|
|
|
344
|
-
|
|
345
|
-
|
|
619
|
+
| Param | Type | Default |
|
|
620
|
+
| --- | --- | --- |
|
|
621
|
+
| [srcPath] | <code>string</code> | <code>"'src/config/path/dist/for'"</code> |
|
|
622
|
+
| [distFinalPath] | <code>string</code> | <code>"'dist/config/path'"</code> |
|
|
623
|
+
| [tsSearch] | <code>string</code> | <code>"'ts/search/config/path'"</code> |
|
|
624
|
+
|
|
625
|
+
<a name="module_partials.distForSrc"></a>
|
|
626
|
+
|
|
627
|
+
### partials.distForSrc([useTs]) ⇒ <code>string</code>
|
|
628
|
+
Retrieve the correct distFor search path based on TS Config.
|
|
629
|
+
|
|
630
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
346
631
|
|
|
347
|
-
|
|
348
|
-
|
|
632
|
+
| Param | Type | Default |
|
|
633
|
+
| --- | --- | --- |
|
|
634
|
+
| [useTs] | [<code>FlagStringSetting</code>](#module_gulpConfig..FlagStringSetting) | <code>'config/for/ts'</code> |
|
|
635
|
+
|
|
636
|
+
<a name="module_partials.distFor"></a>
|
|
637
|
+
|
|
638
|
+
### partials.distFor([srcPath], [destPath]) ⇒ <code>\*</code>
|
|
639
|
+
Build the distribution for a given source pattern.
|
|
640
|
+
|
|
641
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
642
|
+
|
|
643
|
+
| Param | Type | Default |
|
|
644
|
+
| --- | --- | --- |
|
|
645
|
+
| [srcPath] | <code>string</code> \| <code>array</code> | <code>"'src/config/path/dist/for'"</code> |
|
|
646
|
+
| [destPath] | <code>string</code> | <code>"'dist/config/path'"</code> |
|
|
647
|
+
|
|
648
|
+
<a name="module_partials.clean"></a>
|
|
649
|
+
|
|
650
|
+
### partials.clean([done], [paths]) ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
651
|
+
Deletes all the distribution and browser files (used before create a new build).
|
|
349
652
|
|
|
350
|
-
|
|
653
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
654
|
+
|
|
655
|
+
| Param | Type | Default |
|
|
656
|
+
| --- | --- | --- |
|
|
657
|
+
| [done] | <code>function</code> | <code></code> |
|
|
658
|
+
| [paths] | <code>Array.<string></code> | <code>['dist/config/path', 'browser/config/path']</code> |
|
|
659
|
+
|
|
660
|
+
<a name="module_partials.beginWatcher"></a>
|
|
661
|
+
|
|
662
|
+
### partials.beginWatcher() ⇒ <code>FSWatcher</code>
|
|
663
|
+
Create a chokidar instance which watches and triggers change when the globed files are modified.
|
|
664
|
+
|
|
665
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
666
|
+
<a name="module_partials.addToReadme"></a>
|
|
667
|
+
|
|
668
|
+
### partials.addToReadme([done]) ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
351
669
|
Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
352
670
|
|
|
353
|
-
**Kind**:
|
|
671
|
+
**Kind**: static method of [<code>partials</code>](#module_partials)
|
|
672
|
+
|
|
673
|
+
| Param | Type | Default |
|
|
674
|
+
| --- | --- | --- |
|
|
675
|
+
| [done] | <code>function</code> \| <code>null</code> | <code></code> |
|
|
676
|
+
|