propagate-cli 1.10.1 → 1.10.4
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/.swcrc +5 -0
- package/lib/abbreviations.js +22 -0
- package/lib/action/addDirectory.js +41 -0
- package/lib/action/addForcedDependencyRelation.js +51 -0
- package/lib/action/addIgnoredDependency.js +40 -0
- package/lib/action/help.js +15 -0
- package/lib/action/initialise.js +23 -0
- package/lib/action/listDirectories.js +57 -0
- package/lib/action/listForcedDependencyRelations.js +30 -0
- package/lib/action/listIgnoredDependencies.js +56 -0
- package/lib/action/propagate.js +57 -0
- package/lib/action/removeDirectory.js +43 -0
- package/lib/action/removeForcedDependencyRelation.js +43 -0
- package/lib/action/removeIgnoredDependency.js +43 -0
- package/lib/action/setShellCommands.js +43 -0
- package/lib/action/version.js +19 -0
- package/lib/changeDirectory.js +33 -0
- package/lib/commands.js +70 -0
- package/lib/configuration/version_1_10.js +48 -0
- package/lib/configuration/version_1_3.js +21 -0
- package/lib/configuration/version_1_7.js +21 -0
- package/lib/configuration/version_1_9.js +27 -0
- package/lib/configuration.js +191 -0
- package/lib/constants.js +46 -0
- package/lib/defaults.js +54 -0
- package/lib/descriptions.js +82 -0
- package/lib/diff/map.js +114 -0
- package/lib/diff/semver.js +88 -0
- package/lib/diff/version.js +97 -0
- package/lib/diff.js +210 -0
- package/lib/main.js +119 -0
- package/lib/messages.js +190 -0
- package/lib/operation/checkDevDependencies.js +34 -0
- package/lib/operation/createDiffs.js +78 -0
- package/lib/operation/createReleaseGraph.js +43 -0
- package/lib/operation/createReleaseMap.js +26 -0
- package/lib/operation/createSubDirectoryMap.js +65 -0
- package/lib/operation/createSubDirectoryPath.js +30 -0
- package/lib/operation/dryRun.js +22 -0
- package/lib/operation/prompt/addDirectory.js +37 -0
- package/lib/operation/prompt/addForcedDependency.js +37 -0
- package/lib/operation/prompt/addForcedDependent.js +37 -0
- package/lib/operation/prompt/addIgnoredDependency.js +37 -0
- package/lib/operation/prompt/build.js +52 -0
- package/lib/operation/prompt/git.js +52 -0
- package/lib/operation/prompt/install.js +52 -0
- package/lib/operation/prompt/publish.js +61 -0
- package/lib/operation/prompt/removeDirectory.js +39 -0
- package/lib/operation/prompt/removeForcedDependencyRelation.js +39 -0
- package/lib/operation/prompt/removeIgnoredDependency.js +39 -0
- package/lib/operation/prompt/save.js +57 -0
- package/lib/operation/prompt/setBuildShellCommands.js +33 -0
- package/lib/operation/prompt/setGitShellCommands.js +33 -0
- package/lib/operation/prompt/setInstallShellCommands.js +33 -0
- package/lib/operation/prompt/setPublishShellCommands.js +33 -0
- package/lib/operation/propagateRelease.js +73 -0
- package/lib/operation/retrieveRelease.js +31 -0
- package/lib/operation/saveAndApplyDiff.js +49 -0
- package/lib/operation/saveAndApplyDiffs.js +27 -0
- package/lib/options.js +34 -0
- package/lib/prepare.js +48 -0
- package/lib/release.js +227 -0
- package/lib/releaseGraph.js +170 -0
- package/lib/releaseMap.js +120 -0
- package/lib/utilities/console.js +81 -0
- package/lib/utilities/dependency.js +25 -0
- package/lib/utilities/diffs.js +28 -0
- package/lib/utilities/operation.js +53 -0
- package/lib/utilities/packageJSON.js +50 -0
- package/lib/utilities/path.js +22 -0
- package/lib/utilities/prompt.js +15 -0
- package/lib/utilities/propagate.js +60 -0
- package/lib/utilities/shell.js +63 -0
- package/lib/utilities/validate.js +68 -0
- package/lib/version.js +140 -0
- package/lib/versions.js +34 -0
- package/package.json +18 -3
- package/propagate.js +3 -3
- package/src/abbreviations.js +19 -0
- package/{bin → src}/action/addDirectory.js +5 -7
- package/{bin → src}/action/addForcedDependencyRelation.js +8 -10
- package/{bin → src}/action/addIgnoredDependency.js +7 -9
- package/{bin → src}/action/help.js +1 -3
- package/{bin → src}/action/initialise.js +3 -5
- package/{bin → src}/action/listDirectories.js +4 -6
- package/{bin → src}/action/listForcedDependencyRelations.js +4 -6
- package/{bin → src}/action/listIgnoredDependencies.js +4 -6
- package/src/action/propagate.js +48 -0
- package/{bin → src}/action/removeDirectory.js +6 -8
- package/{bin → src}/action/removeForcedDependencyRelation.js +6 -8
- package/{bin → src}/action/removeIgnoredDependency.js +6 -8
- package/src/action/setShellCommands.js +37 -0
- package/src/action/version.js +13 -0
- package/{bin → src}/changeDirectory.js +4 -6
- package/src/commands.js +16 -0
- package/{bin → src}/configuration/version_1_10.js +4 -9
- package/{bin → src}/configuration/version_1_3.js +2 -6
- package/{bin → src}/configuration/version_1_7.js +2 -6
- package/{bin → src}/configuration/version_1_9.js +3 -7
- package/{bin → src}/configuration.js +23 -40
- package/src/constants.js +10 -0
- package/src/defaults.js +12 -0
- package/src/descriptions.js +19 -0
- package/{bin → src}/diff/map.js +4 -6
- package/{bin → src}/diff/semver.js +1 -3
- package/{bin → src}/diff/version.js +2 -4
- package/{bin → src}/diff.js +5 -7
- package/{bin → src}/main.js +20 -22
- package/src/messages.js +46 -0
- package/{bin → src}/operation/checkDevDependencies.js +1 -3
- package/{bin → src}/operation/createDiffs.js +2 -4
- package/{bin → src}/operation/createReleaseGraph.js +5 -7
- package/{bin → src}/operation/createReleaseMap.js +3 -5
- package/{bin → src}/operation/createSubDirectoryMap.js +5 -7
- package/{bin → src}/operation/createSubDirectoryPath.js +5 -7
- package/{bin → src}/operation/dryRun.js +1 -3
- package/{bin → src}/operation/prompt/addDirectory.js +5 -7
- package/{bin → src}/operation/prompt/addForcedDependency.js +5 -7
- package/{bin → src}/operation/prompt/addForcedDependent.js +5 -7
- package/{bin → src}/operation/prompt/addIgnoredDependency.js +5 -7
- package/{bin → src}/operation/prompt/build.js +8 -10
- package/{bin → src}/operation/prompt/git.js +8 -10
- package/{bin → src}/operation/prompt/install.js +8 -10
- package/{bin → src}/operation/prompt/publish.js +9 -11
- package/{bin → src}/operation/prompt/removeDirectory.js +5 -7
- package/{bin → src}/operation/prompt/removeForcedDependencyRelation.js +5 -7
- package/{bin → src}/operation/prompt/removeIgnoredDependency.js +5 -7
- package/{bin → src}/operation/prompt/save.js +9 -11
- package/{bin → src}/operation/prompt/setBuildShellCommands.js +6 -8
- package/{bin → src}/operation/prompt/setGitShellCommands.js +6 -8
- package/{bin → src}/operation/prompt/setInstallShellCommands.js +6 -8
- package/{bin → src}/operation/prompt/setPublishShellCommands.js +6 -8
- package/{bin → src}/operation/propagateRelease.js +3 -5
- package/{bin → src}/operation/retrieveRelease.js +2 -4
- package/{bin → src}/operation/saveAndApplyDiff.js +8 -10
- package/src/operation/saveAndApplyDiffs.js +17 -0
- package/src/options.js +7 -0
- package/{bin → src}/prepare.js +17 -19
- package/{bin → src}/release.js +5 -7
- package/{bin → src}/releaseGraph.js +2 -4
- package/{bin → src}/releaseMap.js +2 -4
- package/{bin → src}/utilities/console.js +5 -11
- package/{bin → src}/utilities/dependency.js +1 -5
- package/{bin → src}/utilities/diffs.js +2 -7
- package/{bin → src}/utilities/operation.js +3 -8
- package/{bin → src}/utilities/packageJSON.js +4 -9
- package/{bin → src}/utilities/path.js +2 -6
- package/src/utilities/prompt.js +3 -0
- package/{bin → src}/utilities/propagate.js +3 -8
- package/{bin → src}/utilities/shell.js +7 -11
- package/src/utilities/validate.js +19 -0
- package/{bin → src}/version.js +2 -4
- package/src/versions.js +7 -0
- package/bin/abbreviations.js +0 -11
- package/bin/action/propagate.js +0 -50
- package/bin/action/setShellCommands.js +0 -39
- package/bin/action/version.js +0 -15
- package/bin/commands.js +0 -33
- package/bin/constants.js +0 -23
- package/bin/defaults.js +0 -25
- package/bin/descriptions.js +0 -39
- package/bin/messages.js +0 -93
- package/bin/operation/saveAndApplyDiffs.js +0 -19
- package/bin/options.js +0 -15
- package/bin/utilities/prompt.js +0 -7
- package/bin/utilities/validate.js +0 -31
- package/bin/versions.js +0 -15
package/{bin → src}/release.js
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Version from "./version";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { execute } from "./utilities/shell";
|
|
6
|
+
import { readPackageJSONFile } from "./utilities/packageJSON";
|
|
7
|
+
import { retrieveShellCommands, retrieveIgnoredBuilds, retrieveIgnoredPublishes } from "./configuration";
|
|
8
8
|
|
|
9
|
-
class Release {
|
|
9
|
+
export default class Release {
|
|
10
10
|
constructor(name, version, dependencyMap, devDependencyMap, subDirectoryPath) {
|
|
11
11
|
this.name = name;
|
|
12
12
|
this.version = version;
|
|
@@ -189,8 +189,6 @@ class Release {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
module.exports = Release;
|
|
193
|
-
|
|
194
192
|
function updateSemver(name, versionString, map) {
|
|
195
193
|
let success = false;
|
|
196
194
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { DirectedGraph } from "occam-directed-graphs";
|
|
4
4
|
|
|
5
|
-
class ReleaseGraph {
|
|
5
|
+
export default class ReleaseGraph {
|
|
6
6
|
constructor(dependencyDirectedGraph, devDependencyDirectedGraph) {
|
|
7
7
|
this.dependencyDirectedGraph = dependencyDirectedGraph;
|
|
8
8
|
this.devDependencyDirectedGraph = devDependencyDirectedGraph;
|
|
@@ -184,5 +184,3 @@ class ReleaseGraph {
|
|
|
184
184
|
return releaseGraph;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
module.exports = ReleaseGraph;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import Release from "./release";
|
|
4
4
|
|
|
5
|
-
class ReleaseMap {
|
|
5
|
+
export default class ReleaseMap {
|
|
6
6
|
constructor(map) {
|
|
7
7
|
this.map = map;
|
|
8
8
|
}
|
|
@@ -74,8 +74,6 @@ class ReleaseMap {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
module.exports = ReleaseMap;
|
|
78
|
-
|
|
79
77
|
function subDirectoryPathsFromSubDirectoryMapAndIgnoredDependencies(subDirectoryMap, ignoredDependencies) {
|
|
80
78
|
const subDirectoryPaths = [],
|
|
81
79
|
subDirectoryNames = Object.keys(subDirectoryMap), ///
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { nextDiffsFromDiff, previousDiffsFromDiff } from "../utilities/diffs";
|
|
6
6
|
|
|
7
7
|
const { first } = arrayUtilities;
|
|
8
8
|
|
|
9
|
-
function consoleLogUnpublishedDiff(diff, diffs) {
|
|
9
|
+
export function consoleLogUnpublishedDiff(diff, diffs) {
|
|
10
10
|
const previousDiffs = previousDiffsFromDiff(diff, diffs),
|
|
11
11
|
unpublishedDiff = diff; ///
|
|
12
12
|
|
|
13
13
|
consoleLogUnpublishedDiffEx(unpublishedDiff, previousDiffs);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function consoleLogUnpublishedDiffs(diff, diffs) {
|
|
16
|
+
export function consoleLogUnpublishedDiffs(diff, diffs) {
|
|
17
17
|
const nextDiffs = nextDiffsFromDiff(diff, diffs),
|
|
18
18
|
previousDiffs = previousDiffsFromDiff(diff, diffs),
|
|
19
19
|
unpublishedDiffs = [
|
|
@@ -24,7 +24,7 @@ function consoleLogUnpublishedDiffs(diff, diffs) {
|
|
|
24
24
|
unpublishedDiffs.forEach((unpublishedDiff) => consoleLogUnpublishedDiffEx(unpublishedDiff, previousDiffs));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function consoleLogSubDirectoryPathsCycle(subDirectoryPaths) {
|
|
27
|
+
export function consoleLogSubDirectoryPathsCycle(subDirectoryPaths) {
|
|
28
28
|
const firstSubDirectoryPath = first(subDirectoryPaths);
|
|
29
29
|
|
|
30
30
|
subDirectoryPaths = [
|
|
@@ -37,12 +37,6 @@ function consoleLogSubDirectoryPathsCycle(subDirectoryPaths) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
module.exports = {
|
|
41
|
-
consoleLogUnpublishedDiff,
|
|
42
|
-
consoleLogUnpublishedDiffs,
|
|
43
|
-
consoleLogSubDirectoryPathsCycle
|
|
44
|
-
};
|
|
45
|
-
|
|
46
40
|
function consoleLogUnpublishedDiffEx(unpublishedDiff, previousDiffs) {
|
|
47
41
|
const name = unpublishedDiff.getName();
|
|
48
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function isDependencyRelationForced(dependencyRelease, dependentRelease, subDirectoryMap, forcedDependencyRelations) {
|
|
3
|
+
export function isDependencyRelationForced(dependencyRelease, dependentRelease, subDirectoryMap, forcedDependencyRelations) {
|
|
4
4
|
const dependentReleaseSubDirectoryPath = dependentRelease.getSubDirectoryPath(),
|
|
5
5
|
dependentReleaseSubDirectoryName = subDirectoryNameFromSubDirectoryPath(dependentReleaseSubDirectoryPath, subDirectoryMap),
|
|
6
6
|
dependencyReleaseSubDirectoryPath = dependencyRelease.getSubDirectoryPath(),
|
|
@@ -16,10 +16,6 @@ function isDependencyRelationForced(dependencyRelease, dependentRelease, subDire
|
|
|
16
16
|
return dependencyRelationForced;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
module.exports = {
|
|
20
|
-
isDependencyRelationForced
|
|
21
|
-
};
|
|
22
|
-
|
|
23
19
|
function subDirectoryNameFromSubDirectoryPath(subDirectoryPath, subDirectoryMap) {
|
|
24
20
|
const subDirectoryNames = Object.keys(subDirectoryMap), ///
|
|
25
21
|
subDirectoryPaths = Object.values(subDirectoryMap), ///
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function nextDiffsFromDiff(diff, diffs) {
|
|
3
|
+
export function nextDiffsFromDiff(diff, diffs) {
|
|
4
4
|
const index = diffs.indexOf(diff),
|
|
5
5
|
beginIndex = index + 1,
|
|
6
6
|
nextDiffs = diffs.slice(beginIndex);
|
|
@@ -8,7 +8,7 @@ function nextDiffsFromDiff(diff, diffs) {
|
|
|
8
8
|
return nextDiffs;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function previousDiffsFromDiff(diff, diffs) {
|
|
11
|
+
export function previousDiffsFromDiff(diff, diffs) {
|
|
12
12
|
const index = diffs.indexOf(diff),
|
|
13
13
|
endIndex = index, ///
|
|
14
14
|
beginIndex = 0,
|
|
@@ -16,8 +16,3 @@ function previousDiffsFromDiff(diff, diffs) {
|
|
|
16
16
|
|
|
17
17
|
return previousDiffs;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
nextDiffsFromDiff,
|
|
22
|
-
previousDiffsFromDiff
|
|
23
|
-
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { asynchronousUtilities } from "necessary";
|
|
4
4
|
|
|
5
5
|
const { forEach, whilst } = asynchronousUtilities;
|
|
6
6
|
|
|
7
|
-
function executeOperation(array, operation, proceed, abort, context) {
|
|
7
|
+
export function executeOperation(array, operation, proceed, abort, context) {
|
|
8
8
|
let completed = true;
|
|
9
9
|
|
|
10
10
|
forEach(array, (element, next, done, context) => {
|
|
@@ -25,7 +25,7 @@ function executeOperation(array, operation, proceed, abort, context) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function executeOperations(operations, callback, context) {
|
|
28
|
+
export function executeOperations(operations, callback, context) {
|
|
29
29
|
let completed = true;
|
|
30
30
|
|
|
31
31
|
const operationsLength = operations.length,
|
|
@@ -53,8 +53,3 @@ function executeOperations(operations, callback, context) {
|
|
|
53
53
|
callback(completed);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
module.exports = {
|
|
58
|
-
executeOperation,
|
|
59
|
-
executeOperations
|
|
60
|
-
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { pathUtilities, fileSystemUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { PACKAGE_JSON } from "../constants";
|
|
6
6
|
|
|
7
7
|
const { concatenatePaths } = pathUtilities,
|
|
8
8
|
{ readFile, writeFile, checkFileExists } = fileSystemUtilities;
|
|
9
9
|
|
|
10
|
-
function readPackageJSONFile(subDirectoryPath) {
|
|
10
|
+
export function readPackageJSONFile(subDirectoryPath) {
|
|
11
11
|
let packageJSON = null;
|
|
12
12
|
|
|
13
13
|
try {
|
|
@@ -28,7 +28,7 @@ function readPackageJSONFile(subDirectoryPath) {
|
|
|
28
28
|
return packageJSON;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function writePackageJSONFile(subDirectoryPath, packageJSON) {
|
|
31
|
+
export function writePackageJSONFile(subDirectoryPath, packageJSON) {
|
|
32
32
|
let success;
|
|
33
33
|
|
|
34
34
|
try {
|
|
@@ -48,8 +48,3 @@ function writePackageJSONFile(subDirectoryPath, packageJSON) {
|
|
|
48
48
|
|
|
49
49
|
return success;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
module.exports = {
|
|
53
|
-
readPackageJSONFile,
|
|
54
|
-
writePackageJSONFile
|
|
55
|
-
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import path from "path";
|
|
4
4
|
|
|
5
|
-
function absolutePathFromName(name) {
|
|
5
|
+
export function absolutePathFromName(name) {
|
|
6
6
|
const currentWorkingDirectoryPath = process.cwd(), ///
|
|
7
7
|
absolutePath = path.join(currentWorkingDirectoryPath, name);
|
|
8
8
|
|
|
9
9
|
return absolutePath;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
absolutePathFromName
|
|
14
|
-
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { consoleLogUnpublishedDiff } from "../utilities/console";
|
|
4
4
|
|
|
5
|
-
function removeDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
5
|
+
export function removeDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
6
6
|
const release = diff.getRelease(),
|
|
7
7
|
dependentReleases = releaseGraph.retrieveDependentReleases(release, releaseMap),
|
|
8
8
|
dependentReleasesLength = dependentReleases.length;
|
|
@@ -31,7 +31,7 @@ function removeDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function removeDevDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
34
|
+
export function removeDevDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
35
35
|
const release = diff.getRelease(),
|
|
36
36
|
devDependentReleases = releaseGraph.retrieveDevDependentReleases(release, releaseMap),
|
|
37
37
|
devDependentReleasesLength = devDependentReleases.length;
|
|
@@ -50,11 +50,6 @@ function removeDevDependencies(diff, diffs, releaseMap, releaseGraph) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
module.exports = {
|
|
54
|
-
removeDependencies,
|
|
55
|
-
removeDevDependencies
|
|
56
|
-
};
|
|
57
|
-
|
|
58
53
|
function findDiff(release, diffs) {
|
|
59
54
|
const diff = diffs.find((diff) => {
|
|
60
55
|
const diffRelease = diff.getRelease();
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import childProcess from "child_process";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { encodings, shellUtilities } from "necessary";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { validateAnswer } from "../utilities/validate";
|
|
8
|
+
import { isAnswerAffirmative } from "../utilities/prompt";
|
|
9
|
+
import { INVALID_ANSWER_MESSAGE } from "../messages";
|
|
10
|
+
import { FAILED_SCRIPT_DESCRIPTION } from "../descriptions";
|
|
11
11
|
|
|
12
12
|
const { prompt } = shellUtilities,
|
|
13
13
|
{ UTF_8_ENCODING } = encodings;
|
|
14
14
|
|
|
15
|
-
function execute(shellCommands, quietly, callback) {
|
|
15
|
+
export function execute(shellCommands, quietly, callback) {
|
|
16
16
|
const success = execSync(shellCommands, quietly);
|
|
17
17
|
|
|
18
18
|
if (success) {
|
|
@@ -51,10 +51,6 @@ function execute(shellCommands, quietly, callback) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
module.exports = {
|
|
55
|
-
execute
|
|
56
|
-
};
|
|
57
|
-
|
|
58
54
|
function execSync(shellCommands, quietly) {
|
|
59
55
|
let success;
|
|
60
56
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function validateAnswer(answer) { return /^(:?yes|no|y|n)$/i.test(answer); }
|
|
4
|
+
|
|
5
|
+
export function validateDirectoryPath(directoryPath) { return /^\.\.?(?:\/[a-zA-Z0-9\-_]+)+\/?$/.test(directoryPath); }
|
|
6
|
+
|
|
7
|
+
export function validateShellCommands(shellCommands) { return /^.*$/.test(shellCommands); }
|
|
8
|
+
|
|
9
|
+
export function validateDirectoryNumber(directoryNumber, directoryNumbers) { return directoryNumbers.includes(directoryNumber); }
|
|
10
|
+
|
|
11
|
+
export function validateForcedDependentName(forcedDependentName) { return /^.+$/.test(forcedDependentName); }
|
|
12
|
+
|
|
13
|
+
export function validateForcedDependencyName(forcedDependencyName) { return /^.+$/.test(forcedDependencyName); }
|
|
14
|
+
|
|
15
|
+
export function validateIgnoredDependencyName(ignoredDependencyName) { return /^.+$/.test(ignoredDependencyName); }
|
|
16
|
+
|
|
17
|
+
export function validateIgnoredDependencyNumber(ignoredDependencyNumber, ignoredDependencyNumbers) { return ignoredDependencyNumbers.includes(ignoredDependencyNumber); }
|
|
18
|
+
|
|
19
|
+
export function validateForcedDependencyRelationNumber(forcedDependencyRelationNumber, forcedDependencyRelationNumbers) { return forcedDependencyRelationNumbers.includes(forcedDependencyRelationNumber); }
|
package/{bin → src}/version.js
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
5
|
const { first, second } = arrayUtilities;
|
|
6
6
|
|
|
7
|
-
class Version {
|
|
7
|
+
export default class Version {
|
|
8
8
|
constructor(majorNumber, minorNumber, patchNumber) {
|
|
9
9
|
this.majorNumber = majorNumber;
|
|
10
10
|
this.minorNumber = minorNumber;
|
|
@@ -95,8 +95,6 @@ class Version {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
module.exports = Version;
|
|
99
|
-
|
|
100
98
|
function majorNumberFromString(string) {
|
|
101
99
|
const matches = string.match(/(\d+)\.\d+\.\d+$/),
|
|
102
100
|
secondMatch = second(matches),
|
package/src/versions.js
ADDED
package/bin/abbreviations.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { YES_OPTION, HELP_OPTION, VERSION_OPTION, QUIETLY_OPTION, DRY_RUN_OPTION } = require("./options");
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
"y": YES_OPTION,
|
|
7
|
-
"h": HELP_OPTION,
|
|
8
|
-
"v": VERSION_OPTION,
|
|
9
|
-
"q": QUIETLY_OPTION,
|
|
10
|
-
"d": DRY_RUN_OPTION
|
|
11
|
-
};
|
package/bin/action/propagate.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const dryRunOperation = require("../operation/dryRun"),
|
|
4
|
-
createDiffsOperation = require("../operation/createDiffs"),
|
|
5
|
-
retrieveReleaseOperation = require("../operation/retrieveRelease"),
|
|
6
|
-
createReleaseMapOperation = require("../operation/createReleaseMap"),
|
|
7
|
-
propagateReleaseOperation = require("../operation/propagateRelease"),
|
|
8
|
-
saveAndApplyDiffsOperation = require("../operation/saveAndApplyDiffs"),
|
|
9
|
-
createReleaseGraphOperation = require("../operation/createReleaseGraph"),
|
|
10
|
-
checkDevDependenciesOperation = require("../operation/checkDevDependencies"),
|
|
11
|
-
createSubDirectoryMapOperation = require("../operation/createSubDirectoryMap"),
|
|
12
|
-
createSubDirectoryPathOperation = require("../operation/createSubDirectoryPath");
|
|
13
|
-
|
|
14
|
-
const { executeOperations } = require("../utilities/operation"),
|
|
15
|
-
{ FAILED_PROPAGATE_MESSAGE, SUCCESSFUL_PROPAGATE_MESSAGE } = require("../messages");
|
|
16
|
-
|
|
17
|
-
function propagateAction(subDirectoryName, quietly, dryRun, yes) {
|
|
18
|
-
const operations = [
|
|
19
|
-
createSubDirectoryPathOperation,
|
|
20
|
-
createSubDirectoryMapOperation,
|
|
21
|
-
createReleaseMapOperation,
|
|
22
|
-
retrieveReleaseOperation,
|
|
23
|
-
createReleaseGraphOperation,
|
|
24
|
-
propagateReleaseOperation,
|
|
25
|
-
createDiffsOperation,
|
|
26
|
-
dryRunOperation,
|
|
27
|
-
checkDevDependenciesOperation,
|
|
28
|
-
saveAndApplyDiffsOperation
|
|
29
|
-
],
|
|
30
|
-
context = {
|
|
31
|
-
subDirectoryName,
|
|
32
|
-
quietly,
|
|
33
|
-
dryRun,
|
|
34
|
-
yes
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
executeOperations(operations, (completed) => {
|
|
38
|
-
if (!completed) {
|
|
39
|
-
console.log(FAILED_PROPAGATE_MESSAGE);
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (!dryRun) {
|
|
45
|
-
console.log(SUCCESSFUL_PROPAGATE_MESSAGE);
|
|
46
|
-
}
|
|
47
|
-
}, context);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
module.exports = propagateAction;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const setGitShellCommandsPromptOperation = require("../operation/prompt/setGitShellCommands"),
|
|
4
|
-
setBuildShellCommandsPromptOperation = require("../operation/prompt/setBuildShellCommands"),
|
|
5
|
-
setInstallShellCommandsPromptOperation = require("../operation/prompt/setInstallShellCommands"),
|
|
6
|
-
setPublishShellCommandsPromptOperation = require("../operation/prompt/setPublishShellCommands");
|
|
7
|
-
|
|
8
|
-
const { executeOperations } = require("../utilities/operation"),
|
|
9
|
-
{ retrieveShellCommands, updateShellCommands } = require("../configuration"),
|
|
10
|
-
{ FAILED_SET_SHELL_COMMANDS_MESSAGE, SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE } = require("../messages");
|
|
11
|
-
|
|
12
|
-
function setShellCommandsAction() {
|
|
13
|
-
const operations = [
|
|
14
|
-
setGitShellCommandsPromptOperation,
|
|
15
|
-
setInstallShellCommandsPromptOperation,
|
|
16
|
-
setBuildShellCommandsPromptOperation,
|
|
17
|
-
setPublishShellCommandsPromptOperation
|
|
18
|
-
],
|
|
19
|
-
shellCommands = retrieveShellCommands(),
|
|
20
|
-
context = {
|
|
21
|
-
shellCommands
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
executeOperations(operations, (completed) => {
|
|
25
|
-
if (!completed) {
|
|
26
|
-
console.log(FAILED_SET_SHELL_COMMANDS_MESSAGE);
|
|
27
|
-
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const { shellCommands } = context;
|
|
32
|
-
|
|
33
|
-
updateShellCommands(shellCommands);
|
|
34
|
-
|
|
35
|
-
console.log(SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE);
|
|
36
|
-
}, context);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
module.exports = setShellCommandsAction;
|
package/bin/action/version.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const { packageUtilities } = require("necessary");
|
|
4
|
-
|
|
5
|
-
const { PROPAGATE_CLI } = require("../constants");
|
|
6
|
-
|
|
7
|
-
const { getVersion } = packageUtilities;
|
|
8
|
-
|
|
9
|
-
function versionAction() {
|
|
10
|
-
const version = getVersion(); ///
|
|
11
|
-
|
|
12
|
-
console.log(`${PROPAGATE_CLI} version ${version}`);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = versionAction;
|
package/bin/commands.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const HELP_COMMAND = "help",
|
|
4
|
-
VERSION_COMMAND = "version",
|
|
5
|
-
PROPAGATE_COMMAND = "propagate",
|
|
6
|
-
INITIALISE_COMMAND = "initialise",
|
|
7
|
-
ADD_DIRECTORY_COMMAND = "add-directory",
|
|
8
|
-
LIST_DIRECTORIES_COMMAND = "list-directories",
|
|
9
|
-
REMOVE_DIRECTORY_COMMAND = "remove-directory",
|
|
10
|
-
SET_SHELL_COMMANDS_COMMAND = "set-shell-commands",
|
|
11
|
-
ADD_IGNORED_DEPENDENCY_COMMAND = "add-ignored-dependency",
|
|
12
|
-
REMOVE_IGNORED_DEPENDENCY_COMMAND = "remove-ignored-dependency",
|
|
13
|
-
LIST_IGNORED_DEPENDENCIES_COMMAND = "list-ignored-dependencies",
|
|
14
|
-
ADD_FORCED_DEPENDENCY_RELATION_COMMAND = "add-forced-dependency-relation",
|
|
15
|
-
LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND = "list-forced-dependency-relations",
|
|
16
|
-
REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND = "remove-forced-dependency-relation";
|
|
17
|
-
|
|
18
|
-
module.exports = {
|
|
19
|
-
HELP_COMMAND,
|
|
20
|
-
VERSION_COMMAND,
|
|
21
|
-
PROPAGATE_COMMAND,
|
|
22
|
-
INITIALISE_COMMAND,
|
|
23
|
-
ADD_DIRECTORY_COMMAND,
|
|
24
|
-
REMOVE_DIRECTORY_COMMAND,
|
|
25
|
-
LIST_DIRECTORIES_COMMAND,
|
|
26
|
-
SET_SHELL_COMMANDS_COMMAND,
|
|
27
|
-
ADD_IGNORED_DEPENDENCY_COMMAND,
|
|
28
|
-
LIST_IGNORED_DEPENDENCIES_COMMAND,
|
|
29
|
-
REMOVE_IGNORED_DEPENDENCY_COMMAND,
|
|
30
|
-
ADD_FORCED_DEPENDENCY_RELATION_COMMAND,
|
|
31
|
-
LIST_FORCED_DEPENDENCY_RELATIONS_COMMAND,
|
|
32
|
-
REMOVE_FORCED_DEPENDENCY_RELATION_COMMAND
|
|
33
|
-
};
|
package/bin/constants.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const YES = "yes",
|
|
4
|
-
TWO_DOTS = "..",
|
|
5
|
-
PROPAGATE = "propagate",
|
|
6
|
-
DOUBLE_DOTS = "..",
|
|
7
|
-
EMPTY_STRING = "",
|
|
8
|
-
PACKAGE_JSON = "package.json",
|
|
9
|
-
DEPENDENCIES = "dependencies",
|
|
10
|
-
PROPAGATE_CLI = "Propagate-CLI",
|
|
11
|
-
DEV_DEPENDENCIES = "devDependencies";
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
YES,
|
|
15
|
-
TWO_DOTS,
|
|
16
|
-
PROPAGATE,
|
|
17
|
-
DOUBLE_DOTS,
|
|
18
|
-
EMPTY_STRING,
|
|
19
|
-
PACKAGE_JSON,
|
|
20
|
-
DEPENDENCIES,
|
|
21
|
-
PROPAGATE_CLI,
|
|
22
|
-
DEV_DEPENDENCIES
|
|
23
|
-
};
|
package/bin/defaults.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const DEFAULT_YES = false,
|
|
4
|
-
DEFAULT_HELP = false,
|
|
5
|
-
DEFAULT_VERSION = false,
|
|
6
|
-
DEFAULT_DRY_RUN = false,
|
|
7
|
-
DEFAULT_QUIETLY = false,
|
|
8
|
-
DEFAULT_DIRECTORY_NAME = ".",
|
|
9
|
-
DEFAULT_GIT_SHELL_COMMANDS = "git add .; git commit -m \"Propagated.\"; git push",
|
|
10
|
-
DEFAULT_BUILD_SHELL_COMMANDS = "npm run build",
|
|
11
|
-
DEFAULT_INSTALL_SHELL_COMMANDS = "npm install",
|
|
12
|
-
DEFAULT_PUBLISH_SHELL_COMMANDS = "npm publish";
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
DEFAULT_YES,
|
|
16
|
-
DEFAULT_HELP,
|
|
17
|
-
DEFAULT_VERSION,
|
|
18
|
-
DEFAULT_DRY_RUN,
|
|
19
|
-
DEFAULT_QUIETLY,
|
|
20
|
-
DEFAULT_DIRECTORY_NAME,
|
|
21
|
-
DEFAULT_GIT_SHELL_COMMANDS,
|
|
22
|
-
DEFAULT_BUILD_SHELL_COMMANDS,
|
|
23
|
-
DEFAULT_INSTALL_SHELL_COMMANDS,
|
|
24
|
-
DEFAULT_PUBLISH_SHELL_COMMANDS
|
|
25
|
-
};
|
package/bin/descriptions.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const BUILD_YES_NO_DESCRIPTION = "Build? (y)es (n)o: ",
|
|
4
|
-
FAILED_SCRIPT_DESCRIPTION = "The script has failed. Would you like to try again? (y)es (n)o: ",
|
|
5
|
-
DIRECTORY_PATH_DESCRIPTION = "Directory path: ",
|
|
6
|
-
INSTALL_YES_NO_DESCRIPTION = "Install? (y)es (n)o: ",
|
|
7
|
-
PUBLISH_YES_NO_DESCRIPTION = "Publish? (y)es (n)o: ",
|
|
8
|
-
FORCED_DEPENDENT_DESCRIPTION = "Forced dependent sub-directory name: ",
|
|
9
|
-
FORCED_DEPENDENCY_DESCRIPTION = "Forced dependency sub-directory name: ",
|
|
10
|
-
IGNORED_DEPENDENCY_DESCRIPTION = "Ignored dependency sub-directory name: ",
|
|
11
|
-
GIT_SHELL_COMMANDS_DESCRIPTION = "Git shell command(s) (leave blank for default): ",
|
|
12
|
-
SAVE_UPDATES_YES_NO_DESCRIPTION = "Save updates? (y)es (n)o: ",
|
|
13
|
-
ADD_COMMIT_PUSH_GIT_DESCRIPTION = "Add, commit and push with Git? (y)es (n)o: ",
|
|
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): ",
|
|
17
|
-
SPECIFY_DIRECTORY_TO_REMOVE_DESCRIPTION = "Specify a directory to remove: ",
|
|
18
|
-
SPECIFY_IGNORED_DEPENDENCY_TO_REMOVE_DESCRIPTION = "Specify an ignored dependency to remove: ",
|
|
19
|
-
SPECIFY_FORCED_DEPENDENCY_RELATION_TO_REMOVE_DESCRIPTION = "Specify a forced dependency relation to remove: "
|
|
20
|
-
|
|
21
|
-
module.exports = {
|
|
22
|
-
BUILD_YES_NO_DESCRIPTION,
|
|
23
|
-
FAILED_SCRIPT_DESCRIPTION,
|
|
24
|
-
DIRECTORY_PATH_DESCRIPTION,
|
|
25
|
-
INSTALL_YES_NO_DESCRIPTION,
|
|
26
|
-
PUBLISH_YES_NO_DESCRIPTION,
|
|
27
|
-
FORCED_DEPENDENT_DESCRIPTION,
|
|
28
|
-
FORCED_DEPENDENCY_DESCRIPTION,
|
|
29
|
-
IGNORED_DEPENDENCY_DESCRIPTION,
|
|
30
|
-
GIT_SHELL_COMMANDS_DESCRIPTION,
|
|
31
|
-
SAVE_UPDATES_YES_NO_DESCRIPTION,
|
|
32
|
-
ADD_COMMIT_PUSH_GIT_DESCRIPTION,
|
|
33
|
-
BUILD_SHELL_COMMANDS_DESCRIPTION,
|
|
34
|
-
INSTALL_SHELL_COMMANDS_DESCRIPTION,
|
|
35
|
-
PUBLISH_SHELL_COMMANDS_DESCRIPTION,
|
|
36
|
-
SPECIFY_DIRECTORY_TO_REMOVE_DESCRIPTION,
|
|
37
|
-
SPECIFY_IGNORED_DEPENDENCY_TO_REMOVE_DESCRIPTION,
|
|
38
|
-
SPECIFY_FORCED_DEPENDENCY_RELATION_TO_REMOVE_DESCRIPTION
|
|
39
|
-
};
|