js-build-tools 1.2.1 → 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.
- package/README.md +353 -353
- package/dist/addToReadme.js +22 -21
- package/dist/addToReadme.min.js +1 -1
- package/dist/build.js +23 -22
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +15 -16
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +20 -22
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +20 -21
- package/dist/bundleMinify.min.js +1 -1
- package/dist/clean.js +8 -10
- package/dist/clean.min.js +1 -1
- package/dist/compileReadme.js +13 -12
- package/dist/compileReadme.min.js +1 -1
- package/dist/default.js +14 -13
- package/dist/default.min.js +1 -1
- package/dist/dist.js +10 -12
- package/dist/dist.min.js +1 -1
- package/dist/distFor.js +21 -20
- package/dist/distFor.min.js +1 -1
- package/dist/distLint.js +20 -21
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +20 -20
- package/dist/distMinify.min.js +1 -1
- package/dist/readmeTemplate.js +15 -16
- package/dist/readmeTemplate.min.js +1 -1
- package/dist/testFull.js +13 -56
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +175 -176
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +15 -58
- package/dist/testQuick.min.js +1 -1
- package/dist/watchFull.js +20 -27
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +14 -15
- package/dist/watchTest.min.js +1 -1
- package/functions/addToReadme.js +17 -17
- package/functions/build.js +25 -25
- package/functions/bundle.js +15 -15
- package/functions/bundleLint.js +17 -17
- package/functions/bundleMinify.js +15 -15
- package/functions/compileReadme.js +10 -10
- package/functions/default.js +11 -11
- package/functions/dist.js +9 -9
- package/functions/distFor.js +15 -15
- package/functions/distLint.js +17 -17
- package/functions/distMinify.js +15 -15
- package/functions/readmeTemplate.js +13 -13
- package/functions/testFull.js +10 -10
- package/functions/testHelpers.test.js +100 -100
- package/functions/testQuick.js +10 -10
- package/package.json +11 -11
|
@@ -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
|
+
})
|
package/functions/testQuick.js
CHANGED
|
@@ -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.
|
|
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.
|
|
37
|
-
"@babel/plugin-proposal-throw-expressions": "^7.
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
39
|
-
"@babel/runtime-corejs3": "^7.
|
|
40
|
-
"babel-jest": "^29.
|
|
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.
|
|
42
|
+
"core-js": "^3.32.1",
|
|
43
43
|
"del": "^6.1.1",
|
|
44
44
|
"fs": "^0.0.1-security",
|
|
45
|
-
"glob": "^
|
|
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.
|
|
52
|
-
"jest-environment-jsdom": "^29.
|
|
51
|
+
"jest": "^29.6.4",
|
|
52
|
+
"jest-environment-jsdom": "^29.6.4",
|
|
53
53
|
"jsdoc-to-markdown": "^8.0.0",
|
|
54
|
-
"regenerator-runtime": "^0.
|
|
54
|
+
"regenerator-runtime": "^0.14.0",
|
|
55
55
|
"vinyl-source-stream": "^2.0.0"
|
|
56
56
|
},
|
|
57
57
|
"files": [
|