propagate-cli 1.10.0 → 1.10.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.
Files changed (167) hide show
  1. package/.swcrc +5 -0
  2. package/lib/abbreviations.js +22 -0
  3. package/lib/action/addDirectory.js +41 -0
  4. package/lib/action/addForcedDependencyRelation.js +51 -0
  5. package/lib/action/addIgnoredDependency.js +40 -0
  6. package/lib/action/help.js +15 -0
  7. package/lib/action/initialise.js +23 -0
  8. package/lib/action/listDirectories.js +57 -0
  9. package/lib/action/listForcedDependencyRelations.js +30 -0
  10. package/lib/action/listIgnoredDependencies.js +56 -0
  11. package/lib/action/propagate.js +57 -0
  12. package/lib/action/removeDirectory.js +43 -0
  13. package/lib/action/removeForcedDependencyRelation.js +43 -0
  14. package/lib/action/removeIgnoredDependency.js +43 -0
  15. package/lib/action/setShellCommands.js +43 -0
  16. package/lib/action/version.js +19 -0
  17. package/lib/changeDirectory.js +33 -0
  18. package/lib/commands.js +70 -0
  19. package/lib/configuration/version_1_10.js +48 -0
  20. package/lib/configuration/version_1_3.js +21 -0
  21. package/lib/configuration/version_1_7.js +21 -0
  22. package/lib/configuration/version_1_9.js +27 -0
  23. package/lib/configuration.js +191 -0
  24. package/lib/constants.js +46 -0
  25. package/lib/defaults.js +54 -0
  26. package/lib/descriptions.js +82 -0
  27. package/lib/diff/map.js +114 -0
  28. package/lib/diff/semver.js +88 -0
  29. package/lib/diff/version.js +97 -0
  30. package/lib/diff.js +210 -0
  31. package/lib/main.js +119 -0
  32. package/lib/messages.js +190 -0
  33. package/lib/operation/checkDevDependencies.js +34 -0
  34. package/lib/operation/createDiffs.js +78 -0
  35. package/lib/operation/createReleaseGraph.js +43 -0
  36. package/lib/operation/createReleaseMap.js +26 -0
  37. package/lib/operation/createSubDirectoryMap.js +65 -0
  38. package/lib/operation/createSubDirectoryPath.js +30 -0
  39. package/lib/operation/dryRun.js +22 -0
  40. package/lib/operation/prompt/addDirectory.js +37 -0
  41. package/lib/operation/prompt/addForcedDependency.js +37 -0
  42. package/lib/operation/prompt/addForcedDependent.js +37 -0
  43. package/lib/operation/prompt/addIgnoredDependency.js +37 -0
  44. package/lib/operation/prompt/build.js +52 -0
  45. package/lib/operation/prompt/git.js +52 -0
  46. package/lib/operation/prompt/install.js +52 -0
  47. package/lib/operation/prompt/publish.js +61 -0
  48. package/lib/operation/prompt/removeDirectory.js +39 -0
  49. package/lib/operation/prompt/removeForcedDependencyRelation.js +39 -0
  50. package/lib/operation/prompt/removeIgnoredDependency.js +39 -0
  51. package/lib/operation/prompt/save.js +57 -0
  52. package/lib/operation/prompt/setBuildShellCommands.js +33 -0
  53. package/lib/operation/prompt/setGitShellCommands.js +33 -0
  54. package/lib/operation/prompt/setInstallShellCommands.js +33 -0
  55. package/lib/operation/prompt/setPublishShellCommands.js +33 -0
  56. package/lib/operation/propagateRelease.js +73 -0
  57. package/lib/operation/retrieveRelease.js +31 -0
  58. package/lib/operation/saveAndApplyDiff.js +49 -0
  59. package/lib/operation/saveAndApplyDiffs.js +27 -0
  60. package/lib/options.js +34 -0
  61. package/lib/prepare.js +48 -0
  62. package/lib/release.js +227 -0
  63. package/lib/releaseGraph.js +170 -0
  64. package/lib/releaseMap.js +120 -0
  65. package/lib/utilities/console.js +81 -0
  66. package/lib/utilities/dependency.js +25 -0
  67. package/lib/utilities/diffs.js +28 -0
  68. package/lib/utilities/operation.js +53 -0
  69. package/lib/utilities/packageJSON.js +50 -0
  70. package/lib/utilities/path.js +22 -0
  71. package/lib/utilities/prompt.js +15 -0
  72. package/lib/utilities/propagate.js +60 -0
  73. package/lib/utilities/shell.js +63 -0
  74. package/lib/utilities/validate.js +68 -0
  75. package/lib/version.js +140 -0
  76. package/lib/versions.js +34 -0
  77. package/package.json +19 -4
  78. package/propagate.js +3 -3
  79. package/src/abbreviations.js +19 -0
  80. package/{bin → src}/action/addDirectory.js +5 -7
  81. package/{bin → src}/action/addForcedDependencyRelation.js +8 -10
  82. package/{bin → src}/action/addIgnoredDependency.js +7 -9
  83. package/{bin → src}/action/help.js +1 -3
  84. package/{bin → src}/action/initialise.js +3 -5
  85. package/{bin → src}/action/listDirectories.js +4 -6
  86. package/{bin → src}/action/listForcedDependencyRelations.js +4 -6
  87. package/{bin → src}/action/listIgnoredDependencies.js +4 -6
  88. package/src/action/propagate.js +48 -0
  89. package/{bin → src}/action/removeDirectory.js +6 -8
  90. package/{bin → src}/action/removeForcedDependencyRelation.js +6 -8
  91. package/{bin → src}/action/removeIgnoredDependency.js +6 -8
  92. package/src/action/setShellCommands.js +37 -0
  93. package/src/action/version.js +13 -0
  94. package/{bin → src}/changeDirectory.js +4 -6
  95. package/src/commands.js +16 -0
  96. package/{bin → src}/configuration/version_1_10.js +4 -9
  97. package/{bin → src}/configuration/version_1_3.js +2 -6
  98. package/{bin → src}/configuration/version_1_7.js +2 -6
  99. package/{bin → src}/configuration/version_1_9.js +3 -7
  100. package/{bin → src}/configuration.js +23 -40
  101. package/src/constants.js +10 -0
  102. package/src/defaults.js +12 -0
  103. package/src/descriptions.js +19 -0
  104. package/{bin → src}/diff/map.js +4 -6
  105. package/{bin → src}/diff/semver.js +1 -3
  106. package/{bin → src}/diff/version.js +2 -4
  107. package/{bin → src}/diff.js +5 -7
  108. package/{bin → src}/main.js +20 -22
  109. package/src/messages.js +46 -0
  110. package/{bin → src}/operation/checkDevDependencies.js +1 -3
  111. package/{bin → src}/operation/createDiffs.js +2 -4
  112. package/{bin → src}/operation/createReleaseGraph.js +5 -7
  113. package/{bin → src}/operation/createReleaseMap.js +3 -5
  114. package/{bin → src}/operation/createSubDirectoryMap.js +5 -7
  115. package/{bin → src}/operation/createSubDirectoryPath.js +5 -7
  116. package/{bin → src}/operation/dryRun.js +1 -3
  117. package/{bin → src}/operation/prompt/addDirectory.js +5 -7
  118. package/{bin → src}/operation/prompt/addForcedDependency.js +5 -7
  119. package/{bin → src}/operation/prompt/addForcedDependent.js +5 -7
  120. package/{bin → src}/operation/prompt/addIgnoredDependency.js +5 -7
  121. package/{bin → src}/operation/prompt/build.js +8 -10
  122. package/{bin → src}/operation/prompt/git.js +8 -10
  123. package/{bin → src}/operation/prompt/install.js +8 -10
  124. package/{bin → src}/operation/prompt/publish.js +9 -11
  125. package/{bin → src}/operation/prompt/removeDirectory.js +5 -7
  126. package/{bin → src}/operation/prompt/removeForcedDependencyRelation.js +5 -7
  127. package/{bin → src}/operation/prompt/removeIgnoredDependency.js +5 -7
  128. package/{bin → src}/operation/prompt/save.js +9 -11
  129. package/{bin → src}/operation/prompt/setBuildShellCommands.js +6 -8
  130. package/{bin → src}/operation/prompt/setGitShellCommands.js +6 -8
  131. package/{bin → src}/operation/prompt/setInstallShellCommands.js +6 -8
  132. package/{bin → src}/operation/prompt/setPublishShellCommands.js +6 -8
  133. package/{bin → src}/operation/propagateRelease.js +3 -5
  134. package/{bin → src}/operation/retrieveRelease.js +2 -4
  135. package/{bin → src}/operation/saveAndApplyDiff.js +8 -10
  136. package/src/operation/saveAndApplyDiffs.js +17 -0
  137. package/src/options.js +7 -0
  138. package/{bin → src}/prepare.js +17 -19
  139. package/{bin → src}/release.js +5 -7
  140. package/{bin → src}/releaseGraph.js +2 -4
  141. package/{bin → src}/releaseMap.js +2 -4
  142. package/{bin → src}/utilities/console.js +5 -11
  143. package/{bin → src}/utilities/dependency.js +1 -5
  144. package/{bin → src}/utilities/diffs.js +2 -7
  145. package/{bin → src}/utilities/operation.js +3 -8
  146. package/{bin → src}/utilities/packageJSON.js +4 -9
  147. package/{bin → src}/utilities/path.js +2 -6
  148. package/src/utilities/prompt.js +3 -0
  149. package/{bin → src}/utilities/propagate.js +3 -8
  150. package/{bin → src}/utilities/shell.js +7 -11
  151. package/src/utilities/validate.js +19 -0
  152. package/{bin → src}/version.js +2 -4
  153. package/src/versions.js +7 -0
  154. package/bin/abbreviations.js +0 -11
  155. package/bin/action/propagate.js +0 -50
  156. package/bin/action/setShellCommands.js +0 -39
  157. package/bin/action/version.js +0 -15
  158. package/bin/commands.js +0 -33
  159. package/bin/constants.js +0 -23
  160. package/bin/defaults.js +0 -25
  161. package/bin/descriptions.js +0 -39
  162. package/bin/messages.js +0 -93
  163. package/bin/operation/saveAndApplyDiffs.js +0 -19
  164. package/bin/options.js +0 -15
  165. package/bin/utilities/prompt.js +0 -7
  166. package/bin/utilities/validate.js +0 -31
  167. package/bin/versions.js +0 -15
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ export const HELP_COMMAND = "help";
4
+ export const VERSION_COMMAND = "version";
5
+ export const PROPAGATE_COMMAND = "propagate";
6
+ export const INITIALISE_COMMAND = "initialise";
7
+ export const ADD_DIRECTORY_COMMAND = "add-directory";
8
+ export const LIST_DIRECTORIES_COMMAND = "list-directories";
9
+ export const REMOVE_DIRECTORY_COMMAND = "remove-directory";
10
+ export const SET_SHELL_COMMANDS_COMMAND = "set-shell-commands";
11
+ export const ADD_IGNORED_DEPENDENCY_COMMAND = "add-ignored-dependency";
12
+ export const REMOVE_IGNORED_DEPENDENCY_COMMAND = "remove-ignored-dependency";
13
+ export const LIST_IGNORED_DEPENDENCIES_COMMAND = "list-ignored-dependencies";
14
+ export const ADD_FORCED_DEPENDENCY_RELATION_COMMAND = "add-forced-dependency-relation";
15
+ export const LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND = "list-forced-dependency-relations";
16
+ export const REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND = "remove-forced-dependency-relation";
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- const { VERSION_1_10 } = require("../versions"),
4
- { DEFAULT_GIT_SHELL_COMMANDS, DEFAULT_INSTALL_SHELL_COMMANDS, DEFAULT_BUILD_SHELL_COMMANDS, DEFAULT_PUBLISH_SHELL_COMMANDS } = require("../defaults");
3
+ import { VERSION_1_10 } from "../versions";
4
+ import { DEFAULT_GIT_SHELL_COMMANDS, DEFAULT_INSTALL_SHELL_COMMANDS, DEFAULT_BUILD_SHELL_COMMANDS, DEFAULT_PUBLISH_SHELL_COMMANDS } from "../defaults";
5
5
 
6
- function createConfiguration() {
6
+ export function createConfiguration() {
7
7
  const git = DEFAULT_GIT_SHELL_COMMANDS, ///
8
8
  build = DEFAULT_BUILD_SHELL_COMMANDS, ///
9
9
  install = DEFAULT_INSTALL_SHELL_COMMANDS, ///
@@ -33,7 +33,7 @@ function createConfiguration() {
33
33
  return configuration;
34
34
  }
35
35
 
36
- function migrateConfigurationToVersion_1_10(configuration) {
36
+ export function migrateConfigurationToVersion_1_10(configuration) {
37
37
  const version = VERSION_1_10, ///
38
38
  ignoredBuilds = [],
39
39
  ignoredPublishes = [];
@@ -46,8 +46,3 @@ function migrateConfigurationToVersion_1_10(configuration) {
46
46
 
47
47
  return configuration;
48
48
  }
49
-
50
- module.exports = {
51
- createConfiguration,
52
- migrateConfigurationToVersion_1_10
53
- };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const { VERSION_1_3 } = require("../versions");
3
+ import { VERSION_1_3 } from "../versions";
4
4
 
5
- function migrateConfigurationToVersion_1_3(configuration) {
5
+ export function migrateConfigurationToVersion_1_3(configuration) {
6
6
  const version = VERSION_1_3,
7
7
  ignoredDependencies = [];
8
8
 
@@ -13,7 +13,3 @@ function migrateConfigurationToVersion_1_3(configuration) {
13
13
 
14
14
  return configuration;
15
15
  }
16
-
17
- module.exports = {
18
- migrateConfigurationToVersion_1_3
19
- };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const { VERSION_1_7 } = require("../versions");
3
+ import { VERSION_1_7 } from "../versions";
4
4
 
5
- function migrateConfigurationToVersion_1_7(configuration) {
5
+ export function migrateConfigurationToVersion_1_7(configuration) {
6
6
  const version = VERSION_1_7,
7
7
  forcedDependencyRelations = [];
8
8
 
@@ -13,7 +13,3 @@ function migrateConfigurationToVersion_1_7(configuration) {
13
13
 
14
14
  return configuration;
15
15
  }
16
-
17
- module.exports = {
18
- migrateConfigurationToVersion_1_7
19
- };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
- const { VERSION_1_9 } = require("../versions"),
4
- { DEFAULT_INSTALL_SHELL_COMMANDS } = require("../defaults");
3
+ import { VERSION_1_9 } from "../versions";
4
+ import { DEFAULT_INSTALL_SHELL_COMMANDS } from "../defaults";
5
5
 
6
- function migrateConfigurationToVersion_1_9(configuration) {
6
+ export function migrateConfigurationToVersion_1_9(configuration) {
7
7
  const version = VERSION_1_9;
8
8
 
9
9
  let { shellCommands } = configuration;
@@ -21,7 +21,3 @@ function migrateConfigurationToVersion_1_9(configuration) {
21
21
 
22
22
  return configuration;
23
23
  }
24
-
25
- module.exports = {
26
- migrateConfigurationToVersion_1_9
27
- };
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
 
3
- const { versionUtilities, configurationUtilities } = require("necessary");
3
+ import { versionUtilities, configurationUtilities } from "necessary";
4
4
 
5
- const { PROPAGATE } = require("./constants"),
6
- { createConfiguration } = require("./configuration/version_1_10"),
7
- { migrateConfigurationToVersion_1_3 } = require("./configuration/version_1_3"),
8
- { migrateConfigurationToVersion_1_7 } = require("./configuration/version_1_7"),
9
- { migrateConfigurationToVersion_1_9 } = require("./configuration/version_1_9"),
10
- { migrateConfigurationToVersion_1_10 } = require("./configuration/version_1_10"),
11
- { CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } = require("./messages"),
12
- { VERSION_1_0, VERSION_1_3, VERSION_1_7, VERSION_1_9, VERSION_1_10 } = require("./versions");
5
+ import { PROPAGATE } from "./constants";
6
+ import { createConfiguration } from "./configuration/version_1_10";
7
+ import { migrateConfigurationToVersion_1_3 } from "./configuration/version_1_3";
8
+ import { migrateConfigurationToVersion_1_7 } from "./configuration/version_1_7";
9
+ import { migrateConfigurationToVersion_1_9 } from "./configuration/version_1_9";
10
+ import { migrateConfigurationToVersion_1_10 } from "./configuration/version_1_10";
11
+ import { CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } from "./messages";
12
+ import { VERSION_1_0, VERSION_1_3, VERSION_1_7, VERSION_1_9, VERSION_1_10 } from "./versions";
13
13
 
14
14
  const { rc } = configurationUtilities,
15
15
  { migrate } = versionUtilities,
@@ -17,80 +17,80 @@ const { rc } = configurationUtilities,
17
17
 
18
18
  setRCBaseExtension(PROPAGATE);
19
19
 
20
- function retrieveDirectories() {
20
+ export function retrieveDirectories() {
21
21
  const configuration = readConfigurationFile(),
22
22
  { directories } = configuration;
23
23
 
24
24
  return directories;
25
25
  }
26
26
 
27
- function retrieveShellCommands() {
27
+ export function retrieveShellCommands() {
28
28
  const configuration = readConfigurationFile(),
29
29
  { shellCommands } = configuration;
30
30
 
31
31
  return shellCommands;
32
32
  }
33
33
 
34
- function retrieveIgnoredBuilds() {
34
+ export function retrieveIgnoredBuilds() {
35
35
  const configuration = readConfigurationFile(),
36
36
  { ignoredBuilds } = configuration;
37
37
 
38
38
  return ignoredBuilds;
39
39
  }
40
40
 
41
- function retrieveIgnoredPublishes() {
41
+ export function retrieveIgnoredPublishes() {
42
42
  const configuration = readConfigurationFile(),
43
43
  { ignoredPublishes } = configuration;
44
44
 
45
45
  return ignoredPublishes;
46
46
  }
47
47
 
48
- function retrieveIgnoredDependencies() {
48
+ export function retrieveIgnoredDependencies() {
49
49
  const configuration = readConfigurationFile(),
50
50
  { ignoredDependencies } = configuration;
51
51
 
52
52
  return ignoredDependencies;
53
53
  }
54
54
 
55
- function retrieveForcedDependencyRelations() {
55
+ export function retrieveForcedDependencyRelations() {
56
56
  const configuration = readConfigurationFile(),
57
57
  { forcedDependencyRelations } = configuration;
58
58
 
59
59
  return forcedDependencyRelations;
60
60
  }
61
61
 
62
- function updateDirectories(directories) {
62
+ export function updateDirectories(directories) {
63
63
  updateConfigurationFile({
64
64
  directories
65
65
  });
66
66
  }
67
67
 
68
- function updateShellCommands(shellCommands) {
68
+ export function updateShellCommands(shellCommands) {
69
69
  updateConfigurationFile({
70
70
  shellCommands
71
71
  });
72
72
  }
73
73
 
74
- function updateIgnoredDependencies(ignoredDependencies) {
74
+ export function updateIgnoredDependencies(ignoredDependencies) {
75
75
  updateConfigurationFile({
76
76
  ignoredDependencies
77
77
  });
78
78
  }
79
79
 
80
- function updateForcedDependencyRelations(forcedDependencyRelations) {
80
+ export function updateForcedDependencyRelations(forcedDependencyRelations) {
81
81
  updateConfigurationFile({
82
82
  forcedDependencyRelations
83
83
  });
84
84
  }
85
85
 
86
- function createConfigurationFile() {
86
+ export function createConfigurationFile() {
87
87
  const configuration = createConfiguration(),
88
88
  json = configuration; ///
89
89
 
90
90
  writeRCFile(json);
91
91
  }
92
92
 
93
- function migrateConfigurationFile() {
93
+ export function migrateConfigurationFile() {
94
94
  assertConfigurationFileExists();
95
95
 
96
96
  let json = readRCFile();
@@ -108,14 +108,14 @@ function migrateConfigurationFile() {
108
108
  writeRCFile(json);
109
109
  }
110
110
 
111
- function checkConfigurationFileExists() {
111
+ export function checkConfigurationFileExists() {
112
112
  const rcFileExists = checkRCFileExists(),
113
113
  configurationFileExists = rcFileExists; ///
114
114
 
115
115
  return configurationFileExists;
116
116
  }
117
117
 
118
- function assertConfigurationFileExists() {
118
+ export function assertConfigurationFileExists() {
119
119
  const configurationFileExists = checkConfigurationFileExists();
120
120
 
121
121
  if (!configurationFileExists) {
@@ -125,23 +125,6 @@ function assertConfigurationFileExists() {
125
125
  }
126
126
  }
127
127
 
128
- module.exports = {
129
- retrieveDirectories,
130
- retrieveShellCommands,
131
- retrieveIgnoredBuilds,
132
- retrieveIgnoredPublishes,
133
- retrieveIgnoredDependencies,
134
- retrieveForcedDependencyRelations,
135
- updateDirectories,
136
- updateShellCommands,
137
- updateIgnoredDependencies,
138
- updateForcedDependencyRelations,
139
- createConfigurationFile,
140
- migrateConfigurationFile,
141
- checkConfigurationFileExists,
142
- assertConfigurationFileExists
143
- };
144
-
145
128
  function readConfigurationFile() {
146
129
  assertConfigurationFileExists();
147
130
 
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ export const YES = "yes";
4
+ export const PROPAGATE = "propagate";
5
+ export const DOUBLE_DOTS = "..";
6
+ export const EMPTY_STRING = "";
7
+ export const PACKAGE_JSON = "package.json";
8
+ export const DEPENDENCIES = "dependencies";
9
+ export const PROPAGATE_CLI = "Propagate-CLI";
10
+ export const DEV_DEPENDENCIES = "devDependencies";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ export const DEFAULT_YES = false;
4
+ export const DEFAULT_HELP = false;
5
+ export const DEFAULT_VERSION = false;
6
+ export const DEFAULT_DRY_RUN = false;
7
+ export const DEFAULT_QUIETLY = false;
8
+ export const DEFAULT_DIRECTORY_NAME = ".";
9
+ export const DEFAULT_GIT_SHELL_COMMANDS = "git add .; git commit -m \"Propagated.\"; git push";
10
+ export const DEFAULT_BUILD_SHELL_COMMANDS = "npm run build";
11
+ export const DEFAULT_INSTALL_SHELL_COMMANDS = "npm install";
12
+ export const DEFAULT_PUBLISH_SHELL_COMMANDS = "npm publish";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ export const BUILD_YES_NO_DESCRIPTION = "Build? (y)es (n)o: ";
4
+ export const FAILED_SCRIPT_DESCRIPTION = "The script has failed. Would you like to try again? (y)es (n)o: ";
5
+ export const DIRECTORY_PATH_DESCRIPTION = "Directory path: ";
6
+ export const INSTALL_YES_NO_DESCRIPTION = "Install? (y)es (n)o: ";
7
+ export const PUBLISH_YES_NO_DESCRIPTION = "Publish? (y)es (n)o: ";
8
+ export const FORCED_DEPENDENT_DESCRIPTION = "Forced dependent sub-directory name: ";
9
+ export const FORCED_DEPENDENCY_DESCRIPTION = "Forced dependency sub-directory name: ";
10
+ export const IGNORED_DEPENDENCY_DESCRIPTION = "Ignored dependency sub-directory name: ";
11
+ export const GIT_SHELL_COMMANDS_DESCRIPTION = "Git shell command(s) (leave blank for default): ";
12
+ export const SAVE_UPDATES_YES_NO_DESCRIPTION = "Save updates? (y)es (n)o: ";
13
+ export const ADD_COMMIT_PUSH_GIT_DESCRIPTION = "Add, commit and push with Git? (y)es (n)o: ";
14
+ export const BUILD_SHELL_COMMANDS_DESCRIPTION = "Build shell commands() (leave blank for default): ";
15
+ export const INSTALL_SHELL_COMMANDS_DESCRIPTION = "Install shell commands() (leave blank for default): ";
16
+ export const PUBLISH_SHELL_COMMANDS_DESCRIPTION = "Publish shell commands() (leave blank for default): ";
17
+ export const SPECIFY_DIRECTORY_TO_REMOVE_DESCRIPTION = "Specify a directory to remove: ";
18
+ export const SPECIFY_IGNORED_DEPENDENCY_TO_REMOVE_DESCRIPTION = "Specify an ignored dependency to remove: ";
19
+ export const SPECIFY_FORCED_DEPENDENCY_RELATION_TO_REMOVE_DESCRIPTION = "Specify a forced dependency relation to remove.";
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { arrayUtilities } = require("necessary");
3
+ import { arrayUtilities } from "necessary";
4
4
 
5
- const SemverDiff = require("../diff/semver");
5
+ import SemverDiff from "../diff/semver";
6
6
 
7
- const { EMPTY_STRING } = require("../constants");
7
+ import { EMPTY_STRING } from "../constants";
8
8
 
9
9
  const { filter } = arrayUtilities;
10
10
 
11
- class MapDiff {
11
+ export default class MapDiff {
12
12
  constructor(semverDiffs) {
13
13
  this.semverDiffs = semverDiffs;
14
14
  }
@@ -80,5 +80,3 @@ class MapDiff {
80
80
  return mapDiff;
81
81
  }
82
82
  }
83
-
84
- module.exports = MapDiff;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- class SemverDiff {
3
+ export default class SemverDiff {
4
4
  constructor(name, semver, releaseSemver) {
5
5
  this.name = name;
6
6
  this.semver = semver;
@@ -45,5 +45,3 @@ class SemverDiff {
45
45
  return semverDiff;
46
46
  }
47
47
  }
48
-
49
- module.exports = SemverDiff;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const Version = require("../version");
3
+ import Version from "../version";
4
4
 
5
- class VersionDiff {
5
+ export default class VersionDiff {
6
6
  constructor(version, releaseVersion) {
7
7
  this.version = version;
8
8
  this.releaseVersion = releaseVersion;
@@ -56,5 +56,3 @@ class VersionDiff {
56
56
  return versionDiff;
57
57
  }
58
58
  }
59
-
60
- module.exports = VersionDiff;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- const MapDiff = require("./diff/map"),
4
- VersionDiff = require("./diff/version");
3
+ import MapDiff from "./diff/map";
4
+ import VersionDiff from "./diff/version";
5
5
 
6
- const { DEPENDENCIES, DEV_DEPENDENCIES } = require("./constants"),
7
- { readPackageJSONFile, writePackageJSONFile } = require("./utilities/packageJSON");
6
+ import { DEPENDENCIES, DEV_DEPENDENCIES } from "./constants";
7
+ import { readPackageJSONFile, writePackageJSONFile } from "./utilities/packageJSON";
8
8
 
9
- class Diff {
9
+ export default class Diff {
10
10
  constructor(release, versionDiff, dependencyMapDiff, devDependencyMapDiff) {
11
11
  this.release = release;
12
12
  this.versionDiff = versionDiff;
@@ -138,5 +138,3 @@ class Diff {
138
138
  return diff;
139
139
  }
140
140
  }
141
-
142
- module.exports = Diff;
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
 
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
-
18
- const { NO_ARGUMENT_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } = require("./messages"),
19
- { DEFAULT_YES, DEFAULT_QUIETLY, DEFAULT_DRY_RUN } = require("./defaults"),
20
- { HELP_COMMAND,
3
+ import helpAction from "./action/help";
4
+ import versionAction from "./action/version";
5
+ import propagateAction from "./action/propagate";
6
+ import initialiseAction from "./action/initialise";
7
+ import addDirectoryAction from "./action/addDirectory";
8
+ import removeDirectoryAction from "./action/removeDirectory";
9
+ import listDirectoriesAction from "./action/listDirectories";
10
+ import setShellCommandsAction from "./action/setShellCommands";
11
+ import addIgnoredDependencyAction from "./action/addIgnoredDependency";
12
+ import listIgnoredDependenciesAction from "./action/listIgnoredDependencies";
13
+ import removeIgnoredDependencyAction from "./action/removeIgnoredDependency";
14
+ import addForcedDependencyRelationAction from "./action/addForcedDependencyRelation";
15
+ import listForcedDependencyRelationsAction from "./action/listForcedDependencyRelations";
16
+ import removeForcedDependencyRelationAction from "./action/removeForcedDependencyRelation";
17
+
18
+ import { NO_ARGUMENT_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } from "./messages";
19
+ import { DEFAULT_YES, DEFAULT_QUIETLY, DEFAULT_DRY_RUN } from "./defaults";
20
+ import { HELP_COMMAND,
21
21
  VERSION_COMMAND,
22
22
  PROPAGATE_COMMAND,
23
23
  INITIALISE_COMMAND,
@@ -30,9 +30,9 @@ const { NO_ARGUMENT_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } = require(".
30
30
  REMOVE_IGNORED_DEPENDENCY_COMMAND,
31
31
  ADD_FORCED_DEPENDENCY_RELATION_COMMAND,
32
32
  LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND,
33
- REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND } = require("./commands");
33
+ REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND } from "./commands";
34
34
 
35
- function main(command, argument, options) {
35
+ export default function main(command, argument, options) {
36
36
  const { yes = DEFAULT_YES,
37
37
  dryRun = DEFAULT_DRY_RUN,
38
38
  quietly = DEFAULT_QUIETLY } = options;
@@ -135,5 +135,3 @@ function main(command, argument, options) {
135
135
  }
136
136
  }
137
137
  }
138
-
139
- module.exports = main;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ export const NO_RELEASE_MESSAGE = "Either the sub-directory is missing or it does not contain a package.json file.";
4
+ export const NO_ARGUMENT_GIVEN_MESSAGE = "No argument has been given.";
5
+ export const NO_IGNORED_DEPENDENCIES_MESSAGE = "There are no ignored dependencies.";
6
+ export const NO_FORCED_DEPENDENCY_RELATIONS_MESSAGE = "There are no forced dependency relations.";
7
+ export const INVALID_ANSWER_MESSAGE = "You must answer (y)es or (n)o.";
8
+ export const INVALID_DIRECTORY_PATH_MESSAGE = "The directory path should be a relative path, starting with a period or more likely a double period.";
9
+ export const INVALID_DIRECTORY_NUMBER_MESSAGE = "The directory number should match one of the numbers given above.";
10
+ export const INVALID_FORCED_DEPENDENT_NAME_MESSAGE = "The dependent name must be non-empty.";
11
+ export const INVALID_FORCED_DEPENDENCY_NAME_MESSAGE = "The dependency name must be non-empty.";
12
+ export const INVALID_IGNORED_DEPENDENCY_NAME_MESSAGE = "The dependency name must be non-empty.";
13
+ export const INVALID_IGNORED_DEPENDENCY_NUMBER_MESSAGE = "The ignored dependency number should match one of the numbers given above.";
14
+ export const INVALID_FORCED_DEPENDENCY_RELATION_NUMBER_MESSAGE = "The forced dependency relation number should match one of the numbers given above.";
15
+ export const FAILED_GIT_MESSAGE = "The Git script failed.";
16
+ export const FAILED_SAVE_MESSAGE = "The 'package.json' file could not be saved.";
17
+ export const FAILED_BUILD_MESSAGE = "The build script failed.";
18
+ export const FAILED_INSTALL_MESSAGE = "The install script failed.";
19
+ export const FAILED_PUBLISH_MESSAGE = "The publish script failed.";
20
+ export const FAILED_PROPAGATE_MESSAGE = "Failed to propagate the package.";
21
+ export const FAILED_INITIALISE_MESSAGE = "Failed to create a configuration file because one is already present.";
22
+ export const FAILED_ADD_DIRECTORY_MESSAGE = "Failed to add a directory.";
23
+ export const FAILED_REMOVE_DIRECTORY_MESSAGE = "Failed to remove a directory.";
24
+ export const FAILED_SET_SHELL_COMMANDS_MESSAGE = "Failed to set the shell commands.";
25
+ export const FAILED_ADD_IGNORED_DEPENDENCY_MESSAGE = "Failed to add an ignored dependency.";
26
+ export const FAILED_REMOVE_IGNORED_DEPENDENCY_MESSAGE = "Failed to remove an ignored dependency.";
27
+ export const FAILED_ADD_FORCED_DEPENDENCY_RELATION_MESSAGE = "Failed to add a forced dependency relation.";
28
+ export const FAILED_REMOVE_FORCED_DEPENDENCY_RELATION_MESSAGE = "Failed to remove a forced dependency relation.";
29
+ export const SUCCESSFUL_PROPAGATE_MESSAGE = "Propagated the package successfully.";
30
+ export const SUCCESSFUL_INITIALISE_MESSAGE = "The configuration file has been created successfully.";
31
+ export const SUCCESSFUL_ADD_DIRECTORY_MESSAGE = "The directory has been added successfully.";
32
+ export const SUCCESSFUL_REMOVE_DIRECTORY_MESSAGE = "The directory has been removed successfully.";
33
+ export const SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE = "The shell commands have been set successfully.";
34
+ export const SUCCESSFUL_ADD_IGNORED_DEPENDENCY_MESSAGE = "The ignored dependency was added successfully.";
35
+ export const SUCCESSFUL_REMOVE_IGNORED_DEPENDENCY_MESSAGE = "The ignored dependency was added successfully.";
36
+ export const SUCCESSFUL_ADD_FORCED_DEPENDENCY_RELATION_MESSAGE = "The forced dependency relation was added successfully.";
37
+ export const SUCCESSFUL_REMOVE_FORCED_DEPENDENCY_RELATION_MESSAGE = "The forced dependency relation was added successfully.";
38
+ export const COMMAND_NOT_RECOGNISED_MESSAGE = "The command is not recognised.";
39
+ export const RELEASE_NOT_PUBLISHABLE_MESSAGE = "The package.json file must contain both name and version fields in order to be publishable.";
40
+ export const DIRECTORIES_INCLUDES_DIRECTORY_MESSAGE = "The directory has already been added.";
41
+ export const CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE = "The action cannot be performed because the configuration file is missing. Run 'propagate initialise' to create one.";
42
+ export const AT_LEAST_ONE_CYCLIC_DEPENDENCY_MESSAGE = "There is at least one cyclic dependency.";
43
+ export const AT_LEAST_ONE_CYCLIC_DEV_DEPENDENCY_MESSAGE = "There is at least one cyclic developer dependency.";
44
+ export const IGNORED_DEPENDENCIES_INCLUDE_SUB_DIRECTORY_MESSAGE = "You cannot propagate an ignored dependency.";
45
+ export const IGNORED_DEPENDENCIES_INCLUDE_IGNORED_DEPENDENCY_MESSAGE = "The ignored dependency has already been added.";
46
+ export const FORCED_DEPENDENCY_RELATIONS_INCLUDE_FORCED_DEPENDENCY_RELATION_MESSAGE = "The forced dependency relation has already been added.";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function checkDevDependenciesOperation(proceed, abort, context) {
3
+ export default function checkDevDependenciesOperation(proceed, abort, context) {
4
4
  const { diffs } = context,
5
5
  names = [],
6
6
  devDependencyMissing = diffs.some((diff) => {
@@ -38,5 +38,3 @@ function checkDevDependenciesOperation(proceed, abort, context) {
38
38
  abort() :
39
39
  proceed();
40
40
  }
41
-
42
- module.exports = checkDevDependenciesOperation;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const Diff = require("../diff");
3
+ import Diff from "../diff";
4
4
 
5
- function createDiffsOperation(proceed, abort, context) {
5
+ export default function createDiffsOperation(proceed, abort, context) {
6
6
  let { releases } = context;
7
7
 
8
8
  const { release, releaseGraph, dependentReleasesLength } = context,
@@ -46,8 +46,6 @@ function createDiffsOperation(proceed, abort, context) {
46
46
  proceed();
47
47
  }
48
48
 
49
- module.exports = createDiffsOperation;
50
-
51
49
  function sortReleases(releases, orderedSubDirectoryPaths) {
52
50
  releases.sort((releaseA, releaseB) => {
53
51
  const releaseASubDirectoryPath = releaseA.getSubDirectoryPath(),
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const messages = require("../messages"),
4
- ReleaseGraph = require("../releaseGraph");
3
+ import messages from "../messages";
4
+ import ReleaseGraph from "../releaseGraph";
5
5
 
6
- const { consoleLogSubDirectoryPathsCycle } = require('../utilities/console'),
7
- { retrieveForcedDependencyRelations } = require("../configuration");
6
+ import { consoleLogSubDirectoryPathsCycle } from '../utilities/console';
7
+ import { retrieveForcedDependencyRelations } from "../configuration";
8
8
 
9
9
  const { AT_LEAST_ONE_CYCLIC_DEPENDENCY_MESSAGE, AT_LEAST_ONE_CYCLIC_DEV_DEPENDENCY_MESSAGE } = messages;
10
10
 
11
- function createReleaseGraphOperation(proceed, abort, context) {
11
+ export default function createReleaseGraphOperation(proceed, abort, context) {
12
12
  const { releaseMap, subDirectoryMap } = context,
13
13
  forcedDependencyRelations = retrieveForcedDependencyRelations(),
14
14
  releaseGraph = ReleaseGraph.fromReleaseMapSubDirectoryMapAndForcedDependencyRelations(releaseMap, subDirectoryMap, forcedDependencyRelations),
@@ -45,5 +45,3 @@ function createReleaseGraphOperation(proceed, abort, context) {
45
45
 
46
46
  proceed();
47
47
  }
48
-
49
- module.exports = createReleaseGraphOperation;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- const ReleaseMap = require("../releaseMap");
3
+ import ReleaseMap from "../releaseMap"
4
4
 
5
- const { retrieveIgnoredDependencies } = require("../configuration");
5
+ import { retrieveIgnoredDependencies } from "../configuration"
6
6
 
7
- function createReleaseMapOperation(proceed, abort, context) {
7
+ export default function createReleaseMapOperation(proceed, abort, context) {
8
8
  const { subDirectoryMap } = context,
9
9
  ignoredDependencies = retrieveIgnoredDependencies(),
10
10
  releaseMap = ReleaseMap.fromSubDirectoryMapAndIgnoredDependencies(subDirectoryMap, ignoredDependencies);
@@ -15,5 +15,3 @@ function createReleaseMapOperation(proceed, abort, context) {
15
15
 
16
16
  proceed();
17
17
  }
18
-
19
- module.exports = createReleaseMapOperation;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
 
3
- const { pathUtilities, fileSystemUtilities } = require("necessary");
3
+ import { pathUtilities, fileSystemUtilities } from "necessary";
4
4
 
5
- const { retrieveDirectories } = require("../configuration"),
6
- { absolutePathFromName } = require("../utilities/path"),
7
- { DEFAULT_DIRECTORY_NAME } = require("../defaults");
5
+ import { retrieveDirectories } from "../configuration";
6
+ import { absolutePathFromName } from "../utilities/path";
7
+ import { DEFAULT_DIRECTORY_NAME } from "../defaults";
8
8
 
9
9
  const { concatenatePaths } = pathUtilities,
10
10
  { readDirectory, isEntryDirectory } = fileSystemUtilities;
11
11
 
12
- function createSubDirectoryMapOperation(proceed, abort, context) {
12
+ export default function createSubDirectoryMapOperation(proceed, abort, context) {
13
13
  const subDirectoryMap = {},
14
14
  directories = retrieveDirectories(),
15
15
  directoryNames = [
@@ -44,5 +44,3 @@ function createSubDirectoryMapOperation(proceed, abort, context) {
44
44
 
45
45
  proceed();
46
46
  }
47
-
48
- module.exports = createSubDirectoryMapOperation;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { pathUtilities } = require("necessary");
3
+ import { pathUtilities } from "necessary";
4
4
 
5
- const { DEFAULT_DIRECTORY_NAME } = require("../defaults"),
6
- { retrieveIgnoredDependencies } = require("../configuration"),
7
- { IGNORED_DEPENDENCIES_INCLUDE_SUB_DIRECTORY_MESSAGE } = require("../messages");
5
+ import { DEFAULT_DIRECTORY_NAME } from "../defaults";
6
+ import { retrieveIgnoredDependencies } from "../configuration";
7
+ import { IGNORED_DEPENDENCIES_INCLUDE_SUB_DIRECTORY_MESSAGE } from "../messages";
8
8
 
9
9
  const { concatenatePaths } = pathUtilities;
10
10
 
11
- function createSubDirectoryPathOperation(proceed, abort, context) {
11
+ export default function createSubDirectoryPathOperation(proceed, abort, context) {
12
12
  const { subDirectoryName } = context,
13
13
  ignoredDependencies = retrieveIgnoredDependencies(),
14
14
  ignoredDependenciesIncludesSubDirectoryName = ignoredDependencies.includes(subDirectoryName);
@@ -30,5 +30,3 @@ function createSubDirectoryPathOperation(proceed, abort, context) {
30
30
 
31
31
  proceed();
32
32
  }
33
-
34
- module.exports = createSubDirectoryPathOperation;