@clickview/ship-it 0.0.35-dev.7 → 0.0.35-dev.8
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.
|
@@ -52,6 +52,8 @@ exports.BumpPackagesTask = void 0;
|
|
|
52
52
|
require("reflect-metadata");
|
|
53
53
|
var inversify_1 = require("inversify");
|
|
54
54
|
var child_process_1 = require("child_process");
|
|
55
|
+
var util = require('util');
|
|
56
|
+
var execPromise = util.promisify(child_process_1.exec);
|
|
55
57
|
var types_1 = require("../types");
|
|
56
58
|
var services_1 = require("../services");
|
|
57
59
|
var MonorepoPackageJsonFiles_1 = require("../constants/MonorepoPackageJsonFiles");
|
|
@@ -69,16 +71,16 @@ var BumpPackagesTask = /** @class */ (function () {
|
|
|
69
71
|
}
|
|
70
72
|
BumpPackagesTask.prototype.run = function (options) {
|
|
71
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var branch, isValid, lernaVersionCmd;
|
|
73
|
-
return __generator(this, function (
|
|
74
|
-
switch (
|
|
74
|
+
var branch, isValid, lernaVersionCmd, _a, stdout, stderr, error_1;
|
|
75
|
+
return __generator(this, function (_b) {
|
|
76
|
+
switch (_b.label) {
|
|
75
77
|
case 0:
|
|
76
78
|
utils_1.Logger.logTask('Bumping clickview npm package versions');
|
|
77
79
|
this.isReleaseBranch = RELEASE_BRANCH_REGEX.test(options.branchName);
|
|
78
80
|
this.isHotfixBranch = HOTFIX_BRANCH_REGEX.test(options.branchName);
|
|
79
81
|
return [4 /*yield*/, this.service.getBranch(utils_1.ProjectIds.MONOREPO_PROJECT_ID, options.branchName)];
|
|
80
82
|
case 1:
|
|
81
|
-
branch =
|
|
83
|
+
branch = _b.sent();
|
|
82
84
|
if (!branch) {
|
|
83
85
|
utils_1.Logger.logError("Branch with name ".concat(options.branchName, " was not be found."));
|
|
84
86
|
return [2 /*return*/, false];
|
|
@@ -88,13 +90,26 @@ var BumpPackagesTask = /** @class */ (function () {
|
|
|
88
90
|
return [2 /*return*/, false];
|
|
89
91
|
return [4 /*yield*/, this.getLernaCommand(options)];
|
|
90
92
|
case 2:
|
|
91
|
-
lernaVersionCmd =
|
|
93
|
+
lernaVersionCmd = _b.sent();
|
|
92
94
|
if (!lernaVersionCmd) {
|
|
93
95
|
utils_1.Logger.logError('Something went wrong while trying to detect which versioning script to run with Lerna.');
|
|
94
96
|
return [2 /*return*/, false];
|
|
95
97
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
_b.label = 3;
|
|
99
|
+
case 3:
|
|
100
|
+
_b.trys.push([3, 5, , 6]);
|
|
101
|
+
return [4 /*yield*/, execPromise(lernaVersionCmd, { stdio: 'inherit' })];
|
|
102
|
+
case 4:
|
|
103
|
+
_a = _b.sent(), stdout = _a.stdout, stderr = _a.stderr;
|
|
104
|
+
utils_1.Logger.logInfo('Lerna command completed');
|
|
105
|
+
utils_1.Logger.logInfo('stdout:', stdout);
|
|
106
|
+
utils_1.Logger.logInfo('stderr:', stderr);
|
|
107
|
+
return [3 /*break*/, 6];
|
|
108
|
+
case 5:
|
|
109
|
+
error_1 = _b.sent();
|
|
110
|
+
utils_1.Logger.logInfo('Error:', error_1);
|
|
111
|
+
return [3 /*break*/, 6];
|
|
112
|
+
case 6:
|
|
98
113
|
utils_1.Logger.logSuccess('Successfully executed Lerna versioning command.');
|
|
99
114
|
return [2 /*return*/, true];
|
|
100
115
|
}
|
|
@@ -158,8 +173,7 @@ var BumpPackagesTask = /** @class */ (function () {
|
|
|
158
173
|
// Bump the patch with the preId "dev". We currently only support dev prereleases on patch versions
|
|
159
174
|
if (options.preId === 'dev') {
|
|
160
175
|
utils_1.Logger.logMessage("Incrementing the patch version for each package and appending preId: \"dev\".");
|
|
161
|
-
return [2 /*return*/, "lerna version
|
|
162
|
-
// return `lerna version prepatch --preid dev ${SHARED_LERNA_OPTIONS}`;
|
|
176
|
+
return [2 /*return*/, "lerna version prepatch --preid dev ".concat(SHARED_LERNA_OPTIONS)];
|
|
163
177
|
}
|
|
164
178
|
if (options.preId === 'rc') {
|
|
165
179
|
// Bump the minor number with the preId "rc". Release branches always bump the minor number.
|