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.
@@ -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 addDirectory() {
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 = addDirectory;
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 addForcedDependencyRelation() {
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 = addForcedDependencyRelation;
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 addIgnoredDependency() {
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 = addIgnoredDependency;
40
+ module.exports = addIgnoredDependencyAction;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function help() {
3
+ function helpAction() {
4
4
  console.log(`Usage:
5
5
 
6
6
  propagate [help] Show this help
@@ -57,4 +57,4 @@ Please see the readme file on GitHub:
57
57
  `);
58
58
  }
59
59
 
60
- module.exports = help;
60
+ module.exports = helpAction;
@@ -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 initialise() {
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 = initialise;
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 listDirectories() {
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 = listDirectories;
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 listForcedDependencyRelations() {
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 = listForcedDependencyRelations;
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 listForcedDependencyRelations() {
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 = listForcedDependencyRelations;
36
+ module.exports = listForcedDependencyRelationsAction;
@@ -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 propagate(argument, quietly, dryRun, yes) {
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 = propagate;
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 removeDirectory() {
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 = removeDirectory;
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 removeForcedDependencyRelation() {
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 = removeForcedDependencyRelation;
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 removeIgnoredDependency() {
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 = removeIgnoredDependency;
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 setShellCommands() {
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 = setShellCommands;
39
+ module.exports = setShellCommandsAction;
@@ -3,11 +3,11 @@
3
3
  const { PROPAGATE_CLI } = require("../constants"),
4
4
  { getPackageVersion } = require("../utilities/packageJSON");
5
5
 
6
- function version() {
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 = version;
13
+ module.exports = versionAction;
package/bin/actions.js CHANGED
@@ -1,22 +1,21 @@
1
1
  "use strict";
2
2
 
3
- const help = require("./action/help"),
4
- version = require("./action/version"),
5
- propagate = require("./action/propagate"),
6
- initialise = require("./action/initialise"),
7
- addDirectory = require("./action/addDirectory"),
8
- removeDirectory = require("./action/removeDirectory"),
9
- listDirectories = require("./action/listDirectories"),
10
- setShellCommands = require("./action/setShellCommands"),
11
- addIgnoredDependency = require("./action/addIgnoredDependency"),
12
- listIgnoredDependencies = require("./action/listIgnoredDependencies"),
13
- removeIgnoredDependency = require("./action/removeIgnoredDependency"),
14
- addForcedDependencyRelation = require("./action/addForcedDependencyRelation"),
15
- listForcedDependencyRelations = require("./action/listForcedDependencyRelations"),
16
- removeForcedDependencyRelation = require("./action/removeForcedDependencyRelation");
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 { isOptionPresent } = require("./utilities/option"),
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
- yesOptionPresent = isOptionPresent(YES_OPTION, options),
38
- helpOptionPresent = isOptionPresent(HELP_OPTION, options),
39
- dryRunOptionPresent = isOptionPresent(DRY_RUN_OPTION, options),
40
- versionOptionPresent = isOptionPresent(VERSION_OPTION, options),
41
- quietlyOptionPresent = isOptionPresent(QUIETLY_OPTION, options),
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 (versionOptionPresent) {
44
+ } else if (version) {
49
45
  command = VERSION_COMMAND;
50
- } else if (helpOptionPresent) {
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 : help(); break;
78
- case VERSION_COMMAND : version(); break;
79
- case PROPAGATE_COMMAND : propagate(argument, quietly, dryRun, yes); break;
80
- case INITIALISE_COMMAND : initialise(); break;
81
- case ADD_DIRECTORY_COMMAND : addDirectory(); break;
82
- case REMOVE_DIRECTORY_COMMAND : removeDirectory(); break;
83
- case LIST_DIRECTORIES_COMMAND : listDirectories(); break;
84
- case SET_SHELL_COMMANDS_COMMAND : setShellCommands(); break;
85
- case ADD_IGNORED_DEPENDENCY_COMMAND : addIgnoredDependency(); break;
86
- case LIST_IGNORED_DEPENDENCIES_COMMAND : listIgnoredDependencies(); break;
87
- case REMOVE_IGNORED_DEPENDENCY_COMMAND : removeIgnoredDependency(); break;
88
- case ADD_FORCED_DEPENDENCY_RELATION_COMMAND : addForcedDependencyRelation(); break;
89
- case LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND : listForcedDependencyRelations(); break;
90
- case REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND : removeForcedDependencyRelation(); break;
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 DEFAULT_DIRECTORY_NAME = ".",
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "propagate-cli",
3
3
  "author": "James Smith",
4
- "version": "1.9.16",
4
+ "version": "1.9.18",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/propagate-cli",
7
7
  "description": "Propagate updated packages throughout a project.",
@@ -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
- };