js-build-tools 2.2.11 → 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.
Files changed (56) hide show
  1. package/dist/build.js +23 -21
  2. package/dist/build.min.js +1 -1
  3. package/dist/bundle.js +7 -8
  4. package/dist/bundle.min.js +1 -1
  5. package/dist/bundleLint.js +12 -14
  6. package/dist/bundleLint.min.js +1 -1
  7. package/dist/bundleMinify.js +3 -6
  8. package/dist/bundleMinify.min.js +1 -1
  9. package/dist/compileReadme.js +8 -6
  10. package/dist/compileReadme.min.js +1 -1
  11. package/dist/default.js +8 -7
  12. package/dist/default.min.js +1 -1
  13. package/dist/dist.js +2 -4
  14. package/dist/dist.min.js +1 -1
  15. package/dist/distLint.js +12 -13
  16. package/dist/distLint.min.js +1 -1
  17. package/dist/distMinify.js +3 -5
  18. package/dist/distMinify.min.js +1 -1
  19. package/dist/partials/addToReadme.js +9 -12
  20. package/dist/partials/beginWatcher.js +5 -6
  21. package/dist/partials/clean.js +3 -12
  22. package/dist/partials/distFor.js +10 -9
  23. package/dist/partials/distForSrc.js +3 -3
  24. package/dist/partials/distSeries.js +13 -14
  25. package/dist/partials/minifyFor.js +11 -11
  26. package/dist/partials/readmeTemplate.js +7 -8
  27. package/dist/partials/removeDirectory.js +7 -16
  28. package/dist/partials/runOnChange.js +17 -21
  29. package/dist/partials/tsFor.js +14 -17
  30. package/dist/partials.js +11 -11
  31. package/dist/partials.min.js +1 -1
  32. package/dist/test-helpers/circularObject.js +1 -1
  33. package/dist/test-helpers/countMatches.js +1 -5
  34. package/dist/test-helpers/deepReferenceObject.js +1 -1
  35. package/dist/test-helpers/domItem.js +1 -1
  36. package/dist/test-helpers/jsonDom.js +1 -1
  37. package/dist/test-helpers/linkedList.js +1 -1
  38. package/dist/test-helpers/logObject.js +4 -7
  39. package/dist/test-helpers/multiReferenceObject.js +1 -1
  40. package/dist/test-helpers/nodeTree.js +1 -1
  41. package/dist/test-helpers/setUp.js +31 -75
  42. package/dist/testFull.js +6 -5
  43. package/dist/testFull.min.js +1 -1
  44. package/dist/testHelpers.js +10 -10
  45. package/dist/testHelpers.min.js +1 -1
  46. package/dist/testQuick.js +6 -5
  47. package/dist/testQuick.min.js +1 -1
  48. package/dist/typeScript.js +2 -2
  49. package/dist/typeScript.min.js +1 -1
  50. package/dist/watchFull.js +5 -6
  51. package/dist/watchFull.min.js +1 -1
  52. package/dist/watchTest.js +8 -9
  53. package/dist/watchTest.min.js +1 -1
  54. package/functions/build.test.js +4 -11
  55. package/functions/partials/distFor.test.js +7 -7
  56. package/package.json +6 -6
@@ -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(20)
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(8)
184
- expect(countMatches(bundledContents, 'file2')).toEqual(8)
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(3)
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(7)
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
- // If the below assertion fails it is because 'const' no longer is replaced with 'var'
81
- // To fix, change `.browserslistrc` set `> 0.16%` to a lower number. For example, last fix changed from `> 0.21%`
82
- // Next time, lets just change this test since we cannot set this much lower
83
- expect(countMatches(babelifiedContents, 'const ')).toEqual(0)
84
- expect(countMatches(babelifiedContents, 'var ')).toEqual(10)
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
- }, 60000)
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.11",
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.5",
36
+ "@babel/core": "^7.23.7",
37
37
  "@babel/plugin-proposal-throw-expressions": "^7.23.3",
38
- "@babel/preset-env": "^7.23.5",
38
+ "@babel/preset-env": "^7.23.7",
39
39
  "@babel/preset-typescript": "^7.23.3",
40
- "@babel/runtime-corejs3": "^7.23.5",
40
+ "@babel/runtime-corejs3": "^7.23.7",
41
41
  "babel-jest": "^29.7.0",
42
42
  "browserify": "^17.0.0",
43
- "core-js": "^3.34.0",
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.0",
55
+ "regenerator-runtime": "^0.14.1",
56
56
  "vinyl-source-stream": "^2.0.0"
57
57
  },
58
58
  "files": [