js-build-tools 2.2.10 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.js +23 -21
- 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 +3 -6
- package/dist/bundleMinify.min.js +1 -1
- package/dist/compileReadme.js +8 -6
- package/dist/compileReadme.min.js +1 -1
- package/dist/default.js +8 -7
- package/dist/default.min.js +1 -1
- package/dist/dist.js +2 -4
- package/dist/dist.min.js +1 -1
- package/dist/distLint.js +12 -13
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +3 -5
- package/dist/distMinify.min.js +1 -1
- package/dist/partials/addToReadme.js +9 -12
- package/dist/partials/beginWatcher.js +5 -6
- package/dist/partials/clean.js +3 -12
- package/dist/partials/distFor.js +10 -9
- package/dist/partials/distForSrc.js +3 -3
- package/dist/partials/distSeries.js +13 -14
- package/dist/partials/minifyFor.js +11 -11
- package/dist/partials/readmeTemplate.js +7 -8
- package/dist/partials/removeDirectory.js +7 -16
- package/dist/partials/runOnChange.js +17 -21
- package/dist/partials/tsFor.js +14 -17
- package/dist/partials.js +11 -11
- package/dist/partials.min.js +1 -1
- package/dist/test-helpers/circularObject.js +1 -1
- package/dist/test-helpers/countMatches.js +1 -5
- package/dist/test-helpers/deepReferenceObject.js +1 -1
- package/dist/test-helpers/domItem.js +1 -1
- package/dist/test-helpers/jsonDom.js +1 -1
- package/dist/test-helpers/linkedList.js +1 -1
- package/dist/test-helpers/logObject.js +4 -7
- package/dist/test-helpers/multiReferenceObject.js +1 -1
- package/dist/test-helpers/nodeTree.js +1 -1
- package/dist/test-helpers/setUp.js +31 -75
- package/dist/testFull.js +6 -5
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +10 -10
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +6 -5
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +2 -2
- package/dist/typeScript.min.js +1 -1
- package/dist/watchFull.js +5 -6
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +8 -9
- package/dist/watchTest.min.js +1 -1
- package/functions/build.test.js +4 -11
- package/functions/partials/distFor.test.js +7 -7
- package/package.json +6 -6
package/functions/build.test.js
CHANGED
|
@@ -105,7 +105,7 @@ describe('build', () => {
|
|
|
105
105
|
fs.writeFileSync(`${sourcesPath}/file2.js`, file2Contents)
|
|
106
106
|
fs.writeFileSync(`${srcPath}/main.js`, mainFileContents)
|
|
107
107
|
gulpConfig.set('nodeOnly', true)
|
|
108
|
-
expect.assertions(
|
|
108
|
+
expect.assertions(13)
|
|
109
109
|
build(() => {
|
|
110
110
|
// Called 'clean'
|
|
111
111
|
expect(clean).toHaveBeenCalled()
|
|
@@ -122,17 +122,10 @@ describe('build', () => {
|
|
|
122
122
|
expect(fs.existsSync(`${distSourcesPath}/file1.min.js`)).toBeTruthy()
|
|
123
123
|
const babelifiedFile1 = fs.readFileSync(`${distSourcesPath}/file1.js`).toString()
|
|
124
124
|
expect(countMatches(babelifiedFile1, '\'use strict\'')).toEqual(1)
|
|
125
|
-
expect(countMatches(babelifiedFile1, 'const ')).toEqual(0)
|
|
126
|
-
expect(countMatches(babelifiedFile1, 'var ')).toEqual(1)
|
|
127
|
-
expect(countMatches(babelifiedFile1, 'function ')).toEqual(1)
|
|
128
|
-
expect(countMatches(babelifiedFile1, 'return ')).toEqual(1)
|
|
129
125
|
|
|
130
126
|
expect(fs.existsSync(`${distSourcesPath}/file2.min.js`)).toBeTruthy()
|
|
131
127
|
const babelifiedFile2 = fs.readFileSync(`${distSourcesPath}/file2.js`).toString()
|
|
132
128
|
expect(countMatches(babelifiedFile2, '\'use strict\'')).toEqual(1)
|
|
133
|
-
expect(countMatches(babelifiedFile2, 'const ')).toEqual(0)
|
|
134
|
-
expect(countMatches(babelifiedFile2, 'var ')).toEqual(2)
|
|
135
|
-
expect(countMatches(babelifiedFile2, 'function ')).toEqual(1)
|
|
136
129
|
|
|
137
130
|
// Generated README.md (compileReadme)
|
|
138
131
|
const readmeContents = fs.readFileSync(`${readmePath}/${readmeFile}`).toString()
|
|
@@ -180,8 +173,8 @@ describe('build', () => {
|
|
|
180
173
|
// Minify the browser files (bundleMinify)
|
|
181
174
|
expect(fs.existsSync(`${browserPath}/${browserFile}.min.js`)).toBeTruthy()
|
|
182
175
|
const bundledContents = fs.readFileSync(bundledFile).toString()
|
|
183
|
-
expect(countMatches(bundledContents, 'file1')).toEqual(
|
|
184
|
-
expect(countMatches(bundledContents, 'file2')).toEqual(
|
|
176
|
+
expect(countMatches(bundledContents, 'file1')).toEqual(7)
|
|
177
|
+
expect(countMatches(bundledContents, 'file2')).toEqual(7)
|
|
185
178
|
|
|
186
179
|
// Generated README.md (compileReadme)
|
|
187
180
|
const readmeContents = fs.readFileSync(`${readmePath}/${readmeFile}`).toString()
|
|
@@ -272,7 +265,7 @@ describe('build', () => {
|
|
|
272
265
|
// Minify the browser files (bundleMinify)
|
|
273
266
|
expect(fs.existsSync(`${browserPath}/${browserFile}.min.js`)).toBeTruthy()
|
|
274
267
|
const bundledContents = fs.readFileSync(bundledFile).toString()
|
|
275
|
-
expect(countMatches(bundledContents, 'main')).toEqual(
|
|
268
|
+
expect(countMatches(bundledContents, 'main')).toEqual(2)
|
|
276
269
|
|
|
277
270
|
// Generated README.md (compileReadme)
|
|
278
271
|
const readmeContents = fs.readFileSync(`${readmePath}/${readmeFile}`).toString()
|
|
@@ -68,7 +68,7 @@ describe('distFor', () => {
|
|
|
68
68
|
const srcPath = gulpConfig.get('srcPath')
|
|
69
69
|
const srcFile = `${srcPath}/distFor.js`
|
|
70
70
|
fs.writeFileSync(srcFile, rawContents)
|
|
71
|
-
expect.assertions(
|
|
71
|
+
expect.assertions(5)
|
|
72
72
|
const oldContents = fs.readFileSync(srcFile).toString()
|
|
73
73
|
expect(countMatches(oldContents, 'const ')).toEqual(7)
|
|
74
74
|
const distPath = gulpConfig.get('distPath')
|
|
@@ -77,11 +77,11 @@ describe('distFor', () => {
|
|
|
77
77
|
expect(fs.existsSync(distPath)).toBeTruthy()
|
|
78
78
|
const babelifiedContents = fs.readFileSync(`${distPath}/distFor.js`).toString()
|
|
79
79
|
expect(countMatches(babelifiedContents, '"use strict"')).toEqual(1)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
/* There used to be a nice check here where `const` and `let` would be swapped to `var`, but that no longer
|
|
81
|
+
happens.
|
|
82
|
+
It would be nice if it still happened, but due to 'browserlist' supposedly, most browsers support
|
|
83
|
+
`const` and `let` now.
|
|
84
|
+
*/
|
|
85
85
|
expect(countMatches(babelifiedContents, 'function')).toEqual(1)
|
|
86
86
|
expect(countMatches(babelifiedContents, 'arguments')).toEqual(6)
|
|
87
87
|
done()
|
|
@@ -90,7 +90,7 @@ describe('distFor', () => {
|
|
|
90
90
|
console.error('Encountered error', error)
|
|
91
91
|
done()
|
|
92
92
|
})
|
|
93
|
-
},
|
|
93
|
+
}, 5000)
|
|
94
94
|
|
|
95
95
|
test('can process typescript before babel', done => {
|
|
96
96
|
const srcPath = gulpConfig.get('srcPath')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-build-tools",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Standardised build process with gulp.",
|
|
5
5
|
"main": "gulpfile.base.js",
|
|
6
6
|
"scripts": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/core": "^7.23.
|
|
36
|
+
"@babel/core": "^7.23.7",
|
|
37
37
|
"@babel/plugin-proposal-throw-expressions": "^7.23.3",
|
|
38
|
-
"@babel/preset-env": "^7.23.
|
|
38
|
+
"@babel/preset-env": "^7.23.7",
|
|
39
39
|
"@babel/preset-typescript": "^7.23.3",
|
|
40
|
-
"@babel/runtime-corejs3": "^7.23.
|
|
40
|
+
"@babel/runtime-corejs3": "^7.23.7",
|
|
41
41
|
"babel-jest": "^29.7.0",
|
|
42
42
|
"browserify": "^17.0.0",
|
|
43
|
-
"core-js": "^3.
|
|
43
|
+
"core-js": "^3.35.0",
|
|
44
44
|
"fs": "^0.0.1-security",
|
|
45
45
|
"glob": "^10.3.10",
|
|
46
46
|
"gulp": "^4.0.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"jest": "^29.7.0",
|
|
53
53
|
"jest-environment-jsdom": "^29.7.0",
|
|
54
54
|
"jsdoc-to-markdown": "^8.0.0",
|
|
55
|
-
"regenerator-runtime": "^0.14.
|
|
55
|
+
"regenerator-runtime": "^0.14.1",
|
|
56
56
|
"vinyl-source-stream": "^2.0.0"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|