js-build-tools 1.0.0 → 1.0.4

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 CHANGED
@@ -45,6 +45,10 @@ module.exports = {
45
45
  // The directory where Jest test files are stored.
46
46
  // By default stored as *.test.js adjacent with the files they are testing).
47
47
  testPath: 'src',
48
+
49
+ // The search pattern for watching files for changes.
50
+ watchSearch: 'src/**/*.js',
51
+ }
48
52
  ```
49
53
 
50
54
  ### Create your local gulpfile.js
@@ -1,18 +1,18 @@
1
- const bundle = require('./bundle')
2
- const distFor = require('./distFor')
3
- const gulpConfig = require('../gulp.config.js')
4
- const { parallel, series, watch } = require('gulp')
5
- const testQuick = require('./testQuick')
6
-
7
- /**
8
- * Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
9
- * @returns {*}
10
- */
11
- const watchFull = () => watch(gulpConfig.srcSearch)
12
- .on('change', path => {
13
- const pathRegex = new RegExp(`^${gulpConfig.srcPath}(.*\\/).+\\.js$`, 'i')
14
- const distForPath = () => distFor(path, path.replace(pathRegex, `${gulpConfig.distPath}$1`))
15
- return parallel(testQuick, series(distForPath, bundle))()
16
- })
17
-
18
- module.exports = watchFull
1
+ const bundle = require('./bundle')
2
+ const distFor = require('./distFor')
3
+ const gulpConfig = require('../gulp.config.js')
4
+ const { parallel, series, watch } = require('gulp')
5
+ const testQuick = require('./testQuick')
6
+
7
+ /**
8
+ * Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
9
+ * @returns {*}
10
+ */
11
+ const watchFull = () => watch(gulpConfig.watchSearch)
12
+ .on('change', path => {
13
+ const pathRegex = new RegExp(`^${gulpConfig.srcPath}(.*\\/).+\\.js$`, 'i')
14
+ const distForPath = () => distFor(path, path.replace(pathRegex, `${gulpConfig.distPath}$1`))
15
+ return parallel(testQuick, series(distForPath, bundle))()
16
+ })
17
+
18
+ module.exports = watchFull
@@ -1,11 +1,11 @@
1
- const gulpConfig = require('../gulp.config.js')
2
- const { series, watch } = require('gulp')
3
- const testQuick = require('./testQuick')
4
-
5
- /**
6
- * Watch for changes and run the tests.
7
- * @returns {*}
8
- */
9
- const watchTest = () => watch(gulpConfig.srcSearch, { ignoreInitial: false }, series(testQuick))
10
-
11
- module.exports = watchTest
1
+ const gulpConfig = require('../gulp.config.js')
2
+ const { series, watch } = require('gulp')
3
+ const testQuick = require('./testQuick')
4
+
5
+ /**
6
+ * Watch for changes and run the tests.
7
+ * @returns {*}
8
+ */
9
+ const watchTest = () => watch(gulpConfig.watchSearch, { ignoreInitial: false }, series(testQuick))
10
+
11
+ module.exports = watchTest
package/gulp.config.js CHANGED
@@ -1,18 +1,19 @@
1
- const parentConfig = require('../../build-tools.config.js')
2
- const defaultConfig = (config, path, defaultValue) => {
3
- if (typeof config[path] === 'undefined') {
4
- return defaultValue
5
- }
6
- return config[path]
7
- }
8
- module.exports = {
9
- browserName: defaultConfig(parentConfig, 'browserName', 'default'),
10
- browserPath: defaultConfig(parentConfig, 'browserPath', 'browser'),
11
- distMain: defaultConfig(parentConfig, 'distMain', 'dist/main'),
12
- distPath: defaultConfig(parentConfig, 'distPath', 'dist'),
13
- distSearch: defaultConfig(parentConfig, 'distSearch', 'dist/**/*.js'),
14
- readmeTemplate: defaultConfig(parentConfig, 'readmeTemplate', 'MAIN.md'),
15
- srcPath: defaultConfig(parentConfig, 'srcPath', 'src'),
16
- srcSearch: defaultConfig(parentConfig, 'srcSearch', 'src/**/!(*.test).js'),
17
- testPath: defaultConfig(parentConfig, 'testPath', ['src']),
18
- }
1
+ const parentConfig = require('../../build-tools.config.js')
2
+ const defaultConfig = (config, path, defaultValue) => {
3
+ if (typeof config[path] === 'undefined') {
4
+ return defaultValue
5
+ }
6
+ return config[path]
7
+ }
8
+ module.exports = {
9
+ browserName: defaultConfig(parentConfig, 'browserName', 'default'),
10
+ browserPath: defaultConfig(parentConfig, 'browserPath', 'browser'),
11
+ distMain: defaultConfig(parentConfig, 'distMain', 'dist/main'),
12
+ distPath: defaultConfig(parentConfig, 'distPath', 'dist'),
13
+ distSearch: defaultConfig(parentConfig, 'distSearch', 'dist/**/*.js'),
14
+ readmeTemplate: defaultConfig(parentConfig, 'readmeTemplate', 'MAIN.md'),
15
+ srcPath: defaultConfig(parentConfig, 'srcPath', 'src'),
16
+ srcSearch: defaultConfig(parentConfig, 'srcSearch', 'src/**/!(*.test).js'),
17
+ testPath: defaultConfig(parentConfig, 'testPath', ['src']),
18
+ watchSearch: defaultConfig(parentConfig, 'watchSearch', 'src/**/*.js'),
19
+ }
package/package.json CHANGED
@@ -1,68 +1,60 @@
1
- {
2
- "name": "js-build-tools",
3
- "version": "1.0.0",
4
- "description": "Standardised build process with gulp.",
5
- "main": "gulpfile.base.js",
6
- "scripts": {
7
- "build": "gulp build",
8
- "dev": "gulp",
9
- "htmldocs": "jsdoc -R MAIN.md -c ./.jsdoc.conf.js -d docs",
10
- "readme": "gulp readme",
11
- "resolutions": "npx npm-force-resolutions",
12
- "test": "gulp test",
13
- "test:quick": "gulp test:quick",
14
- "watch": "gulp watch",
15
- "watch:tests": "gulp watch:tests"
16
- },
17
- "repository": "github:jheagle/js-build-tools",
18
- "keywords": [
19
- "gulp",
20
- "build",
21
- "node",
22
- "bundler"
23
- ],
24
- "author": "Joshua Heagle <joshuaheagle@gmail.com> (https://joshuaheagle.com)",
25
- "license": "GPL-3.0-or-later",
26
- "bugs": {
27
- "url": "https://github.com/jheagle/js-build-tools/issues"
28
- },
29
- "homepage": "https://github.com/jheagle/js-build-tools#readme",
30
- "standard": {
31
- "env": [
32
- "jest"
33
- ]
34
- },
35
- "dependencies": {
36
- "@babel/core": "^7.17.8",
37
- "@babel/preset-env": "^7.16.11",
38
- "@babel/runtime-corejs3": "^7.17.8",
39
- "babel-jest": "^27.5.1",
40
- "browserify": "^17.0.0",
41
- "core-js": "^3.21.1",
42
- "del": "^6.0.0",
43
- "fs": "^0.0.1-security",
44
- "glob-parent": "^6.0.2",
45
- "gulp": "^4.0.2",
46
- "gulp-babel": "^8.0.0",
47
- "gulp-filenames": "^4.0.1",
48
- "gulp-rename": "^2.0.0",
49
- "gulp-standard": "^14.0.0",
50
- "gulp-uglify-es": "^3.0.0",
51
- "jest": "^27.5.1",
52
- "jsdoc-to-markdown": "^7.1.1",
53
- "lodash.template": "^4.5.0",
54
- "regenerator-runtime": "^0.13.9",
55
- "vinyl-source-stream": "^2.0.0"
56
- },
57
- "resolutions": {
58
- "glob-parent": "6.0.2",
59
- "lodash.template": "4.5.0"
60
- },
61
- "files": [
62
- "babel.config.js",
63
- "functions",
64
- "gulpfile.base.js",
65
- "gulp.config.js"
66
- ],
67
- "funding": "https://www.paypal.com/donate/?business=LRYR6SZRWKXVY&no_recurring=0&item_name=Let%27s+build+together+today+to+simplify+our+jobs+tomorrow.&currency_code=CAD"
68
- }
1
+ {
2
+ "name": "js-build-tools",
3
+ "version": "1.0.4",
4
+ "description": "Standardised build process with gulp.",
5
+ "main": "gulpfile.base.js",
6
+ "scripts": {
7
+ "resolutions": "npx npm-force-resolutions"
8
+ },
9
+ "repository": "github:jheagle/js-build-tools",
10
+ "keywords": [
11
+ "gulp",
12
+ "build",
13
+ "node",
14
+ "bundler"
15
+ ],
16
+ "author": "Joshua Heagle <joshuaheagle@gmail.com> (https://joshuaheagle.com)",
17
+ "license": "GPL-3.0-or-later",
18
+ "bugs": {
19
+ "url": "https://github.com/jheagle/js-build-tools/issues"
20
+ },
21
+ "homepage": "https://github.com/jheagle/js-build-tools#readme",
22
+ "standard": {
23
+ "env": [
24
+ "jest"
25
+ ]
26
+ },
27
+ "dependencies": {
28
+ "@babel/core": "^7.18.6",
29
+ "@babel/preset-env": "^7.18.6",
30
+ "@babel/runtime-corejs3": "^7.18.6",
31
+ "babel-jest": "^28.1.2",
32
+ "browserify": "^17.0.0",
33
+ "core-js": "^3.23.3",
34
+ "del": "^6.1.1",
35
+ "fs": "^0.0.1-security",
36
+ "glob-parent": "^6.0.2",
37
+ "gulp": "^4.0.2",
38
+ "gulp-babel": "^8.0.0",
39
+ "gulp-filenames": "^4.0.1",
40
+ "gulp-rename": "^2.0.0",
41
+ "gulp-standard": "^14.0.0",
42
+ "gulp-uglify-es": "^3.0.0",
43
+ "jest": "^28.1.2",
44
+ "jsdoc-to-markdown": "^7.1.1",
45
+ "lodash.template": "^4.5.0",
46
+ "regenerator-runtime": "^0.13.9",
47
+ "vinyl-source-stream": "^2.0.0"
48
+ },
49
+ "resolutions": {
50
+ "glob-parent": "6.0.2",
51
+ "lodash.template": "4.5.0"
52
+ },
53
+ "files": [
54
+ "babel.config.js",
55
+ "functions",
56
+ "gulpfile.base.js",
57
+ "gulp.config.js"
58
+ ],
59
+ "funding": "https://www.paypal.com/donate/?business=LRYR6SZRWKXVY&no_recurring=0&item_name=Let%27s+build+together+today+to+simplify+our+jobs+tomorrow.&currency_code=CAD"
60
+ }