propagate-cli 1.9.16 → 1.9.18
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/action/addDirectory.js +2 -2
- package/bin/action/addForcedDependencyRelation.js +2 -2
- package/bin/action/addIgnoredDependency.js +2 -2
- package/bin/action/help.js +2 -2
- package/bin/action/initialise.js +2 -2
- package/bin/action/listDirectories.js +2 -2
- package/bin/action/listForcedDependencyRelations.js +2 -2
- package/bin/action/listIgnoredDependencies.js +2 -2
- package/bin/action/propagate.js +2 -2
- package/bin/action/removeDirectory.js +2 -2
- package/bin/action/removeForcedDependencyRelation.js +2 -2
- package/bin/action/removeIgnoredDependency.js +2 -2
- package/bin/action/setShellCommands.js +2 -2
- package/bin/action/version.js +2 -2
- package/bin/actions.js +36 -40
- package/bin/defaults.js +11 -1
- package/package.json +1 -1
- package/bin/utilities/option.js +0 -17
|
@@ -6,7 +6,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
6
6
|
{ retrieveDirectories, updateDirectories } = require("../configuration"),
|
|
7
7
|
{ FAILED_ADD_DIRECTORY_MESSAGE, SUCCESSFUL_ADD_DIRECTORY_MESSAGE, DIRECTORIES_INCLUDES_DIRECTORY_MESSAGE } = require("../messages");
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function addDirectoryAction() {
|
|
10
10
|
const operations = [
|
|
11
11
|
addDirectoryPromptOperation
|
|
12
12
|
],
|
|
@@ -36,4 +36,4 @@ function addDirectory() {
|
|
|
36
36
|
}, context);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
module.exports =
|
|
39
|
+
module.exports = addDirectoryAction;
|
|
@@ -9,7 +9,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
9
9
|
SUCCESSFUL_ADD_FORCED_DEPENDENCY_RELATION_MESSAGE,
|
|
10
10
|
FORCED_DEPENDENCY_RELATIONS_INCLUDE_FORCED_DEPENDENCY_RELATION_MESSAGE } = require("../messages");
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function addForcedDependencyRelationAction() {
|
|
13
13
|
const operations = [
|
|
14
14
|
addForcedDependencyPromptOperation,
|
|
15
15
|
addForcedDependentPromptOperation
|
|
@@ -52,4 +52,4 @@ function addForcedDependencyRelation() {
|
|
|
52
52
|
}, context);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
module.exports =
|
|
55
|
+
module.exports = addForcedDependencyRelationAction;
|
|
@@ -8,7 +8,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
8
8
|
SUCCESSFUL_ADD_IGNORED_DEPENDENCY_MESSAGE,
|
|
9
9
|
IGNORED_DEPENDENCIES_INCLUDE_IGNORED_DEPENDENCY_MESSAGE } = require("../messages");
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function addIgnoredDependencyAction() {
|
|
12
12
|
const operations = [
|
|
13
13
|
addIgnoredDependencyPromptOperation
|
|
14
14
|
],
|
|
@@ -37,4 +37,4 @@ function addIgnoredDependency() {
|
|
|
37
37
|
}, context);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
module.exports =
|
|
40
|
+
module.exports = addIgnoredDependencyAction;
|
package/bin/action/help.js
CHANGED
package/bin/action/initialise.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { checkConfigurationFileExists, createConfigurationFile } = require("../configuration"),
|
|
4
4
|
{ FAILED_INITIALISE_MESSAGE, SUCCESSFUL_INITIALISE_MESSAGE } = require("../messages");
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function initialiseAction() {
|
|
7
7
|
const configurationFileExists = checkConfigurationFileExists();
|
|
8
8
|
|
|
9
9
|
if (configurationFileExists) {
|
|
@@ -15,4 +15,4 @@ function initialise() {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
module.exports =
|
|
18
|
+
module.exports = initialiseAction;
|
|
@@ -4,7 +4,7 @@ const { EMPTY_STRING } = require("../constants"),
|
|
|
4
4
|
{ retrieveDirectories } = require("../configuration"),
|
|
5
5
|
{ DEFAULT_DIRECTORY_NAME } = require("../defaults");
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function listDirectoriesAction() {
|
|
8
8
|
const directoryNumbers = [],
|
|
9
9
|
directories = retrieveDirectories(),
|
|
10
10
|
defaultDirectoryName = DEFAULT_DIRECTORY_NAME,
|
|
@@ -32,4 +32,4 @@ function listDirectories() {
|
|
|
32
32
|
return directoryNumbers;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
module.exports =
|
|
35
|
+
module.exports = listDirectoriesAction;
|
|
@@ -5,7 +5,7 @@ const { EMPTY_STRING } = require("../constants"),
|
|
|
5
5
|
|
|
6
6
|
const { NO_FORCED_DEPENDENCY_RELATIONS_MESSAGE } = require("../messages");
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function listForcedDependencyRelationsAction() {
|
|
9
9
|
const forcedDependencyRelationsNumbers = [],
|
|
10
10
|
forcedDependencyRelations = retrieveForcedDependencyRelations(),
|
|
11
11
|
forcedDependencyRelationsLength = forcedDependencyRelations.length;
|
|
@@ -30,4 +30,4 @@ function listForcedDependencyRelations() {
|
|
|
30
30
|
return forcedDependencyRelationsNumbers;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
module.exports =
|
|
33
|
+
module.exports = listForcedDependencyRelationsAction;
|
|
@@ -5,7 +5,7 @@ const { EMPTY_STRING } = require("../constants"),
|
|
|
5
5
|
|
|
6
6
|
const { NO_IGNORED_DEPENDENCIES_MESSAGE } = require("../messages");
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
function listForcedDependencyRelationsAction() {
|
|
9
9
|
const ignoredDependencyNumbers = [],
|
|
10
10
|
ignoredDependencies = retrieveIgnoredDependencies(),
|
|
11
11
|
ignoredDependenciesLength = ignoredDependencies.length;
|
|
@@ -33,4 +33,4 @@ function listForcedDependencyRelations() {
|
|
|
33
33
|
return ignoredDependencyNumbers;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
module.exports =
|
|
36
|
+
module.exports = listForcedDependencyRelationsAction;
|
package/bin/action/propagate.js
CHANGED
|
@@ -14,7 +14,7 @@ const dryRunOperation = require("../operation/dryRun"),
|
|
|
14
14
|
const { executeOperations } = require("../utilities/operation"),
|
|
15
15
|
{ FAILED_PROPAGATE_MESSAGE, SUCCESSFUL_PROPAGATE_MESSAGE } = require("../messages");
|
|
16
16
|
|
|
17
|
-
function
|
|
17
|
+
function propagateAction(argument, quietly, dryRun, yes) {
|
|
18
18
|
const operations = [
|
|
19
19
|
createSubDirectoryPathOperation,
|
|
20
20
|
createSubDirectoryMapOperation,
|
|
@@ -47,4 +47,4 @@ function propagate(argument, quietly, dryRun, yes) {
|
|
|
47
47
|
}, context);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
module.exports =
|
|
50
|
+
module.exports = propagateAction;
|
|
@@ -7,7 +7,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
7
7
|
{ updateDirectories, retrieveDirectories } = require("../configuration"),
|
|
8
8
|
{ FAILED_REMOVE_DIRECTORY_MESSAGE, SUCCESSFUL_REMOVE_DIRECTORY_MESSAGE } = require("../messages");
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function removeDirectoryAction() {
|
|
11
11
|
const operations = [
|
|
12
12
|
removeDirectoryPromptOperation
|
|
13
13
|
],
|
|
@@ -42,4 +42,4 @@ function removeDirectory() {
|
|
|
42
42
|
}, context);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
module.exports =
|
|
45
|
+
module.exports = removeDirectoryAction;
|
|
@@ -7,7 +7,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
7
7
|
{ updateForcedDependencyRelations, retrieveForcedDependencyRelations } = require("../configuration"),
|
|
8
8
|
{ FAILED_REMOVE_FORCED_DEPENDENCY_RELATION_MESSAGE, SUCCESSFUL_REMOVE_FORCED_DEPENDENCY_RELATION_MESSAGE } = require("../messages");
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function removeForcedDependencyRelationAction() {
|
|
11
11
|
const operations = [
|
|
12
12
|
removeForcedDependencyRelationPromptOperation
|
|
13
13
|
],
|
|
@@ -42,4 +42,4 @@ function removeForcedDependencyRelation() {
|
|
|
42
42
|
}, context);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
module.exports =
|
|
45
|
+
module.exports = removeForcedDependencyRelationAction;
|
|
@@ -7,7 +7,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
7
7
|
{ updateIgnoredDependencies, retrieveIgnoredDependencies } = require("../configuration"),
|
|
8
8
|
{ FAILED_REMOVE_IGNORED_DEPENDENCY_MESSAGE, SUCCESSFUL_REMOVE_IGNORED_DEPENDENCY_MESSAGE } = require("../messages");
|
|
9
9
|
|
|
10
|
-
function
|
|
10
|
+
function removeIgnoredDependencyAction() {
|
|
11
11
|
const operations = [
|
|
12
12
|
removeIgnoredDependencyPromptOperation
|
|
13
13
|
],
|
|
@@ -42,4 +42,4 @@ function removeIgnoredDependency() {
|
|
|
42
42
|
}, context);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
module.exports =
|
|
45
|
+
module.exports = removeIgnoredDependencyAction;
|
|
@@ -9,7 +9,7 @@ const { executeOperations } = require("../utilities/operation"),
|
|
|
9
9
|
{ retrieveShellCommands, updateShellCommands } = require("../configuration"),
|
|
10
10
|
{ FAILED_SET_SHELL_COMMANDS_MESSAGE, SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE } = require("../messages");
|
|
11
11
|
|
|
12
|
-
function
|
|
12
|
+
function setShellCommandsAction() {
|
|
13
13
|
const operations = [
|
|
14
14
|
setGitShellCommandsPromptOperation,
|
|
15
15
|
setInstallShellCommandsPromptOperation,
|
|
@@ -36,4 +36,4 @@ function setShellCommands() {
|
|
|
36
36
|
}, context);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
module.exports =
|
|
39
|
+
module.exports = setShellCommandsAction;
|
package/bin/action/version.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
const { PROPAGATE_CLI } = require("../constants"),
|
|
4
4
|
{ getPackageVersion } = require("../utilities/packageJSON");
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function versionAction() {
|
|
7
7
|
const packageVersion = getPackageVersion(),
|
|
8
8
|
version = packageVersion; ///
|
|
9
9
|
|
|
10
10
|
console.log(`${PROPAGATE_CLI} version ${version}`);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
module.exports =
|
|
13
|
+
module.exports = versionAction;
|
package/bin/actions.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
const helpAction = require("./action/help"),
|
|
4
|
+
versionAction = require("./action/version"),
|
|
5
|
+
propagateAction = require("./action/propagate"),
|
|
6
|
+
initialiseAction = require("./action/initialise"),
|
|
7
|
+
addDirectoryAction = require("./action/addDirectory"),
|
|
8
|
+
removeDirectoryAction = require("./action/removeDirectory"),
|
|
9
|
+
listDirectoriesAction = require("./action/listDirectories"),
|
|
10
|
+
setShellCommandsAction = require("./action/setShellCommands"),
|
|
11
|
+
addIgnoredDependencyAction = require("./action/addIgnoredDependency"),
|
|
12
|
+
listIgnoredDependenciesAction = require("./action/listIgnoredDependencies"),
|
|
13
|
+
removeIgnoredDependencyAction = require("./action/removeIgnoredDependency"),
|
|
14
|
+
addForcedDependencyRelationAction = require("./action/addForcedDependencyRelation"),
|
|
15
|
+
listForcedDependencyRelationsAction = require("./action/listForcedDependencyRelations"),
|
|
16
|
+
removeForcedDependencyRelationAction = require("./action/removeForcedDependencyRelation");
|
|
17
17
|
|
|
18
|
-
const {
|
|
19
|
-
{ YES_OPTION, HELP_OPTION, VERSION_OPTION, QUIETLY_OPTION, DRY_RUN_OPTION } = require("./options"),
|
|
18
|
+
const { DEFAULT_YES, DEFAULT_QUIETLY, DEFAULT_DRY_RUN, DEFAULT_HELP, DEFAULT_VERSION} = require("./defaults"),
|
|
20
19
|
{ HELP_COMMAND,
|
|
21
20
|
VERSION_COMMAND,
|
|
22
21
|
PROPAGATE_COMMAND,
|
|
@@ -34,20 +33,17 @@ const { isOptionPresent } = require("./utilities/option"),
|
|
|
34
33
|
|
|
35
34
|
function actions(command, argument, options) {
|
|
36
35
|
const commandMissing = (command === null),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
quietly = quietlyOptionPresent, ///
|
|
43
|
-
dryRun = dryRunOptionPresent, ///
|
|
44
|
-
yes = yesOptionPresent; ///
|
|
36
|
+
{ yes = DEFAULT_YES,
|
|
37
|
+
help = DEFAULT_HELP,
|
|
38
|
+
dryRun = DEFAULT_DRY_RUN,
|
|
39
|
+
version = DEFAULT_VERSION,
|
|
40
|
+
quietly = DEFAULT_QUIETLY } = options;
|
|
45
41
|
|
|
46
42
|
if (false) {
|
|
47
43
|
///
|
|
48
|
-
} else if (
|
|
44
|
+
} else if (version) {
|
|
49
45
|
command = VERSION_COMMAND;
|
|
50
|
-
} else if (
|
|
46
|
+
} else if (help) {
|
|
51
47
|
command = HELP_COMMAND;
|
|
52
48
|
} else if (commandMissing) {
|
|
53
49
|
command = HELP_COMMAND;
|
|
@@ -74,20 +70,20 @@ function actions(command, argument, options) {
|
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
switch (command) {
|
|
77
|
-
case HELP_COMMAND :
|
|
78
|
-
case VERSION_COMMAND :
|
|
79
|
-
case PROPAGATE_COMMAND :
|
|
80
|
-
case INITIALISE_COMMAND :
|
|
81
|
-
case ADD_DIRECTORY_COMMAND :
|
|
82
|
-
case REMOVE_DIRECTORY_COMMAND :
|
|
83
|
-
case LIST_DIRECTORIES_COMMAND :
|
|
84
|
-
case SET_SHELL_COMMANDS_COMMAND :
|
|
85
|
-
case ADD_IGNORED_DEPENDENCY_COMMAND :
|
|
86
|
-
case LIST_IGNORED_DEPENDENCIES_COMMAND :
|
|
87
|
-
case REMOVE_IGNORED_DEPENDENCY_COMMAND :
|
|
88
|
-
case ADD_FORCED_DEPENDENCY_RELATION_COMMAND :
|
|
89
|
-
case LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND :
|
|
90
|
-
case REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND :
|
|
73
|
+
case HELP_COMMAND : helpAction(); break;
|
|
74
|
+
case VERSION_COMMAND : versionAction(); break;
|
|
75
|
+
case PROPAGATE_COMMAND : propagateAction(argument, quietly, dryRun, yes); break;
|
|
76
|
+
case INITIALISE_COMMAND : initialiseAction(); break;
|
|
77
|
+
case ADD_DIRECTORY_COMMAND : addDirectoryAction(); break;
|
|
78
|
+
case REMOVE_DIRECTORY_COMMAND : removeDirectoryAction(); break;
|
|
79
|
+
case LIST_DIRECTORIES_COMMAND : listDirectoriesAction(); break;
|
|
80
|
+
case SET_SHELL_COMMANDS_COMMAND : setShellCommandsAction(); break;
|
|
81
|
+
case ADD_IGNORED_DEPENDENCY_COMMAND : addIgnoredDependencyAction(); break;
|
|
82
|
+
case LIST_IGNORED_DEPENDENCIES_COMMAND : listIgnoredDependenciesAction(); break;
|
|
83
|
+
case REMOVE_IGNORED_DEPENDENCY_COMMAND : removeIgnoredDependencyAction(); break;
|
|
84
|
+
case ADD_FORCED_DEPENDENCY_RELATION_COMMAND : addForcedDependencyRelationAction(); break;
|
|
85
|
+
case LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND : listForcedDependencyRelationsAction(); break;
|
|
86
|
+
case REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND : removeForcedDependencyRelationAction(); break;
|
|
91
87
|
}
|
|
92
88
|
}
|
|
93
89
|
|
package/bin/defaults.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const DEFAULT_YES = false,
|
|
4
|
+
DEFAULT_HELP = false,
|
|
5
|
+
DEFAULT_DRY_RUN = false,
|
|
6
|
+
DEFAULT_VERSION = false,
|
|
7
|
+
DEFAULT_QUIETLY = false,
|
|
8
|
+
DEFAULT_DIRECTORY_NAME = ".",
|
|
4
9
|
DEFAULT_GIT_SHELL_COMMANDS = "git add .; git commit -m \"Propagated.\"; git push",
|
|
5
10
|
DEFAULT_BUILD_SHELL_COMMANDS = "npm run build",
|
|
6
11
|
DEFAULT_INSTALL_SHELL_COMMANDS = "npm install",
|
|
7
12
|
DEFAULT_PUBLISH_SHELL_COMMANDS = "npm publish";
|
|
8
13
|
|
|
9
14
|
module.exports = {
|
|
15
|
+
DEFAULT_YES,
|
|
16
|
+
DEFAULT_HELP,
|
|
17
|
+
DEFAULT_DRY_RUN,
|
|
18
|
+
DEFAULT_VERSION,
|
|
19
|
+
DEFAULT_QUIETLY,
|
|
10
20
|
DEFAULT_DIRECTORY_NAME,
|
|
11
21
|
DEFAULT_GIT_SHELL_COMMANDS,
|
|
12
22
|
DEFAULT_BUILD_SHELL_COMMANDS,
|
package/package.json
CHANGED
package/bin/utilities/option.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { stringUtilities } = require("argumentative");
|
|
4
|
-
|
|
5
|
-
const { toCamelCase } = stringUtilities;
|
|
6
|
-
|
|
7
|
-
function isOptionPresent(option, options) {
|
|
8
|
-
option = toCamelCase(option); ///
|
|
9
|
-
|
|
10
|
-
const optionPresent = options.hasOwnProperty(option);
|
|
11
|
-
|
|
12
|
-
return optionPresent;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = {
|
|
16
|
-
isOptionPresent
|
|
17
|
-
};
|