js-build-tools 1.2.2 → 1.2.3

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.
@@ -1,10 +1,10 @@
1
- const addToReadme = require('./addToReadme')
2
- const readmeTemplate = require('./readmeTemplate')
3
- const { series } = require('gulp')
4
-
5
- /**
6
- * Generate the README.md file based off of the template, then append the generated documentation.
7
- */
8
- const compileReadme = series(readmeTemplate, addToReadme)
9
-
10
- module.exports = compileReadme
1
+ const addToReadme = require('./addToReadme')
2
+ const readmeTemplate = require('./readmeTemplate')
3
+ const { series } = require('gulp')
4
+
5
+ /**
6
+ * Generate the README.md file based off of the template, then append the generated documentation.
7
+ */
8
+ const compileReadme = series(readmeTemplate, addToReadme)
9
+
10
+ module.exports = compileReadme
@@ -1,11 +1,11 @@
1
- const { series } = require('gulp')
2
- const dist = require('./dist')
3
- const bundle = require('./bundle')
4
- const gulpConfig = require('../gulp.config')
5
-
6
- /**
7
- * Recommended as the default task, runs the simple dist and bundle tasks.
8
- */
9
- const defaultCmd = gulpConfig.nodeOnly ? series(dist) : series(dist, bundle)
10
-
11
- module.exports = defaultCmd
1
+ const { series } = require('gulp')
2
+ const dist = require('./dist')
3
+ const bundle = require('./bundle')
4
+ const gulpConfig = require('../gulp.config')
5
+
6
+ /**
7
+ * Recommended as the default task, runs the simple dist and bundle tasks.
8
+ */
9
+ const defaultCmd = gulpConfig.nodeOnly ? series(dist) : series(dist, bundle)
10
+
11
+ module.exports = defaultCmd
package/functions/dist.js CHANGED
@@ -1,9 +1,9 @@
1
- const distFor = require('./distFor.js')
2
-
3
- /**
4
- * Simplified distribution tasks which will use arguments from distFor.
5
- * @returns {*}
6
- */
7
- const dist = () => distFor()
8
-
9
- module.exports = dist
1
+ const distFor = require('./distFor.js')
2
+
3
+ /**
4
+ * Simplified distribution tasks which will use arguments from distFor.
5
+ * @returns {*}
6
+ */
7
+ const dist = () => distFor()
8
+
9
+ module.exports = dist
@@ -1,15 +1,15 @@
1
- const babel = require('gulp-babel')
2
- const { dest, src } = require('gulp')
3
- const gulpConfig = require('../gulp.config.js')
4
-
5
- /**
6
- * Build the distribution for a given source pattern.
7
- * @param {string|array} srcPath
8
- * @param {string} destPath
9
- * @returns {*}
10
- */
11
- const distFor = (srcPath = gulpConfig.srcSearch, destPath = gulpConfig.distPath) => src(srcPath)
12
- .pipe(babel())
13
- .pipe(dest(destPath))
14
-
15
- module.exports = distFor
1
+ const babel = require('gulp-babel')
2
+ const { dest, src } = require('gulp')
3
+ const gulpConfig = require('../gulp.config.js')
4
+
5
+ /**
6
+ * Build the distribution for a given source pattern.
7
+ * @param {string|array} srcPath
8
+ * @param {string} destPath
9
+ * @returns {*}
10
+ */
11
+ const distFor = (srcPath = gulpConfig.srcSearch, destPath = gulpConfig.distPath) => src(srcPath)
12
+ .pipe(babel())
13
+ .pipe(dest(destPath))
14
+
15
+ module.exports = distFor
@@ -1,17 +1,17 @@
1
- const gulpConfig = require('../gulp.config.js')
2
- const { dest, src } = require('gulp')
3
- const standard = require('gulp-standard')
4
-
5
- /**
6
- * Applies Standard code style linting to distribution files.
7
- * @returns {*}
8
- */
9
- const distLint = () => src(gulpConfig.distSearch)
10
- .pipe(standard({ fix: true }))
11
- .pipe(standard.reporter('default', {
12
- fix: true,
13
- quiet: true
14
- }))
15
- .pipe(dest(gulpConfig.distPath))
16
-
17
- module.exports = distLint
1
+ const gulpConfig = require('../gulp.config.js')
2
+ const { dest, src } = require('gulp')
3
+ const standard = require('gulp-standard')
4
+
5
+ /**
6
+ * Applies Standard code style linting to distribution files.
7
+ * @returns {*}
8
+ */
9
+ const distLint = () => src(gulpConfig.distSearch)
10
+ .pipe(standard({ fix: true }))
11
+ .pipe(standard.reporter('default', {
12
+ fix: true,
13
+ quiet: true
14
+ }))
15
+ .pipe(dest(gulpConfig.distPath))
16
+
17
+ module.exports = distLint
@@ -1,15 +1,15 @@
1
- const { dest, src } = require('gulp')
2
- const gulpConfig = require('../gulp.config.js')
3
- const { default: uglify } = require('gulp-uglify-es')
4
- const rename = require('gulp-rename')
5
-
6
- /**
7
- * Creates minified versions of the dist files.
8
- * @returns {*}
9
- */
10
- const distMinify = () => src(gulpConfig.distSearch)
11
- .pipe(uglify())
12
- .pipe(rename({ extname: '.min.js' }))
13
- .pipe(dest(gulpConfig.distPath))
14
-
15
- module.exports = distMinify
1
+ const { dest, src } = require('gulp')
2
+ const gulpConfig = require('../gulp.config.js')
3
+ const { default: uglify } = require('gulp-uglify-es')
4
+ const rename = require('gulp-rename')
5
+
6
+ /**
7
+ * Creates minified versions of the dist files.
8
+ * @returns {*}
9
+ */
10
+ const distMinify = () => src(gulpConfig.distSearch)
11
+ .pipe(uglify())
12
+ .pipe(rename({ extname: '.min.js' }))
13
+ .pipe(dest(gulpConfig.distPath))
14
+
15
+ module.exports = distMinify
@@ -1,13 +1,13 @@
1
- const { dest, src } = require('gulp')
2
- const gulpConfig = require('../gulp.config.js')
3
- const rename = require('gulp-rename')
4
-
5
- /**
6
- * Copy a readme template into the README.md file.
7
- * @returns {*}
8
- */
9
- const readmeTemplate = () => src(gulpConfig.readmeTemplate)
10
- .pipe(rename('README.md'))
11
- .pipe(dest('.'))
12
-
13
- module.exports = readmeTemplate
1
+ const { dest, src } = require('gulp')
2
+ const gulpConfig = require('../gulp.config.js')
3
+ const rename = require('gulp-rename')
4
+
5
+ /**
6
+ * Copy a readme template into the README.md file.
7
+ * @returns {*}
8
+ */
9
+ const readmeTemplate = () => src(gulpConfig.readmeTemplate)
10
+ .pipe(rename('README.md'))
11
+ .pipe(dest('.'))
12
+
13
+ module.exports = readmeTemplate
@@ -1,10 +1,10 @@
1
- const gulpConfig = require('../gulp.config.js');
2
- const { runCLI: jest } = require('jest')
3
-
4
- /**
5
- * Run all tests with jest.
6
- * @returns {Promise<*>}
7
- */
8
- const testFull = async () => await jest({}, gulpConfig.testPath)
9
-
10
- module.exports = testFull
1
+ const gulpConfig = require('../gulp.config.js');
2
+ const { runCLI: jest } = require('jest')
3
+
4
+ /**
5
+ * Run all tests with jest.
6
+ * @returns {Promise<*>}
7
+ */
8
+ const testFull = async () => await jest({}, gulpConfig.testPath)
9
+
10
+ module.exports = testFull
@@ -1,100 +1,100 @@
1
- const {
2
- circularObject,
3
- deepReferenceObject,
4
- domItem,
5
- jsonDom,
6
- linkedList,
7
- logObject,
8
- multiReferenceObject,
9
- nodeTree
10
- } = require('./testHelpers.js')
11
- const util = require('util')
12
-
13
- describe('testHelpers', () => {
14
- test('can nicely output objects with logObject', () => {
15
- const logSpy = jest.spyOn(console, 'log')
16
- const inspectSpy = jest.spyOn(util, 'inspect')
17
- const someObject = { one: 1, two: 2, three: 3 }
18
- logObject(someObject, 'someObject')
19
- expect(inspectSpy).toHaveBeenCalledWith(someObject, false, null, true)
20
- expect(logSpy).toHaveBeenCalledWith('someObject', util.inspect(someObject, false, null, true))
21
- })
22
-
23
- test('has sample circular object', () => {
24
- expect(circularObject.body.parent).toBe(circularObject)
25
- expect(circularObject.body.children[0].parent).toBe(circularObject.body)
26
- expect(circularObject.body.children[1].parent).toBe(circularObject.body)
27
- expect(circularObject.children[0]).toBe(circularObject.body)
28
- expect(circularObject.head.parent).toBe(circularObject)
29
- expect(circularObject.head.children[0].parent).toBe(circularObject.head)
30
- expect(circularObject.head.children[1].parent).toBe(circularObject.head)
31
- expect(circularObject.children[1]).toBe(circularObject.head)
32
- })
33
-
34
- test('has sample deep reference object', () => {
35
- expect(deepReferenceObject).toHaveProperty('object1.object2.array1')
36
- })
37
-
38
- test('has sample domItem object', () => {
39
- expect(domItem[0]).toHaveProperty('attributes')
40
- expect(domItem[0]).toHaveProperty('children')
41
- expect(domItem[0]).toHaveProperty('element')
42
- expect(domItem[0]).toHaveProperty('eventListeners')
43
- expect(domItem[0]).toHaveProperty('parentItem')
44
- expect(domItem[0]).toHaveProperty('tagName')
45
- })
46
-
47
- test('has sample jsonDom object', () => {
48
- expect(jsonDom).toHaveProperty('attributes')
49
- expect(jsonDom).toHaveProperty('children')
50
- expect(jsonDom).toHaveProperty('element')
51
- expect(jsonDom).toHaveProperty('eventListeners')
52
- expect(jsonDom).toHaveProperty('parentItem')
53
- expect(jsonDom).toHaveProperty('tagName')
54
- })
55
-
56
- test('has sample linkedList object', () => {
57
- expect(linkedList.name).toBe('one')
58
- expect(linkedList).toHaveProperty('prev')
59
- expect(linkedList.prev).toBeNull()
60
-
61
- expect(linkedList).toHaveProperty('next')
62
- expect(linkedList.next.name).toBe('two')
63
- expect(linkedList).toHaveProperty('next.prev')
64
- expect(linkedList.next.prev).toBe(linkedList)
65
-
66
- expect(linkedList).toHaveProperty('next.next')
67
- expect(linkedList.next.next.name).toBe('three')
68
- expect(linkedList).toHaveProperty('next.prev')
69
- expect(linkedList.next.next.prev).toBe(linkedList.next)
70
-
71
- expect(linkedList).toHaveProperty('next.next.next')
72
- expect(linkedList.next.next.next).toBeNull()
73
- })
74
-
75
- test('has sample multiReferenceObject object', () => {
76
- expect(multiReferenceObject).toHaveProperty('object1.name')
77
- expect(multiReferenceObject).toHaveProperty('object2.age')
78
- expect(multiReferenceObject).toHaveProperty('array1.0')
79
- expect(multiReferenceObject).toHaveProperty('array1.1')
80
- expect(multiReferenceObject).toHaveProperty('array2.0')
81
- expect(multiReferenceObject).toHaveProperty('array2.1')
82
- expect(multiReferenceObject).toHaveProperty('title')
83
- expect(multiReferenceObject).toHaveProperty('item')
84
- })
85
-
86
- test('has sample nodeTree object', () => {
87
- expect(nodeTree.name).toBe('one')
88
- expect(nodeTree.parent).toBeNull()
89
- expect(nodeTree.children.length).toBe(2)
90
- expect(nodeTree.children[0].name).toBe('child one')
91
- expect(nodeTree.children[0].parent).toBe(nodeTree)
92
- expect(nodeTree.children[0].children.length).toBe(1)
93
- expect(nodeTree.children[0].children[0].name).toBe('grandchild one')
94
- expect(nodeTree.children[0].children[0].parent).toBe(nodeTree.children[0])
95
- expect(nodeTree.children[0].children[0].children.length).toBe(0)
96
- expect(nodeTree.children[1].name).toBe('child two')
97
- expect(nodeTree.children[1].parent).toBe(nodeTree)
98
- expect(nodeTree.children[1].children.length).toBe(0)
99
- })
100
- })
1
+ const {
2
+ circularObject,
3
+ deepReferenceObject,
4
+ domItem,
5
+ jsonDom,
6
+ linkedList,
7
+ logObject,
8
+ multiReferenceObject,
9
+ nodeTree
10
+ } = require('./testHelpers.js')
11
+ const util = require('util')
12
+
13
+ describe('testHelpers', () => {
14
+ test('can nicely output objects with logObject', () => {
15
+ const logSpy = jest.spyOn(console, 'log')
16
+ const inspectSpy = jest.spyOn(util, 'inspect')
17
+ const someObject = { one: 1, two: 2, three: 3 }
18
+ logObject(someObject, 'someObject')
19
+ expect(inspectSpy).toHaveBeenCalledWith(someObject, false, null, true)
20
+ expect(logSpy).toHaveBeenCalledWith('someObject', util.inspect(someObject, false, null, true))
21
+ })
22
+
23
+ test('has sample circular object', () => {
24
+ expect(circularObject.body.parent).toBe(circularObject)
25
+ expect(circularObject.body.children[0].parent).toBe(circularObject.body)
26
+ expect(circularObject.body.children[1].parent).toBe(circularObject.body)
27
+ expect(circularObject.children[0]).toBe(circularObject.body)
28
+ expect(circularObject.head.parent).toBe(circularObject)
29
+ expect(circularObject.head.children[0].parent).toBe(circularObject.head)
30
+ expect(circularObject.head.children[1].parent).toBe(circularObject.head)
31
+ expect(circularObject.children[1]).toBe(circularObject.head)
32
+ })
33
+
34
+ test('has sample deep reference object', () => {
35
+ expect(deepReferenceObject).toHaveProperty('object1.object2.array1')
36
+ })
37
+
38
+ test('has sample domItem object', () => {
39
+ expect(domItem[0]).toHaveProperty('attributes')
40
+ expect(domItem[0]).toHaveProperty('children')
41
+ expect(domItem[0]).toHaveProperty('element')
42
+ expect(domItem[0]).toHaveProperty('eventListeners')
43
+ expect(domItem[0]).toHaveProperty('parentItem')
44
+ expect(domItem[0]).toHaveProperty('tagName')
45
+ })
46
+
47
+ test('has sample jsonDom object', () => {
48
+ expect(jsonDom).toHaveProperty('attributes')
49
+ expect(jsonDom).toHaveProperty('children')
50
+ expect(jsonDom).toHaveProperty('element')
51
+ expect(jsonDom).toHaveProperty('eventListeners')
52
+ expect(jsonDom).toHaveProperty('parentItem')
53
+ expect(jsonDom).toHaveProperty('tagName')
54
+ })
55
+
56
+ test('has sample linkedList object', () => {
57
+ expect(linkedList.name).toBe('one')
58
+ expect(linkedList).toHaveProperty('prev')
59
+ expect(linkedList.prev).toBeNull()
60
+
61
+ expect(linkedList).toHaveProperty('next')
62
+ expect(linkedList.next.name).toBe('two')
63
+ expect(linkedList).toHaveProperty('next.prev')
64
+ expect(linkedList.next.prev).toBe(linkedList)
65
+
66
+ expect(linkedList).toHaveProperty('next.next')
67
+ expect(linkedList.next.next.name).toBe('three')
68
+ expect(linkedList).toHaveProperty('next.prev')
69
+ expect(linkedList.next.next.prev).toBe(linkedList.next)
70
+
71
+ expect(linkedList).toHaveProperty('next.next.next')
72
+ expect(linkedList.next.next.next).toBeNull()
73
+ })
74
+
75
+ test('has sample multiReferenceObject object', () => {
76
+ expect(multiReferenceObject).toHaveProperty('object1.name')
77
+ expect(multiReferenceObject).toHaveProperty('object2.age')
78
+ expect(multiReferenceObject).toHaveProperty('array1.0')
79
+ expect(multiReferenceObject).toHaveProperty('array1.1')
80
+ expect(multiReferenceObject).toHaveProperty('array2.0')
81
+ expect(multiReferenceObject).toHaveProperty('array2.1')
82
+ expect(multiReferenceObject).toHaveProperty('title')
83
+ expect(multiReferenceObject).toHaveProperty('item')
84
+ })
85
+
86
+ test('has sample nodeTree object', () => {
87
+ expect(nodeTree.name).toBe('one')
88
+ expect(nodeTree.parent).toBeNull()
89
+ expect(nodeTree.children.length).toBe(2)
90
+ expect(nodeTree.children[0].name).toBe('child one')
91
+ expect(nodeTree.children[0].parent).toBe(nodeTree)
92
+ expect(nodeTree.children[0].children.length).toBe(1)
93
+ expect(nodeTree.children[0].children[0].name).toBe('grandchild one')
94
+ expect(nodeTree.children[0].children[0].parent).toBe(nodeTree.children[0])
95
+ expect(nodeTree.children[0].children[0].children.length).toBe(0)
96
+ expect(nodeTree.children[1].name).toBe('child two')
97
+ expect(nodeTree.children[1].parent).toBe(nodeTree)
98
+ expect(nodeTree.children[1].children.length).toBe(0)
99
+ })
100
+ })
@@ -1,10 +1,10 @@
1
- const gulpConfig = require('../gulp.config.js')
2
- const { runCLI: jest } = require('jest')
3
-
4
- /**
5
- * Run the Jest tests for files which have been modified (based on git status).
6
- * @returns {Promise<*>}
7
- */
8
- const testQuick = async () => await jest({ onlyChanged: true }, gulpConfig.testPath)
9
-
10
- module.exports = testQuick
1
+ const gulpConfig = require('../gulp.config.js')
2
+ const { runCLI: jest } = require('jest')
3
+
4
+ /**
5
+ * Run the Jest tests for files which have been modified (based on git status).
6
+ * @returns {Promise<*>}
7
+ */
8
+ const testQuick = async () => await jest({ onlyChanged: true }, gulpConfig.testPath)
9
+
10
+ module.exports = testQuick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-build-tools",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Standardised build process with gulp.",
5
5
  "main": "gulpfile.base.js",
6
6
  "scripts": {
@@ -33,25 +33,25 @@
33
33
  ]
34
34
  },
35
35
  "dependencies": {
36
- "@babel/core": "^7.22.1",
37
- "@babel/plugin-proposal-throw-expressions": "^7.18.6",
38
- "@babel/preset-env": "^7.22.4",
39
- "@babel/runtime-corejs3": "^7.22.3",
40
- "babel-jest": "^29.5.0",
36
+ "@babel/core": "^7.22.15",
37
+ "@babel/plugin-proposal-throw-expressions": "^7.22.5",
38
+ "@babel/preset-env": "^7.22.15",
39
+ "@babel/runtime-corejs3": "^7.22.15",
40
+ "babel-jest": "^29.6.4",
41
41
  "browserify": "^17.0.0",
42
- "core-js": "^3.30.2",
42
+ "core-js": "^3.32.1",
43
43
  "del": "^6.1.1",
44
44
  "fs": "^0.0.1-security",
45
- "glob": "^10.2.6",
45
+ "glob": "^10.3.4",
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.5.0",
52
- "jest-environment-jsdom": "^29.5.0",
51
+ "jest": "^29.6.4",
52
+ "jest-environment-jsdom": "^29.6.4",
53
53
  "jsdoc-to-markdown": "^8.0.0",
54
- "regenerator-runtime": "^0.13.11",
54
+ "regenerator-runtime": "^0.14.0",
55
55
  "vinyl-source-stream": "^2.0.0"
56
56
  },
57
57
  "files": [