js-build-tools 2.3.0 → 2.4.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/dist/bundle.js +12 -12
- package/dist/bundleLint.js +17 -17
- package/dist/bundleMinify.js +8 -8
- package/dist/dist.js +7 -7
- 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/clean.js +10 -10
- package/dist/partials/distFor.js +16 -16
- package/dist/partials/distForSrc.js +9 -9
- package/dist/partials/distSeries.js +19 -19
- package/dist/partials/minifyFor.js +15 -15
- package/dist/partials/readmeTemplate.js +11 -11
- package/dist/partials/removeDirectory.js +17 -17
- package/dist/partials/runOnChange.js +26 -26
- package/dist/partials/tsFor.js +20 -20
- package/dist/sass.js +7 -7
- package/dist/test-helpers/circularObject.js +45 -45
- package/dist/test-helpers/countMatches.js +4 -4
- package/dist/test-helpers/deepReferenceObject.js +15 -15
- package/dist/test-helpers/domItem.js +28 -28
- package/dist/test-helpers/jsonDom.js +15 -15
- package/dist/test-helpers/linkedList.js +18 -18
- package/dist/test-helpers/logObject.js +12 -12
- package/dist/test-helpers/multiReferenceObject.js +15 -15
- package/dist/test-helpers/nodeTree.js +23 -23
- package/dist/testFull.js +17 -17
- package/dist/testHelpers.js +26 -26
- package/dist/testQuick.js +19 -19
- package/dist/typeScript.js +7 -7
- package/dist/watchFull.js +10 -10
- package/dist/watchTest.js +13 -13
- package/functions/partials/removeDirectory.js +23 -23
- package/jsdoc.base.js +10 -0
- package/package.json +3 -2
package/dist/bundle.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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
|
* @function
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @returns {stream.Stream}
|
|
15
|
-
*/
|
|
16
|
-
const bundle = () => browserify(gulpConfig.get('distMain')).bundle().pipe(source(`${gulpConfig.get('browserName')}.js`)).pipe(dest(gulpConfig.get('browserPath')))
|
|
17
|
-
module.exports = bundle
|
|
15
|
+
*/
|
|
16
|
+
const bundle = () => browserify(gulpConfig.get('distMain')).bundle().pipe(source(`${gulpConfig.get('browserName')}.js`)).pipe(dest(gulpConfig.get('browserPath')))
|
|
17
|
+
module.exports = bundle
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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
|
* @function
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @returns {stream.Stream}
|
|
15
|
-
*/
|
|
16
|
-
const bundleLint = () => src(`${gulpConfig.get('browserPath')}/${gulpConfig.get('browserName')}.js`).pipe(standard({
|
|
17
|
-
fix: true
|
|
18
|
-
})).pipe(standard.reporter('default', {
|
|
19
|
-
fix: true,
|
|
20
|
-
quiet: true
|
|
21
|
-
})).pipe(dest(gulpConfig.get('browserPath')))
|
|
22
|
-
module.exports = bundleLint
|
|
15
|
+
*/
|
|
16
|
+
const bundleLint = () => src(`${gulpConfig.get('browserPath')}/${gulpConfig.get('browserName')}.js`).pipe(standard({
|
|
17
|
+
fix: true
|
|
18
|
+
})).pipe(standard.reporter('default', {
|
|
19
|
+
fix: true,
|
|
20
|
+
quiet: true
|
|
21
|
+
})).pipe(dest(gulpConfig.get('browserPath')))
|
|
22
|
+
module.exports = bundleLint
|
package/dist/bundleMinify.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
* @function
|
|
9
9
|
* @memberOf module:js-build-tools
|
|
10
10
|
* @returns {*}
|
|
11
|
-
*/
|
|
12
|
-
const bundleMinify = () => minifyFor(`${gulpConfig.get('browserPath')}/${gulpConfig.get('browserName')}.js`, gulpConfig.get('browserPath'))
|
|
13
|
-
module.exports = bundleMinify
|
|
11
|
+
*/
|
|
12
|
+
const bundleMinify = () => minifyFor(`${gulpConfig.get('browserPath')}/${gulpConfig.get('browserName')}.js`, gulpConfig.get('browserPath'))
|
|
13
|
+
module.exports = bundleMinify
|
package/dist/dist.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const distFor = require('./partials/distFor.js')
|
|
4
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const distFor = require('./partials/distFor.js')
|
|
4
|
+
|
|
5
5
|
/**
|
|
6
6
|
* Simplified distribution tasks which will use arguments from distFor.
|
|
7
7
|
* @function
|
|
8
8
|
* @memberOf module:js-build-tools
|
|
9
9
|
* @returns {*}
|
|
10
|
-
*/
|
|
11
|
-
const dist = () => distFor()
|
|
12
|
-
module.exports = dist
|
|
10
|
+
*/
|
|
11
|
+
const dist = () => distFor()
|
|
12
|
+
module.exports = dist
|
package/dist/distLint.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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
|
* @function
|
|
13
13
|
* @memberOf module:js-build-tools
|
|
14
14
|
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const distLint = () => src(gulpConfig.get('distSearch')).pipe(standard({
|
|
17
|
-
fix: true
|
|
18
|
-
})).pipe(standard.reporter('default', {
|
|
19
|
-
fix: true,
|
|
20
|
-
quiet: true
|
|
21
|
-
})).pipe(dest(gulpConfig.get('distPath')))
|
|
22
|
-
module.exports = distLint
|
|
15
|
+
*/
|
|
16
|
+
const distLint = () => src(gulpConfig.get('distSearch')).pipe(standard({
|
|
17
|
+
fix: true
|
|
18
|
+
})).pipe(standard.reporter('default', {
|
|
19
|
+
fix: true,
|
|
20
|
+
quiet: true
|
|
21
|
+
})).pipe(dest(gulpConfig.get('distPath')))
|
|
22
|
+
module.exports = distLint
|
package/dist/distMinify.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
* @function
|
|
9
9
|
* @memberOf module:js-build-tools
|
|
10
10
|
* @returns {*}
|
|
11
|
-
*/
|
|
12
|
-
const distMinify = () => minifyFor(gulpConfig.get('distSearch'), gulpConfig.get('distPath'))
|
|
13
|
-
module.exports = distMinify
|
|
11
|
+
*/
|
|
12
|
+
const distMinify = () => minifyFor(gulpConfig.get('distSearch'), gulpConfig.get('distPath'))
|
|
13
|
+
module.exports = distMinify
|
|
@@ -1,20 +1,20 @@
|
|
|
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
|
* @function
|
|
14
14
|
* @memberOf module:partials
|
|
15
15
|
* @returns {string|Uint8Array}
|
|
16
|
-
*/
|
|
17
|
-
const addToReadme = () => jsdoc2md.render({
|
|
18
|
-
files: globSync(gulpConfig.get('readmeSearch'))
|
|
19
|
-
}).then(readme => fs.appendFileSync(gulpConfig.get('readmePath') + gulpConfig.get('readmeFile'), readme, gulpConfig.get('readmeOptions')));
|
|
16
|
+
*/
|
|
17
|
+
const addToReadme = () => jsdoc2md.render({
|
|
18
|
+
files: globSync(gulpConfig.get('readmeSearch'))
|
|
19
|
+
}).then(readme => fs.appendFileSync(gulpConfig.get('readmePath') + gulpConfig.get('readmeFile'), readme, gulpConfig.get('readmeOptions')));
|
|
20
20
|
module.exports = addToReadme;
|
|
@@ -1,15 +1,15 @@
|
|
|
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
|
* @function
|
|
11
11
|
* @memberOf module:partials
|
|
12
12
|
* @returns {FSWatcher}
|
|
13
|
-
*/
|
|
14
|
-
const beginWatcher = () => watch(gulpConfig.get('watchSearch'));
|
|
13
|
+
*/
|
|
14
|
+
const beginWatcher = () => watch(gulpConfig.get('watchSearch'));
|
|
15
15
|
module.exports = beginWatcher;
|
package/dist/partials/clean.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.async-iterator.reduce.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.reduce.js");
|
|
6
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
7
|
-
const removeDirectory = require('./removeDirectory');
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.async-iterator.reduce.js");
|
|
4
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
|
+
require("core-js/modules/esnext.iterator.reduce.js");
|
|
6
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
7
|
+
const removeDirectory = require('./removeDirectory');
|
|
8
|
+
|
|
9
9
|
/**
|
|
10
10
|
* Deletes all the distribution and browser files (used before create a new build).
|
|
11
11
|
* Configure array of directories to remove with 'cleanPaths'.
|
|
12
12
|
* @function
|
|
13
13
|
* @memberOf module:partials
|
|
14
14
|
* @returns {Promise<string[]> | *}
|
|
15
|
-
*/
|
|
16
|
-
const clean = () => gulpConfig.get('cleanPaths').reduce((promise, path) => promise.then(() => removeDirectory(path)), Promise.resolve());
|
|
15
|
+
*/
|
|
16
|
+
const clean = () => gulpConfig.get('cleanPaths').reduce((promise, path) => promise.then(() => removeDirectory(path)), Promise.resolve());
|
|
17
17
|
module.exports = clean;
|
package/dist/partials/distFor.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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
|
* @function
|
|
@@ -15,10 +15,10 @@ const gulpConfig = require('../../gulp.config.js');
|
|
|
15
15
|
* @param {string|array} [srcPath='src/config/path/dist/for']
|
|
16
16
|
* @param {string} [destPath='dist/config/path']
|
|
17
17
|
* @returns {stream.Stream}
|
|
18
|
-
*/
|
|
19
|
-
const distFor = function () {
|
|
20
|
-
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
21
|
-
let destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
22
|
-
return src(srcPath).pipe(babel()).pipe(dest(destPath));
|
|
23
|
-
};
|
|
18
|
+
*/
|
|
19
|
+
const distFor = function () {
|
|
20
|
+
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
21
|
+
let destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
22
|
+
return src(srcPath).pipe(babel()).pipe(dest(destPath));
|
|
23
|
+
};
|
|
24
24
|
module.exports = distFor;
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
* @function
|
|
8
8
|
* @memberOf module:partials
|
|
9
9
|
* @param {module:gulpConfig~FlagStringSetting} [useTs='config/for/ts']
|
|
10
10
|
* @returns {string}
|
|
11
|
-
*/
|
|
12
|
-
const distForSrc = function () {
|
|
13
|
-
let useTs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('useTsConfig');
|
|
14
|
-
return useTs ? gulpConfig.get('distSearch') : gulpConfig.get('srcSearch');
|
|
15
|
-
};
|
|
11
|
+
*/
|
|
12
|
+
const distForSrc = function () {
|
|
13
|
+
let useTs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('useTsConfig');
|
|
14
|
+
return useTs ? gulpConfig.get('distSearch') : gulpConfig.get('srcSearch');
|
|
15
|
+
};
|
|
16
16
|
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
|
* @function
|
|
@@ -16,13 +16,13 @@ const tsFor = require('./tsFor');
|
|
|
16
16
|
* @param {string} [distFinalPath='dist/config/path']
|
|
17
17
|
* @param {string} [tsSearch='ts/search/config/path']
|
|
18
18
|
* @returns {function(null=): stream.Stream}
|
|
19
|
-
*/
|
|
20
|
-
const distSeries = function () {
|
|
21
|
-
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
22
|
-
let distFinalPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
23
|
-
let tsSearch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gulpConfig.get('tsSearch');
|
|
24
|
-
const typescript = tsFor(tsSearch, distFinalPath);
|
|
25
|
-
const dist = () => distFor(srcPath, distFinalPath);
|
|
26
|
-
return gulpConfig.get('useTsConfig') ? series(typescript, dist) : dist;
|
|
27
|
-
};
|
|
19
|
+
*/
|
|
20
|
+
const distSeries = function () {
|
|
21
|
+
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : distForSrc();
|
|
22
|
+
let distFinalPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
23
|
+
let tsSearch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gulpConfig.get('tsSearch');
|
|
24
|
+
const typescript = tsFor(tsSearch, distFinalPath);
|
|
25
|
+
const dist = () => distFor(srcPath, distFinalPath);
|
|
26
|
+
return gulpConfig.get('useTsConfig') ? series(typescript, dist) : dist;
|
|
27
|
+
};
|
|
28
28
|
module.exports = distSeries;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
dest,
|
|
5
|
-
src
|
|
6
|
-
} = require('gulp');
|
|
7
|
-
const {
|
|
8
|
-
default: uglify
|
|
9
|
-
} = require('gulp-uglify-es');
|
|
10
|
-
const rename = require('gulp-rename');
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp');
|
|
7
|
+
const {
|
|
8
|
+
default: uglify
|
|
9
|
+
} = require('gulp-uglify-es');
|
|
10
|
+
const rename = require('gulp-rename');
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Minify files and rename the output with '.min' extension.
|
|
14
14
|
* @function
|
|
15
15
|
* @memberOf module:partials
|
|
16
16
|
* @returns {*}
|
|
17
|
-
*/
|
|
18
|
-
const minifyFor = (srcSearch, destination) => src(srcSearch).pipe(uglify()).pipe(rename({
|
|
19
|
-
extname: '.min.js'
|
|
20
|
-
})).pipe(dest(destination));
|
|
17
|
+
*/
|
|
18
|
+
const minifyFor = (srcSearch, destination) => src(srcSearch).pipe(uglify()).pipe(rename({
|
|
19
|
+
extname: '.min.js'
|
|
20
|
+
})).pipe(dest(destination));
|
|
21
21
|
module.exports = minifyFor;
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
* @function
|
|
13
13
|
* @memberOf module:partials
|
|
14
14
|
* @returns {*}
|
|
15
|
-
*/
|
|
16
|
-
const readmeTemplate = () => src(gulpConfig.get('readmeTemplate')).pipe(rename(gulpConfig.get('readmeFile'))).pipe(dest(gulpConfig.get('readmePath')));
|
|
15
|
+
*/
|
|
16
|
+
const readmeTemplate = () => src(gulpConfig.get('readmeTemplate')).pipe(rename(gulpConfig.get('readmeFile'))).pipe(dest(gulpConfig.get('readmePath')));
|
|
17
17
|
module.exports = readmeTemplate;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
rm,
|
|
5
|
-
exists
|
|
6
|
-
} = require('fs');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Return a promise to be completed once the specified directory is deleted.
|
|
10
|
-
* @function
|
|
11
|
-
* @memberOf module:partials
|
|
12
|
-
* @param {string} dirPath
|
|
13
|
-
* @returns {Promise<*>}
|
|
14
|
-
*/
|
|
15
|
-
const removeDirectory = dirPath => new Promise((resolve, reject) => exists(dirPath, doesExist => doesExist ? rm(dirPath, {
|
|
16
|
-
recursive: true
|
|
17
|
-
}, error => error ? reject(error) : resolve(dirPath)) : resolve(dirPath)));
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
rm,
|
|
5
|
+
exists
|
|
6
|
+
} = require('fs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Return a promise to be completed once the specified directory is deleted.
|
|
10
|
+
* @function
|
|
11
|
+
* @memberOf module:partials
|
|
12
|
+
* @param {string} dirPath
|
|
13
|
+
* @returns {Promise<*>}
|
|
14
|
+
*/
|
|
15
|
+
const removeDirectory = dirPath => new Promise((resolve, reject) => exists(dirPath, doesExist => doesExist ? rm(dirPath, {
|
|
16
|
+
recursive: true
|
|
17
|
+
}, error => error ? reject(error) : resolve(dirPath)) : resolve(dirPath)));
|
|
18
18
|
module.exports = removeDirectory;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
4
|
-
const bundle = require('../bundle');
|
|
5
|
-
const distSeries = require('./distSeries');
|
|
6
|
-
const {
|
|
7
|
-
parallel,
|
|
8
|
-
series
|
|
9
|
-
} = require('gulp');
|
|
10
|
-
const testQuick = require('../testQuick');
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
4
|
+
const bundle = require('../bundle');
|
|
5
|
+
const distSeries = require('./distSeries');
|
|
6
|
+
const {
|
|
7
|
+
parallel,
|
|
8
|
+
series
|
|
9
|
+
} = require('gulp');
|
|
10
|
+
const testQuick = require('../testQuick');
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Run this function when the watched files are modified.
|
|
14
14
|
* 1. Find the sub-folders within src path
|
|
@@ -34,11 +34,11 @@ const testQuick = require('../testQuick');
|
|
|
34
34
|
* @memberOf module:partials
|
|
35
35
|
* @param {string} path
|
|
36
36
|
* @returns {stream.Stream}
|
|
37
|
-
*/
|
|
38
|
-
const runOnChange = path => {
|
|
39
|
-
const useTs = gulpConfig.get('useTsConfig');
|
|
40
|
-
const distPath = gulpConfig.get('distPath');
|
|
41
|
-
const srcPath = gulpConfig.get('srcPath');
|
|
37
|
+
*/
|
|
38
|
+
const runOnChange = path => {
|
|
39
|
+
const useTs = gulpConfig.get('useTsConfig');
|
|
40
|
+
const distPath = gulpConfig.get('distPath');
|
|
41
|
+
const srcPath = gulpConfig.get('srcPath');
|
|
42
42
|
/**
|
|
43
43
|
* 1. The original path comes in from src and is a .ts
|
|
44
44
|
* 2. Discover the outgoing dist path where that file should go
|
|
@@ -46,14 +46,14 @@ const runOnChange = path => {
|
|
|
46
46
|
* 4. Take the original path, convert to full file path in dist
|
|
47
47
|
* 5. Use the dist path found previously in #2
|
|
48
48
|
* 6. Use the full dist path and the dist outgoing path in distFor
|
|
49
|
-
*/
|
|
50
|
-
const pathRegex = new RegExp(`^${srcPath}(.*\\/)(.+)\\.(js|ts)$`, 'i');
|
|
51
|
-
const distPathResult = path.replace(pathRegex, `${distPath}$1`);
|
|
52
|
-
let distSrcPath = path;
|
|
53
|
-
if (useTs) {
|
|
54
|
-
distSrcPath = path.replace(pathRegex, `${distPath}$1$2.js`);
|
|
55
|
-
}
|
|
56
|
-
const runSeries = distSeries(distSrcPath, distPathResult, path);
|
|
57
|
-
return gulpConfig.get('nodeOnly') ? series(testQuick, runSeries)() : parallel(testQuick, series(runSeries, bundle))();
|
|
58
|
-
};
|
|
49
|
+
*/
|
|
50
|
+
const pathRegex = new RegExp(`^${srcPath}(.*\\/)(.+)\\.(js|ts)$`, 'i');
|
|
51
|
+
const distPathResult = path.replace(pathRegex, `${distPath}$1`);
|
|
52
|
+
let distSrcPath = path;
|
|
53
|
+
if (useTs) {
|
|
54
|
+
distSrcPath = path.replace(pathRegex, `${distPath}$1$2.js`);
|
|
55
|
+
}
|
|
56
|
+
const runSeries = distSeries(distSrcPath, distPathResult, path);
|
|
57
|
+
return gulpConfig.get('nodeOnly') ? series(testQuick, runSeries)() : parallel(testQuick, series(runSeries, bundle))();
|
|
58
|
+
};
|
|
59
59
|
module.exports = runOnChange;
|
package/dist/partials/tsFor.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
dest,
|
|
5
|
-
parallel,
|
|
6
|
-
src
|
|
7
|
-
} = require('gulp');
|
|
8
|
-
const gulpConfig = require('../../gulp.config.js');
|
|
9
|
-
const ts = require('gulp-typescript');
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
parallel,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp');
|
|
8
|
+
const gulpConfig = require('../../gulp.config.js');
|
|
9
|
+
const ts = require('gulp-typescript');
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* Starting at the source directory, find all the ts files and convert them into the distribution directory.
|
|
13
13
|
* @function
|
|
@@ -16,14 +16,14 @@ const ts = require('gulp-typescript');
|
|
|
16
16
|
* @param {string} [distPath='']
|
|
17
17
|
* @returns {Function}
|
|
18
18
|
* @see `https://www.typescriptlang.org/docs/handbook/gulp.html` for more info
|
|
19
|
-
*/
|
|
20
|
-
const tsFor = function () {
|
|
21
|
-
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('tsSearch');
|
|
22
|
-
let distPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
23
|
-
const declarationProject = ts.createProject(gulpConfig.get('useTsConfig'));
|
|
24
|
-
const tsProject = ts.createProject(gulpConfig.get('useTsConfig'));
|
|
25
|
-
const makeDeclarations = () => src(srcPath).pipe(declarationProject()).dts.pipe(dest(distPath));
|
|
26
|
-
const compileJS = () => src(srcPath).pipe(tsProject()).js.pipe(dest(distPath));
|
|
27
|
-
return parallel(makeDeclarations, compileJS);
|
|
28
|
-
};
|
|
19
|
+
*/
|
|
20
|
+
const tsFor = function () {
|
|
21
|
+
let srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.get('tsSearch');
|
|
22
|
+
let distPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.get('distPath');
|
|
23
|
+
const declarationProject = ts.createProject(gulpConfig.get('useTsConfig'));
|
|
24
|
+
const tsProject = ts.createProject(gulpConfig.get('useTsConfig'));
|
|
25
|
+
const makeDeclarations = () => src(srcPath).pipe(declarationProject()).dts.pipe(dest(distPath));
|
|
26
|
+
const compileJS = () => src(srcPath).pipe(tsProject()).js.pipe(dest(distPath));
|
|
27
|
+
return parallel(makeDeclarations, compileJS);
|
|
28
|
+
};
|
|
29
29
|
module.exports = tsFor;
|
package/dist/sass.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const sassFor = require('./partials/sassFor')
|
|
4
|
-
|
|
5
|
-
// Compile sass into CSS & auto-inject into browsers
|
|
6
|
-
const sass = () => sassFor()
|
|
7
|
-
module.exports = sass
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const sassFor = require('./partials/sassFor')
|
|
4
|
+
|
|
5
|
+
// Compile sass into CSS & auto-inject into browsers
|
|
6
|
+
const sass = () => sassFor()
|
|
7
|
+
module.exports = sass
|