js-build-tools 1.1.0 → 1.2.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 +98 -98
- package/dist/addToReadme.js +8 -25
- package/dist/addToReadme.min.js +1 -1
- package/dist/build.js +1 -11
- package/dist/bundle.js +1 -5
- package/dist/bundleLint.js +1 -5
- package/dist/bundleMinify.js +1 -6
- package/dist/clean.js +4 -6
- package/dist/compileReadme.js +1 -3
- package/dist/default.js +1 -4
- package/dist/dist.js +1 -2
- package/dist/distFor.js +1 -4
- package/dist/distLint.js +1 -4
- package/dist/distMinify.js +1 -5
- package/dist/readmeTemplate.js +1 -4
- package/dist/testFull.js +3 -32
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +7 -11
- package/dist/testQuick.js +3 -32
- package/dist/testQuick.min.js +1 -1
- package/dist/watchFull.js +1 -13
- package/dist/watchTest.js +1 -4
- package/functions/addToReadme.js +7 -9
- package/functions/clean.js +10 -10
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -105,16 +105,6 @@ Run any of the above commands with `gulp` or `npm run`.
|
|
|
105
105
|
## Constants
|
|
106
106
|
|
|
107
107
|
<dl>
|
|
108
|
-
<dt><a href="#build">build</a></dt>
|
|
109
|
-
<dd><p>Runs several processes to build and validate the project.
|
|
110
|
-
Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.</p>
|
|
111
|
-
</dd>
|
|
112
|
-
<dt><a href="#compileReadme">compileReadme</a></dt>
|
|
113
|
-
<dd><p>Generate the README.md file based off of the template, then append the generated documentation.</p>
|
|
114
|
-
</dd>
|
|
115
|
-
<dt><a href="#defaultCmd">defaultCmd</a></dt>
|
|
116
|
-
<dd><p>Recommended as the default task, runs the simple dist and bundle tasks.</p>
|
|
117
|
-
</dd>
|
|
118
108
|
<dt><a href="#logObject">logObject</a></dt>
|
|
119
109
|
<dd><p>Log out an object in a nicely formatted way.</p>
|
|
120
110
|
</dd>
|
|
@@ -139,74 +129,65 @@ Cleans, distributes (lint and minify), bundles (lint and minify), creates the re
|
|
|
139
129
|
<dt><a href="#nodeTree">nodeTree</a> : <code>Object.<string, (string|Object|Array)></code></dt>
|
|
140
130
|
<dd><p>Sample NodeTree for testing circular references and arrays.</p>
|
|
141
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
142
|
</dl>
|
|
143
143
|
|
|
144
144
|
## Functions
|
|
145
145
|
|
|
146
146
|
<dl>
|
|
147
|
-
<dt><a href="#
|
|
148
|
-
<dd><p>
|
|
149
|
-
</dd>
|
|
150
|
-
<dt><a href="#bundle">bundle()</a> ⇒ <code>*</code></dt>
|
|
151
|
-
<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>
|
|
147
|
+
<dt><a href="#watchTest">watchTest()</a> ⇒ <code>*</code></dt>
|
|
148
|
+
<dd><p>Watch for changes and run the tests.</p>
|
|
152
149
|
</dd>
|
|
153
|
-
<dt><a href="#
|
|
154
|
-
<dd><p>
|
|
150
|
+
<dt><a href="#watchFull">watchFull()</a> ⇒ <code>*</code></dt>
|
|
151
|
+
<dd><p>Watch for changes and run the distribution for the changed files, then bundle and test the changed files.</p>
|
|
155
152
|
</dd>
|
|
156
|
-
<dt><a href="#
|
|
157
|
-
<dd><p>
|
|
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>
|
|
158
155
|
</dd>
|
|
159
|
-
<dt><a href="#
|
|
160
|
-
<dd><p>
|
|
156
|
+
<dt><a href="#testFull">testFull()</a> ⇒ <code>Promise.<*></code></dt>
|
|
157
|
+
<dd><p>Run all tests with jest.</p>
|
|
161
158
|
</dd>
|
|
162
|
-
<dt><a href="#
|
|
163
|
-
<dd><p>
|
|
159
|
+
<dt><a href="#readmeTemplate">readmeTemplate()</a> ⇒ <code>*</code></dt>
|
|
160
|
+
<dd><p>Copy a readme template into the README.md file.</p>
|
|
164
161
|
</dd>
|
|
165
|
-
<dt><a href="#
|
|
166
|
-
<dd><p>
|
|
162
|
+
<dt><a href="#distMinify">distMinify()</a> ⇒ <code>*</code></dt>
|
|
163
|
+
<dd><p>Creates minified versions of the dist files.</p>
|
|
167
164
|
</dd>
|
|
168
165
|
<dt><a href="#distLint">distLint()</a> ⇒ <code>*</code></dt>
|
|
169
166
|
<dd><p>Applies Standard code style linting to distribution files.</p>
|
|
170
167
|
</dd>
|
|
171
|
-
<dt><a href="#
|
|
172
|
-
<dd><p>
|
|
168
|
+
<dt><a href="#distFor">distFor(srcPath, destPath)</a> ⇒ <code>*</code></dt>
|
|
169
|
+
<dd><p>Build the distribution for a given source pattern.</p>
|
|
173
170
|
</dd>
|
|
174
|
-
<dt><a href="#
|
|
175
|
-
<dd><p>
|
|
171
|
+
<dt><a href="#dist">dist()</a> ⇒ <code>*</code></dt>
|
|
172
|
+
<dd><p>Simplified distribution tasks which will use arguments from distFor.</p>
|
|
176
173
|
</dd>
|
|
177
|
-
<dt><a href="#
|
|
178
|
-
<dd><p>
|
|
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>
|
|
179
176
|
</dd>
|
|
180
|
-
<dt><a href="#
|
|
181
|
-
<dd><p>
|
|
177
|
+
<dt><a href="#bundleMinify">bundleMinify()</a> ⇒ <code>*</code></dt>
|
|
178
|
+
<dd><p>Creates the minified bundle file.</p>
|
|
182
179
|
</dd>
|
|
183
|
-
<dt><a href="#
|
|
184
|
-
<dd><p>
|
|
180
|
+
<dt><a href="#bundleLint">bundleLint()</a> ⇒ <code>*</code></dt>
|
|
181
|
+
<dd><p>Applies Standard code style linting to bundled file.</p>
|
|
185
182
|
</dd>
|
|
186
|
-
<dt><a href="#
|
|
187
|
-
<dd><p>
|
|
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
188
|
</dd>
|
|
189
189
|
</dl>
|
|
190
190
|
|
|
191
|
-
<a name="build"></a>
|
|
192
|
-
|
|
193
|
-
## build
|
|
194
|
-
Runs several processes to build and validate the project.
|
|
195
|
-
Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
196
|
-
|
|
197
|
-
**Kind**: global constant
|
|
198
|
-
<a name="compileReadme"></a>
|
|
199
|
-
|
|
200
|
-
## compileReadme
|
|
201
|
-
Generate the README.md file based off of the template, then append the generated documentation.
|
|
202
|
-
|
|
203
|
-
**Kind**: global constant
|
|
204
|
-
<a name="defaultCmd"></a>
|
|
205
|
-
|
|
206
|
-
## defaultCmd
|
|
207
|
-
Recommended as the default task, runs the simple dist and bundle tasks.
|
|
208
|
-
|
|
209
|
-
**Kind**: global constant
|
|
210
191
|
<a name="logObject"></a>
|
|
211
192
|
|
|
212
193
|
## logObject
|
|
@@ -261,40 +242,65 @@ Sample of object containing multiple references.
|
|
|
261
242
|
Sample NodeTree for testing circular references and arrays.
|
|
262
243
|
|
|
263
244
|
**Kind**: global constant
|
|
264
|
-
<a name="
|
|
245
|
+
<a name="defaultCmd"></a>
|
|
265
246
|
|
|
266
|
-
##
|
|
267
|
-
|
|
247
|
+
## defaultCmd
|
|
248
|
+
Recommended as the default task, runs the simple dist and bundle tasks.
|
|
249
|
+
|
|
250
|
+
**Kind**: global constant
|
|
251
|
+
<a name="compileReadme"></a>
|
|
252
|
+
|
|
253
|
+
## compileReadme
|
|
254
|
+
Generate the README.md file based off of the template, then append the generated documentation.
|
|
255
|
+
|
|
256
|
+
**Kind**: global constant
|
|
257
|
+
<a name="build"></a>
|
|
258
|
+
|
|
259
|
+
## build
|
|
260
|
+
Runs several processes to build and validate the project.
|
|
261
|
+
Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
262
|
+
|
|
263
|
+
**Kind**: global constant
|
|
264
|
+
<a name="watchTest"></a>
|
|
265
|
+
|
|
266
|
+
## watchTest() ⇒ <code>\*</code>
|
|
267
|
+
Watch for changes and run the tests.
|
|
268
268
|
|
|
269
269
|
**Kind**: global function
|
|
270
|
-
<a name="
|
|
270
|
+
<a name="watchFull"></a>
|
|
271
271
|
|
|
272
|
-
##
|
|
273
|
-
|
|
272
|
+
## watchFull() ⇒ <code>\*</code>
|
|
273
|
+
Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
274
274
|
|
|
275
275
|
**Kind**: global function
|
|
276
|
-
<a name="
|
|
276
|
+
<a name="testQuick"></a>
|
|
277
277
|
|
|
278
|
-
##
|
|
279
|
-
|
|
278
|
+
## testQuick() ⇒ <code>Promise.<\*></code>
|
|
279
|
+
Run the Jest tests for files which have been modified (based on git status).
|
|
280
280
|
|
|
281
281
|
**Kind**: global function
|
|
282
|
-
<a name="
|
|
282
|
+
<a name="testFull"></a>
|
|
283
283
|
|
|
284
|
-
##
|
|
285
|
-
|
|
284
|
+
## testFull() ⇒ <code>Promise.<\*></code>
|
|
285
|
+
Run all tests with jest.
|
|
286
286
|
|
|
287
287
|
**Kind**: global function
|
|
288
|
-
<a name="
|
|
288
|
+
<a name="readmeTemplate"></a>
|
|
289
289
|
|
|
290
|
-
##
|
|
291
|
-
|
|
290
|
+
## readmeTemplate() ⇒ <code>\*</code>
|
|
291
|
+
Copy a readme template into the README.md file.
|
|
292
292
|
|
|
293
293
|
**Kind**: global function
|
|
294
|
-
<a name="
|
|
294
|
+
<a name="distMinify"></a>
|
|
295
295
|
|
|
296
|
-
##
|
|
297
|
-
|
|
296
|
+
## distMinify() ⇒ <code>\*</code>
|
|
297
|
+
Creates minified versions of the dist files.
|
|
298
|
+
|
|
299
|
+
**Kind**: global function
|
|
300
|
+
<a name="distLint"></a>
|
|
301
|
+
|
|
302
|
+
## distLint() ⇒ <code>\*</code>
|
|
303
|
+
Applies Standard code style linting to distribution files.
|
|
298
304
|
|
|
299
305
|
**Kind**: global function
|
|
300
306
|
<a name="distFor"></a>
|
|
@@ -309,45 +315,39 @@ Build the distribution for a given source pattern.
|
|
|
309
315
|
| srcPath | <code>string</code> \| <code>array</code> |
|
|
310
316
|
| destPath | <code>string</code> |
|
|
311
317
|
|
|
312
|
-
<a name="
|
|
313
|
-
|
|
314
|
-
## distLint() ⇒ <code>\*</code>
|
|
315
|
-
Applies Standard code style linting to distribution files.
|
|
316
|
-
|
|
317
|
-
**Kind**: global function
|
|
318
|
-
<a name="distMinify"></a>
|
|
318
|
+
<a name="dist"></a>
|
|
319
319
|
|
|
320
|
-
##
|
|
321
|
-
|
|
320
|
+
## dist() ⇒ <code>\*</code>
|
|
321
|
+
Simplified distribution tasks which will use arguments from distFor.
|
|
322
322
|
|
|
323
323
|
**Kind**: global function
|
|
324
|
-
<a name="
|
|
324
|
+
<a name="clean"></a>
|
|
325
325
|
|
|
326
|
-
##
|
|
327
|
-
|
|
326
|
+
## clean() ⇒ <code>Promise.<Array.<string>></code> \| <code>\*</code>
|
|
327
|
+
Deletes all the distribution and browser files (used before create a new build).
|
|
328
328
|
|
|
329
329
|
**Kind**: global function
|
|
330
|
-
<a name="
|
|
330
|
+
<a name="bundleMinify"></a>
|
|
331
331
|
|
|
332
|
-
##
|
|
333
|
-
|
|
332
|
+
## bundleMinify() ⇒ <code>\*</code>
|
|
333
|
+
Creates the minified bundle file.
|
|
334
334
|
|
|
335
335
|
**Kind**: global function
|
|
336
|
-
<a name="
|
|
336
|
+
<a name="bundleLint"></a>
|
|
337
337
|
|
|
338
|
-
##
|
|
339
|
-
|
|
338
|
+
## bundleLint() ⇒ <code>\*</code>
|
|
339
|
+
Applies Standard code style linting to bundled file.
|
|
340
340
|
|
|
341
341
|
**Kind**: global function
|
|
342
|
-
<a name="
|
|
342
|
+
<a name="bundle"></a>
|
|
343
343
|
|
|
344
|
-
##
|
|
345
|
-
|
|
344
|
+
## bundle() ⇒ <code>\*</code>
|
|
345
|
+
Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
346
346
|
|
|
347
347
|
**Kind**: global function
|
|
348
|
-
<a name="
|
|
348
|
+
<a name="addToReadme"></a>
|
|
349
349
|
|
|
350
|
-
##
|
|
351
|
-
|
|
350
|
+
## addToReadme() ⇒ <code>string</code> \| <code>Uint8Array</code>
|
|
351
|
+
Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
352
352
|
|
|
353
353
|
**Kind**: global function
|
package/dist/addToReadme.js
CHANGED
|
@@ -1,38 +1,21 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
require('core-js/modules/es.array.map.js')
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.map.js')
|
|
6
|
-
|
|
7
|
-
require('core-js/modules/esnext.iterator.map.js')
|
|
8
|
-
|
|
9
|
-
require('core-js/modules/es.array.concat.js')
|
|
10
|
-
|
|
11
|
-
var filenames = require('gulp-filenames')
|
|
12
|
-
|
|
13
3
|
var fs = require('fs')
|
|
14
|
-
|
|
15
4
|
var gulpConfig = require('../gulp.config.js')
|
|
16
|
-
|
|
17
5
|
var jsdoc2md = require('jsdoc-to-markdown')
|
|
6
|
+
var _require = require('glob')
|
|
7
|
+
var globSync = _require.globSync
|
|
18
8
|
|
|
19
|
-
var _require = require('gulp')
|
|
20
|
-
var src = _require.src
|
|
21
9
|
/**
|
|
22
10
|
* Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
23
11
|
* @returns {string|Uint8Array}
|
|
24
12
|
*/
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
files: filenames.get('readme').map(function (file) {
|
|
30
|
-
return ''.concat(gulpConfig.srcPath, '/').concat(file)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
fs.appendFileSync('README.md', readme, 'utf8')
|
|
34
|
-
return readme
|
|
13
|
+
var addToReadme = function addToReadme (done) {
|
|
14
|
+
var files = globSync(gulpConfig.srcSearch)
|
|
15
|
+
var readme = jsdoc2md.renderSync({
|
|
16
|
+
files: files
|
|
35
17
|
})
|
|
18
|
+
fs.appendFileSync('README.md', readme, 'utf8')
|
|
19
|
+
done()
|
|
36
20
|
}
|
|
37
|
-
|
|
38
21
|
module.exports = addToReadme
|
package/dist/addToReadme.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";var fs=require("fs"),gulpConfig=require("../gulp.config.js"),jsdoc2md=require("jsdoc-to-markdown"),_require=require("glob"),globSync=_require.globSync,addToReadme=function(e){var r=globSync(gulpConfig.srcSearch),o=jsdoc2md.renderSync({files:r});fs.appendFileSync("README.md",o,"utf8"),e()};module.exports=addToReadme;
|
package/dist/build.js
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var bundle = require('./bundle')
|
|
4
|
-
|
|
5
4
|
var bundleLint = require('./bundleLint')
|
|
6
|
-
|
|
7
5
|
var bundleMinify = require('./bundleMinify')
|
|
8
|
-
|
|
9
6
|
var clean = require('./clean')
|
|
10
|
-
|
|
11
7
|
var compileReadme = require('./compileReadme')
|
|
12
|
-
|
|
13
8
|
var dist = require('./dist')
|
|
14
|
-
|
|
15
9
|
var distLint = require('./distLint')
|
|
16
|
-
|
|
17
10
|
var distMinify = require('./distMinify')
|
|
18
|
-
|
|
19
11
|
var _require = require('gulp')
|
|
20
12
|
var parallel = _require.parallel
|
|
21
13
|
var series = _require.series
|
|
22
|
-
|
|
23
14
|
var gulpConfig = require('../gulp.config.js')
|
|
24
|
-
|
|
25
15
|
var testFull = require('./testFull')
|
|
16
|
+
|
|
26
17
|
/**
|
|
27
18
|
* Runs several processes to build and validate the project.
|
|
28
19
|
* Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
29
20
|
*/
|
|
30
|
-
|
|
31
21
|
var build = parallel(gulpConfig.nodeOnly ? series(clean, dist, parallel(distLint, distMinify)) : series(clean, dist, parallel(distLint, distMinify), bundle, parallel(bundleLint, bundleMinify)), compileReadme, testFull)
|
|
32
22
|
module.exports = build
|
package/dist/bundle.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var browserify = require('browserify')
|
|
4
|
-
|
|
5
4
|
var _require = require('gulp')
|
|
6
5
|
var dest = _require.dest
|
|
7
|
-
|
|
8
6
|
var gulpConfig = require('../gulp.config.js')
|
|
9
|
-
|
|
10
7
|
var source = require('vinyl-source-stream')
|
|
8
|
+
|
|
11
9
|
/**
|
|
12
10
|
* Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
13
11
|
* @returns {*}
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
13
|
var bundle = function bundle () {
|
|
17
14
|
return browserify(gulpConfig.distMain).bundle().pipe(source(''.concat(gulpConfig.browserName, '.js'))).pipe(dest(gulpConfig.browserPath))
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
module.exports = bundle
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
require('core-js/modules/es.array.concat.js')
|
|
4
|
-
|
|
5
4
|
var _require = require('gulp')
|
|
6
5
|
var dest = _require.dest
|
|
7
6
|
var src = _require.src
|
|
8
|
-
|
|
9
7
|
var gulpConfig = require('../gulp.config.js')
|
|
10
|
-
|
|
11
8
|
var standard = require('gulp-standard')
|
|
9
|
+
|
|
12
10
|
/**
|
|
13
11
|
* Applies Standard code style linting to bundled file.
|
|
14
12
|
* @returns {*}
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
14
|
var bundleLint = function bundleLint () {
|
|
18
15
|
return src(''.concat(gulpConfig.browserPath, '/').concat(gulpConfig.browserName, '.js')).pipe(standard({
|
|
19
16
|
fix: true
|
|
@@ -22,5 +19,4 @@ var bundleLint = function bundleLint () {
|
|
|
22
19
|
quiet: true
|
|
23
20
|
})).pipe(dest(gulpConfig.browserPath))
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
module.exports = bundleLint
|
package/dist/bundleMinify.js
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
require('core-js/modules/es.array.concat.js')
|
|
4
|
-
|
|
5
4
|
var _require = require('gulp')
|
|
6
5
|
var dest = _require.dest
|
|
7
6
|
var src = _require.src
|
|
8
|
-
|
|
9
7
|
var gulpConfig = require('../gulp.config.js')
|
|
10
|
-
|
|
11
8
|
var _require2 = require('gulp-uglify-es')
|
|
12
9
|
var uglify = _require2.default
|
|
13
|
-
|
|
14
10
|
var rename = require('gulp-rename')
|
|
11
|
+
|
|
15
12
|
/**
|
|
16
13
|
* Creates the minified bundle file.
|
|
17
14
|
* @returns {*}
|
|
18
15
|
*/
|
|
19
|
-
|
|
20
16
|
var bundleMinify = function bundleMinify () {
|
|
21
17
|
return src(''.concat(gulpConfig.browserPath, '/').concat(gulpConfig.browserName, '.js')).pipe(uglify()).pipe(rename({
|
|
22
18
|
extname: '.min.js'
|
|
23
19
|
})).pipe(dest(gulpConfig.browserPath))
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
module.exports = bundleMinify
|
package/dist/clean.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var del = require('del')
|
|
4
|
-
|
|
5
4
|
var gulpConfig = require('../gulp.config.js')
|
|
6
|
-
/**
|
|
7
|
-
* Deletes all the distribution and browser files (used before create a new build).
|
|
8
|
-
* @returns {Promise<string[]> | *}
|
|
9
|
-
*/
|
|
10
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Deletes all the distribution and browser files (used before create a new build).
|
|
8
|
+
* @returns {Promise<string[]> | *}
|
|
9
|
+
*/
|
|
11
10
|
var clean = function clean () {
|
|
12
11
|
return del([gulpConfig.distPath, gulpConfig.browserPath])
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
module.exports = clean
|
package/dist/compileReadme.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var addToReadme = require('./addToReadme')
|
|
4
|
-
|
|
5
4
|
var readmeTemplate = require('./readmeTemplate')
|
|
6
|
-
|
|
7
5
|
var _require = require('gulp')
|
|
8
6
|
var series = _require.series
|
|
7
|
+
|
|
9
8
|
/**
|
|
10
9
|
* Generate the README.md file based off of the template, then append the generated documentation.
|
|
11
10
|
*/
|
|
12
|
-
|
|
13
11
|
var compileReadme = series(readmeTemplate, addToReadme)
|
|
14
12
|
module.exports = compileReadme
|
package/dist/default.js
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _require = require('gulp')
|
|
4
4
|
var series = _require.series
|
|
5
|
-
|
|
6
5
|
var dist = require('./dist')
|
|
7
|
-
|
|
8
6
|
var bundle = require('./bundle')
|
|
9
|
-
|
|
10
7
|
var gulpConfig = require('../gulp.config')
|
|
8
|
+
|
|
11
9
|
/**
|
|
12
10
|
* Recommended as the default task, runs the simple dist and bundle tasks.
|
|
13
11
|
*/
|
|
14
|
-
|
|
15
12
|
var defaultCmd = gulpConfig.nodeOnly ? series(dist) : series(dist, bundle)
|
|
16
13
|
module.exports = defaultCmd
|
package/dist/dist.js
CHANGED
package/dist/distFor.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var babel = require('gulp-babel')
|
|
4
|
-
|
|
5
4
|
var _require = require('gulp')
|
|
6
5
|
var dest = _require.dest
|
|
7
6
|
var src = _require.src
|
|
8
|
-
|
|
9
7
|
var gulpConfig = require('../gulp.config.js')
|
|
8
|
+
|
|
10
9
|
/**
|
|
11
10
|
* Build the distribution for a given source pattern.
|
|
12
11
|
* @param {string|array} srcPath
|
|
13
12
|
* @param {string} destPath
|
|
14
13
|
* @returns {*}
|
|
15
14
|
*/
|
|
16
|
-
|
|
17
15
|
var distFor = function distFor () {
|
|
18
16
|
var srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.srcSearch
|
|
19
17
|
var destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.distPath
|
|
20
18
|
return src(srcPath).pipe(babel()).pipe(dest(destPath))
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
module.exports = distFor
|
package/dist/distLint.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
var gulpConfig = require('../gulp.config.js')
|
|
4
|
-
|
|
5
4
|
var _require = require('gulp')
|
|
6
5
|
var dest = _require.dest
|
|
7
6
|
var src = _require.src
|
|
8
|
-
|
|
9
7
|
var standard = require('gulp-standard')
|
|
8
|
+
|
|
10
9
|
/**
|
|
11
10
|
* Applies Standard code style linting to distribution files.
|
|
12
11
|
* @returns {*}
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
var distLint = function distLint () {
|
|
16
14
|
return src(gulpConfig.distSearch).pipe(standard({
|
|
17
15
|
fix: true
|
|
@@ -20,5 +18,4 @@ var distLint = function distLint () {
|
|
|
20
18
|
quiet: true
|
|
21
19
|
})).pipe(dest(gulpConfig.distPath))
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
module.exports = distLint
|
package/dist/distMinify.js
CHANGED
|
@@ -3,22 +3,18 @@
|
|
|
3
3
|
var _require = require('gulp')
|
|
4
4
|
var dest = _require.dest
|
|
5
5
|
var src = _require.src
|
|
6
|
-
|
|
7
6
|
var gulpConfig = require('../gulp.config.js')
|
|
8
|
-
|
|
9
7
|
var _require2 = require('gulp-uglify-es')
|
|
10
8
|
var uglify = _require2.default
|
|
11
|
-
|
|
12
9
|
var rename = require('gulp-rename')
|
|
10
|
+
|
|
13
11
|
/**
|
|
14
12
|
* Creates minified versions of the dist files.
|
|
15
13
|
* @returns {*}
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
15
|
var distMinify = function distMinify () {
|
|
19
16
|
return src(gulpConfig.distSearch).pipe(uglify()).pipe(rename({
|
|
20
17
|
extname: '.min.js'
|
|
21
18
|
})).pipe(dest(gulpConfig.distPath))
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
module.exports = distMinify
|
package/dist/readmeTemplate.js
CHANGED
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
var _require = require('gulp')
|
|
4
4
|
var dest = _require.dest
|
|
5
5
|
var src = _require.src
|
|
6
|
-
|
|
7
6
|
var gulpConfig = require('../gulp.config.js')
|
|
8
|
-
|
|
9
7
|
var rename = require('gulp-rename')
|
|
8
|
+
|
|
10
9
|
/**
|
|
11
10
|
* Copy a readme template into the README.md file.
|
|
12
11
|
* @returns {*}
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
var readmeTemplate = function readmeTemplate () {
|
|
16
14
|
return src(gulpConfig.readmeTemplate).pipe(rename('README.md')).pipe(dest('.'))
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
module.exports = readmeTemplate
|