watchful-cli 1.7.34 → 1.7.36
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/bin/abbreviations.js +3 -0
- package/bin/action/batch.js +2 -1
- package/bin/action/incremental.js +2 -1
- package/bin/actions.js +6 -4
- package/bin/constants.js +0 -2
- package/bin/defaults.js +4 -2
- package/bin/utilities/bundle.js +3 -2
- package/package.json +1 -1
package/bin/abbreviations.js
CHANGED
|
@@ -4,6 +4,7 @@ const { HELP_OPTION,
|
|
|
4
4
|
NODE_OPTION,
|
|
5
5
|
WAIT_OPTION,
|
|
6
6
|
DEBUG_OPTION,
|
|
7
|
+
MINIFY_OPTION,
|
|
7
8
|
BUNDLER_OPTION,
|
|
8
9
|
QUIETLY_OPTION,
|
|
9
10
|
VERSION_OPTION,
|
|
@@ -20,6 +21,7 @@ const h = HELP_OPTION,
|
|
|
20
21
|
n = NODE_OPTION,
|
|
21
22
|
w = WAIT_OPTION,
|
|
22
23
|
d = DEBUG_OPTION,
|
|
24
|
+
i = MINIFY_OPTION,
|
|
23
25
|
u = BUNDLER_OPTION,
|
|
24
26
|
q = QUIETLY_OPTION,
|
|
25
27
|
v = VERSION_OPTION,
|
|
@@ -37,6 +39,7 @@ module.exports = {
|
|
|
37
39
|
n,
|
|
38
40
|
w,
|
|
39
41
|
d,
|
|
42
|
+
i,
|
|
40
43
|
u,
|
|
41
44
|
q,
|
|
42
45
|
v,
|
package/bin/action/batch.js
CHANGED
|
@@ -10,7 +10,7 @@ const action = require("../action"),
|
|
|
10
10
|
|
|
11
11
|
const { BATCH_BUILD_FAILED_MESSAGE } = require("../messages");
|
|
12
12
|
|
|
13
|
-
function batchAction(wait, node, debug, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory) {
|
|
13
|
+
function batchAction(wait, node, debug, minify, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory) {
|
|
14
14
|
const operations = [
|
|
15
15
|
initialiseOperation,
|
|
16
16
|
createTranspileFileFunctionOperation,
|
|
@@ -23,6 +23,7 @@ function batchAction(wait, node, debug, bundler, quietly, metrics, entryFile, pr
|
|
|
23
23
|
wait,
|
|
24
24
|
node,
|
|
25
25
|
debug,
|
|
26
|
+
minify,
|
|
26
27
|
bundler,
|
|
27
28
|
quietly,
|
|
28
29
|
metrics,
|
|
@@ -9,7 +9,7 @@ const watch = require("../watch"),
|
|
|
9
9
|
|
|
10
10
|
const { INCREMENTAL_BUILD_FAILED_MESSAGE } = require("../messages");
|
|
11
11
|
|
|
12
|
-
function incrementalAction(wait, node, debug, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory) {
|
|
12
|
+
function incrementalAction(wait, node, debug, minify, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory) {
|
|
13
13
|
const operations = [
|
|
14
14
|
initialiseOperation,
|
|
15
15
|
createTranspileFileFunctionOperation,
|
|
@@ -20,6 +20,7 @@ function incrementalAction(wait, node, debug, bundler, quietly, metrics, entryFi
|
|
|
20
20
|
wait,
|
|
21
21
|
node,
|
|
22
22
|
debug,
|
|
23
|
+
minify,
|
|
23
24
|
bundler,
|
|
24
25
|
quietly,
|
|
25
26
|
metrics,
|
package/bin/actions.js
CHANGED
|
@@ -10,8 +10,9 @@ const { HELP_COMMAND, BATCH_COMMAND, VERSION_COMMAND, INCREMENTAL_COMMAND } = re
|
|
|
10
10
|
DEFAULT_WAIT,
|
|
11
11
|
DEFAULT_NODE,
|
|
12
12
|
DEFAULT_DEBUG,
|
|
13
|
-
|
|
13
|
+
DEFAULT_MINIFY,
|
|
14
14
|
DEFAULT_BUNDLER,
|
|
15
|
+
DEFAULT_VERSION,
|
|
15
16
|
DEFAULT_QUIETLY,
|
|
16
17
|
DEFAULT_METRICS,
|
|
17
18
|
DEFAULT_ENTRY_FILE,
|
|
@@ -28,8 +29,9 @@ function actions(command, argument, options) {
|
|
|
28
29
|
wait = DEFAULT_WAIT,
|
|
29
30
|
node = DEFAULT_NODE,
|
|
30
31
|
debug = DEFAULT_DEBUG,
|
|
31
|
-
|
|
32
|
+
minify = DEFAULT_MINIFY,
|
|
32
33
|
bundler = DEFAULT_BUNDLER,
|
|
34
|
+
version = DEFAULT_VERSION,
|
|
33
35
|
quietly = DEFAULT_QUIETLY,
|
|
34
36
|
metrics = DEFAULT_METRICS,
|
|
35
37
|
entryFile = DEFAULT_ENTRY_FILE,
|
|
@@ -52,9 +54,9 @@ function actions(command, argument, options) {
|
|
|
52
54
|
|
|
53
55
|
switch (command) {
|
|
54
56
|
case HELP_COMMAND: helpAction(); break;
|
|
55
|
-
case BATCH_COMMAND: batchAction(wait, node, debug, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory); break;
|
|
57
|
+
case BATCH_COMMAND: batchAction(wait, node, debug, minify, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory); break;
|
|
56
58
|
case VERSION_COMMAND: versionAction(); break;
|
|
57
|
-
case INCREMENTAL_COMMAND: incrementalAction(wait, node, debug, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory); break;
|
|
59
|
+
case INCREMENTAL_COMMAND: incrementalAction(wait, node, debug, minify, bundler, quietly, metrics, entryFile, processes, transpiler, bundleFile, libDirectory, tempDirectory, sourceDirectory); break;
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
|
package/bin/constants.js
CHANGED
|
@@ -11,7 +11,6 @@ const S = "s",
|
|
|
11
11
|
BROWSERIFY = "browserify",
|
|
12
12
|
EMPTY_STRING = "",
|
|
13
13
|
WATCHFUL_CLI = "Watchful-CLI",
|
|
14
|
-
PACKAGE_JSON = "package.json",
|
|
15
14
|
SOURCE_MAP_PREAMBLE = "//# sourceMappingURL=data:application/json;base64,",
|
|
16
15
|
PROCESS_TRANSPILE_FILE = "../process/transpileFile",
|
|
17
16
|
SOURCE_DIRECTORY_WATCH_PATTERN = "/**/*.js";
|
|
@@ -28,7 +27,6 @@ module.exports = {
|
|
|
28
27
|
BROWSERIFY,
|
|
29
28
|
EMPTY_STRING,
|
|
30
29
|
WATCHFUL_CLI,
|
|
31
|
-
PACKAGE_JSON,
|
|
32
30
|
SOURCE_MAP_PREAMBLE,
|
|
33
31
|
PROCESS_TRANSPILE_FILE,
|
|
34
32
|
SOURCE_DIRECTORY_WATCH_PATTERN
|
package/bin/defaults.js
CHANGED
|
@@ -6,8 +6,9 @@ const DEFAULT_HELP = false,
|
|
|
6
6
|
DEFAULT_WAIT = 0,
|
|
7
7
|
DEFAULT_NODE = false,
|
|
8
8
|
DEFAULT_DEBUG = false,
|
|
9
|
-
|
|
9
|
+
DEFAULT_MINIFY = false,
|
|
10
10
|
DEFAULT_BUNDLER = BROWSERIFY,
|
|
11
|
+
DEFAULT_VERSION = false,
|
|
11
12
|
DEFAULT_QUIETLY = false,
|
|
12
13
|
DEFAULT_METRICS = false,
|
|
13
14
|
DEFAULT_PROCESSES = 1,
|
|
@@ -23,8 +24,9 @@ module.exports = {
|
|
|
23
24
|
DEFAULT_WAIT,
|
|
24
25
|
DEFAULT_NODE,
|
|
25
26
|
DEFAULT_DEBUG,
|
|
26
|
-
|
|
27
|
+
DEFAULT_MINIFY,
|
|
27
28
|
DEFAULT_BUNDLER,
|
|
29
|
+
DEFAULT_VERSION,
|
|
28
30
|
DEFAULT_QUIETLY,
|
|
29
31
|
DEFAULT_METRICS,
|
|
30
32
|
DEFAULT_PROCESSES,
|
package/bin/utilities/bundle.js
CHANGED
|
@@ -32,7 +32,7 @@ function createEsbuildBundleFilesFunction(context) {
|
|
|
32
32
|
esbuild = require(esbuildPath);
|
|
33
33
|
|
|
34
34
|
esBuildBundleFilesFunction = (entryFilePath, bundleFilePath, targetDirectoryPath, callback) => {
|
|
35
|
-
const { node, debug } = context,
|
|
35
|
+
const { node, debug, minify } = context,
|
|
36
36
|
bundler = esbuild, ///
|
|
37
37
|
targetEntryFilePath = combinePaths(targetDirectoryPath, entryFilePath),
|
|
38
38
|
entryPoint = targetEntryFilePath, ///
|
|
@@ -44,7 +44,8 @@ function createEsbuildBundleFilesFunction(context) {
|
|
|
44
44
|
options = {
|
|
45
45
|
entryPoints,
|
|
46
46
|
outfile,
|
|
47
|
-
bundle
|
|
47
|
+
bundle,
|
|
48
|
+
minify
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
if (debug) {
|
package/package.json
CHANGED