propagate-cli 1.8.3 → 1.9.1
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/README.md +3 -3
- package/bin/action/help.js +1 -1
- package/bin/action/listDirectories.js +4 -3
- package/bin/action/listForcedDependencyRelations.js +4 -3
- package/bin/action/listIgnoredDependencies.js +4 -3
- package/bin/action/setShellCommands.js +4 -2
- package/bin/callback/checkDevDependencies.js +0 -2
- package/bin/callback/prompt/install.js +65 -0
- package/bin/callback/prompt/setBuildShellCommands.js +3 -2
- package/bin/callback/prompt/setGitShellCommands.js +3 -2
- package/bin/callback/prompt/setInstallShellCommands.js +39 -0
- package/bin/callback/prompt/setPublishShellCommands.js +3 -2
- package/bin/callback/saveAndApplyDiff.js +5 -2
- package/bin/configuration/version_1_0.js +12 -1
- package/bin/configuration/version_1_9.js +55 -0
- package/bin/configuration.js +23 -7
- package/bin/constants.js +4 -0
- package/bin/defaults.js +3 -1
- package/bin/descriptions.js +7 -3
- package/bin/diff/map.js +3 -1
- package/bin/diff.js +2 -0
- package/bin/main.js +3 -2
- package/bin/messages.js +2 -0
- package/bin/release.js +11 -0
- package/bin/versions.js +7 -3
- package/package.json +1 -1
- package/test/Development/.propagaterc +11 -0
- package/test/Development/argumentative/package.json +27 -0
- package/test/Development/boring/package.json +22 -0
- package/test/Development/concur-algorithm/package.json +44 -0
- package/test/Development/concurrent-layer-protocol/package.json +38 -0
- package/test/Development/easy/package.json +27 -0
- package/test/Development/easy-draganddrop/package.json +36 -0
- package/test/Development/easy-layout/package.json +29 -0
- package/test/Development/easy-richtextarea/package.json +30 -0
- package/test/Development/fragmented/package.json +31 -0
- package/test/Development/inference/package.json +45 -0
- package/test/Development/juxtapose/package.json +35 -0
- package/test/Development/necessary/package.json +26 -0
- package/test/Development/occam-browser/package.json +13 -0
- package/test/Development/occam-client/package.json +53 -0
- package/test/Development/occam-colours/package.json +11 -0
- package/test/Development/occam-custom-grammars/package.json +41 -0
- package/test/Development/occam-desktop/package.json +21 -0
- package/test/Development/occam-directed-graphs/package.json +34 -0
- package/test/Development/occam-documents/package.json +27 -0
- package/test/Development/occam-dom/package.json +40 -0
- package/test/Development/occam-editor/package.json +44 -0
- package/test/Development/occam-file-system/package.json +33 -0
- package/test/Development/occam-grammar-utilities/package.json +41 -0
- package/test/Development/occam-kahn/package.json +30 -0
- package/test/Development/occam-lazy/package.json +44 -0
- package/test/Development/occam-lexers/package.json +38 -0
- package/test/Development/occam-open-cli/package.json +40 -0
- package/test/Development/occam-parsers/package.json +39 -0
- package/test/Development/occam-pearce-kelly/package.json +31 -0
- package/test/Development/occam-pretty/package.json +43 -0
- package/test/Development/occam-tarjan/package.json +30 -0
- package/test/Development/occam-verifier/package.json +23 -0
- package/test/Development/propagate-cli/package.json +21 -0
- package/test/Development/reaction/package.json +33 -0
- package/test/Development/reaction-with-style/package.json +30 -0
- package/test/Development/sufficient/package.json +29 -0
- package/test/Development/with-style/package.json +45 -0
- package/test/Development/xgl/package.json +38 -0
- package/test/Development/xgl-server/package.json +32 -0
- package/test/Public/aleph-one.com/package.json +30 -0
- package/test/Public/djalbat.com/package.json +6 -0
- package/test/Public/juxtapose.info/package.json +36 -0
- package/test/Public/occam.science/package.json +40 -0
- package/test/Public/openmathematics.org/package.json +47 -0
- package/test/Public/schoonercecilie.org/package.json +30 -0
- package/test/Public/weconcurjohn.com/package.json +8 -0
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ Commands:
|
|
|
102
102
|
|
|
103
103
|
list-directories List directories, including the default directory
|
|
104
104
|
|
|
105
|
-
set-shell-commands Set the Git, build and publish shell commands
|
|
105
|
+
set-shell-commands Set the Git, install, build and publish shell commands
|
|
106
106
|
|
|
107
107
|
add-ignored-dependency Add an ignored dependency
|
|
108
108
|
|
|
@@ -153,9 +153,9 @@ It is important to understand what happens when you choose to answer 'no' to any
|
|
|
153
153
|
|
|
154
154
|
1. If you chose to answer 'no' at a save prompt, Propagate will assume that you do not want to propagate the package and will adjust all the remaining updates accordingly.
|
|
155
155
|
|
|
156
|
-
2. If you chose to answer 'no' at a build prompt, Propagate will continue with the update. The rationale behind this is that the update in question might not be to a package but instead to a
|
|
156
|
+
2. If you chose to answer 'no' at either a build prompt or an install prompt, Propagate will continue with the update. The rationale behind this is that the update in question might not be to a package but instead to a project that may need its `package.json` file updated with the latest dependencies but may not need to be built right away. Also bear in mind that you do not need to rebuild a package before publishing if all you are doing is updating its dependencies. Therefore you can safely answer 'no' at either of these prompts even for propagated packages.
|
|
157
157
|
|
|
158
|
-
3. If you choose to answer 'no' at a Git prompt, much the same rationale as for building holds.
|
|
158
|
+
3. If you choose to answer 'no' at a Git prompt, much the same rationale as for installing and building holds.
|
|
159
159
|
|
|
160
160
|
4. If you choose to answer 'no' at a publish prompt, Propagate will again assume that you do not want to propagate the package and will make the necessary adjustments as before.
|
|
161
161
|
|
package/bin/action/help.js
CHANGED
|
@@ -23,7 +23,7 @@ Commands:
|
|
|
23
23
|
|
|
24
24
|
list-directories List directories, including the default directory
|
|
25
25
|
|
|
26
|
-
set-shell-commands Set the Git, build and publish shell commands
|
|
26
|
+
set-shell-commands Set the Git, build, install and publish shell commands
|
|
27
27
|
|
|
28
28
|
add-ignored-dependency Add an ignored dependency
|
|
29
29
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { EMPTY_STRING } = require("../constants"),
|
|
4
|
+
{ retrieveDirectories } = require("../configuration"),
|
|
4
5
|
{ DEFAULT_DIRECTORY_NAME } = require("../defaults");
|
|
5
6
|
|
|
6
7
|
function listDirectories() {
|
|
@@ -12,7 +13,7 @@ function listDirectories() {
|
|
|
12
13
|
...directories
|
|
13
14
|
];
|
|
14
15
|
|
|
15
|
-
console.log(
|
|
16
|
+
console.log(EMPTY_STRING);
|
|
16
17
|
|
|
17
18
|
directoryNames.forEach((directoryName, index) => {
|
|
18
19
|
if (index === 0) {
|
|
@@ -26,7 +27,7 @@ function listDirectories() {
|
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
console.log(
|
|
30
|
+
console.log(EMPTY_STRING);
|
|
30
31
|
|
|
31
32
|
return directoryNumbers;
|
|
32
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { EMPTY_STRING } = require("../constants"),
|
|
4
|
+
{ retrieveForcedDependencyRelations } = require("../configuration");
|
|
4
5
|
|
|
5
6
|
const { NO_FORCED_DEPENDENCY_RELATIONS_MESSAGE } = require("../messages");
|
|
6
7
|
|
|
@@ -16,7 +17,7 @@ function listForcedDependencyRelations() {
|
|
|
16
17
|
...forcedDependencyRelations
|
|
17
18
|
];
|
|
18
19
|
|
|
19
|
-
console.log(
|
|
20
|
+
console.log(EMPTY_STRING);
|
|
20
21
|
|
|
21
22
|
forcedDependencyRelationsNames.forEach((forcedDependencyRelationsName, index) => {
|
|
22
23
|
const forcedDependencyRelationsNumber = index + 1; ///
|
|
@@ -26,7 +27,7 @@ function listForcedDependencyRelations() {
|
|
|
26
27
|
forcedDependencyRelationsNumbers.push(forcedDependencyRelationsNumber);
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
console.log(
|
|
30
|
+
console.log(EMPTY_STRING);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
return forcedDependencyRelationsNumbers;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { EMPTY_STRING } = require("../constants"),
|
|
4
|
+
{ retrieveIgnoredDependencies } = require("../configuration");
|
|
4
5
|
|
|
5
6
|
const { NO_IGNORED_DEPENDENCIES_MESSAGE } = require("../messages");
|
|
6
7
|
|
|
@@ -16,7 +17,7 @@ function listForcedDependencyRelations() {
|
|
|
16
17
|
...ignoredDependencies
|
|
17
18
|
];
|
|
18
19
|
|
|
19
|
-
console.log(
|
|
20
|
+
console.log(EMPTY_STRING);
|
|
20
21
|
|
|
21
22
|
ignoredDependencyNames.forEach((ignoredDependencyName, index) => {
|
|
22
23
|
const ignoredDependencyNumber = index + 1; ///
|
|
@@ -26,7 +27,7 @@ function listForcedDependencyRelations() {
|
|
|
26
27
|
ignoredDependencyNumbers.push(ignoredDependencyNumber);
|
|
27
28
|
});
|
|
28
29
|
|
|
29
|
-
console.log(
|
|
30
|
+
console.log(EMPTY_STRING);
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
return ignoredDependencyNumbers;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const setGitShellCommandsPromptCallback = require("../callback/prompt/setGitShellCommands"),
|
|
4
4
|
setBuildShellCommandsPromptCallback = require("../callback/prompt/setBuildShellCommands"),
|
|
5
|
+
setInstallShellCommandsPromptCallback = require("../callback/prompt/setInstallShellCommands"),
|
|
5
6
|
setPublishShellCommandsPromptCallback = require("../callback/prompt/setPublishShellCommands");
|
|
6
7
|
|
|
7
8
|
const { executeCallbacks } = require("../utilities/callback"),
|
|
@@ -10,9 +11,10 @@ const { executeCallbacks } = require("../utilities/callback"),
|
|
|
10
11
|
|
|
11
12
|
function setShellCommands() {
|
|
12
13
|
const callbacks = [
|
|
13
|
-
|
|
14
|
+
setGitShellCommandsPromptCallback,
|
|
15
|
+
setInstallShellCommandsPromptCallback,
|
|
14
16
|
setBuildShellCommandsPromptCallback,
|
|
15
|
-
|
|
17
|
+
setPublishShellCommandsPromptCallback,
|
|
16
18
|
],
|
|
17
19
|
shellCommands = retrieveShellCommands(),
|
|
18
20
|
context = {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { shellUtilities } = require("necessary");
|
|
4
|
+
|
|
5
|
+
const { YES } = require("../../constants"),
|
|
6
|
+
{ validateAnswer } = require("../../utilities/validate"),
|
|
7
|
+
{ isAnswerAffirmative } = require("../../utilities/prompt"),
|
|
8
|
+
{ INSTALL_YES_NO_DESCRIPTION } = require("../../descriptions"),
|
|
9
|
+
{ consoleLogUnpublishedDiffs } = require("../../utilities/console"),
|
|
10
|
+
{ FAILED_INSTALL_MESSAGE, INVALID_ANSWER_MESSAGE } = require("../../messages");
|
|
11
|
+
|
|
12
|
+
const { prompt } = shellUtilities;
|
|
13
|
+
|
|
14
|
+
function installPromptCallback(proceed, abort, context) {
|
|
15
|
+
const { yes, diff, diffs, quietly } = context;
|
|
16
|
+
|
|
17
|
+
const answer = yes ?
|
|
18
|
+
YES :
|
|
19
|
+
null,
|
|
20
|
+
description = INSTALL_YES_NO_DESCRIPTION,
|
|
21
|
+
errorMessage = INVALID_ANSWER_MESSAGE,
|
|
22
|
+
validationFunction = validateAnswer, ///
|
|
23
|
+
options = {
|
|
24
|
+
answer,
|
|
25
|
+
description,
|
|
26
|
+
errorMessage,
|
|
27
|
+
validationFunction
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
prompt(options, (answer) => {
|
|
31
|
+
const valid = (answer !== null);
|
|
32
|
+
|
|
33
|
+
if (valid) {
|
|
34
|
+
const affirmative = isAnswerAffirmative(answer);
|
|
35
|
+
|
|
36
|
+
if (!affirmative) {
|
|
37
|
+
proceed();
|
|
38
|
+
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
diff.install(quietly, (success) => {
|
|
43
|
+
if (!success) {
|
|
44
|
+
consoleLogUnpublishedDiffs(diff, diffs);
|
|
45
|
+
|
|
46
|
+
console.log(FAILED_INSTALL_MESSAGE);
|
|
47
|
+
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
proceed();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
consoleLogUnpublishedDiffs(diff, diffs);
|
|
58
|
+
|
|
59
|
+
console.log(FAILED_INSTALL_MESSAGE);
|
|
60
|
+
|
|
61
|
+
process.exit(1);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = installPromptCallback;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { shellUtilities } = require("necessary");
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { EMPTY_STRING } = require("../../constants"),
|
|
6
|
+
{ validateShellCommands } = require("../../utilities/validate"),
|
|
6
7
|
{ DEFAULT_BUILD_SHELL_COMMANDS } = require("../../defaults"),
|
|
7
8
|
{ BUILD_SHELL_COMMANDS_DESCRIPTION } = require("../../descriptions");
|
|
8
9
|
|
|
@@ -23,7 +24,7 @@ function setBuildShellCommandsPromptCallback(proceed, abort, context) {
|
|
|
23
24
|
|
|
24
25
|
prompt(options, (answer) => {
|
|
25
26
|
const buildShellCommands = answer, ///
|
|
26
|
-
build = (buildShellCommands !==
|
|
27
|
+
build = (buildShellCommands !== EMPTY_STRING) ?
|
|
27
28
|
buildShellCommands :
|
|
28
29
|
DEFAULT_BUILD_SHELL_COMMANDS;
|
|
29
30
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { shellUtilities } = require("necessary");
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { EMPTY_STRING } = require("../../constants"),
|
|
6
|
+
{ validateShellCommands } = require("../../utilities/validate"),
|
|
6
7
|
{ DEFAULT_GIT_SHELL_COMMANDS } = require("../../defaults"),
|
|
7
8
|
{ GIT_SHELL_COMMANDS_DESCRIPTION } = require("../../descriptions");
|
|
8
9
|
|
|
@@ -23,7 +24,7 @@ function setGitShellCommandsPromptCallback(proceed, abort, context) {
|
|
|
23
24
|
|
|
24
25
|
prompt(options, (answer) => {
|
|
25
26
|
const gitShellCommands = answer, ///
|
|
26
|
-
git = (gitShellCommands !==
|
|
27
|
+
git = (gitShellCommands !== EMPTY_STRING) ?
|
|
27
28
|
gitShellCommands :
|
|
28
29
|
DEFAULT_GIT_SHELL_COMMANDS;
|
|
29
30
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { shellUtilities } = require("necessary");
|
|
4
|
+
|
|
5
|
+
const { EMPTY_STRING } = require("../../constants"),
|
|
6
|
+
{ validateShellCommands } = require("../../utilities/validate"),
|
|
7
|
+
{ DEFAULT_INSTALL_SHELL_COMMANDS } = require("../../defaults"),
|
|
8
|
+
{ INSTALL_SHELL_COMMANDS_DESCRIPTION } = require("../../descriptions");
|
|
9
|
+
|
|
10
|
+
const { prompt } = shellUtilities;
|
|
11
|
+
|
|
12
|
+
function setInstallShellCommandsPromptCallback(proceed, abort, context) {
|
|
13
|
+
const { shellCommands } = context,
|
|
14
|
+
{ install } = shellCommands,
|
|
15
|
+
installShellCommands = install, ///
|
|
16
|
+
initialAnswer = installShellCommands, //
|
|
17
|
+
validationFunction = validateShellCommands, ///
|
|
18
|
+
description = INSTALL_SHELL_COMMANDS_DESCRIPTION,
|
|
19
|
+
options = {
|
|
20
|
+
description,
|
|
21
|
+
initialAnswer,
|
|
22
|
+
validationFunction
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
prompt(options, (answer) => {
|
|
26
|
+
const installShellCommands = answer, ///
|
|
27
|
+
install = (installShellCommands !== EMPTY_STRING) ?
|
|
28
|
+
installShellCommands :
|
|
29
|
+
DEFAULT_INSTALL_SHELL_COMMANDS;
|
|
30
|
+
|
|
31
|
+
Object.assign(shellCommands, {
|
|
32
|
+
install
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
proceed();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = setInstallShellCommandsPromptCallback;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { shellUtilities } = require("necessary");
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { EMPTY_STRING } = require("../../constants"),
|
|
6
|
+
{ validateShellCommands } = require("../../utilities/validate"),
|
|
6
7
|
{ DEFAULT_PUBLISH_SHELL_COMMANDS } = require("../../defaults"),
|
|
7
8
|
{ PUBLISH_SHELL_COMMANDS_DESCRIPTION } = require("../../descriptions");
|
|
8
9
|
|
|
@@ -23,7 +24,7 @@ function setPublishShellCommandsPromptCallback(proceed, abort, context) {
|
|
|
23
24
|
|
|
24
25
|
prompt(options, (answer) => {
|
|
25
26
|
const publishShellCommands = answer, ///
|
|
26
|
-
publish = (publishShellCommands !==
|
|
27
|
+
publish = (publishShellCommands !== EMPTY_STRING) ?
|
|
27
28
|
publishShellCommands :
|
|
28
29
|
DEFAULT_PUBLISH_SHELL_COMMANDS;
|
|
29
30
|
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
const gitPromptCallback = require("../callback/prompt/git"),
|
|
4
4
|
savePromptCallback = require("../callback/prompt/save"),
|
|
5
5
|
buildPromptCallback = require("../callback/prompt/build"),
|
|
6
|
+
installPromptCallback = require("../callback/prompt/install"),
|
|
6
7
|
publishPromptCallback = require("../callback/prompt/publish");
|
|
7
8
|
|
|
8
|
-
const {
|
|
9
|
+
const { EMPTY_STRING } = require("../constants"),
|
|
10
|
+
{ executeCallbacks } = require("../utilities/callback");
|
|
9
11
|
|
|
10
12
|
function saveAndApplyDiffCallback(diff, proceed, abort, context) {
|
|
11
13
|
const { diffs } = context,
|
|
@@ -28,12 +30,13 @@ function saveAndApplyDiffCallback(diff, proceed, abort, context) {
|
|
|
28
30
|
|
|
29
31
|
const callbacks = [
|
|
30
32
|
savePromptCallback,
|
|
33
|
+
installPromptCallback,
|
|
31
34
|
buildPromptCallback,
|
|
32
35
|
gitPromptCallback,
|
|
33
36
|
publishPromptCallback
|
|
34
37
|
];
|
|
35
38
|
|
|
36
|
-
console.log(
|
|
39
|
+
console.log(EMPTY_STRING);
|
|
37
40
|
|
|
38
41
|
executeCallbacks(callbacks, (completed) => {
|
|
39
42
|
delete context.diff;
|
|
@@ -24,6 +24,17 @@ function createConfiguration() {
|
|
|
24
24
|
return configuration;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function migrateConfigurationToVersion_1_0(configuration) {
|
|
28
|
+
const version = VERSION_1_0;
|
|
29
|
+
|
|
30
|
+
configuration = Object.assign(configuration, {
|
|
31
|
+
version
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return configuration;
|
|
35
|
+
}
|
|
36
|
+
|
|
27
37
|
module.exports = {
|
|
28
|
-
createConfiguration
|
|
38
|
+
createConfiguration,
|
|
39
|
+
migrateConfigurationToVersion_1_0
|
|
29
40
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { VERSION_1_9 } = require("../versions"),
|
|
4
|
+
{ DEFAULT_GIT_SHELL_COMMANDS, DEFAULT_INSTALL_SHELL_COMMANDS, DEFAULT_BUILD_SHELL_COMMANDS, DEFAULT_PUBLISH_SHELL_COMMANDS } = require("../defaults"),
|
|
5
|
+
git = DEFAULT_GIT_SHELL_COMMANDS, ///
|
|
6
|
+
build = DEFAULT_BUILD_SHELL_COMMANDS, ///
|
|
7
|
+
install = DEFAULT_INSTALL_SHELL_COMMANDS, ///
|
|
8
|
+
publish = DEFAULT_PUBLISH_SHELL_COMMANDS, ///
|
|
9
|
+
defaultShellCommands = {
|
|
10
|
+
git,
|
|
11
|
+
build,
|
|
12
|
+
install,
|
|
13
|
+
publish
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function createConfiguration() {
|
|
17
|
+
const version = VERSION_1_9, ///
|
|
18
|
+
directories = [],
|
|
19
|
+
shellCommands = defaultShellCommands, ///
|
|
20
|
+
ignoredDependencies = [],
|
|
21
|
+
forcedDependencyRelations = [],
|
|
22
|
+
configuration = {
|
|
23
|
+
version,
|
|
24
|
+
directories,
|
|
25
|
+
shellCommands,
|
|
26
|
+
ignoredDependencies,
|
|
27
|
+
forcedDependencyRelations
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return configuration;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function migrateConfigurationToVersion_1_9(configuration) {
|
|
34
|
+
const version = VERSION_1_9;
|
|
35
|
+
|
|
36
|
+
let { shellCommands } = configuration;
|
|
37
|
+
|
|
38
|
+
const install = DEFAULT_INSTALL_SHELL_COMMANDS; ///
|
|
39
|
+
|
|
40
|
+
shellCommands = Object.assign(shellCommands, {
|
|
41
|
+
install
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
configuration = Object.assign(configuration, {
|
|
45
|
+
version,
|
|
46
|
+
shellCommands
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return configuration;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = {
|
|
53
|
+
createConfiguration,
|
|
54
|
+
migrateConfigurationToVersion_1_9
|
|
55
|
+
};
|
package/bin/configuration.js
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
const { configurationUtilities } = require("necessary");
|
|
4
4
|
|
|
5
5
|
const { PROPAGATE } = require("./constants"),
|
|
6
|
-
{
|
|
6
|
+
{ migrateConfigurationToVersion_1_0 } = require("./configuration/version_1_0"),
|
|
7
|
+
{ migrateConfigurationToVersion_1_3 } = require("./configuration/version_1_3"),
|
|
8
|
+
{ migrateConfigurationToVersion_1_7 } = require("./configuration/version_1_7"),
|
|
7
9
|
{ CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } = require("./messages"),
|
|
8
|
-
{ createConfiguration,
|
|
10
|
+
{ createConfiguration, migrateConfigurationToVersion_1_9 } = require("./configuration/version_1_9"),
|
|
11
|
+
{ VERSION_1_0, VERSION_1_3, VERSION_1_7, CURRENT_VERSION, UNDEFINED_VERSION } = require("./versions");
|
|
9
12
|
|
|
10
13
|
const { rc } = configurationUtilities,
|
|
11
14
|
{ setRCBaseExtension, checkRCFileExists, updateRCFile, writeRCFile, readRCFile } = rc;
|
|
@@ -72,23 +75,36 @@ function createConfigurationFile() {
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
function migrateConfigurationFile() {
|
|
75
|
-
let version;
|
|
76
|
-
|
|
77
78
|
let json = readRCFile();
|
|
78
79
|
|
|
79
80
|
let configuration = json; ///
|
|
80
81
|
|
|
81
|
-
version =
|
|
82
|
+
let { version = UNDEFINED_VERSION } = configuration;
|
|
82
83
|
|
|
83
84
|
while (version !== CURRENT_VERSION) {
|
|
84
85
|
switch (version) {
|
|
85
|
-
|
|
86
|
+
case UNDEFINED_VERSION :
|
|
87
|
+
configuration = migrateConfigurationToVersion_1_0(configuration);
|
|
88
|
+
|
|
89
|
+
break;
|
|
90
|
+
|
|
91
|
+
case VERSION_1_0 :
|
|
92
|
+
configuration = migrateConfigurationToVersion_1_3(configuration);
|
|
93
|
+
|
|
94
|
+
break;
|
|
95
|
+
|
|
96
|
+
case VERSION_1_3 :
|
|
86
97
|
configuration = migrateConfigurationToVersion_1_7(configuration);
|
|
87
98
|
|
|
99
|
+
break;
|
|
100
|
+
|
|
101
|
+
case VERSION_1_7 :
|
|
102
|
+
configuration = migrateConfigurationToVersion_1_9(configuration);
|
|
103
|
+
|
|
88
104
|
break;
|
|
89
105
|
}
|
|
90
106
|
|
|
91
|
-
version = configuration
|
|
107
|
+
({ version } = configuration);
|
|
92
108
|
}
|
|
93
109
|
|
|
94
110
|
json = configuration; ///
|
package/bin/constants.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const YES = "yes",
|
|
4
4
|
UTF_8 = "utf-8",
|
|
5
|
+
TWO_DOTS = "..",
|
|
5
6
|
PROPAGATE = "propagate",
|
|
7
|
+
EMPTY_STRING = "",
|
|
6
8
|
PACKAGE_JSON = "package.json",
|
|
7
9
|
DEPENDENCIES = "dependencies",
|
|
8
10
|
PROPAGATE_CLI = "Propagate-CLI",
|
|
@@ -11,7 +13,9 @@ const YES = "yes",
|
|
|
11
13
|
module.exports = {
|
|
12
14
|
YES,
|
|
13
15
|
UTF_8,
|
|
16
|
+
TWO_DOTS,
|
|
14
17
|
PROPAGATE,
|
|
18
|
+
EMPTY_STRING,
|
|
15
19
|
PACKAGE_JSON,
|
|
16
20
|
DEPENDENCIES,
|
|
17
21
|
PROPAGATE_CLI,
|
package/bin/defaults.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
const DEFAULT_DIRECTORY_NAME = ".",
|
|
4
4
|
DEFAULT_GIT_SHELL_COMMANDS = "git add .; git commit -m \"Propagated.\"; git push",
|
|
5
|
-
DEFAULT_BUILD_SHELL_COMMANDS = "npm
|
|
5
|
+
DEFAULT_BUILD_SHELL_COMMANDS = "npm run build",
|
|
6
|
+
DEFAULT_INSTALL_SHELL_COMMANDS = "npm install",
|
|
6
7
|
DEFAULT_PUBLISH_SHELL_COMMANDS = "npm publish";
|
|
7
8
|
|
|
8
9
|
module.exports = {
|
|
9
10
|
DEFAULT_DIRECTORY_NAME,
|
|
10
11
|
DEFAULT_GIT_SHELL_COMMANDS,
|
|
11
12
|
DEFAULT_BUILD_SHELL_COMMANDS,
|
|
13
|
+
DEFAULT_INSTALL_SHELL_COMMANDS,
|
|
12
14
|
DEFAULT_PUBLISH_SHELL_COMMANDS
|
|
13
15
|
};
|
package/bin/descriptions.js
CHANGED
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
const BUILD_YES_NO_DESCRIPTION = "Build? (y)es (n)o: ",
|
|
4
4
|
FAILED_SCRIPT_DESCRIPTION = "The script has failed. Would you like to try again? (y)es (n)o: ",
|
|
5
5
|
DIRECTORY_PATH_DESCRIPTION = "Directory path: ",
|
|
6
|
+
INSTALL_YES_NO_DESCRIPTION = "Install? (y)es (n)o: ",
|
|
6
7
|
PUBLISH_YES_NO_DESCRIPTION = "Publish? (y)es (n)o: ",
|
|
7
8
|
FORCED_DEPENDENT_DESCRIPTION = "Forced dependent sub-directory name: ",
|
|
8
9
|
FORCED_DEPENDENCY_DESCRIPTION = "Forced dependency sub-directory name: ",
|
|
9
10
|
IGNORED_DEPENDENCY_DESCRIPTION = "Ignored dependency sub-directory name: ",
|
|
10
|
-
GIT_SHELL_COMMANDS_DESCRIPTION = "Git shell
|
|
11
|
+
GIT_SHELL_COMMANDS_DESCRIPTION = "Git shell command(s) (leave blank for default): ",
|
|
11
12
|
SAVE_UPDATES_YES_NO_DESCRIPTION = "Save updates? (y)es (n)o: ",
|
|
12
13
|
ADD_COMMIT_PUSH_GIT_DESCRIPTION = "Add, commit and push with Git? (y)es (n)o: ",
|
|
13
|
-
BUILD_SHELL_COMMANDS_DESCRIPTION = "Build shell commands (leave blank for default): ",
|
|
14
|
-
|
|
14
|
+
BUILD_SHELL_COMMANDS_DESCRIPTION = "Build shell commands() (leave blank for default): ",
|
|
15
|
+
INSTALL_SHELL_COMMANDS_DESCRIPTION = "Install shell commands() (leave blank for default): ",
|
|
16
|
+
PUBLISH_SHELL_COMMANDS_DESCRIPTION = "Publish shell commands() (leave blank for default): ",
|
|
15
17
|
SPECIFY_DIRECTORY_TO_REMOVE_DESCRIPTION = "Specify a directory to remove: ",
|
|
16
18
|
SPECIFY_IGNORED_DEPENDENCY_TO_REMOVE_DESCRIPTION = "Specify an ignored dependency to remove: ",
|
|
17
19
|
SPECIFY_FORCED_DEPENDENCY_RELATION_TO_REMOVE_DESCRIPTION = "Specify a forced dependency relation to remove: "
|
|
@@ -20,6 +22,7 @@ module.exports = {
|
|
|
20
22
|
BUILD_YES_NO_DESCRIPTION,
|
|
21
23
|
FAILED_SCRIPT_DESCRIPTION,
|
|
22
24
|
DIRECTORY_PATH_DESCRIPTION,
|
|
25
|
+
INSTALL_YES_NO_DESCRIPTION,
|
|
23
26
|
PUBLISH_YES_NO_DESCRIPTION,
|
|
24
27
|
FORCED_DEPENDENT_DESCRIPTION,
|
|
25
28
|
FORCED_DEPENDENCY_DESCRIPTION,
|
|
@@ -28,6 +31,7 @@ module.exports = {
|
|
|
28
31
|
SAVE_UPDATES_YES_NO_DESCRIPTION,
|
|
29
32
|
ADD_COMMIT_PUSH_GIT_DESCRIPTION,
|
|
30
33
|
BUILD_SHELL_COMMANDS_DESCRIPTION,
|
|
34
|
+
INSTALL_SHELL_COMMANDS_DESCRIPTION,
|
|
31
35
|
PUBLISH_SHELL_COMMANDS_DESCRIPTION,
|
|
32
36
|
SPECIFY_DIRECTORY_TO_REMOVE_DESCRIPTION,
|
|
33
37
|
SPECIFY_IGNORED_DEPENDENCY_TO_REMOVE_DESCRIPTION,
|
package/bin/diff/map.js
CHANGED
|
@@ -4,6 +4,8 @@ const { arrayUtilities } = require("necessary");
|
|
|
4
4
|
|
|
5
5
|
const SemverDiff = require("../diff/semver");
|
|
6
6
|
|
|
7
|
+
const { EMPTY_STRING } = require("../constants");
|
|
8
|
+
|
|
7
9
|
const { filter } = arrayUtilities;
|
|
8
10
|
|
|
9
11
|
class MapDiff {
|
|
@@ -53,7 +55,7 @@ class MapDiff {
|
|
|
53
55
|
semverDiffsString = `${semverDiffsString}${semverDiffString}`;
|
|
54
56
|
|
|
55
57
|
return semverDiffsString;
|
|
56
|
-
},
|
|
58
|
+
}, EMPTY_STRING),
|
|
57
59
|
string = `{\n${semverDiffsString}\n }`;
|
|
58
60
|
|
|
59
61
|
return string;
|
package/bin/diff.js
CHANGED
|
@@ -67,6 +67,8 @@ class Diff {
|
|
|
67
67
|
|
|
68
68
|
git(quietly, callback) { this.release.git(quietly, callback); }
|
|
69
69
|
|
|
70
|
+
install(quietly, callback) { this.release.install(quietly, callback); }
|
|
71
|
+
|
|
70
72
|
build(quietly, callback) { this.release.build(quietly, callback); }
|
|
71
73
|
|
|
72
74
|
publish(quietly, callback) { this.release.publish(quietly, callback); }
|
package/bin/main.js
CHANGED
|
@@ -4,7 +4,8 @@ const { pathUtilities } = require("necessary");
|
|
|
4
4
|
|
|
5
5
|
const actions = require("./actions");
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const { TWO_DOTS } = require("./constants"),
|
|
8
|
+
{ PROPAGATE_COMMAND } = require("./commands"),
|
|
8
9
|
{ checkConfigurationFileExists, migrateConfigurationFile } = require("./configuration");
|
|
9
10
|
|
|
10
11
|
const { bottommostNameFromPath } = pathUtilities;
|
|
@@ -16,7 +17,7 @@ function main(command, argument, options) {
|
|
|
16
17
|
if (!configurationFileExists) {
|
|
17
18
|
const currentWorkingDirectoryPath = process.cwd(); ///
|
|
18
19
|
|
|
19
|
-
process.chdir(
|
|
20
|
+
process.chdir(TWO_DOTS);
|
|
20
21
|
|
|
21
22
|
const oldCurrentWorkingDirectoryPath = currentWorkingDirectoryPath; ///
|
|
22
23
|
|
package/bin/messages.js
CHANGED
|
@@ -11,6 +11,7 @@ const INVALID_ANSWER_MESSAGE = "You must answer (y)es or (n)o.",
|
|
|
11
11
|
FAILED_GIT_MESSAGE = "The Git script failed.",
|
|
12
12
|
FAILED_SAVE_MESSAGE = "The 'package.json' file could not be saved.",
|
|
13
13
|
FAILED_BUILD_MESSAGE = "The build script failed.",
|
|
14
|
+
FAILED_INSTALL_MESSAGE = "The install script failed.",
|
|
14
15
|
FAILED_PUBLISH_MESSAGE = "The publish script failed.",
|
|
15
16
|
FAILED_PROPAGATE_MESSAGE = "Failed to propagate the package.",
|
|
16
17
|
FAILED_INITIALISE_MESSAGE = "Failed to create a configuration file because one is already present.",
|
|
@@ -55,6 +56,7 @@ module.exports = {
|
|
|
55
56
|
FAILED_GIT_MESSAGE,
|
|
56
57
|
FAILED_SAVE_MESSAGE,
|
|
57
58
|
FAILED_BUILD_MESSAGE,
|
|
59
|
+
FAILED_INSTALL_MESSAGE,
|
|
58
60
|
FAILED_PUBLISH_MESSAGE,
|
|
59
61
|
FAILED_PROPAGATE_MESSAGE,
|
|
60
62
|
FAILED_INITIALISE_MESSAGE,
|
package/bin/release.js
CHANGED
|
@@ -70,6 +70,17 @@ class Release {
|
|
|
70
70
|
this.executeShellCommands(shellCommands, quietly, callback);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
install(quietly, callback) {
|
|
74
|
+
let shellCommands = retrieveShellCommands();
|
|
75
|
+
|
|
76
|
+
const { install } = shellCommands,
|
|
77
|
+
installShellCommands = install;
|
|
78
|
+
|
|
79
|
+
shellCommands = installShellCommands; ///
|
|
80
|
+
|
|
81
|
+
this.executeShellCommands(shellCommands, quietly, callback);
|
|
82
|
+
}
|
|
83
|
+
|
|
73
84
|
build(quietly, callback) {
|
|
74
85
|
let shellCommands = retrieveShellCommands();
|
|
75
86
|
|
package/bin/versions.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const VERSION_1_0 = "1.
|
|
3
|
+
const VERSION_1_0 = "1.0",
|
|
4
4
|
VERSION_1_3 = "1.3",
|
|
5
5
|
VERSION_1_7 = "1.7",
|
|
6
|
-
|
|
6
|
+
VERSION_1_9 = "1.9",
|
|
7
|
+
CURRENT_VERSION = VERSION_1_9, ///
|
|
8
|
+
UNDEFINED_VERSION = null; ///
|
|
7
9
|
|
|
8
10
|
module.exports = {
|
|
9
11
|
VERSION_1_0,
|
|
10
12
|
VERSION_1_3,
|
|
11
13
|
VERSION_1_7,
|
|
12
|
-
|
|
14
|
+
VERSION_1_9,
|
|
15
|
+
CURRENT_VERSION,
|
|
16
|
+
UNDEFINED_VERSION
|
|
13
17
|
};
|
package/package.json
CHANGED