@clickview/ship-it 0.0.2-dev.0 → 0.0.2-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/src/api-clients/GitLabApiClient.js +1 -1
  2. package/lib/src/api-clients/git-lab/GitLabApiClient.js +285 -0
  3. package/lib/src/api-clients/git-lab/GitLabMapper.js +51 -0
  4. package/lib/src/api-clients/index.js +1 -1
  5. package/lib/src/commands/BumpPackagesCommand.js +10 -2
  6. package/lib/src/commands/CommitPackageVersionsCommand.js +78 -0
  7. package/lib/src/commands/CreateBranchCommand.js +8 -8
  8. package/lib/src/commands/CreateMergeRequestCommand.js +10 -10
  9. package/lib/src/commands/CreateReleaseNotesCommand.js +4 -4
  10. package/lib/src/commands/ReleaseCommand.js +14 -14
  11. package/lib/src/commands/StatusCommand.js +2 -2
  12. package/lib/src/commands/VersionCommand.js +2 -2
  13. package/lib/src/constants/index.js +2 -2
  14. package/lib/src/errors/ShipItError.js +32 -0
  15. package/lib/src/errors/index.js +17 -0
  16. package/lib/src/interfaces/VersionType.js +2 -0
  17. package/lib/src/interfaces/command-options/CommitPackageVersionsCommandOptions.js +2 -0
  18. package/lib/src/interfaces/index.js +1 -0
  19. package/lib/src/inversify.config.js +1 -0
  20. package/lib/src/services/GitLabService.js +60 -33
  21. package/lib/src/startup/AddMilestoneCommand.js +2 -2
  22. package/lib/src/startup/SetupCommands.js +3 -4
  23. package/lib/src/tasks/BumpPackagesTask.js +49 -30
  24. package/lib/src/tasks/BumpVersionTxtTask.js +13 -26
  25. package/lib/src/tasks/CommitLocalPackagesTask.js +137 -0
  26. package/lib/src/tasks/CommitPackageVersionsTask.js +111 -0
  27. package/lib/src/tasks/CreateBranchTask.js +17 -32
  28. package/lib/src/tasks/CreateMergeRequestTask.js +21 -36
  29. package/lib/src/tasks/CreateReleaseNotesTask.js +2 -6
  30. package/lib/src/tasks/InstallPackagesTask.js +65 -92
  31. package/lib/src/tasks/ValidateCommitsTask.js +6 -14
  32. package/lib/src/tasks/ValidateDescriptionsTask.js +4 -8
  33. package/lib/src/tasks/ValidateTask.js +5 -6
  34. package/lib/src/tasks/VersionTask.js +7 -20
  35. package/lib/src/tasks/index.js +1 -0
  36. package/lib/src/types.js +2 -1
  37. package/lib/src/utils/Descriptions.js +5 -4
  38. package/lib/src/utils/ProjectIds.js +6 -2
  39. package/package.json +22 -22
@@ -60,7 +60,7 @@ var child_process_1 = __importDefault(require("child_process"));
60
60
  var types_1 = require("../types");
61
61
  var services_1 = require("../services");
62
62
  var utils_1 = require("../utils");
63
- var constants_1 = require("../constants");
63
+ var MonorepoPackageJsonFiles_1 = require("../constants/MonorepoPackageJsonFiles");
64
64
  var ROOT_DIRECTORIES = {
65
65
  // Curator
66
66
  62: 'src/ClickView.Curator.Web/Assets',
@@ -75,16 +75,16 @@ var ROOT_DIRECTORIES = {
75
75
  };
76
76
  var InstallPackagesTask = /** @class */ (function () {
77
77
  function InstallPackagesTask(service) {
78
- this._service = service;
78
+ this.service = service;
79
79
  }
80
80
  InstallPackagesTask.prototype.run = function (options) {
81
81
  return __awaiter(this, void 0, void 0, function () {
82
- var projects, monorepo, consumingProjects, monorepoBranchName, versions, _i, consumingProjects_1, project, branchName, _a, consumingProjects_2, project, _b, consumingProjects_3, project, branchName;
82
+ var projects, monorepo, consumingProjects, _a, monorepoBranch, monorepoBranchName, versions, _i, consumingProjects_1, project, _b, branch, branchName, hasUpdates;
83
83
  return __generator(this, function (_c) {
84
84
  switch (_c.label) {
85
85
  case 0:
86
- utils_1.Logger.logTask('Installing clickview npm packages in consuming projects');
87
- return [4 /*yield*/, this._service.getProjects(options)];
86
+ utils_1.Logger.logTask('Installing npm packages');
87
+ return [4 /*yield*/, this.service.getProjects(options)];
88
88
  case 1:
89
89
  projects = _c.sent();
90
90
  monorepo = projects.find(function (p) { return p.id.toString() === utils_1.ProjectIds.MONOREPO_PROJECT_ID; });
@@ -97,11 +97,11 @@ var InstallPackagesTask = /** @class */ (function () {
97
97
  utils_1.Logger.logError("No projects that consume monorepo could be found");
98
98
  return [2 /*return*/, false];
99
99
  }
100
- return [4 /*yield*/, this.getBranchName(monorepo.id, options.version)];
100
+ return [4 /*yield*/, this.service.getNextBranchInfo(monorepo.id, options.version)];
101
101
  case 2:
102
- monorepoBranchName = _c.sent();
103
- if (!monorepoBranchName) {
104
- utils_1.Logger.logError("[".concat(monorepo.title, "] branch does not exist"));
102
+ _a = _c.sent(), monorepoBranch = _a.branch, monorepoBranchName = _a.branchName;
103
+ if (!monorepoBranch) {
104
+ utils_1.Logger.logError("[".concat(monorepo.title, "]: [").concat(monorepoBranchName, "] branch does not exist"));
105
105
  return [2 /*return*/, false];
106
106
  }
107
107
  return [4 /*yield*/, this.getPackageVersions(monorepoBranchName)];
@@ -111,61 +111,50 @@ var InstallPackagesTask = /** @class */ (function () {
111
111
  Object.keys(versions).forEach(function (key) {
112
112
  utils_1.Logger.logMessage("- [".concat(key, "]: ").concat(versions[key]));
113
113
  });
114
- // let cont = true;
115
114
  utils_1.Logger.logMessage('\nInstalling packages:\n');
116
115
  _i = 0, consumingProjects_1 = consumingProjects;
117
116
  _c.label = 4;
118
117
  case 4:
119
- if (!(_i < consumingProjects_1.length)) return [3 /*break*/, 8];
118
+ if (!(_i < consumingProjects_1.length)) return [3 /*break*/, 9];
120
119
  project = consumingProjects_1[_i];
121
- return [4 /*yield*/, this.getBranchName(project.id, options.version)];
120
+ return [4 /*yield*/, this.service.getNextBranchInfo(project.id, options.version)];
122
121
  case 5:
123
- branchName = _c.sent();
124
- // TODO: potentially add a validate branches task and removing the branch checking from this task
125
- // so that install-packages can't be run until create release is run
126
- if (!branchName) {
127
- utils_1.Logger.logError("[".concat(project.title, "]: branch does not exist"));
128
- return [3 /*break*/, 7];
122
+ _b = _c.sent(), branch = _b.branch, branchName = _b.branchName;
123
+ if (!branch) {
124
+ utils_1.Logger.logError("[".concat(project.title, "]: [").concat(branchName, "] does not exist"));
125
+ return [3 /*break*/, 8];
129
126
  }
130
127
  return [4 /*yield*/, this.updateAndSavePackageFiles(project, options.milestone, branchName, versions)];
131
128
  case 6:
132
- _c.sent();
133
- _c.label = 7;
134
- case 7:
135
- _i++;
136
- return [3 /*break*/, 4];
137
- case 8:
138
- for (_a = 0, consumingProjects_2 = consumingProjects; _a < consumingProjects_2.length; _a++) {
139
- project = consumingProjects_2[_a];
140
- utils_1.Logger.logInfo("[".concat(project.title, "]: Running npm i --package-lock-only"));
141
- this.npmInstall(project, options.milestone);
142
- utils_1.Logger.logInfo('\n');
143
- }
129
+ hasUpdates = _c.sent();
144
130
  /**
145
- * TODO: Need to not commit when there's no changes
131
+ * If there are no changes to the versions, we're done here
146
132
  */
147
- utils_1.Logger.logMessage('Committing files');
148
- _b = 0, consumingProjects_3 = consumingProjects;
149
- _c.label = 9;
150
- case 9:
151
- if (!(_b < consumingProjects_3.length)) return [3 /*break*/, 13];
152
- project = consumingProjects_3[_b];
153
- return [4 /*yield*/, this.getBranchName(project.id, options.version)];
154
- case 10:
155
- branchName = _c.sent();
156
- if (!branchName) {
157
- utils_1.Logger.logError("[".concat(project.title, "]: branch does not exist"));
158
- return [3 /*break*/, 12];
133
+ if (!hasUpdates) {
134
+ utils_1.Logger.logWarning("[".concat(project.title, "]: [").concat(branchName, "] does not require any updates"));
135
+ return [3 /*break*/, 8];
159
136
  }
137
+ /**
138
+ * Run npm i to update our package log file
139
+ */
140
+ utils_1.Logger.logInfo("[".concat(project.title, "]: Running npm i --package-lock-only"));
141
+ this.npmInstall(project, options.milestone);
142
+ utils_1.Logger.logInfo('\n');
143
+ /**
144
+ * Commit our updated package.json and package-lock.json
145
+ */
160
146
  return [4 /*yield*/, this.commitUpdatedFiles(project, options.milestone, branchName)];
161
- case 11:
147
+ case 7:
148
+ /**
149
+ * Commit our updated package.json and package-lock.json
150
+ */
162
151
  _c.sent();
163
152
  utils_1.Logger.logMessage("[".concat(project.title, "]: File changes committed"));
164
- _c.label = 12;
165
- case 12:
166
- _b++;
167
- return [3 /*break*/, 9];
168
- case 13: return [2 /*return*/, true];
153
+ _c.label = 8;
154
+ case 8:
155
+ _i++;
156
+ return [3 /*break*/, 4];
157
+ case 9: return [2 /*return*/, true];
169
158
  }
170
159
  });
171
160
  });
@@ -193,7 +182,7 @@ var InstallPackagesTask = /** @class */ (function () {
193
182
  case 2:
194
183
  commitFiles = _a.concat([(_c.content = _d.sent(),
195
184
  _c)]);
196
- return [4 /*yield*/, this._service.commit(project.id, branchName, 'Installing @clickview npm packages', commitFiles)];
185
+ return [4 /*yield*/, this.service.commit(project.id, branchName, 'Installing @clickview npm packages', commitFiles)];
197
186
  case 3:
198
187
  _d.sent();
199
188
  return [2 /*return*/];
@@ -211,7 +200,7 @@ var InstallPackagesTask = /** @class */ (function () {
211
200
  };
212
201
  InstallPackagesTask.prototype.updateAndSavePackageFiles = function (project, milestone, branchName, versions) {
213
202
  return __awaiter(this, void 0, void 0, function () {
214
- var rootDir, packageJson, packageLock, packageJsonObj, outputPath;
203
+ var rootDir, packageJson, packageLock, packageJsonObj, original, outputPath;
215
204
  return __generator(this, function (_a) {
216
205
  switch (_a.label) {
217
206
  case 0:
@@ -223,6 +212,7 @@ var InstallPackagesTask = /** @class */ (function () {
223
212
  case 2:
224
213
  packageLock = _a.sent();
225
214
  packageJsonObj = JSON.parse(packageJson);
215
+ original = packageJson;
226
216
  utils_1.Logger.logMessage(project.title);
227
217
  /**
228
218
  * Annoyingly some projects have clickview packages sitting in dependencies
@@ -239,7 +229,7 @@ var InstallPackagesTask = /** @class */ (function () {
239
229
  return [4 /*yield*/, fs_extra_1.default.outputFile("".concat(outputPath, "/package-lock.json"), packageLock, { encoding: 'utf8' })];
240
230
  case 4:
241
231
  _a.sent();
242
- return [2 /*return*/];
232
+ return [2 /*return*/, original !== packageJson];
243
233
  }
244
234
  });
245
235
  });
@@ -265,28 +255,35 @@ var InstallPackagesTask = /** @class */ (function () {
265
255
  });
266
256
  return packageJson;
267
257
  };
258
+ /**
259
+ * Pulls out the version from each package.json file in monorepo. We use these values to update
260
+ * the package.json dependencies in consuming projects
261
+ */
268
262
  InstallPackagesTask.prototype.getPackageVersions = function (branchName) {
269
263
  return __awaiter(this, void 0, void 0, function () {
270
- var monorepoPackages, _i, MONOREPO_PACKAGE_JSON_FILES_1, file, text, json;
264
+ var monorepoPackages, promises;
265
+ var _this = this;
271
266
  return __generator(this, function (_a) {
272
267
  switch (_a.label) {
273
268
  case 0:
274
269
  monorepoPackages = {};
275
- _i = 0, MONOREPO_PACKAGE_JSON_FILES_1 = constants_1.MONOREPO_PACKAGE_JSON_FILES;
276
- _a.label = 1;
270
+ promises = MonorepoPackageJsonFiles_1.MONOREPO_PACKAGE_JSON_FILES.map(function (file) { return __awaiter(_this, void 0, void 0, function () {
271
+ var text, json;
272
+ return __generator(this, function (_a) {
273
+ switch (_a.label) {
274
+ case 0: return [4 /*yield*/, this.getFileText(utils_1.ProjectIds.MONOREPO_PROJECT_ID, branchName, file)];
275
+ case 1:
276
+ text = _a.sent();
277
+ json = JSON.parse(text);
278
+ monorepoPackages[json.name] = json.version;
279
+ return [2 /*return*/];
280
+ }
281
+ });
282
+ }); });
283
+ return [4 /*yield*/, Promise.all(promises)];
277
284
  case 1:
278
- if (!(_i < MONOREPO_PACKAGE_JSON_FILES_1.length)) return [3 /*break*/, 4];
279
- file = MONOREPO_PACKAGE_JSON_FILES_1[_i];
280
- return [4 /*yield*/, this.getFileText(utils_1.ProjectIds.MONOREPO_PROJECT_ID, branchName, file)];
281
- case 2:
282
- text = _a.sent();
283
- json = JSON.parse(text);
284
- monorepoPackages[json.name] = json.version;
285
- _a.label = 3;
286
- case 3:
287
- _i++;
288
- return [3 /*break*/, 1];
289
- case 4: return [2 /*return*/, monorepoPackages];
285
+ _a.sent();
286
+ return [2 /*return*/, monorepoPackages];
290
287
  }
291
288
  });
292
289
  });
@@ -296,7 +293,7 @@ var InstallPackagesTask = /** @class */ (function () {
296
293
  var file, buff;
297
294
  return __generator(this, function (_a) {
298
295
  switch (_a.label) {
299
- case 0: return [4 /*yield*/, this._service.getFile(projectId, branchName, fileName)];
296
+ case 0: return [4 /*yield*/, this.service.getFile(projectId, branchName, fileName)];
300
297
  case 1:
301
298
  file = _a.sent();
302
299
  if (!file)
@@ -307,30 +304,6 @@ var InstallPackagesTask = /** @class */ (function () {
307
304
  });
308
305
  });
309
306
  };
310
- InstallPackagesTask.prototype.getBranchName = function (projectId, version) {
311
- return __awaiter(this, void 0, void 0, function () {
312
- var currentVersionTag, nextVersion, branchName, branch;
313
- return __generator(this, function (_a) {
314
- switch (_a.label) {
315
- case 0: return [4 /*yield*/, this._service.getCurrentVersionTag(projectId)];
316
- case 1:
317
- currentVersionTag = _a.sent();
318
- if (!currentVersionTag)
319
- return [2 /*return*/, null];
320
- return [4 /*yield*/, utils_1.Versions.getNextVersion(currentVersionTag.name, version)];
321
- case 2:
322
- nextVersion = _a.sent();
323
- branchName = utils_1.BranchNames.getRelease(nextVersion);
324
- return [4 /*yield*/, this._service.getBranch(projectId, branchName)];
325
- case 3:
326
- branch = _a.sent();
327
- if (!branch)
328
- return [2 /*return*/, null];
329
- return [2 /*return*/, branchName];
330
- }
331
- });
332
- });
333
- };
334
307
  InstallPackagesTask.prototype.getOutputPath = function (project, milestone) {
335
308
  return "./temp/".concat(milestone, "/").concat(project.title);
336
309
  };
@@ -56,36 +56,28 @@ var services_1 = require("../services");
56
56
  var utils_1 = require("../utils");
57
57
  var ValidateCommitsTask = /** @class */ (function () {
58
58
  function ValidateCommitsTask(service) {
59
- this._service = service;
59
+ this.service = service;
60
60
  }
61
61
  ValidateCommitsTask.prototype.run = function (options) {
62
62
  return __awaiter(this, void 0, void 0, function () {
63
- var projects, cont, _i, projects_1, project, currentVersionTag, devCommits, shouldCherryPick;
63
+ var projects, cont, _i, projects_1, project, tag, devCommits, shouldCherryPick;
64
64
  return __generator(this, function (_a) {
65
65
  switch (_a.label) {
66
66
  case 0:
67
67
  utils_1.Logger.logTask('Validating dev commits');
68
- return [4 /*yield*/, this._service.getProjects(options)];
68
+ return [4 /*yield*/, this.service.getProjects(options)];
69
69
  case 1:
70
70
  projects = _a.sent();
71
- if (!projects.length) {
72
- utils_1.Logger.logError("No projects could be found with the specified options");
73
- return [2 /*return*/, false];
74
- }
75
71
  cont = true;
76
72
  _i = 0, projects_1 = projects;
77
73
  _a.label = 2;
78
74
  case 2:
79
75
  if (!(_i < projects_1.length)) return [3 /*break*/, 6];
80
76
  project = projects_1[_i];
81
- return [4 /*yield*/, this._service.getCurrentVersionTag(project.id)];
77
+ return [4 /*yield*/, this.service.getNextBranchInfo(project.id, options.version)];
82
78
  case 3:
83
- currentVersionTag = _a.sent();
84
- if (!currentVersionTag) {
85
- utils_1.Logger.logError("Could not find the next version for: ".concat(project.title));
86
- return [2 /*return*/, false];
87
- }
88
- return [4 /*yield*/, this._service.getDevCommitsSince(project.id, currentVersionTag.target)];
79
+ tag = (_a.sent()).tag;
80
+ return [4 /*yield*/, this.service.getDevCommitsSince(project.id, tag.target)];
89
81
  case 4:
90
82
  devCommits = _a.sent();
91
83
  shouldCherryPick = utils_1.Commits.shouldCherryPick(project, devCommits);
@@ -56,11 +56,11 @@ require("reflect-metadata");
56
56
  var inversify_1 = require("inversify");
57
57
  var lodash_1 = __importDefault(require("lodash"));
58
58
  var types_1 = require("../types");
59
- var GitLabService_1 = require("../services/GitLabService");
59
+ var services_1 = require("../services");
60
60
  var utils_1 = require("../utils");
61
61
  var ValidateDescriptionsTask = /** @class */ (function () {
62
62
  function ValidateDescriptionsTask(service) {
63
- this._service = service;
63
+ this.service = service;
64
64
  }
65
65
  ValidateDescriptionsTask.prototype.run = function (options) {
66
66
  return __awaiter(this, void 0, void 0, function () {
@@ -69,13 +69,9 @@ var ValidateDescriptionsTask = /** @class */ (function () {
69
69
  switch (_e.label) {
70
70
  case 0:
71
71
  utils_1.Logger.logTask('Validating descriptions');
72
- return [4 /*yield*/, this._service.getProjects(options)];
72
+ return [4 /*yield*/, this.service.getProjects(options)];
73
73
  case 1:
74
74
  projects = _e.sent();
75
- if (!projects.length) {
76
- utils_1.Logger.logError("No projects could be found with the specified options");
77
- return [2 /*return*/, false];
78
- }
79
75
  cont = true;
80
76
  for (_i = 0, projects_1 = projects; _i < projects_1.length; _i++) {
81
77
  project = projects_1[_i];
@@ -111,7 +107,7 @@ var ValidateDescriptionsTask = /** @class */ (function () {
111
107
  ValidateDescriptionsTask = __decorate([
112
108
  (0, inversify_1.injectable)(),
113
109
  __param(0, (0, inversify_1.inject)(types_1.SERVICES.GitLabService)),
114
- __metadata("design:paramtypes", [GitLabService_1.GitLabService])
110
+ __metadata("design:paramtypes", [services_1.GitLabService])
115
111
  ], ValidateDescriptionsTask);
116
112
  return ValidateDescriptionsTask;
117
113
  }());
@@ -71,7 +71,7 @@ var services_1 = require("../services");
71
71
  var utils_1 = require("../utils");
72
72
  var ValidateTask = /** @class */ (function () {
73
73
  function ValidateTask(service) {
74
- this._service = service;
74
+ this.service = service;
75
75
  }
76
76
  ValidateTask.prototype.run = function (options) {
77
77
  return __awaiter(this, void 0, void 0, function () {
@@ -80,13 +80,9 @@ var ValidateTask = /** @class */ (function () {
80
80
  switch (_a.label) {
81
81
  case 0:
82
82
  utils_1.Logger.logTask('Validating the release');
83
- return [4 /*yield*/, this._service.getProjects(options)];
83
+ return [4 /*yield*/, this.service.getProjects(options)];
84
84
  case 1:
85
85
  projects = _a.sent();
86
- if (!projects.length) {
87
- utils_1.Logger.logError("No projects could be found with the specified options");
88
- return [2 /*return*/, false];
89
- }
90
86
  utils_1.Logger.logMessage("Found ".concat(projects.length, " projects that need to be released"));
91
87
  cont = true;
92
88
  _loop_1 = function (project) {
@@ -96,6 +92,9 @@ var ValidateTask = /** @class */ (function () {
96
92
  return __assign(__assign({}, prev), (_a = {}, _a[current] = groupedMRs[current].length, _a));
97
93
  }, {});
98
94
  var ready = !count.opened || count.opened === 0;
95
+ /**
96
+ * Any MRs that are not targeting dev should not have a milestone
97
+ */
99
98
  var nonDevMrs = project.mergeRequests.filter(function (mr) { return mr.targetBranch !== 'dev'; });
100
99
  if (nonDevMrs.length)
101
100
  ready = false;
@@ -56,47 +56,34 @@ var services_1 = require("../services");
56
56
  var utils_1 = require("../utils");
57
57
  var VersionTask = /** @class */ (function () {
58
58
  function VersionTask(service) {
59
- this._service = service;
59
+ this.service = service;
60
60
  }
61
61
  VersionTask.prototype.run = function (options) {
62
62
  return __awaiter(this, void 0, void 0, function () {
63
- var projects, cont, _i, projects_1, project, currentVersionTag, nextVersion;
63
+ var projects, _i, projects_1, project, tag, nextVersion;
64
64
  return __generator(this, function (_a) {
65
65
  switch (_a.label) {
66
66
  case 0:
67
67
  utils_1.Logger.logTask('Calculating versions');
68
- return [4 /*yield*/, this._service.getProjects(options)];
68
+ return [4 /*yield*/, this.service.getProjects(options)];
69
69
  case 1:
70
70
  projects = _a.sent();
71
- if (!projects.length) {
72
- utils_1.Logger.logError("No projects could be found with the specified options");
73
- return [2 /*return*/, false];
74
- }
75
- cont = true;
76
71
  utils_1.Logger.logMessage('Versions:');
77
72
  _i = 0, projects_1 = projects;
78
73
  _a.label = 2;
79
74
  case 2:
80
75
  if (!(_i < projects_1.length)) return [3 /*break*/, 5];
81
76
  project = projects_1[_i];
82
- return [4 /*yield*/, this._service.getCurrentVersionTag(project.id)];
77
+ return [4 /*yield*/, this.service.getNextBranchInfo(project.id, options.version)];
83
78
  case 3:
84
- currentVersionTag = _a.sent();
85
- if (currentVersionTag === null) {
86
- utils_1.Logger.logError("[NOT FOUND]: ".concat(project.title));
87
- cont = false;
88
- return [3 /*break*/, 4];
89
- }
90
- nextVersion = utils_1.Versions.getNextVersion(currentVersionTag.name, options.version);
79
+ tag = (_a.sent()).tag;
80
+ nextVersion = utils_1.Versions.getNextVersion(tag.name, options.version);
91
81
  utils_1.Logger.logMessage("[".concat(nextVersion, "]: ").concat(project.title));
92
82
  _a.label = 4;
93
83
  case 4:
94
84
  _i++;
95
85
  return [3 /*break*/, 2];
96
- case 5:
97
- if (!cont)
98
- utils_1.Logger.logError('\nCould not calculate versions for all projects');
99
- return [2 /*return*/, cont];
86
+ case 5: return [2 /*return*/, true];
100
87
  }
101
88
  });
102
89
  });
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BumpPackagesTask"), exports);
18
18
  __exportStar(require("./BumpVersionTxtTask"), exports);
19
+ __exportStar(require("./CommitPackageVersionsTask"), exports);
19
20
  __exportStar(require("./CreateBranchTask"), exports);
20
21
  __exportStar(require("./CreateMergeRequestTask"), exports);
21
22
  __exportStar(require("./CreateReleaseNotesTask"), exports);
package/lib/src/types.js CHANGED
@@ -20,7 +20,8 @@ exports.TASKS = {
20
20
  ValidateDescriptionsTask: Symbol.for('ValidateDescriptionsTask'),
21
21
  CreateReleaseNotesTask: Symbol.for('CreateReleaseNotesTask'),
22
22
  InstallPackagesTask: Symbol.for('InstallPackagesTask'),
23
- BumpPackagesTask: Symbol.for('BumpPackagesTask')
23
+ BumpPackagesTask: Symbol.for('BumpPackagesTask'),
24
+ CommitPackageVersionsTask: Symbol.for('CommitPackageVersionsTask')
24
25
  };
25
26
  exports.COMMANDS = {
26
27
  StatusCommand: Symbol.for('StatusCommand'),
@@ -19,14 +19,15 @@ var VALID_MONOREPO_HEADINGS = {
19
19
  'styles': true,
20
20
  'player': true,
21
21
  'reports': true,
22
- 'analytis': true,
22
+ 'analytics': true,
23
23
  'tooling': true,
24
24
  'testing': true,
25
25
  'dependencies': true,
26
- 'notes': true
26
+ 'notes': true,
27
+ 'monorepo': true
27
28
  };
28
29
  function toObject(lines, headingPrefix) {
29
- var obj = [];
30
+ var obj = {};
30
31
  var currentHeading = 'Other';
31
32
  for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
32
33
  var line = lines_1[_i];
@@ -116,7 +117,7 @@ exports.Descriptions = {
116
117
  var descriptionObjs = mergeRequests
117
118
  .filter(function (mr) { return mr.status === 'merged'; })
118
119
  .map(function (mr) { return toObject(mr.description.split('\n'), '#'); });
119
- var combinedObj = [];
120
+ var combinedObj = {};
120
121
  var _loop_2 = function (descriptionObj) {
121
122
  Object.keys(descriptionObj).forEach(function (key) {
122
123
  if (!combinedObj[key])
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- // TODO: Eventually this should allow us to map project names to project ids
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
7
6
  exports.ProjectIds = void 0;
8
7
  var lodash_1 = __importDefault(require("lodash"));
8
+ var errors_1 = require("../errors");
9
9
  var PROJECT_NAMES = {
10
10
  monorepo: '789',
11
11
  online: '109',
@@ -16,6 +16,10 @@ var PROJECT_NAMES = {
16
16
  };
17
17
  exports.ProjectIds = {
18
18
  MONOREPO_PROJECT_ID: '798',
19
+ /**
20
+ * This allows project names to be passed into the CLI.
21
+ * For example `ship-it release -m S2 -p lite`
22
+ */
19
23
  getProjectIds: function (projects) {
20
24
  var projectIds = [];
21
25
  for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) {
@@ -26,7 +30,7 @@ exports.ProjectIds = {
26
30
  }
27
31
  var mappedId = PROJECT_NAMES[project.toLowerCase()];
28
32
  if (!mappedId)
29
- throw new Error("Could not find project id mapping for ".concat(project));
33
+ throw new errors_1.ShipItError("Could not find project id mapping for ".concat(project));
30
34
  projectIds.push(mappedId);
31
35
  }
32
36
  return projectIds;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/ship-it",
3
- "version": "0.0.2-dev.0",
3
+ "version": "0.0.2-dev.2",
4
4
  "description": "Release Manager",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -18,28 +18,28 @@
18
18
  "author": "Joshua Taylor, Shale Kuzmanovski",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@gitbeaker/node": "^35.6.0",
22
- "chalk": "^4.1.2",
23
- "commander": "^9.1.0",
24
- "fs-extra": "^10.0.1",
25
- "inversify": "^6.0.1",
26
- "lodash": "^4.17.21",
27
- "reflect-metadata": "^0.1.13",
28
- "semver": "^7.3.5"
21
+ "@gitbeaker/node": "35.6.0",
22
+ "chalk": "4.1.2",
23
+ "commander": "9.1.0",
24
+ "fs-extra": "10.0.1",
25
+ "inversify": "6.0.1",
26
+ "lodash": "4.17.21",
27
+ "reflect-metadata": "0.1.13",
28
+ "semver": "7.3.5"
29
29
  },
30
30
  "devDependencies": {
31
- "@clickview/eslint-config": "^1.0.3",
32
- "@types/fs-extra": "^9.0.13",
33
- "@types/lodash": "^4.14.181",
34
- "@types/node": "^17.0.23",
35
- "@types/semver": "^7.3.9",
36
- "@typescript-eslint/eslint-plugin": "^5.17.0",
37
- "@typescript-eslint/parser": "^5.17.0",
38
- "eslint": "^8.12.0",
39
- "eslint-plugin-react-hooks": "^4.4.0",
40
- "ts-node": "^10.7.0",
41
- "tsc-alias": "^1.6.6",
42
- "tsconfig-paths": "^3.14.1",
43
- "typescript": "^4.6.3"
31
+ "@clickview/eslint-config": "1.0.3",
32
+ "@types/fs-extra": "9.0.13",
33
+ "@types/lodash": "4.14.181",
34
+ "@types/node": "17.0.23",
35
+ "@types/semver": "7.3.9",
36
+ "@typescript-eslint/eslint-plugin": "5.17.0",
37
+ "@typescript-eslint/parser": "5.17.0",
38
+ "eslint": "8.12.0",
39
+ "eslint-plugin-react-hooks": "4.4.0",
40
+ "ts-node": "10.7.0",
41
+ "tsc-alias": "1.6.6",
42
+ "tsconfig-paths": "3.14.1",
43
+ "typescript": "4.6.3"
44
44
  }
45
45
  }