@clickview/ship-it 0.0.49 → 0.0.50

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 (66) hide show
  1. package/config.json +5 -0
  2. package/lib/config.json +5 -0
  3. package/lib/src/api-clients/git-lab/GitLabApiClient.js +1 -1
  4. package/lib/src/api-clients/index.js +1 -0
  5. package/lib/src/api-clients/slack/SlackApiClient.js +27 -25
  6. package/lib/src/api-clients/team-city/TeamCityApiClient.js +1 -1
  7. package/lib/src/api-clients/trello/TrelloApiClient.js +1 -1
  8. package/lib/src/commands/BumpPackagesCommand.js +1 -1
  9. package/lib/src/commands/CheckReleaseReadyCommand.js +1 -1
  10. package/lib/src/commands/ConfigureProjectsCommand.js +1 -1
  11. package/lib/src/commands/CreateBranchCommand.js +1 -1
  12. package/lib/src/commands/CreateHotfixCommand.js +1 -1
  13. package/lib/src/commands/CreateMergeRequestCommand.js +1 -1
  14. package/lib/src/commands/CreateNotesAuditCommand.js +1 -1
  15. package/lib/src/commands/CreateReleaseNotesCommand.js +1 -1
  16. package/lib/src/commands/CreateTrelloCardsCommand.js +1 -1
  17. package/lib/src/commands/InstallPackagesCommand.js +1 -1
  18. package/lib/src/commands/JiraTicketsStatusCommand.js +1 -41
  19. package/lib/src/commands/ListProjectsCommand.js +1 -1
  20. package/lib/src/commands/ReleaseCommand.js +1 -1
  21. package/lib/src/commands/StartProjectBuildsCommand.js +1 -1
  22. package/lib/src/commands/StatusCommand.js +1 -1
  23. package/lib/src/commands/TagMasterCommand.js +1 -1
  24. package/lib/src/commands/ToolingReleaseCommand.js +1 -1
  25. package/lib/src/commands/UpdateDescriptionCommand.js +1 -1
  26. package/lib/src/commands/ValidateMergeRequestCommand.js +1 -1
  27. package/lib/src/commands/VersionCommand.js +1 -1
  28. package/lib/src/commands/index.js +2 -0
  29. package/lib/src/constants/CommandTypeMapping.js +2 -0
  30. package/lib/src/inversify.config.js +7 -0
  31. package/lib/src/services/GitLabService.js +9 -4
  32. package/lib/src/services/SlackService.js +3 -7
  33. package/lib/src/services/TrelloService.js +1 -1
  34. package/lib/src/services/index.js +1 -0
  35. package/lib/src/startup/AddMilestoneCommand.js +1 -1
  36. package/lib/src/startup/GetAction.js +1 -1
  37. package/lib/src/startup/SetupCommands.js +3 -1
  38. package/lib/src/tasks/BumpPackagesTask.js +1 -1
  39. package/lib/src/tasks/BumpVersionTxtTask.js +1 -1
  40. package/lib/src/tasks/ChangeMilestoneTask.js +1 -1
  41. package/lib/src/tasks/CheckReleaseReadyTask.js +29 -17
  42. package/lib/src/tasks/CreateBranchTask.js +1 -1
  43. package/lib/src/tasks/CreateHotfixTask.js +1 -1
  44. package/lib/src/tasks/CreateMergeRequestTask.js +1 -1
  45. package/lib/src/tasks/CreateNotesAuditTask.js +40 -16
  46. package/lib/src/tasks/CreateReleaseNotesTask.js +1 -1
  47. package/lib/src/tasks/InstallPackagesTask.js +1 -1
  48. package/lib/src/tasks/ListProjectsTask.js +1 -1
  49. package/lib/src/tasks/PopulateTrelloBoardTask.js +1 -1
  50. package/lib/src/tasks/StartMonorepoBuildTask.js +1 -1
  51. package/lib/src/tasks/StartProjectBuildsTask.js +1 -1
  52. package/lib/src/tasks/TagMasterTask.js +1 -1
  53. package/lib/src/tasks/UpdateMergeRequestDescriptionTask.js +1 -1
  54. package/lib/src/tasks/ValidateCommitsTask.js +1 -1
  55. package/lib/src/tasks/ValidateDescriptionsTask.js +1 -1
  56. package/lib/src/tasks/ValidateMergeRequestTask.js +1 -1
  57. package/lib/src/tasks/ValidateTask.js +23 -20
  58. package/lib/src/tasks/VersionTask.js +1 -1
  59. package/lib/src/tasks/configure-projects/AddApprovalRulesTask.js +1 -1
  60. package/lib/src/tasks/configure-projects/CreateToolingBranchTask.js +1 -1
  61. package/lib/src/tasks/configure-projects/EnsureApprovalRulesTask.js +1 -1
  62. package/lib/src/tasks/configure-projects/primitives/BaseConfigureProjectsTask.js +2 -2
  63. package/lib/src/tasks/index.js +2 -0
  64. package/lib/src/types.js +7 -0
  65. package/lib/src/utils/Descriptions.js +38 -10
  66. package/package.json +6 -5
package/lib/src/types.js CHANGED
@@ -3,18 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.COMMANDS = exports.TASKS = exports.SERVICES = exports.API_CLIENTS = exports.MISC = void 0;
4
4
  exports.MISC = {
5
5
  GitLabConfig: Symbol.for('GitLabConfig'),
6
+ JiraConfig: Symbol.for('JiraConfig'),
6
7
  TeamCityConfig: Symbol.for('TeamCityConfig'),
7
8
  TrelloConfig: Symbol.for('TrelloConfig'),
8
9
  SlackConfig: Symbol.for('SlackConfig')
9
10
  };
10
11
  exports.API_CLIENTS = {
11
12
  GitLabApiClient: Symbol.for('GitLabApiClient'),
13
+ JiraApiClient: Symbol.for('JiraApiClient'),
12
14
  TeamCityApiClient: Symbol.for('TeamCityApiClient'),
13
15
  TrelloApiClient: Symbol.for('TrelloApiClient'),
14
16
  SlackApiClient: Symbol.for('SlackApiClient')
15
17
  };
16
18
  exports.SERVICES = {
17
19
  GitLabService: Symbol.for('GitLabService'),
20
+ JiraService: Symbol.for('JiraService'),
18
21
  TeamCityService: Symbol.for('TeamCityService'),
19
22
  TrelloService: Symbol.for('TrelloService'),
20
23
  SlackService: Symbol.for('SlackService')
@@ -29,6 +32,7 @@ exports.TASKS = {
29
32
  ValidateDescriptionsTask: Symbol.for('ValidateDescriptionsTask'),
30
33
  CreateReleaseNotesTask: Symbol.for('CreateReleaseNotesTask'),
31
34
  CreateNotesAuditTask: Symbol.for('CreateNotesAuditTask'),
35
+ JiraTicketsStatusTask: Symbol.for('JiraTicketsStatusTask'),
32
36
  InstallPackagesTask: Symbol.for('InstallPackagesTask'),
33
37
  BumpPackagesTask: Symbol.for('BumpPackagesTask'),
34
38
  ValidateMergeRequestTask: Symbol.for('ValidateMergeRequestTask'),
@@ -40,6 +44,7 @@ exports.TASKS = {
40
44
  AddApprovalRulesTask: Symbol.for('AddApprovalRulesTask'),
41
45
  CreateToolingBranchTask: Symbol.for('CreateToolingBranchTask'),
42
46
  EnsureApprovalRulesTask: Symbol.for('EnsureApprovalRulesTask'),
47
+ CheckReleaseReadyTask: Symbol.for('CheckReleaseReadyTask'),
43
48
  CreateHotfixTask: Symbol.for('CreateHotfixTask'),
44
49
  ChangeMilestoneTask: Symbol.for('ChangeMilestoneTask'),
45
50
  UpdateMergeRequestDescriptionTask: Symbol.for('UpdateMergeRequestDescriptionTask')
@@ -53,6 +58,7 @@ exports.COMMANDS = {
53
58
  CreateMergeRequestCommand: Symbol.for('CreateMergeRequestCommand'),
54
59
  CreateReleaseNotesCommand: Symbol.for('CreateReleaseNotesCommand'),
55
60
  CreateNotesAuditCommand: Symbol.for('CreateNotesAuditCommand'),
61
+ JiraTicketsStatusCommand: Symbol.for('JiraTicketsStatusCommand'),
56
62
  InstallPackagesCommand: Symbol.for('InstallPackagesCommand'),
57
63
  BumpPackagesCommand: Symbol.for('BumpPackagesCommand'),
58
64
  ValidateMergeRequestCommand: Symbol.for('ValidateMergeRequestCommand'),
@@ -61,6 +67,7 @@ exports.COMMANDS = {
61
67
  ListProjectsCommand: Symbol.for('ListProjectsCommand'),
62
68
  CreateTrelloCardsCommand: Symbol.for('CreateTrelloCardsCommand'),
63
69
  ConfigureProjectsCommand: Symbol.for('ConfigureProjectsCommand'),
70
+ CheckReleaseReadyCommand: Symbol.for('CheckReleaseReadyCommand'),
64
71
  CreateHotfixCommand: Symbol.for('CreateHotfixCommand'),
65
72
  UpdateDescriptionCommand: Symbol.for('UpdateDescriptionCommand')
66
73
  };
@@ -35,7 +35,7 @@ var HEADING_ORDER = [
35
35
  Headings.AfterRelease,
36
36
  Headings.CustomerChanges,
37
37
  Headings.CodeChanges,
38
- '*',
38
+ '*', // This wildcard is where all the other headings will go
39
39
  Headings.Testing,
40
40
  Headings.Notes,
41
41
  ];
@@ -237,15 +237,43 @@ exports.Descriptions = {
237
237
  description += MERGE_REQUEST_CHECKLIST;
238
238
  return description;
239
239
  },
240
- getDescriptionSection: function (heading, mergeRequest) {
241
- var descriptionObj = toObject(mergeRequest.description.split('\n'), '#');
242
- var obj = {};
243
- Object.keys(descriptionObj).forEach(function (key) {
244
- if (!obj[key])
245
- obj[key] = '';
246
- obj[key] += descriptionObj[key] + '\n';
247
- });
248
- return obj[Headings[heading]];
240
+ // eslint-disable-next-line max-len
241
+ getDescriptionSection: function (heading, mergeRequest, subHeading) {
242
+ if (!subHeading) {
243
+ var descriptionObj_1 = toObject(mergeRequest.description.split('\n'), '#');
244
+ var obj_1 = {};
245
+ Object.keys(descriptionObj_1).forEach(function (key) {
246
+ if (!obj_1[key])
247
+ obj_1[key] = '';
248
+ obj_1[key] += descriptionObj_1[key] + '\n';
249
+ });
250
+ return obj_1[Headings[heading]];
251
+ }
252
+ var descriptionLines = mergeRequest.description.split('\n');
253
+ var mainHeadingText = "# ".concat(Headings[heading]);
254
+ var subHeadingText = "## ".concat(Headings[subHeading]);
255
+ var inMainSection = false;
256
+ var inSubSection = false;
257
+ var collectedLines = [];
258
+ for (var _i = 0, descriptionLines_1 = descriptionLines; _i < descriptionLines_1.length; _i++) {
259
+ var line = descriptionLines_1[_i];
260
+ if (line.trim() === mainHeadingText) {
261
+ inMainSection = true;
262
+ inSubSection = false;
263
+ continue;
264
+ }
265
+ if (inMainSection && line.startsWith('# ') && line.trim() !== mainHeadingText)
266
+ break;
267
+ if (inMainSection && line.trim() === subHeadingText) {
268
+ inSubSection = true;
269
+ continue;
270
+ }
271
+ if (inSubSection && line.startsWith('## ') && line.trim() !== subHeadingText)
272
+ break;
273
+ if (inSubSection)
274
+ collectedLines.push(line);
275
+ }
276
+ return collectedLines.length > 0 ? collectedLines.join('\n').trim() : '';
249
277
  },
250
278
  // TODO: This isn't readable, it needs to be refactored
251
279
  getMonorepoCombinedDescription: function (mergeRequests) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickview/ship-it",
3
- "version": "0.0.49",
3
+ "version": "0.0.50",
4
4
  "description": "Release Manager",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -19,13 +19,14 @@
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
21
  "@gitbeaker/node": "35.6.0",
22
+ "@slack/web-api": "6.11.2",
22
23
  "@slack/webhook": "7.0.2",
23
- "@slack/web-api":"6.11.2",
24
24
  "chalk": "4.1.2",
25
25
  "commander": "9.1.0",
26
26
  "fast-csv": "4.3.6",
27
27
  "fs-extra": "10.0.1",
28
28
  "inversify": "6.0.1",
29
+ "jira.js": "5.3.1",
29
30
  "lodash": "4.17.21",
30
31
  "reflect-metadata": "0.1.13",
31
32
  "semver": "7.3.5",
@@ -38,13 +39,13 @@
38
39
  "@types/lodash": "4.14.181",
39
40
  "@types/node": "17.0.23",
40
41
  "@types/semver": "7.3.9",
41
- "@typescript-eslint/eslint-plugin": "5.17.0",
42
- "@typescript-eslint/parser": "5.17.0",
42
+ "@typescript-eslint/eslint-plugin": "6.21.0",
43
+ "@typescript-eslint/parser": "6.21.0",
43
44
  "eslint": "8.12.0",
44
45
  "eslint-plugin-react-hooks": "4.4.0",
45
46
  "ts-node": "10.7.0",
46
47
  "tsc-alias": "1.6.6",
47
48
  "tsconfig-paths": "3.14.1",
48
- "typescript": "4.6.3"
49
+ "typescript": "5.3.3"
49
50
  }
50
51
  }