js-build-tools 1.2.0 → 1.2.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/addToReadme.js +9 -8
- package/dist/addToReadme.min.js +1 -1
- package/dist/build.js +15 -14
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +7 -8
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +12 -14
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +12 -13
- package/dist/bundleMinify.min.js +1 -1
- package/dist/clean.js +3 -5
- package/dist/clean.min.js +1 -1
- package/dist/compileReadme.js +6 -5
- package/dist/compileReadme.min.js +1 -1
- package/dist/default.js +7 -6
- package/dist/default.min.js +1 -1
- package/dist/dist.js +2 -4
- package/dist/dist.min.js +1 -1
- package/dist/distFor.js +9 -8
- package/dist/distFor.min.js +1 -1
- package/dist/distLint.js +12 -13
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +12 -12
- package/dist/distMinify.min.js +1 -1
- package/dist/readmeTemplate.js +7 -8
- package/dist/readmeTemplate.min.js +1 -1
- package/dist/testFull.js +5 -48
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +9 -10
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +7 -50
- package/dist/testQuick.min.js +1 -1
- package/dist/watchFull.js +14 -21
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +9 -10
- package/dist/watchTest.min.js +1 -1
- package/package.json +9 -8
package/dist/addToReadme.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Appends all the jsdoc comments to the readme file. Assumes empty or templated file.
|
|
11
12
|
* @returns {string|Uint8Array}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const addToReadme = done => {
|
|
15
|
+
const files = globSync(gulpConfig.srcSearch)
|
|
16
|
+
const readme = jsdoc2md.renderSync({
|
|
16
17
|
files: files
|
|
17
18
|
})
|
|
18
19
|
fs.appendFileSync('README.md', readme, 'utf8')
|
package/dist/addToReadme.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const fs=require("fs"),gulpConfig=require("../gulp.config.js"),jsdoc2md=require("jsdoc-to-markdown"),{globSync:globSync}=require("glob"),addToReadme=e=>{const o=globSync(gulpConfig.srcSearch),d=jsdoc2md.renderSync({files:o});fs.appendFileSync("README.md",d,"utf8"),e()};module.exports=addToReadme;
|
package/dist/build.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
const bundle = require('./bundle')
|
|
4
|
+
const bundleLint = require('./bundleLint')
|
|
5
|
+
const bundleMinify = require('./bundleMinify')
|
|
6
|
+
const clean = require('./clean')
|
|
7
|
+
const compileReadme = require('./compileReadme')
|
|
8
|
+
const dist = require('./dist')
|
|
9
|
+
const distLint = require('./distLint')
|
|
10
|
+
const distMinify = require('./distMinify')
|
|
11
|
+
const {
|
|
12
|
+
parallel,
|
|
13
|
+
series
|
|
14
|
+
} = require('gulp')
|
|
15
|
+
const gulpConfig = require('../gulp.config.js')
|
|
16
|
+
const testFull = require('./testFull')
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Runs several processes to build and validate the project.
|
|
19
20
|
* Cleans, distributes (lint and minify), bundles (lint and minify), creates the readme, then runs the tests.
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
const build = parallel(gulpConfig.nodeOnly ? series(clean, dist, parallel(distLint, distMinify)) : series(clean, dist, parallel(distLint, distMinify), bundle, parallel(bundleLint, bundleMinify)), compileReadme, testFull)
|
|
22
23
|
module.exports = build
|
package/dist/build.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const bundle=require("./bundle"),bundleLint=require("./bundleLint"),bundleMinify=require("./bundleMinify"),clean=require("./clean"),compileReadme=require("./compileReadme"),dist=require("./dist"),distLint=require("./distLint"),distMinify=require("./distMinify"),{parallel:parallel,series:series}=require("gulp"),gulpConfig=require("../gulp.config.js"),testFull=require("./testFull"),build=parallel(gulpConfig.nodeOnly?series(clean,dist,parallel(distLint,distMinify)):series(clean,dist,parallel(distLint,distMinify),bundle,parallel(bundleLint,bundleMinify)),compileReadme,testFull);module.exports=build;
|
package/dist/bundle.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Starting at the distribution entry point, bundle all the files into a single file and store them in the specified output directory.
|
|
11
12
|
* @returns {*}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
return browserify(gulpConfig.distMain).bundle().pipe(source(''.concat(gulpConfig.browserName, '.js'))).pipe(dest(gulpConfig.browserPath))
|
|
15
|
-
}
|
|
14
|
+
const bundle = () => browserify(gulpConfig.distMain).bundle().pipe(source(''.concat(gulpConfig.browserName, '.js'))).pipe(dest(gulpConfig.browserPath))
|
|
16
15
|
module.exports = bundle
|
package/dist/bundle.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const browserify=require("browserify"),{dest:dest}=require("gulp"),gulpConfig=require("../gulp.config.js"),source=require("vinyl-source-stream"),bundle=()=>browserify(gulpConfig.distMain).bundle().pipe(source("".concat(gulpConfig.browserName,".js"))).pipe(dest(gulpConfig.browserPath));module.exports=bundle;
|
package/dist/bundleLint.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const standard = require('gulp-standard')
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Applies Standard code style linting to bundled file.
|
|
12
12
|
* @returns {*}
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})).pipe(dest(gulpConfig.browserPath))
|
|
21
|
-
}
|
|
14
|
+
const bundleLint = () => src(''.concat(gulpConfig.browserPath, '/').concat(gulpConfig.browserName, '.js')).pipe(standard({
|
|
15
|
+
fix: true
|
|
16
|
+
})).pipe(standard.reporter('default', {
|
|
17
|
+
fix: true,
|
|
18
|
+
quiet: true
|
|
19
|
+
})).pipe(dest(gulpConfig.browserPath))
|
|
22
20
|
module.exports = bundleLint
|
package/dist/bundleLint.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const{dest:dest,src:src}=require("gulp"),gulpConfig=require("../gulp.config.js"),standard=require("gulp-standard"),bundleLint=()=>src("".concat(gulpConfig.browserPath,"/").concat(gulpConfig.browserName,".js")).pipe(standard({fix:!0})).pipe(standard.reporter("default",{fix:!0,quiet:!0})).pipe(dest(gulpConfig.browserPath));module.exports=bundleLint;
|
package/dist/bundleMinify.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const {
|
|
9
|
+
default: uglify
|
|
10
|
+
} = require('gulp-uglify-es')
|
|
11
|
+
const rename = require('gulp-rename')
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Creates the minified bundle file.
|
|
14
15
|
* @returns {*}
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})).pipe(dest(gulpConfig.browserPath))
|
|
20
|
-
}
|
|
17
|
+
const bundleMinify = () => src(''.concat(gulpConfig.browserPath, '/').concat(gulpConfig.browserName, '.js')).pipe(uglify()).pipe(rename({
|
|
18
|
+
extname: '.min.js'
|
|
19
|
+
})).pipe(dest(gulpConfig.browserPath))
|
|
21
20
|
module.exports = bundleMinify
|
package/dist/bundleMinify.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const{dest:dest,src:src}=require("gulp"),gulpConfig=require("../gulp.config.js"),{default:uglify}=require("gulp-uglify-es"),rename=require("gulp-rename"),bundleMinify=()=>src("".concat(gulpConfig.browserPath,"/").concat(gulpConfig.browserName,".js")).pipe(uglify()).pipe(rename({extname:".min.js"})).pipe(dest(gulpConfig.browserPath));module.exports=bundleMinify;
|
package/dist/clean.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const del = require('del')
|
|
4
|
+
const gulpConfig = require('../gulp.config.js')
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Deletes all the distribution and browser files (used before create a new build).
|
|
8
8
|
* @returns {Promise<string[]> | *}
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
return del([gulpConfig.distPath, gulpConfig.browserPath])
|
|
12
|
-
}
|
|
10
|
+
const clean = () => del([gulpConfig.distPath, gulpConfig.browserPath])
|
|
13
11
|
module.exports = clean
|
package/dist/clean.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const del=require("del"),gulpConfig=require("../gulp.config.js"),clean=()=>del([gulpConfig.distPath,gulpConfig.browserPath]);module.exports=clean;
|
package/dist/compileReadme.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const addToReadme = require('./addToReadme')
|
|
4
|
+
const readmeTemplate = require('./readmeTemplate')
|
|
5
|
+
const {
|
|
6
|
+
series
|
|
7
|
+
} = require('gulp')
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Generate the README.md file based off of the template, then append the generated documentation.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
const compileReadme = series(readmeTemplate, addToReadme)
|
|
12
13
|
module.exports = compileReadme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const addToReadme=require("./addToReadme"),readmeTemplate=require("./readmeTemplate"),{series:series}=require("gulp"),compileReadme=series(readmeTemplate,addToReadme);module.exports=compileReadme;
|
package/dist/default.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const {
|
|
4
|
+
series
|
|
5
|
+
} = require('gulp')
|
|
6
|
+
const dist = require('./dist')
|
|
7
|
+
const bundle = require('./bundle')
|
|
8
|
+
const gulpConfig = require('../gulp.config')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Recommended as the default task, runs the simple dist and bundle tasks.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
const defaultCmd = gulpConfig.nodeOnly ? series(dist) : series(dist, bundle)
|
|
13
14
|
module.exports = defaultCmd
|
package/dist/default.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const{series:series}=require("gulp"),dist=require("./dist"),bundle=require("./bundle"),gulpConfig=require("../gulp.config"),defaultCmd=gulpConfig.nodeOnly?series(dist):series(dist,bundle);module.exports=defaultCmd;
|
package/dist/dist.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const distFor = require('./distFor.js')
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Simplified distribution tasks which will use arguments from distFor.
|
|
7
7
|
* @returns {*}
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
return distFor()
|
|
11
|
-
}
|
|
9
|
+
const dist = () => distFor()
|
|
12
10
|
module.exports = dist
|
package/dist/dist.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const distFor=require("./distFor.js"),dist=()=>distFor();module.exports=dist;
|
package/dist/distFor.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const babel = require('gulp-babel')
|
|
4
|
+
const {
|
|
5
|
+
dest,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp')
|
|
8
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Build the distribution for a given source pattern.
|
|
@@ -12,9 +13,9 @@ var gulpConfig = require('../gulp.config.js')
|
|
|
12
13
|
* @param {string} destPath
|
|
13
14
|
* @returns {*}
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const distFor = function () {
|
|
17
|
+
const srcPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : gulpConfig.srcSearch
|
|
18
|
+
const destPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : gulpConfig.distPath
|
|
18
19
|
return src(srcPath).pipe(babel()).pipe(dest(destPath))
|
|
19
20
|
}
|
|
20
21
|
module.exports = distFor
|
package/dist/distFor.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const babel=require("gulp-babel"),{dest:dest,src:src}=require("gulp"),gulpConfig=require("../gulp.config.js"),distFor=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gulpConfig.srcSearch,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gulpConfig.distPath;return src(e).pipe(babel()).pipe(dest(r))};module.exports=distFor;
|
package/dist/distLint.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const {
|
|
5
|
+
dest,
|
|
6
|
+
src
|
|
7
|
+
} = require('gulp')
|
|
8
|
+
const standard = require('gulp-standard')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Applies Standard code style linting to distribution files.
|
|
11
12
|
* @returns {*}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})).pipe(dest(gulpConfig.distPath))
|
|
20
|
-
}
|
|
14
|
+
const distLint = () => src(gulpConfig.distSearch).pipe(standard({
|
|
15
|
+
fix: true
|
|
16
|
+
})).pipe(standard.reporter('default', {
|
|
17
|
+
fix: true,
|
|
18
|
+
quiet: true
|
|
19
|
+
})).pipe(dest(gulpConfig.distPath))
|
|
21
20
|
module.exports = distLint
|
package/dist/distLint.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const gulpConfig=require("../gulp.config.js"),{dest:dest,src:src}=require("gulp"),standard=require("gulp-standard"),distLint=()=>src(gulpConfig.distSearch).pipe(standard({fix:!0})).pipe(standard.reporter("default",{fix:!0,quiet:!0})).pipe(dest(gulpConfig.distPath));module.exports=distLint;
|
package/dist/distMinify.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const {
|
|
9
|
+
default: uglify
|
|
10
|
+
} = require('gulp-uglify-es')
|
|
11
|
+
const rename = require('gulp-rename')
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Creates minified versions of the dist files.
|
|
13
15
|
* @returns {*}
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})).pipe(dest(gulpConfig.distPath))
|
|
19
|
-
}
|
|
17
|
+
const distMinify = () => src(gulpConfig.distSearch).pipe(uglify()).pipe(rename({
|
|
18
|
+
extname: '.min.js'
|
|
19
|
+
})).pipe(dest(gulpConfig.distPath))
|
|
20
20
|
module.exports = distMinify
|
package/dist/distMinify.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const{dest:dest,src:src}=require("gulp"),gulpConfig=require("../gulp.config.js"),{default:uglify}=require("gulp-uglify-es"),rename=require("gulp-rename"),distMinify=()=>src(gulpConfig.distSearch).pipe(uglify()).pipe(rename({extname:".min.js"})).pipe(dest(gulpConfig.distPath));module.exports=distMinify;
|
package/dist/readmeTemplate.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const {
|
|
4
|
+
dest,
|
|
5
|
+
src
|
|
6
|
+
} = require('gulp')
|
|
7
|
+
const gulpConfig = require('../gulp.config.js')
|
|
8
|
+
const rename = require('gulp-rename')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Copy a readme template into the README.md file.
|
|
11
12
|
* @returns {*}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
return src(gulpConfig.readmeTemplate).pipe(rename('README.md')).pipe(dest('.'))
|
|
15
|
-
}
|
|
14
|
+
const readmeTemplate = () => src(gulpConfig.readmeTemplate).pipe(rename('README.md')).pipe(dest('.'))
|
|
16
15
|
module.exports = readmeTemplate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const{dest:dest,src:src}=require("gulp"),gulpConfig=require("../gulp.config.js"),rename=require("gulp-rename"),readmeTemplate=()=>src(gulpConfig.readmeTemplate).pipe(rename("README.md")).pipe(dest("."));module.exports=readmeTemplate;
|
package/dist/testFull.js
CHANGED
|
@@ -1,56 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require('
|
|
7
|
-
require('core-js/modules/es.symbol.iterator.js')
|
|
8
|
-
require('core-js/modules/es.array.iterator.js')
|
|
9
|
-
require('core-js/modules/es.string.iterator.js')
|
|
10
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
11
|
-
require('core-js/modules/es.symbol.async-iterator.js')
|
|
12
|
-
require('core-js/modules/es.symbol.to-string-tag.js')
|
|
13
|
-
require('core-js/modules/es.json.to-string-tag.js')
|
|
14
|
-
require('core-js/modules/es.math.to-string-tag.js')
|
|
15
|
-
require('core-js/modules/es.object.get-prototype-of.js')
|
|
16
|
-
require('core-js/modules/esnext.async-iterator.for-each.js')
|
|
17
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
18
|
-
require('core-js/modules/esnext.iterator.for-each.js')
|
|
19
|
-
require('core-js/modules/web.dom-collections.for-each.js')
|
|
20
|
-
require('core-js/modules/es.object.set-prototype-of.js')
|
|
21
|
-
require('core-js/modules/es.array.slice.js')
|
|
22
|
-
require('core-js/modules/es.object.to-string.js')
|
|
23
|
-
require('core-js/modules/es.promise.js')
|
|
24
|
-
function _regeneratorRuntime () { 'use strict'; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime () { return exports }; var exports = {}; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value }; var $Symbol = typeof Symbol === 'function' ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || '@@iterator'; var asyncIteratorSymbol = $Symbol.asyncIterator || '@@asyncIterator'; var toStringTagSymbol = $Symbol.toStringTag || '@@toStringTag'; function define (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key] } try { define({}, '') } catch (err) { define = function define (obj, key, value) { return obj[key] = value } } function wrap (innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); return defineProperty(generator, '_invoke', { value: makeInvokeMethod(innerFn, self, context) }), generator } function tryCatch (fn, obj, arg) { try { return { type: 'normal', arg: fn.call(obj, arg) } } catch (err) { return { type: 'throw', arg: err } } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator () {} function GeneratorFunction () {} function GeneratorFunctionPrototype () {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods (prototype) { ['next', 'throw', 'return'].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg) }) }) } function AsyncIterator (generator, PromiseImpl) { function invoke (method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type !== 'throw') { var result = record.arg; var value = result.value; return value && _typeof(value) == 'object' && hasOwn.call(value, '__await') ? PromiseImpl.resolve(value.__await).then(function (value) { invoke('next', value, resolve, reject) }, function (err) { invoke('throw', err, resolve, reject) }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result) }, function (error) { return invoke('throw', error, resolve, reject) }) } reject(record.arg) } var previousPromise; defineProperty(this, '_invoke', { value: function value (method, arg) { function callInvokeWithMethodAndArg () { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject) }) } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg() } }) } function makeInvokeMethod (innerFn, self, context) { var state = 'suspendedStart'; return function (method, arg) { if (state === 'executing') throw new Error('Generator is already running'); if (state === 'completed') { if (method === 'throw') throw arg; return doneResult() } for (context.method = method, context.arg = arg; ;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult } } if (context.method === 'next') context.sent = context._sent = context.arg; else if (context.method === 'throw') { if (state === 'suspendedStart') throw state = 'completed', context.arg; context.dispatchException(context.arg) } else context.method === 'return' && context.abrupt('return', context.arg); state = 'executing'; var record = tryCatch(innerFn, self, context); if (record.type === 'normal') { if (state = context.done ? 'completed' : 'suspendedYield', record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done } } record.type === 'throw' && (state = 'completed', context.method = 'throw', context.arg = record.arg) } } } function maybeInvokeDelegate (delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, methodName === 'throw' && delegate.iterator.return && (context.method = 'return', context.arg = undefined, maybeInvokeDelegate(delegate, context), context.method === 'throw') || methodName !== 'return' && (context.method = 'throw', context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === 'throw') return context.method = 'throw', context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, context.method !== 'return' && (context.method = 'next', context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = 'throw', context.arg = new TypeError('iterator result is not an object'), context.delegate = null, ContinueSentinel) } function pushTryEntry (locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry) } function resetTryEntry (entry) { var record = entry.completion || {}; record.type = 'normal', delete record.arg, entry.completion = record } function Context (tryLocsList) { this.tryEntries = [{ tryLoc: 'root' }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0) } function values (iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (typeof iterable.next === 'function') return iterable; if (!isNaN(iterable.length)) { var i = -1; var next = function next () { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next }; return next.next = next } } return { next: doneResult } } function doneResult () { return { value: undefined, done: !0 } } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, 'constructor', { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, 'constructor', { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, 'GeneratorFunction'), exports.isGeneratorFunction = function (genFun) { var ctor = typeof genFun === 'function' && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || (ctor.displayName || ctor.name) === 'GeneratorFunction') }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, 'GeneratorFunction')), genFun.prototype = Object.create(Gp), genFun }, exports.awrap = function (arg) { return { __await: arg } }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next() }) }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, 'Generator'), define(Gp, iteratorSymbol, function () { return this }), define(Gp, 'toString', function () { return '[object Generator]' }), exports.keys = function (val) { var object = Object(val); var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next () { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next } return next.done = !0, next } }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset (skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = 'next', this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) name.charAt(0) === 't' && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined) }, stop: function stop () { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (rootRecord.type === 'throw') throw rootRecord.arg; return this.rval }, dispatchException: function dispatchException (exception) { if (this.done) throw exception; var context = this; function handle (loc, caught) { return record.type = 'throw', record.arg = exception, context.next = loc, caught && (context.method = 'next', context.arg = undefined), !!caught } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === 'root') return handle('end'); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, 'catchLoc'); var hasFinally = hasOwn.call(entry, 'finallyLoc'); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc) } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0) } else { if (!hasFinally) throw new Error('try statement without catch or finally'); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc) } } } }, abrupt: function abrupt (type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, 'finallyLoc') && this.prev < entry.finallyLoc) { var finallyEntry = entry; break } } finallyEntry && (type === 'break' || type === 'continue') && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = 'next', this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record) }, complete: function complete (record, afterLoc) { if (record.type === 'throw') throw record.arg; return record.type === 'break' || record.type === 'continue' ? this.next = record.arg : record.type === 'return' ? (this.rval = this.arg = record.arg, this.method = 'return', this.next = 'end') : record.type === 'normal' && afterLoc && (this.next = afterLoc), ContinueSentinel }, finish: function finish (finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel } }, catch: function _catch (tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === 'throw') { var thrown = record.arg; resetTryEntry(entry) } return thrown } } throw new Error('illegal catch attempt') }, delegateYield: function delegateYield (iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, this.method === 'next' && (this.arg = undefined), ContinueSentinel } }, exports }
|
|
25
|
-
function asyncGeneratorStep (gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value } catch (error) { reject(error); return } if (info.done) { resolve(value) } else { Promise.resolve(value).then(_next, _throw) } }
|
|
26
|
-
function _asyncToGenerator (fn) { return function () { var self = this; var args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next (value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value) } function _throw (err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err) } _next(undefined) }) } }
|
|
27
|
-
var gulpConfig = require('../gulp.config.js')
|
|
28
|
-
var _require = require('jest')
|
|
29
|
-
var jest = _require.runCLI
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const {
|
|
5
|
+
runCLI: jest
|
|
6
|
+
} = require('jest')
|
|
30
7
|
|
|
31
8
|
/**
|
|
32
9
|
* Run all tests with jest.
|
|
33
10
|
* @returns {Promise<*>}
|
|
34
11
|
*/
|
|
35
|
-
|
|
36
|
-
var _ref = _asyncToGenerator(/* #__PURE__ */_regeneratorRuntime().mark(function _callee () {
|
|
37
|
-
return _regeneratorRuntime().wrap(function _callee$ (_context) {
|
|
38
|
-
while (1) {
|
|
39
|
-
switch (_context.prev = _context.next) {
|
|
40
|
-
case 0:
|
|
41
|
-
_context.next = 2
|
|
42
|
-
return jest({}, gulpConfig.testPath)
|
|
43
|
-
case 2:
|
|
44
|
-
return _context.abrupt('return', _context.sent)
|
|
45
|
-
case 3:
|
|
46
|
-
case 'end':
|
|
47
|
-
return _context.stop()
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, _callee)
|
|
51
|
-
}))
|
|
52
|
-
return function testFull () {
|
|
53
|
-
return _ref.apply(this, arguments)
|
|
54
|
-
}
|
|
55
|
-
}())
|
|
12
|
+
const testFull = async () => await jest({}, gulpConfig.testPath)
|
|
56
13
|
module.exports = testFull
|
package/dist/testFull.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const gulpConfig=require("../gulp.config.js"),{runCLI:jest}=require("jest"),testFull=async()=>await jest({},gulpConfig.testPath);module.exports=testFull;
|
package/dist/testHelpers.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
require('core-js/modules/es.object.define-property.js')
|
|
4
3
|
Object.defineProperty(exports, '__esModule', {
|
|
5
4
|
value: true
|
|
6
5
|
})
|
|
@@ -10,8 +9,8 @@ exports.nodeTree = exports.multiReferenceObject = exports.logObject = exports.li
|
|
|
10
9
|
* @param {Object} object
|
|
11
10
|
* @param {string} [label='logging']
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const logObject = function (object) {
|
|
13
|
+
const label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logging'
|
|
15
14
|
if (typeof require === 'undefined') {
|
|
16
15
|
console.log(label, object)
|
|
17
16
|
return
|
|
@@ -24,7 +23,7 @@ var logObject = function logObject (object) {
|
|
|
24
23
|
* @type {Object.<string, string|Object|Array>}
|
|
25
24
|
*/
|
|
26
25
|
exports.logObject = logObject
|
|
27
|
-
|
|
26
|
+
const circularObject = {
|
|
28
27
|
name: 'root',
|
|
29
28
|
parent: {},
|
|
30
29
|
body: {},
|
|
@@ -72,7 +71,7 @@ circularObject.head.children[1].parent = circularObject.head
|
|
|
72
71
|
* Sample object with deep references.
|
|
73
72
|
* @type {Object.<string, string|number|Object>}
|
|
74
73
|
*/
|
|
75
|
-
|
|
74
|
+
const deepReferenceObject = {
|
|
76
75
|
object1: {
|
|
77
76
|
name: 'someName',
|
|
78
77
|
object2: {
|
|
@@ -90,7 +89,7 @@ var deepReferenceObject = {
|
|
|
90
89
|
* @type {Object.<string, string|Object>}
|
|
91
90
|
*/
|
|
92
91
|
exports.deepReferenceObject = deepReferenceObject
|
|
93
|
-
|
|
92
|
+
const linkedList = {
|
|
94
93
|
name: 'one',
|
|
95
94
|
prev: null,
|
|
96
95
|
next: null
|
|
@@ -110,7 +109,7 @@ linkedList.next.next = {
|
|
|
110
109
|
/**
|
|
111
110
|
* Sample of jsonDom object containing empty nested array and objects
|
|
112
111
|
*/
|
|
113
|
-
|
|
112
|
+
const jsonDom = {
|
|
114
113
|
tagName: 'div',
|
|
115
114
|
attributes: {
|
|
116
115
|
style: {},
|
|
@@ -127,7 +126,7 @@ var jsonDom = {
|
|
|
127
126
|
* Sample of domItem child with nested child and optional details
|
|
128
127
|
*/
|
|
129
128
|
exports.jsonDom = jsonDom
|
|
130
|
-
|
|
129
|
+
const domItem = [{
|
|
131
130
|
attributes: {
|
|
132
131
|
className: 'row',
|
|
133
132
|
style: {}
|
|
@@ -158,7 +157,7 @@ var domItem = [{
|
|
|
158
157
|
* @type {Object.<string, string|number|Object>}
|
|
159
158
|
*/
|
|
160
159
|
exports.domItem = domItem
|
|
161
|
-
|
|
160
|
+
const multiReferenceObject = {
|
|
162
161
|
object1: {
|
|
163
162
|
name: 'someName'
|
|
164
163
|
},
|
|
@@ -176,7 +175,7 @@ var multiReferenceObject = {
|
|
|
176
175
|
* @type {Object.<string, string|Object|Array>}
|
|
177
176
|
*/
|
|
178
177
|
exports.multiReferenceObject = multiReferenceObject
|
|
179
|
-
|
|
178
|
+
const nodeTree = {
|
|
180
179
|
name: 'one',
|
|
181
180
|
parent: null,
|
|
182
181
|
children: []
|
package/dist/testHelpers.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.nodeTree=exports.multiReferenceObject=exports.logObject=exports.linkedList=exports.jsonDom=exports.domItem=exports.deepReferenceObject=exports.circularObject=void 0;const logObject=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"logging";"undefined"!=typeof require?console.log(t,require("util").inspect(e,!1,null,!0)):console.log(t,e)};exports.logObject=logObject;const circularObject={name:"root",parent:{},body:{},head:{},children:[]};exports.circularObject=circularObject,circularObject.children=[{name:"body",parent:{},children:[]},{name:"head",parent:{},children:[]}],circularObject.body=circularObject.children[0],circularObject.head=circularObject.children[1],circularObject.body.parent=circularObject,circularObject.head.parent=circularObject,circularObject.body.children=[{name:"body child one",parent:{},children:[]},{name:"body child two",parent:{},children:[]}],circularObject.body.children[0].parent=circularObject.body,circularObject.body.children[1].parent=circularObject.body,circularObject.head.children=[{name:"head child one",parent:{},children:[]},{name:"head child two",parent:{},children:[]}],circularObject.head.children[0].parent=circularObject.head,circularObject.head.children[1].parent=circularObject.head;const deepReferenceObject={object1:{name:"someName",object2:{age:12,array1:["someString","anotherString"]},array2:[89,32]},title:"Some Title",item:45};exports.deepReferenceObject=deepReferenceObject;const linkedList={name:"one",prev:null,next:null};exports.linkedList=linkedList,linkedList.next={name:"two",prev:linkedList,next:null},linkedList.next.next={name:"three",prev:linkedList.next,next:null};const jsonDom={tagName:"div",attributes:{style:{},className:"column"},element:null,eventListeners:{},parentItem:{},children:[],axis:"x"};exports.jsonDom=jsonDom;const domItem=[{attributes:{className:"row",style:{}},axis:"y",children:[{attributes:{style:{}},axis:"x",children:[],element:{},eventListeners:{},hasShip:!1,isHit:!1,parentItem:{},point:{},tagName:"div"}],element:null,eventListeners:{},parentItem:{},tagName:"div"}];exports.domItem=domItem;const multiReferenceObject={object1:{name:"someName"},object2:{age:12},array1:["someString","anotherString"],array2:[89,32],title:"Some Title",item:45};exports.multiReferenceObject=multiReferenceObject;const nodeTree={name:"one",parent:null,children:[]};exports.nodeTree=nodeTree,nodeTree.children[0]={name:"child one",parent:nodeTree,children:[]},nodeTree.children[1]={name:"child two",parent:nodeTree,children:[]},nodeTree.children[0].children[0]={name:"grandchild one",parent:nodeTree.children[0],children:[]};
|
package/dist/testQuick.js
CHANGED
|
@@ -1,58 +1,15 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require('
|
|
7
|
-
require('core-js/modules/es.symbol.iterator.js')
|
|
8
|
-
require('core-js/modules/es.array.iterator.js')
|
|
9
|
-
require('core-js/modules/es.string.iterator.js')
|
|
10
|
-
require('core-js/modules/web.dom-collections.iterator.js')
|
|
11
|
-
require('core-js/modules/es.symbol.async-iterator.js')
|
|
12
|
-
require('core-js/modules/es.symbol.to-string-tag.js')
|
|
13
|
-
require('core-js/modules/es.json.to-string-tag.js')
|
|
14
|
-
require('core-js/modules/es.math.to-string-tag.js')
|
|
15
|
-
require('core-js/modules/es.object.get-prototype-of.js')
|
|
16
|
-
require('core-js/modules/esnext.async-iterator.for-each.js')
|
|
17
|
-
require('core-js/modules/esnext.iterator.constructor.js')
|
|
18
|
-
require('core-js/modules/esnext.iterator.for-each.js')
|
|
19
|
-
require('core-js/modules/web.dom-collections.for-each.js')
|
|
20
|
-
require('core-js/modules/es.object.set-prototype-of.js')
|
|
21
|
-
require('core-js/modules/es.array.slice.js')
|
|
22
|
-
require('core-js/modules/es.object.to-string.js')
|
|
23
|
-
require('core-js/modules/es.promise.js')
|
|
24
|
-
function _regeneratorRuntime () { 'use strict'; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime () { return exports }; var exports = {}; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value }; var $Symbol = typeof Symbol === 'function' ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || '@@iterator'; var asyncIteratorSymbol = $Symbol.asyncIterator || '@@asyncIterator'; var toStringTagSymbol = $Symbol.toStringTag || '@@toStringTag'; function define (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key] } try { define({}, '') } catch (err) { define = function define (obj, key, value) { return obj[key] = value } } function wrap (innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); return defineProperty(generator, '_invoke', { value: makeInvokeMethod(innerFn, self, context) }), generator } function tryCatch (fn, obj, arg) { try { return { type: 'normal', arg: fn.call(obj, arg) } } catch (err) { return { type: 'throw', arg: err } } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator () {} function GeneratorFunction () {} function GeneratorFunctionPrototype () {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods (prototype) { ['next', 'throw', 'return'].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg) }) }) } function AsyncIterator (generator, PromiseImpl) { function invoke (method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type !== 'throw') { var result = record.arg; var value = result.value; return value && _typeof(value) == 'object' && hasOwn.call(value, '__await') ? PromiseImpl.resolve(value.__await).then(function (value) { invoke('next', value, resolve, reject) }, function (err) { invoke('throw', err, resolve, reject) }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result) }, function (error) { return invoke('throw', error, resolve, reject) }) } reject(record.arg) } var previousPromise; defineProperty(this, '_invoke', { value: function value (method, arg) { function callInvokeWithMethodAndArg () { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject) }) } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg() } }) } function makeInvokeMethod (innerFn, self, context) { var state = 'suspendedStart'; return function (method, arg) { if (state === 'executing') throw new Error('Generator is already running'); if (state === 'completed') { if (method === 'throw') throw arg; return doneResult() } for (context.method = method, context.arg = arg; ;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult } } if (context.method === 'next') context.sent = context._sent = context.arg; else if (context.method === 'throw') { if (state === 'suspendedStart') throw state = 'completed', context.arg; context.dispatchException(context.arg) } else context.method === 'return' && context.abrupt('return', context.arg); state = 'executing'; var record = tryCatch(innerFn, self, context); if (record.type === 'normal') { if (state = context.done ? 'completed' : 'suspendedYield', record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done } } record.type === 'throw' && (state = 'completed', context.method = 'throw', context.arg = record.arg) } } } function maybeInvokeDelegate (delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, methodName === 'throw' && delegate.iterator.return && (context.method = 'return', context.arg = undefined, maybeInvokeDelegate(delegate, context), context.method === 'throw') || methodName !== 'return' && (context.method = 'throw', context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === 'throw') return context.method = 'throw', context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, context.method !== 'return' && (context.method = 'next', context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = 'throw', context.arg = new TypeError('iterator result is not an object'), context.delegate = null, ContinueSentinel) } function pushTryEntry (locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry) } function resetTryEntry (entry) { var record = entry.completion || {}; record.type = 'normal', delete record.arg, entry.completion = record } function Context (tryLocsList) { this.tryEntries = [{ tryLoc: 'root' }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0) } function values (iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (typeof iterable.next === 'function') return iterable; if (!isNaN(iterable.length)) { var i = -1; var next = function next () { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next }; return next.next = next } } return { next: doneResult } } function doneResult () { return { value: undefined, done: !0 } } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, 'constructor', { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, 'constructor', { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, 'GeneratorFunction'), exports.isGeneratorFunction = function (genFun) { var ctor = typeof genFun === 'function' && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || (ctor.displayName || ctor.name) === 'GeneratorFunction') }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, 'GeneratorFunction')), genFun.prototype = Object.create(Gp), genFun }, exports.awrap = function (arg) { return { __await: arg } }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next() }) }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, 'Generator'), define(Gp, iteratorSymbol, function () { return this }), define(Gp, 'toString', function () { return '[object Generator]' }), exports.keys = function (val) { var object = Object(val); var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next () { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next } return next.done = !0, next } }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset (skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = 'next', this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) name.charAt(0) === 't' && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined) }, stop: function stop () { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (rootRecord.type === 'throw') throw rootRecord.arg; return this.rval }, dispatchException: function dispatchException (exception) { if (this.done) throw exception; var context = this; function handle (loc, caught) { return record.type = 'throw', record.arg = exception, context.next = loc, caught && (context.method = 'next', context.arg = undefined), !!caught } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === 'root') return handle('end'); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, 'catchLoc'); var hasFinally = hasOwn.call(entry, 'finallyLoc'); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc) } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0) } else { if (!hasFinally) throw new Error('try statement without catch or finally'); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc) } } } }, abrupt: function abrupt (type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, 'finallyLoc') && this.prev < entry.finallyLoc) { var finallyEntry = entry; break } } finallyEntry && (type === 'break' || type === 'continue') && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = 'next', this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record) }, complete: function complete (record, afterLoc) { if (record.type === 'throw') throw record.arg; return record.type === 'break' || record.type === 'continue' ? this.next = record.arg : record.type === 'return' ? (this.rval = this.arg = record.arg, this.method = 'return', this.next = 'end') : record.type === 'normal' && afterLoc && (this.next = afterLoc), ContinueSentinel }, finish: function finish (finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel } }, catch: function _catch (tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === 'throw') { var thrown = record.arg; resetTryEntry(entry) } return thrown } } throw new Error('illegal catch attempt') }, delegateYield: function delegateYield (iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, this.method === 'next' && (this.arg = undefined), ContinueSentinel } }, exports }
|
|
25
|
-
function asyncGeneratorStep (gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value } catch (error) { reject(error); return } if (info.done) { resolve(value) } else { Promise.resolve(value).then(_next, _throw) } }
|
|
26
|
-
function _asyncToGenerator (fn) { return function () { var self = this; var args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next (value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value) } function _throw (err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err) } _next(undefined) }) } }
|
|
27
|
-
var gulpConfig = require('../gulp.config.js')
|
|
28
|
-
var _require = require('jest')
|
|
29
|
-
var jest = _require.runCLI
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const {
|
|
5
|
+
runCLI: jest
|
|
6
|
+
} = require('jest')
|
|
30
7
|
|
|
31
8
|
/**
|
|
32
9
|
* Run the Jest tests for files which have been modified (based on git status).
|
|
33
10
|
* @returns {Promise<*>}
|
|
34
11
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
while (1) {
|
|
39
|
-
switch (_context.prev = _context.next) {
|
|
40
|
-
case 0:
|
|
41
|
-
_context.next = 2
|
|
42
|
-
return jest({
|
|
43
|
-
onlyChanged: true
|
|
44
|
-
}, gulpConfig.testPath)
|
|
45
|
-
case 2:
|
|
46
|
-
return _context.abrupt('return', _context.sent)
|
|
47
|
-
case 3:
|
|
48
|
-
case 'end':
|
|
49
|
-
return _context.stop()
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}, _callee)
|
|
53
|
-
}))
|
|
54
|
-
return function testQuick () {
|
|
55
|
-
return _ref.apply(this, arguments)
|
|
56
|
-
}
|
|
57
|
-
}())
|
|
12
|
+
const testQuick = async () => await jest({
|
|
13
|
+
onlyChanged: true
|
|
14
|
+
}, gulpConfig.testPath)
|
|
58
15
|
module.exports = testQuick
|
package/dist/testQuick.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const gulpConfig=require("../gulp.config.js"),{runCLI:jest}=require("jest"),testQuick=async()=>await jest({onlyChanged:!0},gulpConfig.testPath);module.exports=testQuick;
|
package/dist/watchFull.js
CHANGED
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
require('core-js/modules/es.regexp.constructor.js')
|
|
4
|
-
require('core-js/modules/es.regexp.exec.js')
|
|
5
|
-
require('core-js/modules/es.regexp.sticky.js')
|
|
6
|
-
require('core-js/modules/es.regexp.to-string.js')
|
|
7
3
|
require('core-js/modules/es.string.replace.js')
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const bundle = require('./bundle')
|
|
5
|
+
const distFor = require('./distFor')
|
|
6
|
+
const gulpConfig = require('../gulp.config.js')
|
|
7
|
+
const {
|
|
8
|
+
parallel,
|
|
9
|
+
series,
|
|
10
|
+
watch
|
|
11
|
+
} = require('gulp')
|
|
12
|
+
const testQuick = require('./testQuick')
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
19
16
|
* @returns {*}
|
|
20
17
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return parallel(testQuick, series(distForPath, bundle))()
|
|
28
|
-
})
|
|
29
|
-
}
|
|
18
|
+
const watchFull = () => watch(gulpConfig.watchSearch).on('change', path => {
|
|
19
|
+
const pathRegex = new RegExp('^'.concat(gulpConfig.srcPath, '(.*\\/).+\\.js$'), 'i')
|
|
20
|
+
const distForPath = () => distFor(path, path.replace(pathRegex, ''.concat(gulpConfig.distPath, '$1')))
|
|
21
|
+
return parallel(testQuick, series(distForPath, bundle))()
|
|
22
|
+
})
|
|
30
23
|
module.exports = watchFull
|
package/dist/watchFull.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("core-js/modules/es.
|
|
1
|
+
"use strict";require("core-js/modules/es.string.replace.js");const bundle=require("./bundle"),distFor=require("./distFor"),gulpConfig=require("../gulp.config.js"),{parallel:parallel,series:series,watch:watch}=require("gulp"),testQuick=require("./testQuick"),watchFull=()=>watch(gulpConfig.watchSearch).on("change",(e=>{const r=new RegExp("^".concat(gulpConfig.srcPath,"(.*\\/).+\\.js$"),"i");return parallel(testQuick,series((()=>distFor(e,e.replace(r,"".concat(gulpConfig.distPath,"$1")))),bundle))()}));module.exports=watchFull;
|
package/dist/watchTest.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const gulpConfig = require('../gulp.config.js')
|
|
4
|
+
const {
|
|
5
|
+
series,
|
|
6
|
+
watch
|
|
7
|
+
} = require('gulp')
|
|
8
|
+
const testQuick = require('./testQuick')
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Watch for changes and run the tests.
|
|
11
12
|
* @returns {*}
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, series(testQuick))
|
|
17
|
-
}
|
|
14
|
+
const watchTest = () => watch(gulpConfig.watchSearch, {
|
|
15
|
+
ignoreInitial: false
|
|
16
|
+
}, series(testQuick))
|
|
18
17
|
module.exports = watchTest
|
package/dist/watchTest.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const gulpConfig=require("../gulp.config.js"),{series:series,watch:watch}=require("gulp"),testQuick=require("./testQuick"),watchTest=()=>watch(gulpConfig.watchSearch,{ignoreInitial:!1},series(testQuick));module.exports=watchTest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-build-tools",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Standardised build process with gulp.",
|
|
5
5
|
"main": "gulpfile.base.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,22 +33,23 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/core": "^7.
|
|
36
|
+
"@babel/core": "^7.22.1",
|
|
37
37
|
"@babel/plugin-proposal-throw-expressions": "^7.18.6",
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
39
|
-
"@babel/runtime-corejs3": "^7.
|
|
40
|
-
"babel-jest": "^29.
|
|
38
|
+
"@babel/preset-env": "^7.22.4",
|
|
39
|
+
"@babel/runtime-corejs3": "^7.22.3",
|
|
40
|
+
"babel-jest": "^29.5.0",
|
|
41
41
|
"browserify": "^17.0.0",
|
|
42
|
-
"core-js": "^3.
|
|
42
|
+
"core-js": "^3.30.2",
|
|
43
43
|
"del": "^6.1.1",
|
|
44
44
|
"fs": "^0.0.1-security",
|
|
45
|
-
"glob": "^
|
|
45
|
+
"glob": "^10.2.6",
|
|
46
46
|
"gulp": "^4.0.2",
|
|
47
47
|
"gulp-babel": "^8.0.0",
|
|
48
48
|
"gulp-rename": "^2.0.0",
|
|
49
49
|
"gulp-standard": "^14.0.0",
|
|
50
50
|
"gulp-uglify-es": "^3.0.0",
|
|
51
|
-
"jest": "^29.
|
|
51
|
+
"jest": "^29.5.0",
|
|
52
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
52
53
|
"jsdoc-to-markdown": "^8.0.0",
|
|
53
54
|
"regenerator-runtime": "^0.13.11",
|
|
54
55
|
"vinyl-source-stream": "^2.0.0"
|