tnp-helpers 16.444.21 → 16.444.22
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/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/base/base-git.mjs +65 -2
- package/browser/esm2022/lib/base/base-library-build.mjs +4 -2
- package/browser/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/browser/esm2022/lib/base/base-project.mjs +8 -1
- package/browser/esm2022/lib/base/base-release-process.mjs +381 -3
- package/browser/esm2022/lib/base/base-vscode.mjs +10 -1
- package/browser/esm2022/lib/base/commit-data.mjs +116 -44
- package/browser/esm2022/lib/base/core-project.mjs +1 -1
- package/browser/esm2022/lib/base/index.mjs +3 -1
- package/browser/esm2022/lib/models.mjs +1 -1
- package/browser/fesm2022/tnp-helpers.mjs +925 -84
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-git.d.ts +15 -4
- package/browser/lib/base/base-library-build.d.ts +1 -1
- package/browser/lib/base/base-npm-helpers.d.ts +25 -1
- package/browser/lib/base/base-project.d.ts +4 -0
- package/browser/lib/base/base-release-process.d.ts +32 -2
- package/browser/lib/base/commit-data.d.ts +18 -13
- package/browser/lib/base/core-project.d.ts +3 -0
- package/browser/lib/base/index.d.ts +1 -0
- package/browser/lib/models.d.ts +5 -0
- package/client/esm2022/lib/base/base-git.mjs +65 -2
- package/client/esm2022/lib/base/base-library-build.mjs +4 -2
- package/client/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/client/esm2022/lib/base/base-project.mjs +8 -1
- package/client/esm2022/lib/base/base-release-process.mjs +381 -3
- package/client/esm2022/lib/base/base-vscode.mjs +10 -1
- package/client/esm2022/lib/base/commit-data.mjs +116 -44
- package/client/esm2022/lib/base/core-project.mjs +1 -1
- package/client/esm2022/lib/base/index.mjs +3 -1
- package/client/esm2022/lib/models.mjs +1 -1
- package/client/fesm2022/tnp-helpers.mjs +925 -84
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-git.d.ts +15 -4
- package/client/lib/base/base-library-build.d.ts +1 -1
- package/client/lib/base/base-npm-helpers.d.ts +25 -1
- package/client/lib/base/base-project.d.ts +4 -0
- package/client/lib/base/base-release-process.d.ts +32 -2
- package/client/lib/base/commit-data.d.ts +18 -13
- package/client/lib/base/core-project.d.ts +3 -0
- package/client/lib/base/index.d.ts +1 -0
- package/client/lib/models.d.ts +5 -0
- package/client/package.json +30 -30
- package/lib/base/base-command-line.backend.d.ts +3 -0
- package/lib/base/base-command-line.backend.js +51 -0
- package/lib/base/base-command-line.backend.js.map +1 -1
- package/lib/base/base-git.d.ts +12 -1
- package/lib/base/base-git.js +118 -41
- package/lib/base/base-git.js.map +1 -1
- package/lib/base/base-library-build.d.ts +1 -1
- package/lib/base/base-library-build.js +33 -31
- package/lib/base/base-library-build.js.map +1 -1
- package/lib/base/base-npm-helpers.d.ts +27 -2
- package/lib/base/base-npm-helpers.js +157 -16
- package/lib/base/base-npm-helpers.js.map +1 -1
- package/lib/base/base-project.d.ts +4 -0
- package/lib/base/base-project.js +13 -0
- package/lib/base/base-project.js.map +1 -1
- package/lib/base/base-release-process.d.ts +32 -2
- package/lib/base/base-release-process.js +621 -16
- package/lib/base/base-release-process.js.map +1 -1
- package/lib/base/base-vscode.js +9 -0
- package/lib/base/base-vscode.js.map +1 -1
- package/lib/base/commit-data.d.ts +17 -12
- package/lib/base/commit-data.js +138 -78
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/core-project.d.ts +3 -0
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/index.d.ts +2 -0
- package/lib/base/index.js +2 -0
- package/lib/base/index.js.map +1 -1
- package/lib/base/translate.d.ts +227 -1
- package/lib/base/translate.js +566 -54
- package/lib/base/translate.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.d.ts +1 -0
- package/lib/helpers/for-backend/helpers-console-gui.js +3 -2
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +16 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +123 -16
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +10 -8
- package/lib/helpers/for-backend/helpers-process.backend.js +56 -56
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +3 -3
- package/lib/models.d.ts +5 -0
- package/lib/old/base-component.js +3 -3
- package/lib/old/base-formly-component.js +3 -3
- package/lib/old/dual-component-ctrl.js +3 -3
- package/package.json +4 -4
- package/tmp-environment.json +34 -34
- package/websql/esm2022/lib/base/base-git.mjs +65 -2
- package/websql/esm2022/lib/base/base-library-build.mjs +4 -2
- package/websql/esm2022/lib/base/base-npm-helpers.mjs +131 -14
- package/websql/esm2022/lib/base/base-project.mjs +8 -1
- package/websql/esm2022/lib/base/base-release-process.mjs +381 -3
- package/websql/esm2022/lib/base/base-vscode.mjs +10 -1
- package/websql/esm2022/lib/base/commit-data.mjs +116 -44
- package/websql/esm2022/lib/base/core-project.mjs +1 -1
- package/websql/esm2022/lib/base/index.mjs +3 -1
- package/websql/esm2022/lib/models.mjs +1 -1
- package/websql/fesm2022/tnp-helpers.mjs +925 -84
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-git.d.ts +15 -4
- package/websql/lib/base/base-library-build.d.ts +1 -1
- package/websql/lib/base/base-npm-helpers.d.ts +26 -4
- package/websql/lib/base/base-project.d.ts +4 -0
- package/websql/lib/base/base-release-process.d.ts +32 -2
- package/websql/lib/base/commit-data.d.ts +18 -13
- package/websql/lib/base/core-project.d.ts +3 -0
- package/websql/lib/base/index.d.ts +1 -0
- package/websql/lib/models.d.ts +5 -0
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseReleaseProcess = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
//#
|
|
6
|
-
var
|
|
5
|
+
//#endregion
|
|
6
|
+
var index_1 = require("../index");
|
|
7
7
|
var base_feature_for_project_1 = require("./base-feature-for-project");
|
|
8
8
|
var tnp_core_1 = require("tnp-core");
|
|
9
|
+
var commit_data_1 = require("./commit-data");
|
|
10
|
+
var tnp_config_1 = require("tnp-config");
|
|
9
11
|
//#endregion
|
|
10
12
|
var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
11
13
|
tslib_1.__extends(BaseReleaseProcess, _super);
|
|
@@ -15,10 +17,14 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
15
17
|
* Automatic release process of patch plus one version
|
|
16
18
|
*/
|
|
17
19
|
_this.automaticRelease = false;
|
|
20
|
+
_this.commitsForChangelog = [];
|
|
18
21
|
return _this;
|
|
19
22
|
//#endregion
|
|
20
23
|
}
|
|
21
24
|
//#endregion
|
|
25
|
+
BaseReleaseProcess.prototype.getReleaseWords = function () {
|
|
26
|
+
return ['release'];
|
|
27
|
+
};
|
|
22
28
|
//#region methods & getters / start release
|
|
23
29
|
BaseReleaseProcess.prototype.startRelease = function (options) {
|
|
24
30
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
@@ -26,21 +32,433 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
26
32
|
return tslib_1.__generator(this, function (_g) {
|
|
27
33
|
switch (_g.label) {
|
|
28
34
|
case 0:
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
if (!true) return [3 /*break*/, 15];
|
|
36
|
+
index_1.Helpers.clearConsole();
|
|
37
|
+
this.newVersion = options === null || options === void 0 ? void 0 : options.newVersion;
|
|
38
|
+
this.automaticRelease = (options === null || options === void 0 ? void 0 : options.automaticRelease) || false;
|
|
39
|
+
return [4 /*yield*/, this.resetReleaseFiles()];
|
|
40
|
+
case 1:
|
|
41
|
+
_g.sent();
|
|
42
|
+
this.project.npmHelpers.reloadPackageJsonInMemory();
|
|
31
43
|
_a = this;
|
|
32
44
|
return [4 /*yield*/, this.generateLastChangesSummary()];
|
|
33
|
-
case
|
|
45
|
+
case 2:
|
|
34
46
|
_a.lastChangesSummary = _g.sent();
|
|
35
47
|
_c = (_b = console).log;
|
|
36
|
-
|
|
48
|
+
_d = "".concat(tnp_core_1.chalk.bold.underline("Release process for ".concat(this.project.name)), ":\n");
|
|
37
49
|
return [4 /*yield*/, this.lastChangesSummary];
|
|
38
|
-
case
|
|
39
|
-
_c.apply(_b, [
|
|
40
|
-
|
|
50
|
+
case 3:
|
|
51
|
+
_c.apply(_b, [_d +
|
|
52
|
+
(_g.sent())]);
|
|
53
|
+
_e = this;
|
|
41
54
|
return [4 /*yield*/, this.selectReleaseType()];
|
|
55
|
+
case 4:
|
|
56
|
+
_e.type = _g.sent();
|
|
57
|
+
return [4 /*yield*/, this.confirmNewVersion()];
|
|
58
|
+
case 5:
|
|
59
|
+
_g.sent();
|
|
60
|
+
_f = this;
|
|
61
|
+
return [4 /*yield*/, this.selectChangelogCommits()];
|
|
62
|
+
case 6:
|
|
63
|
+
_f.commitsForChangelog = _g.sent();
|
|
64
|
+
return [4 /*yield*/, this.updateChangeLogFromCommits()];
|
|
65
|
+
case 7:
|
|
66
|
+
_g.sent();
|
|
67
|
+
return [4 /*yield*/, this.bumpNewVersionEverywhere()];
|
|
68
|
+
case 8:
|
|
69
|
+
_g.sent();
|
|
70
|
+
return [4 /*yield*/, this.buildAllLibraries()];
|
|
71
|
+
case 9:
|
|
72
|
+
_g.sent();
|
|
73
|
+
return [4 /*yield*/, this.testBeforePublish()];
|
|
74
|
+
case 10:
|
|
75
|
+
if (!(_g.sent())) {
|
|
76
|
+
return [3 /*break*/, 0];
|
|
77
|
+
}
|
|
78
|
+
return [4 /*yield*/, this.publishToNpm()];
|
|
79
|
+
case 11:
|
|
80
|
+
if (!(_g.sent())) {
|
|
81
|
+
return [3 /*break*/, 0];
|
|
82
|
+
}
|
|
83
|
+
return [4 /*yield*/, this.reinstallNodeModules()];
|
|
84
|
+
case 12:
|
|
85
|
+
_g.sent();
|
|
86
|
+
return [4 /*yield*/, this.testAfterPublish()];
|
|
87
|
+
case 13:
|
|
88
|
+
if (!(_g.sent())) {
|
|
89
|
+
return [3 /*break*/, 0];
|
|
90
|
+
}
|
|
91
|
+
return [4 /*yield*/, this.commitAndPush()];
|
|
92
|
+
case 14:
|
|
93
|
+
_g.sent();
|
|
94
|
+
return [3 /*break*/, 0];
|
|
95
|
+
case 15: return [2 /*return*/];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region methods & getters / reinstall node modules
|
|
102
|
+
BaseReleaseProcess.prototype.reinstallNodeModules = function () {
|
|
103
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
104
|
+
return tslib_1.__generator(this, function (_a) {
|
|
105
|
+
index_1.Helpers.taskStarted("Reinstalling node_modules to recreate package-lock.json");
|
|
106
|
+
this.project.npmHelpers.reinstalNodeModules();
|
|
107
|
+
index_1.Helpers.taskDone("Reinstalling node_modules to recreate package-lock.json");
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region methods & getters / select changelog commits
|
|
114
|
+
BaseReleaseProcess.prototype.selectChangelogCommits = function () {
|
|
115
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
116
|
+
var data, useAllCommitsForChangelog, choices;
|
|
117
|
+
return tslib_1.__generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0: return [4 /*yield*/, this.getCommitsUpToReleaseCommit()];
|
|
120
|
+
case 1:
|
|
121
|
+
data = _a.sent();
|
|
122
|
+
index_1.Helpers.info("Last commits up to release commiut:\n" +
|
|
123
|
+
data.map(function (d) { return "- ".concat(d.commitMessages); }).join('\n'));
|
|
124
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Use all commits for changelog ?')];
|
|
125
|
+
case 2:
|
|
126
|
+
useAllCommitsForChangelog = _a.sent();
|
|
127
|
+
if (useAllCommitsForChangelog) {
|
|
128
|
+
return [2 /*return*/, data];
|
|
129
|
+
}
|
|
130
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.multiselect('Select commits to add to changelog', data.map(function (d) {
|
|
131
|
+
var _a;
|
|
132
|
+
return {
|
|
133
|
+
name: d.commitMessages,
|
|
134
|
+
value: (_a = d.index) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
135
|
+
};
|
|
136
|
+
}))];
|
|
137
|
+
case 3:
|
|
138
|
+
choices = _a.sent();
|
|
139
|
+
return [2 /*return*/, choices.map(function (v) {
|
|
140
|
+
return data.find(function (d) { return d.index.toString() === v; });
|
|
141
|
+
})];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region methods & getters / get commits up to release commit
|
|
148
|
+
BaseReleaseProcess.prototype.getCommitsUpToReleaseCommit = function () {
|
|
149
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
150
|
+
var lastReleaseCommitData, commits, index, commitMessages;
|
|
151
|
+
return tslib_1.__generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0: return [4 /*yield*/, this.getLastReleaseCommitData()];
|
|
154
|
+
case 1:
|
|
155
|
+
lastReleaseCommitData = _a.sent();
|
|
156
|
+
if (!(lastReleaseCommitData.index !== -1)) return [3 /*break*/, 6];
|
|
157
|
+
commits = [];
|
|
158
|
+
index = 0;
|
|
159
|
+
_a.label = 2;
|
|
160
|
+
case 2:
|
|
161
|
+
if (!(index < lastReleaseCommitData.index)) return [3 /*break*/, 5];
|
|
162
|
+
return [4 /*yield*/, this.project.git.getCommitMessageByIndex(index)];
|
|
163
|
+
case 3:
|
|
164
|
+
commitMessages = _a.sent();
|
|
165
|
+
commits.push({ commitMessages: commitMessages, index: index });
|
|
166
|
+
_a.label = 4;
|
|
167
|
+
case 4:
|
|
168
|
+
index++;
|
|
169
|
+
return [3 /*break*/, 2];
|
|
170
|
+
case 5: return [2 /*return*/, commits];
|
|
171
|
+
case 6: return [2 /*return*/, []];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region methods & getters / publish to npm
|
|
178
|
+
BaseReleaseProcess.prototype.publishToNpm = function () {
|
|
179
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
180
|
+
var editor, error_1;
|
|
181
|
+
return tslib_1.__generator(this, function (_a) {
|
|
182
|
+
switch (_a.label) {
|
|
183
|
+
case 0:
|
|
184
|
+
if (!!this.automaticRelease) return [3 /*break*/, 6];
|
|
185
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo("Preview compiled code before publish ?")];
|
|
186
|
+
case 1:
|
|
187
|
+
if (!_a.sent()) return [3 /*break*/, 6];
|
|
188
|
+
_a.label = 2;
|
|
189
|
+
case 2:
|
|
190
|
+
_a.trys.push([2, 4, , 5]);
|
|
191
|
+
return [4 /*yield*/, this.project.ins.configDb.getCodeEditor()];
|
|
42
192
|
case 3:
|
|
43
|
-
|
|
193
|
+
editor = _a.sent();
|
|
194
|
+
this.project.run("cd dist && ".concat(editor, " ."), { output: true }).sync();
|
|
195
|
+
return [3 /*break*/, 5];
|
|
196
|
+
case 4:
|
|
197
|
+
error_1 = _a.sent();
|
|
198
|
+
return [3 /*break*/, 5];
|
|
199
|
+
case 5:
|
|
200
|
+
index_1.Helpers.pressKeyOrWait("Press any key to continue");
|
|
201
|
+
_a.label = 6;
|
|
202
|
+
case 6: return [4 /*yield*/, index_1.Helpers.questionYesNo("Publish ".concat(this.newVersion, " to npm ?"))];
|
|
203
|
+
case 7:
|
|
204
|
+
if (!(_a.sent())) {
|
|
205
|
+
return [2 /*return*/, false];
|
|
206
|
+
}
|
|
207
|
+
return [4 /*yield*/, this.project.publish()];
|
|
208
|
+
case 8:
|
|
209
|
+
_a.sent();
|
|
210
|
+
return [2 /*return*/, true];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region methods & getters / test after publish
|
|
217
|
+
BaseReleaseProcess.prototype.testAfterPublish = function () {
|
|
218
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
219
|
+
return tslib_1.__generator(this, function (_a) {
|
|
220
|
+
switch (_a.label) {
|
|
221
|
+
case 0:
|
|
222
|
+
if (!!this.automaticRelease) return [3 /*break*/, 3];
|
|
223
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo("Do you want to run test after fresh install (and before release commit ?) ?")];
|
|
224
|
+
case 1:
|
|
225
|
+
if (!_a.sent()) return [3 /*break*/, 3];
|
|
226
|
+
return [4 /*yield*/, this.testLibraries()];
|
|
227
|
+
case 2:
|
|
228
|
+
if (!(_a.sent())) {
|
|
229
|
+
index_1.Helpers.pressKeyOrWait("Test failed.. starting release again.. press any key to continue");
|
|
230
|
+
return [2 /*return*/, false];
|
|
231
|
+
}
|
|
232
|
+
_a.label = 3;
|
|
233
|
+
case 3: return [2 /*return*/, true];
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region methods & getters / test before publish
|
|
240
|
+
BaseReleaseProcess.prototype.testBeforePublish = function () {
|
|
241
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
242
|
+
return tslib_1.__generator(this, function (_a) {
|
|
243
|
+
switch (_a.label) {
|
|
244
|
+
case 0:
|
|
245
|
+
if (!!this.automaticRelease) return [3 /*break*/, 3];
|
|
246
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo("Do you want to run test before npm publish ?")];
|
|
247
|
+
case 1:
|
|
248
|
+
if (!_a.sent()) return [3 /*break*/, 3];
|
|
249
|
+
return [4 /*yield*/, this.testLibraries()];
|
|
250
|
+
case 2:
|
|
251
|
+
if (!(_a.sent())) {
|
|
252
|
+
index_1.Helpers.pressKeyOrWait("Test failed.. starting release again.. press any key to continue");
|
|
253
|
+
return [2 /*return*/, false];
|
|
254
|
+
}
|
|
255
|
+
_a.label = 3;
|
|
256
|
+
case 3: return [2 /*return*/, true];
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region methods & getters / commit and push
|
|
263
|
+
BaseReleaseProcess.prototype.commitAndPush = function () {
|
|
264
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
265
|
+
var releaseCommitMessage, lastCommitMessage, jiraNumbers, args;
|
|
266
|
+
return tslib_1.__generator(this, function (_a) {
|
|
267
|
+
switch (_a.label) {
|
|
268
|
+
case 0:
|
|
269
|
+
releaseCommitMessage = this.releaseCommitTemplate();
|
|
270
|
+
return [4 /*yield*/, this.project.git.penultimateCommitMessage()];
|
|
271
|
+
case 1:
|
|
272
|
+
lastCommitMessage = _a.sent();
|
|
273
|
+
jiraNumbers = commit_data_1.CommitData.extractAndOrderJiraNumbers(lastCommitMessage);
|
|
274
|
+
args = [jiraNumbers.join(' ') + ' ' + releaseCommitMessage];
|
|
275
|
+
// console.log({ jiraNumbers, args, lastCommitMessage });
|
|
276
|
+
return [4 /*yield*/, this.project.git.pushProcess({
|
|
277
|
+
typeofCommit: 'release',
|
|
278
|
+
askToConfirmPush: true,
|
|
279
|
+
askToConfirmBranchChange: true,
|
|
280
|
+
askToConfirmCommit: true,
|
|
281
|
+
skipLint: true,
|
|
282
|
+
args: args,
|
|
283
|
+
exitCallBack: function () {
|
|
284
|
+
process.exit(1);
|
|
285
|
+
},
|
|
286
|
+
})];
|
|
287
|
+
case 2:
|
|
288
|
+
// console.log({ jiraNumbers, args, lastCommitMessage });
|
|
289
|
+
_a.sent();
|
|
290
|
+
return [2 /*return*/];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region methods & getters / release commit template
|
|
297
|
+
BaseReleaseProcess.prototype.releaseCommitTemplate = function () {
|
|
298
|
+
return "Release v".concat(this.newVersion, " + changelog.md update");
|
|
299
|
+
};
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region methods & getters / test libraries
|
|
302
|
+
BaseReleaseProcess.prototype.testLibraries = function () {
|
|
303
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
304
|
+
return tslib_1.__generator(this, function (_a) {
|
|
305
|
+
try {
|
|
306
|
+
this.project.run('npm run test', { output: true }).sync();
|
|
307
|
+
return [2 /*return*/, true];
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
index_1.Helpers.info("Test failed, you can run test manually");
|
|
311
|
+
return [2 /*return*/, false];
|
|
312
|
+
}
|
|
313
|
+
return [2 /*return*/];
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region methods & getters / build all libraries
|
|
319
|
+
BaseReleaseProcess.prototype.buildAllLibraries = function () {
|
|
320
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
321
|
+
return tslib_1.__generator(this, function (_a) {
|
|
322
|
+
switch (_a.label) {
|
|
323
|
+
case 0: return [4 /*yield*/, this.project.libraryBuild.buildLibraries({
|
|
324
|
+
watch: false,
|
|
325
|
+
releaseBuild: true,
|
|
326
|
+
buildType: 'angular',
|
|
327
|
+
})];
|
|
328
|
+
case 1:
|
|
329
|
+
_a.sent();
|
|
330
|
+
return [2 /*return*/];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region methods & getters / reset release files
|
|
337
|
+
BaseReleaseProcess.prototype.resetReleaseFiles = function () {
|
|
338
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
339
|
+
var _a, _b, projToBump;
|
|
340
|
+
var e_1, _c;
|
|
341
|
+
return tslib_1.__generator(this, function (_d) {
|
|
342
|
+
//#region @backendFunc
|
|
343
|
+
this.project.git.restoreLastVersion(this.changeLogPath);
|
|
344
|
+
try {
|
|
345
|
+
for (_a = tslib_1.__values(this.toBumpProjects), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
346
|
+
projToBump = _b.value;
|
|
347
|
+
projToBump.git.restoreLastVersion(tnp_config_1.config.file.package_json);
|
|
348
|
+
projToBump.git.restoreLastVersion(tnp_config_1.config.file.package_lock_json);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
352
|
+
finally {
|
|
353
|
+
try {
|
|
354
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
355
|
+
}
|
|
356
|
+
finally { if (e_1) throw e_1.error; }
|
|
357
|
+
}
|
|
358
|
+
return [2 /*return*/];
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
Object.defineProperty(BaseReleaseProcess.prototype, "toBumpProjects", {
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region methods & getters / to bump projects
|
|
365
|
+
get: function () {
|
|
366
|
+
var toBumpProjects = tslib_1.__spreadArray([
|
|
367
|
+
this.project
|
|
368
|
+
], tslib_1.__read(this.project.libraryBuild.libraries), false);
|
|
369
|
+
return toBumpProjects;
|
|
370
|
+
},
|
|
371
|
+
enumerable: false,
|
|
372
|
+
configurable: true
|
|
373
|
+
});
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region methods & getters / bump new version everywhere
|
|
376
|
+
BaseReleaseProcess.prototype.bumpNewVersionEverywhere = function () {
|
|
377
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
378
|
+
var allLibrariesNames, _a, _b, projToBump, allLibrariesNames_1, allLibrariesNames_1_1, libName;
|
|
379
|
+
var e_2, _c, e_3, _d;
|
|
380
|
+
return tslib_1.__generator(this, function (_e) {
|
|
381
|
+
allLibrariesNames = this.project.libraryBuild.libraries.map(function (l) { return l.name; });
|
|
382
|
+
try {
|
|
383
|
+
for (_a = tslib_1.__values(this.toBumpProjects), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
384
|
+
projToBump = _b.value;
|
|
385
|
+
projToBump.npmHelpers.version = this.newVersion;
|
|
386
|
+
try {
|
|
387
|
+
for (allLibrariesNames_1 = (e_3 = void 0, tslib_1.__values(allLibrariesNames)), allLibrariesNames_1_1 = allLibrariesNames_1.next(); !allLibrariesNames_1_1.done; allLibrariesNames_1_1 = allLibrariesNames_1.next()) {
|
|
388
|
+
libName = allLibrariesNames_1_1.value;
|
|
389
|
+
projToBump.npmHelpers.updateDependency(libName, (this.project.location === projToBump.location ? '' : '^') +
|
|
390
|
+
this.newVersion);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
394
|
+
finally {
|
|
395
|
+
try {
|
|
396
|
+
if (allLibrariesNames_1_1 && !allLibrariesNames_1_1.done && (_d = allLibrariesNames_1.return)) _d.call(allLibrariesNames_1);
|
|
397
|
+
}
|
|
398
|
+
finally { if (e_3) throw e_3.error; }
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
403
|
+
finally {
|
|
404
|
+
try {
|
|
405
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
406
|
+
}
|
|
407
|
+
finally { if (e_2) throw e_2.error; }
|
|
408
|
+
}
|
|
409
|
+
return [2 /*return*/];
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region methods & getters / confirm release type
|
|
415
|
+
BaseReleaseProcess.prototype.confirmNewVersion = function () {
|
|
416
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
417
|
+
var newVersion, originalNewVersion, confirm_1;
|
|
418
|
+
return tslib_1.__generator(this, function (_a) {
|
|
419
|
+
switch (_a.label) {
|
|
420
|
+
case 0:
|
|
421
|
+
//#region @backendFunc
|
|
422
|
+
if (this.automaticRelease) {
|
|
423
|
+
return [2 /*return*/];
|
|
424
|
+
}
|
|
425
|
+
newVersion = this.newVersion;
|
|
426
|
+
if (!this.newVersion) {
|
|
427
|
+
newVersion = this.project.npmHelpers.versionWithPatchPlusOne;
|
|
428
|
+
if (this.type === 'minor') {
|
|
429
|
+
newVersion =
|
|
430
|
+
this.project.npmHelpers.versionWithMinorPlusOneAndPatchZero;
|
|
431
|
+
}
|
|
432
|
+
if (this.type === 'major') {
|
|
433
|
+
newVersion =
|
|
434
|
+
this.project.npmHelpers
|
|
435
|
+
.versionWithMajorPlusOneAndMinorZeroAndPatchZero;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
originalNewVersion = newVersion;
|
|
439
|
+
_a.label = 1;
|
|
440
|
+
case 1:
|
|
441
|
+
if (!true) return [3 /*break*/, 6];
|
|
442
|
+
index_1.Helpers.info("New version will be: ".concat(newVersion));
|
|
443
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Do you want to continue?')];
|
|
444
|
+
case 2:
|
|
445
|
+
confirm_1 = _a.sent();
|
|
446
|
+
if (!confirm_1) return [3 /*break*/, 3];
|
|
447
|
+
return [3 /*break*/, 6];
|
|
448
|
+
case 3: return [4 /*yield*/, index_1.Helpers.consoleGui.input({
|
|
449
|
+
question: 'Provide proper new version and press enter',
|
|
450
|
+
defaultValue: originalNewVersion,
|
|
451
|
+
validate: function (value) {
|
|
452
|
+
var regexForValidationNpmVersionWithPossiblePreRelease = /^(\d+\.\d+\.\d+)(\-[a-zA-Z0-9]+)?$/;
|
|
453
|
+
return regexForValidationNpmVersionWithPossiblePreRelease.test(value);
|
|
454
|
+
},
|
|
455
|
+
})];
|
|
456
|
+
case 4:
|
|
457
|
+
newVersion = _a.sent();
|
|
458
|
+
_a.label = 5;
|
|
459
|
+
case 5: return [3 /*break*/, 1];
|
|
460
|
+
case 6:
|
|
461
|
+
this.newVersion = newVersion;
|
|
44
462
|
return [2 /*return*/];
|
|
45
463
|
}
|
|
46
464
|
});
|
|
@@ -72,7 +490,7 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
72
490
|
value: 'major',
|
|
73
491
|
},
|
|
74
492
|
];
|
|
75
|
-
return [4 /*yield*/,
|
|
493
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.select('Select release type', options)];
|
|
76
494
|
case 1:
|
|
77
495
|
selected = _a.sent();
|
|
78
496
|
return [2 /*return*/, selected];
|
|
@@ -81,7 +499,193 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
81
499
|
});
|
|
82
500
|
};
|
|
83
501
|
//#endregion
|
|
84
|
-
|
|
502
|
+
//#region methods & getters / commit message in changelog transform fn
|
|
503
|
+
BaseReleaseProcess.prototype.commitMessageInChangelogTransformFn = function (message) {
|
|
504
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
505
|
+
return tslib_1.__generator(this, function (_a) {
|
|
506
|
+
return [2 /*return*/, message];
|
|
507
|
+
});
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region methods & getters / caclulate item
|
|
512
|
+
BaseReleaseProcess.prototype.getChangelogContentToAppend = function (askForEveryItem) {
|
|
513
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
514
|
+
var newChangeLogContentToAdd, _a, _b, commit, template, e_4_1, thingsToAddToChangeLog;
|
|
515
|
+
var e_4, _c;
|
|
516
|
+
return tslib_1.__generator(this, function (_d) {
|
|
517
|
+
switch (_d.label) {
|
|
518
|
+
case 0:
|
|
519
|
+
newChangeLogContentToAdd = '';
|
|
520
|
+
_d.label = 1;
|
|
521
|
+
case 1:
|
|
522
|
+
_d.trys.push([1, 6, 7, 8]);
|
|
523
|
+
_a = tslib_1.__values(this.commitsForChangelog), _b = _a.next();
|
|
524
|
+
_d.label = 2;
|
|
525
|
+
case 2:
|
|
526
|
+
if (!!_b.done) return [3 /*break*/, 5];
|
|
527
|
+
commit = _b.value;
|
|
528
|
+
return [4 /*yield*/, this.changelogItemTemplate(commit.index, askForEveryItem)];
|
|
529
|
+
case 3:
|
|
530
|
+
template = (_d.sent()) +
|
|
531
|
+
'\n';
|
|
532
|
+
newChangeLogContentToAdd += template;
|
|
533
|
+
_d.label = 4;
|
|
534
|
+
case 4:
|
|
535
|
+
_b = _a.next();
|
|
536
|
+
return [3 /*break*/, 2];
|
|
537
|
+
case 5: return [3 /*break*/, 8];
|
|
538
|
+
case 6:
|
|
539
|
+
e_4_1 = _d.sent();
|
|
540
|
+
e_4 = { error: e_4_1 };
|
|
541
|
+
return [3 /*break*/, 8];
|
|
542
|
+
case 7:
|
|
543
|
+
try {
|
|
544
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
545
|
+
}
|
|
546
|
+
finally { if (e_4) throw e_4.error; }
|
|
547
|
+
return [7 /*endfinally*/];
|
|
548
|
+
case 8:
|
|
549
|
+
thingsToAddToChangeLog = "".concat(newChangeLogContentToAdd
|
|
550
|
+
? "".concat(this.changeLogKeyWord(), " ").concat(this.newVersion, " ") +
|
|
551
|
+
"(".concat((0, tnp_core_1.dateformat)(new Date(), 'yyyy-mm-dd'), ")\n") +
|
|
552
|
+
"----------------------------------\n" +
|
|
553
|
+
"".concat(newChangeLogContentToAdd.trim() + '\n', "\n")
|
|
554
|
+
: '');
|
|
555
|
+
return [2 /*return*/, thingsToAddToChangeLog];
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region methods & getters / update changelog.md from commits
|
|
562
|
+
/**
|
|
563
|
+
* TODO extend this to all commits from last release
|
|
564
|
+
*/
|
|
565
|
+
BaseReleaseProcess.prototype.updateChangeLogFromCommits = function () {
|
|
566
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
567
|
+
var askForEveryItem, thingsToAddToChangeLog, changeLogNewContent;
|
|
568
|
+
return tslib_1.__generator(this, function (_a) {
|
|
569
|
+
switch (_a.label) {
|
|
570
|
+
case 0:
|
|
571
|
+
askForEveryItem = false;
|
|
572
|
+
_a.label = 1;
|
|
573
|
+
case 1:
|
|
574
|
+
if (!true) return [3 /*break*/, 4];
|
|
575
|
+
return [4 /*yield*/, this.getChangelogContentToAppend(askForEveryItem)];
|
|
576
|
+
case 2:
|
|
577
|
+
thingsToAddToChangeLog = _a.sent();
|
|
578
|
+
console.log("New thing for change log:\n".concat(tnp_core_1.chalk.gray.bold(thingsToAddToChangeLog)));
|
|
579
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Accept this new things in changelog (if no -> edit mode) ?')];
|
|
580
|
+
case 3:
|
|
581
|
+
if (!(_a.sent())) {
|
|
582
|
+
askForEveryItem = true;
|
|
583
|
+
return [3 /*break*/, 1];
|
|
584
|
+
}
|
|
585
|
+
changeLogNewContent = thingsToAddToChangeLog + "".concat(this.changelogContent.trim(), "\n");
|
|
586
|
+
this.project.writeFile(this.changeLogPath, changeLogNewContent);
|
|
587
|
+
return [3 /*break*/, 4];
|
|
588
|
+
case 4: return [2 /*return*/];
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
//#endregion
|
|
594
|
+
//#region methods & getters / extract changed libraries in last commit
|
|
595
|
+
BaseReleaseProcess.prototype.extractChangedLibrariesInCommit = function (hashOrIndex) {
|
|
596
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
597
|
+
var hash, index, useHash, lastChanges, _a, libraries;
|
|
598
|
+
var _this = this;
|
|
599
|
+
return tslib_1.__generator(this, function (_b) {
|
|
600
|
+
switch (_b.label) {
|
|
601
|
+
case 0:
|
|
602
|
+
hash = tnp_core_1._.isString(hashOrIndex) ? hashOrIndex : void 0;
|
|
603
|
+
index = tnp_core_1._.isNumber(hashOrIndex) ? hashOrIndex : void 0;
|
|
604
|
+
useHash = !!hash;
|
|
605
|
+
if (!useHash) return [3 /*break*/, 2];
|
|
606
|
+
return [4 /*yield*/, this.project.git.getChangedFilesInCommitByHash(hash)];
|
|
607
|
+
case 1:
|
|
608
|
+
_a = _b.sent();
|
|
609
|
+
return [3 /*break*/, 4];
|
|
610
|
+
case 2: return [4 /*yield*/, this.project.git.getChangedFilesInCommitByIndex(index)];
|
|
611
|
+
case 3:
|
|
612
|
+
_a = _b.sent();
|
|
613
|
+
_b.label = 4;
|
|
614
|
+
case 4:
|
|
615
|
+
lastChanges = _a;
|
|
616
|
+
libraries = this.project.libraryBuild.libraries.filter(function (l) {
|
|
617
|
+
var libraryRelativePath = l.location.replace(_this.project.location + '/', '');
|
|
618
|
+
return lastChanges.some(function (c) { return c.includes(libraryRelativePath); });
|
|
619
|
+
});
|
|
620
|
+
return [2 /*return*/, libraries.map(function (l) { return l.name; }).join(', ')];
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region methods & getters / change log item template
|
|
627
|
+
BaseReleaseProcess.prototype.changelogItemTemplate = function (hashOrIndex, confirmEveryItem) {
|
|
628
|
+
if (confirmEveryItem === void 0) { confirmEveryItem = false; }
|
|
629
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
630
|
+
var hash, index, useHash, commitMessage, _a, jiraNumbers, message, extractedLibraries, translatedMessage, _b, _c, result, itemIsOK, confirm_2;
|
|
631
|
+
return tslib_1.__generator(this, function (_d) {
|
|
632
|
+
switch (_d.label) {
|
|
633
|
+
case 0:
|
|
634
|
+
hash = tnp_core_1._.isString(hashOrIndex) ? hashOrIndex : void 0;
|
|
635
|
+
index = tnp_core_1._.isNumber(hashOrIndex) ? hashOrIndex : void 0;
|
|
636
|
+
useHash = !!hash;
|
|
637
|
+
if (!useHash) return [3 /*break*/, 2];
|
|
638
|
+
return [4 /*yield*/, this.project.git.getCommitMessageByHash(hash)];
|
|
639
|
+
case 1:
|
|
640
|
+
_a = _d.sent();
|
|
641
|
+
return [3 /*break*/, 4];
|
|
642
|
+
case 2: return [4 /*yield*/, this.project.git.getCommitMessageByIndex(index)];
|
|
643
|
+
case 3:
|
|
644
|
+
_a = _d.sent();
|
|
645
|
+
_d.label = 4;
|
|
646
|
+
case 4:
|
|
647
|
+
commitMessage = _a;
|
|
648
|
+
jiraNumbers = commit_data_1.CommitData.extractAndOrderJiraNumbers(commitMessage);
|
|
649
|
+
message = commit_data_1.CommitData.cleanMessageFromJiraNumTeamIdEtc(commitMessage);
|
|
650
|
+
return [4 /*yield*/, this.extractChangedLibrariesInCommit(hashOrIndex)];
|
|
651
|
+
case 5:
|
|
652
|
+
extractedLibraries = _d.sent();
|
|
653
|
+
_c = (_b = tnp_core_1._).upperFirst;
|
|
654
|
+
return [4 /*yield*/, this.commitMessageInChangelogTransformFn(message.replace(/\-/g, '').replace(/\:/g, ''))];
|
|
655
|
+
case 6:
|
|
656
|
+
translatedMessage = _c.apply(_b, [_d.sent()]);
|
|
657
|
+
result = ("* [".concat(tnp_core_1._.last(jiraNumbers), "] - ") +
|
|
658
|
+
"".concat(extractedLibraries ? extractedLibraries + ' - ' : '') +
|
|
659
|
+
" ".concat(translatedMessage))
|
|
660
|
+
.replace(/\- \-/g, ' - ')
|
|
661
|
+
.replace(/\ \ /g, ' ');
|
|
662
|
+
if (!confirmEveryItem) return [3 /*break*/, 9];
|
|
663
|
+
console.log("Confirm changelog new item ".concat(tnp_core_1.chalk.gray("(from \"".concat(commitMessage, "\")")), ":\n") +
|
|
664
|
+
"\n".concat(tnp_core_1.chalk.italic(result), "\n"));
|
|
665
|
+
return [4 /*yield*/, index_1.Helpers.questionYesNo('Is this item OK ?')];
|
|
666
|
+
case 7:
|
|
667
|
+
itemIsOK = _d.sent();
|
|
668
|
+
if (!!itemIsOK) return [3 /*break*/, 9];
|
|
669
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.input({
|
|
670
|
+
question: 'Provide proper changelog item or press enter to confirm',
|
|
671
|
+
defaultValue: result,
|
|
672
|
+
// required: false,
|
|
673
|
+
})];
|
|
674
|
+
case 8:
|
|
675
|
+
confirm_2 = _d.sent();
|
|
676
|
+
result = confirm_2;
|
|
677
|
+
_d.label = 9;
|
|
678
|
+
case 9:
|
|
679
|
+
// replace double spaces
|
|
680
|
+
result = result.replace(/\ \ /g, ' ');
|
|
681
|
+
result = result.replace(/\ \ /g, ' ');
|
|
682
|
+
result = result.replace(/\ \ /g, ' ');
|
|
683
|
+
return [2 /*return*/, result];
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
//#endregion
|
|
85
689
|
//#region methods & getters / generate last changes summary
|
|
86
690
|
BaseReleaseProcess.prototype.generateLastChangesSummary = function () {
|
|
87
691
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
@@ -95,7 +699,7 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
95
699
|
lastReleaseCommitMsg = !hasLastReleaseCommit
|
|
96
700
|
? '< nothing release yet >'
|
|
97
701
|
: lastReleaseCommitData.lastRelaseCommitMsg;
|
|
98
|
-
_c = (_b = "".concat(tnp_core_1.chalk.bold.gray('Last changelog
|
|
702
|
+
_c = (_b = "".concat(tnp_core_1.chalk.bold.gray('Last changelog.md notes summary'), ":\n")).concat;
|
|
99
703
|
return [4 /*yield*/, this.getLastPackageVersionChangesFromChnagelog()];
|
|
100
704
|
case 2:
|
|
101
705
|
_d = (_a = _c.apply(_b, [_e.sent(), "\n\n"]).concat(tnp_core_1.chalk.bold.gray(hasLastReleaseCommit ? 'Last commits up to relase commit' : 'Last 3 commits'), ":\n")).concat;
|
|
@@ -156,16 +760,17 @@ var BaseReleaseProcess = /** @class */ (function (_super) {
|
|
|
156
760
|
index = 0;
|
|
157
761
|
maxMessages = 50;
|
|
158
762
|
_loop_1 = function () {
|
|
159
|
-
var commitMessage,
|
|
763
|
+
var commitMessage, npmVersionRegex, match;
|
|
160
764
|
return tslib_1.__generator(this, function (_b) {
|
|
161
765
|
switch (_b.label) {
|
|
162
766
|
case 0: return [4 /*yield*/, this_1.project.git.getCommitMessageByIndex(index)];
|
|
163
767
|
case 1:
|
|
164
768
|
commitMessage = _b.sent();
|
|
165
|
-
releaseWorlds = ['release', 'wydanie'];
|
|
166
769
|
npmVersionRegex = /\d+\.\d+\.\d+/;
|
|
167
770
|
// console.log('commitMessage', { index, commitMessage });
|
|
168
|
-
if (
|
|
771
|
+
if (this_1.getReleaseWords().some(function (r) {
|
|
772
|
+
return commitMessage.toLowerCase().includes(r);
|
|
773
|
+
})) {
|
|
169
774
|
match = commitMessage.match(npmVersionRegex);
|
|
170
775
|
if (match) {
|
|
171
776
|
2;
|