js-build-tools 4.0.2 → 4.0.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/gulp.config.mjs +2 -19
- package/package.json +1 -1
package/gulp.config.mjs
CHANGED
|
@@ -12,22 +12,18 @@ import { fileExists } from 'test-filesystem'
|
|
|
12
12
|
* A setting that may be an array of strings or a string only.
|
|
13
13
|
* @typedef {Array<string>|string} module:gulpConfig~ArrayableSetting
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* A setting that may be true or false.
|
|
18
17
|
* @typedef {boolean} module:gulpConfig~BooleanSetting
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
19
|
/**
|
|
22
20
|
* A setting that may be flag 'false' or provide a StringSetting
|
|
23
21
|
* @typedef {false|StringSetting} module:gulpConfig~FlagStringSetting
|
|
24
22
|
*/
|
|
25
|
-
|
|
26
23
|
/**
|
|
27
24
|
* An object of boolean settings used as flags.
|
|
28
25
|
* @typedef {Object<string, BooleanSetting>} module:gulpConfig~FlagsSetting
|
|
29
26
|
*/
|
|
30
|
-
|
|
31
27
|
/**
|
|
32
28
|
* Configure cli options for running Jest.
|
|
33
29
|
* @typedef {FlagsSetting} module:gulpConfig~JestTestFlags
|
|
@@ -41,17 +37,14 @@ import { fileExists } from 'test-filesystem'
|
|
|
41
37
|
* @property {BooleanSetting} watch
|
|
42
38
|
* @property {BooleanSetting} watchAll
|
|
43
39
|
*/
|
|
44
|
-
|
|
45
40
|
/**
|
|
46
41
|
* A setting that may only be a string.
|
|
47
42
|
* @typedef {string} module:gulpConfig~StringSetting
|
|
48
43
|
*/
|
|
49
|
-
|
|
50
44
|
/**
|
|
51
45
|
* Any single configuration option is a Setting.
|
|
52
46
|
* @typedef {ArrayableSetting|BooleanSetting|FlagsSetting|StringSetting} Setting
|
|
53
47
|
*/
|
|
54
|
-
|
|
55
48
|
/**
|
|
56
49
|
* Configurations for building the browser files.
|
|
57
50
|
* @typedef {Object<string, Setting>} module:gulpConfig~BrowserConfig
|
|
@@ -60,7 +53,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
60
53
|
* @property {StringSetting} name - The search pattern used for retrieving compiled distribution files.
|
|
61
54
|
* @property {StringSetting} to - The output directory for browser-bundled files.
|
|
62
55
|
*/
|
|
63
|
-
|
|
64
56
|
/**
|
|
65
57
|
* Configurations for building the node distribution files.
|
|
66
58
|
* @typedef {Object<string, Setting>} module:gulpConfig~DistConfig
|
|
@@ -68,7 +60,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
68
60
|
* @property {StringSetting} main - Name of the entry the distribution file.
|
|
69
61
|
* @property {StringSetting} to - The output directory for the distribution files.
|
|
70
62
|
*/
|
|
71
|
-
|
|
72
63
|
/**
|
|
73
64
|
* Configurations for copying the font files.
|
|
74
65
|
* @typedef {Object<string, Setting>} module:gulpConfig~FontConfig
|
|
@@ -76,7 +67,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
76
67
|
* @property {StringSetting} from - Path to search for fonts.
|
|
77
68
|
* @property {StringSetting} to - Path to output fonts.
|
|
78
69
|
*/
|
|
79
|
-
|
|
80
70
|
/**
|
|
81
71
|
* Configurations to minify and copy the images.
|
|
82
72
|
* @typedef {Object<string, Setting>} module:gulpConfig~ImageConfig
|
|
@@ -84,7 +74,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
84
74
|
* @property {StringSetting} from - Path to search for images.
|
|
85
75
|
* @property {StringSetting} to - Path to output images.
|
|
86
76
|
*/
|
|
87
|
-
|
|
88
77
|
/**
|
|
89
78
|
* Configurations to compile and generate the Readme file.
|
|
90
79
|
* @typedef {Object<string, Setting>} module:gulpConfig~ReadmeConfig
|
|
@@ -94,7 +83,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
94
83
|
* @property {StringSetting} template - The file which will be pre-fixed to your README.md output.
|
|
95
84
|
* @property {StringSetting} to - The directory to output the readme file in.
|
|
96
85
|
*/
|
|
97
|
-
|
|
98
86
|
/**
|
|
99
87
|
* Configurations to compile and copy the sass files into css.
|
|
100
88
|
* @typedef {Object<string, Setting>} module:gulpConfig~SassConfig
|
|
@@ -103,7 +91,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
103
91
|
* @property {StringSetting} path - The directory were sass files will be stored.
|
|
104
92
|
* @property {StringSetting} to - The destination path for where generated CSS (from SASS files) should go.
|
|
105
93
|
*/
|
|
106
|
-
|
|
107
94
|
/**
|
|
108
95
|
* Configurations for running the test suite.
|
|
109
96
|
* @typedef {Object<string, Setting>} module:gulpConfig~TestConfig
|
|
@@ -112,7 +99,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
112
99
|
* By default, stored as *.test.js adjacent to the files they are testing.
|
|
113
100
|
* @property {ArrayableSetting} watch - The search pattern for watching files for changes.
|
|
114
101
|
*/
|
|
115
|
-
|
|
116
102
|
/**
|
|
117
103
|
* Configurations for compiling typescript into JS files.
|
|
118
104
|
* @typedef {Object<string, Setting>} module:gulpConfig~TsConfig
|
|
@@ -121,7 +107,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
121
107
|
* @property {StringSetting} from - Pattern for finding the TypeScript files.
|
|
122
108
|
* @property {StringSetting} to - Directory where parsed typescript files go.
|
|
123
109
|
*/
|
|
124
|
-
|
|
125
110
|
/**
|
|
126
111
|
* A set of Configurations options defined by Settings.
|
|
127
112
|
* @typedef {Object<string, Setting>} module:gulpConfig~Configurations
|
|
@@ -137,7 +122,6 @@ import { fileExists } from 'test-filesystem'
|
|
|
137
122
|
* @property {TestConfig} test - Run test suite configuration.
|
|
138
123
|
* @property {TsConfig} typescript - Compile from typescript configuration.
|
|
139
124
|
*/
|
|
140
|
-
|
|
141
125
|
import { dotGet } from './functions/utilities/dotGet.mjs'
|
|
142
126
|
import { dotSet } from './functions/utilities/dotSet.mjs'
|
|
143
127
|
import { dotNotate } from './functions/utilities/dotNotate.mjs'
|
|
@@ -210,9 +194,8 @@ const setDefaults = {
|
|
|
210
194
|
* @type {Configurations}
|
|
211
195
|
*/
|
|
212
196
|
let gulpConfigurations = null
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
gulpConfigurations = JSON.parse(readFileSync('../../build-tools.config.json').toString())
|
|
197
|
+
if (fileExists(process.cwd() + '/build-tools.config.json')) {
|
|
198
|
+
gulpConfigurations = JSON.parse(readFileSync(process.cwd() + '/build-tools.config.json').toString())
|
|
216
199
|
} else {
|
|
217
200
|
if (fileExists('./build-tools.config.json')) {
|
|
218
201
|
gulpConfigurations = JSON.parse(readFileSync('./build-tools.config.json').toString())
|