js-build-tools 3.0.0 → 3.0.2
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/dist/build.js +59 -59
- package/dist/bundle.js +12 -12
- package/dist/bundleLint.js +17 -17
- package/dist/bundleMinify.js +8 -8
- package/dist/copyFonts.js +8 -8
- package/dist/default.js +15 -15
- package/dist/distLint.js +17 -17
- package/dist/distMinify.js +8 -8
- package/dist/partials/addToReadme.js +13 -13
- package/dist/partials/beginWatcher.js +9 -9
- package/dist/partials/distFor.js +16 -16
- package/dist/partials/distForSrc.js +9 -9
- package/dist/partials/distSeries.js +19 -19
- package/dist/partials/imagesFor.js +27 -27
- package/dist/partials/readmeTemplate.js +11 -11
- package/dist/partials/runOnChange.js +27 -27
- package/dist/partials/sassFor.js +20 -20
- package/dist/partials/tsFor.js +20 -20
- package/dist/partials.js +34 -34
- package/dist/test-helpers/setUp.js +51 -51
- package/dist/testFull.js +17 -17
- package/dist/testHelpers.js +8 -8
- package/dist/testQuick.js +19 -19
- package/dist/utilities/dotGet.js +42 -42
- package/dist/utilities/dotNotate.js +50 -50
- package/dist/utilities/dotSet.js +36 -36
- package/dist/utilities/isObject.js +4 -4
- package/dist/utilities/strAfter.js +14 -0
- package/dist/utilities/strBefore.js +14 -0
- package/dist/watchTest.js +13 -13
- package/functions/utilities/dotGet.js +2 -2
- package/functions/utilities/dotSet.js +2 -2
- package/functions/utilities/strAfter.js +13 -0
- package/functions/utilities/strBefore.js +13 -0
- package/package.json +4 -4
- package/vendor/array-union/index.js +30 -30
- package/vendor/easy-transform-stream/index.js +54 -58
- package/vendor/globby/gitignore.js +96 -100
- package/vendor/globby/index.js +191 -195
- package/vendor/globby/stream-utils.js +57 -57
- package/vendor/globby/to-path.js +19 -19
- package/vendor/gulp-imagemin/index.js +5 -9
- package/vendor/gulp-plugin-extras/index.js +42 -46
- package/vendor/gulp-plugin-extras/plugin-error.js +144 -144
- package/vendor/ignore/index.js +467 -467
- package/vendor/imagemin/index.js +90 -94
- package/vendor/imagemin-gifsicle/index.js +33 -37
- package/vendor/imagemin-mozjpeg/index.js +100 -104
- package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +2 -6
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +2 -2
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +2 -6
- package/vendor/imagemin-optipng/index.js +43 -43
- package/vendor/imagemin-svgo/index.js +26 -26
- package/vendor/is-jpg/index.js +11 -11
- package/vendor/junk/index.js +48 -48
- package/vendor/mozjpeg/index.js +8 -8
- package/vendor/mozjpeg/lib/index.js +17 -17
- package/vendor/mozjpeg/package.json +49 -50
- package/vendor/mozjpeg/vendor/cjpeg +0 -0
- package/vendor/mozjpeg/vendor/source/mozjpeg.tar.gz +0 -0
- package/vendor/p-pipe/index.js +22 -26
- package/vendor/plur/index.js +31 -31
- package/vendor/pretty-bytes/index.js +70 -70
- package/vendor/slash/index.js +11 -11
package/dist/build.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
4
|
-
const bundle = require('./bundle')
|
|
5
|
-
const bundleLint = require('./bundleLint')
|
|
6
|
-
const bundleMinify = require('./bundleMinify')
|
|
7
|
-
const {
|
|
8
|
-
clean,
|
|
9
|
-
distSeries
|
|
10
|
-
} = require('./partials')
|
|
11
|
-
const compileReadme = require('./compileReadme')
|
|
12
|
-
const distLint = require('./distLint')
|
|
13
|
-
const distMinify = require('./distMinify')
|
|
14
|
-
const {
|
|
15
|
-
parallel,
|
|
16
|
-
series
|
|
17
|
-
} = require('gulp')
|
|
18
|
-
const gulpConfig = require('../gulp.config.js')
|
|
19
|
-
const copyFonts = require('./copyFonts.js')
|
|
20
|
-
const images = require('./images.js')
|
|
21
|
-
const sass = require('./sass.js')
|
|
22
|
-
const testFull = require('./testFull')
|
|
23
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/web.dom-collections.iterator.js')
|
|
4
|
+
const bundle = require('./bundle')
|
|
5
|
+
const bundleLint = require('./bundleLint')
|
|
6
|
+
const bundleMinify = require('./bundleMinify')
|
|
7
|
+
const {
|
|
8
|
+
clean,
|
|
9
|
+
distSeries
|
|
10
|
+
} = require('./partials')
|
|
11
|
+
const compileReadme = require('./compileReadme')
|
|
12
|
+
const distLint = require('./distLint')
|
|
13
|
+
const distMinify = require('./distMinify')
|
|
14
|
+
const {
|
|
15
|
+
parallel,
|
|
16
|
+
series
|
|
17
|
+
} = require('gulp')
|
|
18
|
+
const gulpConfig = require('../gulp.config.js')
|
|
19
|
+
const copyFonts = require('./copyFonts.js')
|
|
20
|
+
const images = require('./images.js')
|
|
21
|
+
const sass = require('./sass.js')
|
|
22
|
+
const testFull = require('./testFull')
|
|
23
|
+
|
|
24
24
|
/**
|
|
25
25
|
* Runs several processes to build and validate the project.
|
|
26
26
|
* Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
27
27
|
* @memberOf module:js-build-tools
|
|
28
28
|
* @returns {stream.Stream}
|
|
29
|
-
*/
|
|
30
|
-
const build = function () {
|
|
31
|
-
const done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
32
|
-
const distLintMinify = parallel(distLint, distMinify)
|
|
33
|
-
const bundleLintMinify = parallel(bundleLint, bundleMinify)
|
|
34
|
-
const buildActions = [clean, distSeries(), distLintMinify]
|
|
35
|
-
if (gulpConfig.get('typescript.enabled')) {
|
|
36
|
-
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
37
|
-
buildActions.push(compileReadme)
|
|
38
|
-
}
|
|
39
|
-
if (gulpConfig.get('browser.enabled')) {
|
|
40
|
-
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
41
|
-
buildActions.push(bundle)
|
|
42
|
-
buildActions.push(bundleLintMinify)
|
|
43
|
-
}
|
|
44
|
-
const runActions = [series(...buildActions)]
|
|
45
|
-
if (!gulpConfig.get('typescript.enabled')) {
|
|
46
|
-
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
47
|
-
runActions.push(compileReadme)
|
|
48
|
-
}
|
|
49
|
-
runActions.push(testFull)
|
|
50
|
-
if (gulpConfig.get('fonts.enabled')) {
|
|
51
|
-
// Conditionally add Fonts process
|
|
52
|
-
runActions.push(copyFonts)
|
|
53
|
-
}
|
|
54
|
-
if (gulpConfig.get('images.enabled')) {
|
|
55
|
-
// Conditionally add Images process
|
|
56
|
-
runActions.push(images)
|
|
57
|
-
}
|
|
58
|
-
if (gulpConfig.get('sass.enabled')) {
|
|
59
|
-
// Conditionally add SASS process
|
|
60
|
-
runActions.push(sass)
|
|
61
|
-
}
|
|
62
|
-
return parallel(...runActions)(done)
|
|
63
|
-
}
|
|
64
|
-
module.exports = build
|
|
29
|
+
*/
|
|
30
|
+
const build = function () {
|
|
31
|
+
const done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
32
|
+
const distLintMinify = parallel(distLint, distMinify)
|
|
33
|
+
const bundleLintMinify = parallel(bundleLint, bundleMinify)
|
|
34
|
+
const buildActions = [clean, distSeries(), distLintMinify]
|
|
35
|
+
if (gulpConfig.get('typescript.enabled')) {
|
|
36
|
+
// For ts usage, we need to run the readme on the dist directly since that is where the .js files are located
|
|
37
|
+
buildActions.push(compileReadme)
|
|
38
|
+
}
|
|
39
|
+
if (gulpConfig.get('browser.enabled')) {
|
|
40
|
+
// If not 'nodeOnly' then we also want to bundle for browser after we complete the dist directory
|
|
41
|
+
buildActions.push(bundle)
|
|
42
|
+
buildActions.push(bundleLintMinify)
|
|
43
|
+
}
|
|
44
|
+
const runActions = [series(...buildActions)]
|
|
45
|
+
if (!gulpConfig.get('typescript.enabled')) {
|
|
46
|
+
// Since we didn't run this in series after dist because of typescript, we need to run it now. Potentially faster here.
|
|
47
|
+
runActions.push(compileReadme)
|
|
48
|
+
}
|
|
49
|
+
runActions.push(testFull)
|
|
50
|
+
if (gulpConfig.get('fonts.enabled')) {
|
|
51
|
+
// Conditionally add Fonts process
|
|
52
|
+
runActions.push(copyFonts)
|
|
53
|
+
}
|
|
54
|
+
if (gulpConfig.get('images.enabled')) {
|
|
55
|
+
// Conditionally add Images process
|
|
56
|
+
runActions.push(images)
|
|
57
|
+
}
|
|
58
|
+
if (gulpConfig.get('sass.enabled')) {
|
|
59
|
+
// Conditionally add SASS process
|
|
60
|
+
runActions.push(sass)
|
|
61
|
+
}
|
|
62
|
+
return parallel(...runActions)(done)
|
|
63
|
+
}
|
|
64
|
+
module.exports = build
|
package/dist/bundle.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const browserify = require('browserify')
|
|
4
|
-
const {
|
|
5
|
-
dest
|
|
6
|
-
} = require('gulp')
|
|
7
|
-
const gulpConfig = require('../gulp.config.js')
|
|
8
|
-
const source = require('vinyl-source-stream')
|
|
9
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const browserify = require('browserify')
|
|
4
|
+
const {
|
|
5
|
+
dest
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const source = require('vinyl-source-stream')
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
12
12
|
* @memberOf module:js-build-tools
|
|
13
13
|
* @returns {stream.Stream}
|
|
14
|
-
*/
|
|
15
|
-
const bundle = () => browserify(gulpConfig.get('dist.main')).bundle().pipe(source(''.concat(gulpConfig.get('browser.name'), '.js'))).pipe(dest(gulpConfig.get('browser.to')))
|
|
16
|
-
module.exports = bundle
|
|
14
|
+
*/
|
|
15
|
+
const bundle = () => browserify(gulpConfig.get('dist.main')).bundle().pipe(source(''.concat(gulpConfig.get('browser.name'), '.js'))).pipe(dest(gulpConfig.get('browser.to')))
|
|
16
|
+
module.exports = bundle
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
dest,
|
|
5
|
-
src
|
|
6
|
-
} = require('gulp')
|
|
7
|
-
const gulpConfig = require('../gulp.config.js')
|
|
8
|
-
const standard = require('gulp-standard')
|
|
9
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const standard = require('gulp-standard')
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Applies Standard code style linting to bundled file.
|
|
12
12
|
* @memberOf module:js-build-tools
|
|
13
13
|
* @returns {stream.Stream}
|
|
14
|
-
*/
|
|
15
|
-
const bundleLint = () => src(''.concat(gulpConfig.get('browser.to'), '/').concat(gulpConfig.get('browser.name'), '.js')).pipe(standard({
|
|
16
|
-
fix: true
|
|
17
|
-
})).pipe(standard.reporter('default', {
|
|
18
|
-
fix: true,
|
|
19
|
-
quiet: true
|
|
20
|
-
})).pipe(dest(gulpConfig.get('browser.to')))
|
|
21
|
-
module.exports = bundleLint
|
|
14
|
+
*/
|
|
15
|
+
const bundleLint = () => src(''.concat(gulpConfig.get('browser.to'), '/').concat(gulpConfig.get('browser.name'), '.js')).pipe(standard({
|
|
16
|
+
fix: true
|
|
17
|
+
})).pipe(standard.reporter('default', {
|
|
18
|
+
fix: true,
|
|
19
|
+
quiet: true
|
|
20
|
+
})).pipe(dest(gulpConfig.get('browser.to')))
|
|
21
|
+
module.exports = bundleLint
|
package/dist/bundleMinify.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../gulp.config.js')
|
|
4
|
-
const minifyFor = require('./partials/minifyFor')
|
|
5
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const minifyFor = require('./partials/minifyFor')
|
|
5
|
+
|
|
6
6
|
/**
|
|
7
7
|
* Creates the minified bundle file.
|
|
8
8
|
* @memberOf module:js-build-tools
|
|
9
9
|
* @returns {*}
|
|
10
|
-
*/
|
|
11
|
-
const bundleMinify = () => minifyFor(''.concat(gulpConfig.get('browser.to'), '/').concat(gulpConfig.get('browser.name'), '.js'), gulpConfig.get('browser.to'))
|
|
12
|
-
module.exports = bundleMinify
|
|
10
|
+
*/
|
|
11
|
+
const bundleMinify = () => minifyFor(''.concat(gulpConfig.get('browser.to'), '/').concat(gulpConfig.get('browser.name'), '.js'), gulpConfig.get('browser.to'))
|
|
12
|
+
module.exports = bundleMinify
|
package/dist/copyFonts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const copyFor = require('./partials/copyFor.js')
|
|
4
|
-
const gulpConfig = require('../gulp.config.js')
|
|
5
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const copyFor = require('./partials/copyFor.js')
|
|
4
|
+
const gulpConfig = require('../gulp.config.js')
|
|
5
|
+
|
|
6
6
|
/**
|
|
7
7
|
* Move the font files into the browser directory.
|
|
8
8
|
* @memberOf module:js-build-tools
|
|
9
9
|
* @return {stream.Stream}
|
|
10
|
-
*/
|
|
11
|
-
const copyFonts = () => copyFor(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'))
|
|
12
|
-
module.exports = copyFonts
|
|
10
|
+
*/
|
|
11
|
+
const copyFonts = () => copyFor(gulpConfig.get('fonts.from'), gulpConfig.get('fonts.to'))
|
|
12
|
+
module.exports = copyFonts
|
package/dist/default.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const dist = require('./dist')
|
|
4
|
-
const bundle = require('./bundle')
|
|
5
|
-
const gulpConfig = require('../gulp.config')
|
|
6
|
-
const {
|
|
7
|
-
series
|
|
8
|
-
} = require('gulp')
|
|
9
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const dist = require('./dist')
|
|
4
|
+
const bundle = require('./bundle')
|
|
5
|
+
const gulpConfig = require('../gulp.config')
|
|
6
|
+
const {
|
|
7
|
+
series
|
|
8
|
+
} = require('gulp')
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Recommended as the default task, runs the simple dist and bundle tasks.
|
|
12
12
|
* @memberOf module:js-build-tools
|
|
13
13
|
* @param {function} [done=null]
|
|
14
14
|
* @returns {stream.Stream}
|
|
15
|
-
*/
|
|
16
|
-
const defaultCmd = function () {
|
|
17
|
-
const done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
18
|
-
return gulpConfig.get('browser.enabled') ? series(dist, bundle)(done) : series(dist)(done)
|
|
19
|
-
}
|
|
20
|
-
module.exports = defaultCmd
|
|
15
|
+
*/
|
|
16
|
+
const defaultCmd = function () {
|
|
17
|
+
const done = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
|
|
18
|
+
return gulpConfig.get('browser.enabled') ? series(dist, bundle)(done) : series(dist)(done)
|
|
19
|
+
}
|
|
20
|
+
module.exports = defaultCmd
|
package/dist/distLint.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../gulp.config.js')
|
|
4
|
-
const {
|
|
5
|
-
dest,
|
|
6
|
-
src
|
|
7
|
-
} = require('gulp')
|
|
8
|
-
const standard = require('gulp-standard')
|
|
9
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const {
|
|
5
|
+
dest,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp')
|
|
8
|
+
const standard = require('gulp-standard')
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Applies Standard code style linting to distribution files.
|
|
12
12
|
* @memberOf module:js-build-tools
|
|
13
13
|
* @returns {*}
|
|
14
|
-
*/
|
|
15
|
-
const distLint = () => src(gulpConfig.get('browser.from')).pipe(standard({
|
|
16
|
-
fix: true
|
|
17
|
-
})).pipe(standard.reporter('default', {
|
|
18
|
-
fix: true,
|
|
19
|
-
quiet: true
|
|
20
|
-
})).pipe(dest(gulpConfig.get('dist.to')))
|
|
21
|
-
module.exports = distLint
|
|
14
|
+
*/
|
|
15
|
+
const distLint = () => src(gulpConfig.get('browser.from')).pipe(standard({
|
|
16
|
+
fix: true
|
|
17
|
+
})).pipe(standard.reporter('default', {
|
|
18
|
+
fix: true,
|
|
19
|
+
quiet: true
|
|
20
|
+
})).pipe(dest(gulpConfig.get('dist.to')))
|
|
21
|
+
module.exports = distLint
|
package/dist/distMinify.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../gulp.config.js')
|
|
4
|
-
const minifyFor = require('./partials/minifyFor')
|
|
5
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const minifyFor = require('./partials/minifyFor')
|
|
5
|
+
|
|
6
6
|
/**
|
|
7
7
|
* Creates minified versions of the dist files.
|
|
8
8
|
* @memberOf module:js-build-tools
|
|
9
9
|
* @returns {*}
|
|
10
|
-
*/
|
|
11
|
-
const distMinify = () => minifyFor(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'))
|
|
12
|
-
module.exports = distMinify
|
|
10
|
+
*/
|
|
11
|
+
const distMinify = () => minifyFor(gulpConfig.get('browser.from'), gulpConfig.get('dist.to'))
|
|
12
|
+
module.exports = distMinify
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
5
|
-
const jsdoc2md = require('jsdoc-to-markdown');
|
|
6
|
-
const {
|
|
7
|
-
globSync
|
|
8
|
-
} = require('glob');
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
5
|
+
const jsdoc2md = require('jsdoc-to-markdown');
|
|
6
|
+
const {
|
|
7
|
+
globSync
|
|
8
|
+
} = require('glob');
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
12
12
|
* Configure this with 'readmeSearch', 'readmePath', 'readmeFile', and 'readmeOptions'.
|
|
13
13
|
* @memberOf module:partials
|
|
14
14
|
* @returns {string|Uint8Array}
|
|
15
|
-
*/
|
|
16
|
-
const addToReadme = () => jsdoc2md.render({
|
|
17
|
-
files: globSync(gulpConfig.get('readme.from'))
|
|
18
|
-
}).then(readme => fs.appendFileSync(gulpConfig.get('readme.to') + gulpConfig.get('readme.file'), readme, gulpConfig.get('readmeOptions')));
|
|
15
|
+
*/
|
|
16
|
+
const addToReadme = () => jsdoc2md.render({
|
|
17
|
+
files: globSync(gulpConfig.get('readme.from'))
|
|
18
|
+
}).then(readme => fs.appendFileSync(gulpConfig.get('readme.to') + gulpConfig.get('readme.file'), readme, gulpConfig.get('readmeOptions')));
|
|
19
19
|
module.exports = addToReadme;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
4
|
-
const {
|
|
5
|
-
watch
|
|
6
|
-
} = require('gulp');
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
4
|
+
const {
|
|
5
|
+
watch
|
|
6
|
+
} = require('gulp');
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* Create a chokidar instance which watches and triggers change when the globed files are modified.
|
|
10
10
|
* @memberOf module:partials
|
|
11
11
|
* @returns {FSWatcher}
|
|
12
|
-
*/
|
|
13
|
-
const beginWatcher = () => watch(gulpConfig.get('test.watch'));
|
|
12
|
+
*/
|
|
13
|
+
const beginWatcher = () => watch(gulpConfig.get('test.watch'));
|
|
14
14
|
module.exports = beginWatcher;
|
package/dist/partials/distFor.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const babel = require('gulp-babel');
|
|
4
|
-
const {
|
|
5
|
-
dest,
|
|
6
|
-
src
|
|
7
|
-
} = require('gulp');
|
|
8
|
-
const distForSrc = require('./distForSrc');
|
|
9
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const babel = require('gulp-babel');
|
|
4
|
+
const {
|
|
5
|
+
dest,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp');
|
|
8
|
+
const distForSrc = require('./distForSrc');
|
|
9
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* Build the distribution for a given source pattern.
|
|
13
13
|
* @memberOf module:partials
|
|
14
14
|
* @param {string|array} [srcPath='src/config/path/dist/for']
|
|
15
15
|
* @param {string} [destPath='dist/config/path']
|
|
16
16
|
* @returns {stream.Stream}
|
|
17
|
-
*/
|
|
18
|
-
const distFor = function () {
|
|
19
|
-
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
20
|
-
let destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('dist.to');
|
|
21
|
-
return src(srcPath).pipe(babel()).pipe(dest(destPath));
|
|
22
|
-
};
|
|
17
|
+
*/
|
|
18
|
+
const distFor = function () {
|
|
19
|
+
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
20
|
+
let destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('dist.to');
|
|
21
|
+
return src(srcPath).pipe(babel()).pipe(dest(destPath));
|
|
22
|
+
};
|
|
23
23
|
module.exports = distFor;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../../gulp.config');
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../../gulp.config');
|
|
4
|
+
|
|
5
5
|
/**
|
|
6
6
|
* Retrieve the correct distFor search path based on TS Config.
|
|
7
7
|
* @memberOf module:partials
|
|
8
8
|
* @param {module:gulpConfig~FlagStringSetting} [useTs='config/for/ts']
|
|
9
9
|
* @returns {string}
|
|
10
|
-
*/
|
|
11
|
-
const distForSrc = function () {
|
|
12
|
-
let useTs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('typescript.enabled');
|
|
13
|
-
return useTs ? gulpConfig.get('browser.from') : gulpConfig.get('dist.from');
|
|
14
|
-
};
|
|
10
|
+
*/
|
|
11
|
+
const distForSrc = function () {
|
|
12
|
+
let useTs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('typescript.enabled');
|
|
13
|
+
return useTs ? gulpConfig.get('browser.from') : gulpConfig.get('dist.from');
|
|
14
|
+
};
|
|
15
15
|
module.exports = distForSrc;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../../gulp.config');
|
|
4
|
-
const distFor = require('./distFor');
|
|
5
|
-
const distForSrc = require('./distForSrc');
|
|
6
|
-
const {
|
|
7
|
-
series
|
|
8
|
-
} = require('gulp');
|
|
9
|
-
const tsFor = require('./tsFor');
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../../gulp.config');
|
|
4
|
+
const distFor = require('./distFor');
|
|
5
|
+
const distForSrc = require('./distForSrc');
|
|
6
|
+
const {
|
|
7
|
+
series
|
|
8
|
+
} = require('gulp');
|
|
9
|
+
const tsFor = require('./tsFor');
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* When using TypeScript, ensure that we process the ts first then run babel (dist)
|
|
13
13
|
* @memberOf module:partials
|
|
@@ -15,13 +15,13 @@ const tsFor = require('./tsFor');
|
|
|
15
15
|
* @param {string} [distFinalPath='dist/config/path']
|
|
16
16
|
* @param {string} [tsSearch='ts/search/config/path']
|
|
17
17
|
* @returns {function(null=): stream.Stream}
|
|
18
|
-
*/
|
|
19
|
-
const distSeries = function () {
|
|
20
|
-
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
21
|
-
let distFinalPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('dist.to');
|
|
22
|
-
let tsSearch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gulpConfig.get('typescript.from');
|
|
23
|
-
const typescript = tsFor(tsSearch, distFinalPath);
|
|
24
|
-
const dist = () => distFor(srcPath, distFinalPath);
|
|
25
|
-
return gulpConfig.get('typescript.enabled') ? series(typescript, dist) : dist;
|
|
26
|
-
};
|
|
18
|
+
*/
|
|
19
|
+
const distSeries = function () {
|
|
20
|
+
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
21
|
+
let distFinalPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('dist.to');
|
|
22
|
+
let tsSearch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gulpConfig.get('typescript.from');
|
|
23
|
+
const typescript = tsFor(tsSearch, distFinalPath);
|
|
24
|
+
const dist = () => distFor(srcPath, distFinalPath);
|
|
25
|
+
return gulpConfig.get('typescript.enabled') ? series(typescript, dist) : dist;
|
|
26
|
+
};
|
|
27
27
|
module.exports = distSeries;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const cache = require('gulp-cache');
|
|
4
|
-
const {
|
|
5
|
-
dest,
|
|
6
|
-
src
|
|
7
|
-
} = require('gulp');
|
|
8
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
9
|
-
let imagemin = content => content;
|
|
10
|
-
try {
|
|
11
|
-
imagemin = require('../../vendor/gulp-imagemin').default;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
// It didn't get created yet
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const cache = require('gulp-cache');
|
|
4
|
+
const {
|
|
5
|
+
dest,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp');
|
|
8
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
9
|
+
let imagemin = content => content;
|
|
10
|
+
try {
|
|
11
|
+
imagemin = require('../../vendor/gulp-imagemin').default;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
// It didn't get created yet
|
|
14
|
+
}
|
|
15
|
+
|
|
16
16
|
/**
|
|
17
17
|
* Move and optimize images into the browser directory.
|
|
18
18
|
* @memberOf module:partials
|
|
19
19
|
* @param {string|array} [imageSrc=src/images/pattern]
|
|
20
20
|
* @param {string} [imageDest=dest/image/folder]
|
|
21
21
|
* @return {stream.Stream}
|
|
22
|
-
*/
|
|
23
|
-
const imagesFor = function () {
|
|
24
|
-
let imageSrc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('images.from');
|
|
25
|
-
let imageDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('images.to');
|
|
26
|
-
return src(imageSrc).pipe(
|
|
27
|
-
// Caching images that ran through imagemin
|
|
28
|
-
cache(imagemin({
|
|
29
|
-
interlaced: true,
|
|
30
|
-
silent: true,
|
|
31
|
-
verbose: false
|
|
32
|
-
}))).pipe(dest(imageDest));
|
|
33
|
-
};
|
|
22
|
+
*/
|
|
23
|
+
const imagesFor = function () {
|
|
24
|
+
let imageSrc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('images.from');
|
|
25
|
+
let imageDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('images.to');
|
|
26
|
+
return src(imageSrc).pipe(
|
|
27
|
+
// Caching images that ran through imagemin
|
|
28
|
+
cache(imagemin({
|
|
29
|
+
interlaced: true,
|
|
30
|
+
silent: true,
|
|
31
|
+
verbose: false
|
|
32
|
+
}))).pipe(dest(imageDest));
|
|
33
|
+
};
|
|
34
34
|
module.exports = imagesFor;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
dest,
|
|
5
|
-
src
|
|
6
|
-
} = require('gulp');
|
|
7
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
8
|
-
const rename = require('gulp-rename');
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp');
|
|
7
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
8
|
+
const rename = require('gulp-rename');
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Copy a readme template into the README.md file.
|
|
12
12
|
* @memberOf module:partials
|
|
13
13
|
* @returns {*}
|
|
14
|
-
*/
|
|
15
|
-
const readmeTemplate = () => src(gulpConfig.get('readme.template')).pipe(rename(gulpConfig.get('readme.file'))).pipe(dest(gulpConfig.get('readme.to')));
|
|
14
|
+
*/
|
|
15
|
+
const readmeTemplate = () => src(gulpConfig.get('readme.template')).pipe(rename(gulpConfig.get('readme.file'))).pipe(dest(gulpConfig.get('readme.to')));
|
|
16
16
|
module.exports = readmeTemplate;
|