@clickview/ship-it 0.0.20-dev.1 → 0.0.21
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/README.md +48 -48
- package/config.json +10 -10
- package/lib/config.json +11 -11
- package/lib/src/api-clients/git-lab/GitLabApiClient.js +404 -404
- package/lib/src/api-clients/git-lab/GitLabMapper.js +81 -81
- package/lib/src/api-clients/index.js +18 -18
- package/lib/src/api-clients/team-city/TeamCityApiClient.js +100 -85
- package/lib/src/commands/BumpPackagesCommand.js +84 -84
- package/lib/src/commands/CreateBranchCommand.js +100 -100
- package/lib/src/commands/CreateMergeRequestCommand.js +107 -107
- package/lib/src/commands/CreateReleaseNotesCommand.js +84 -84
- package/lib/src/commands/CreateTestingNotesCommand.js +84 -84
- package/lib/src/commands/InstallPackagesCommand.js +76 -76
- package/lib/src/commands/ListProjectsCommand.js +76 -76
- package/lib/src/commands/ReleaseCommand.js +129 -129
- package/lib/src/commands/StartConsumingProjectBuildsCommand.js +76 -76
- package/lib/src/commands/StatusCommand.js +88 -88
- package/lib/src/commands/TagMasterCommand.js +76 -76
- package/lib/src/commands/ValidateMergeRequestCommand.js +76 -76
- package/lib/src/commands/VersionCommand.js +76 -76
- package/lib/src/commands/index.js +29 -29
- package/lib/src/constants/CommandTypeMapping.js +19 -19
- package/lib/src/constants/GitLabMemberIds.js +6 -6
- package/lib/src/constants/MonorepoPackageJsonFiles.js +16 -16
- package/lib/src/constants/MonorepoProjectNames.js +16 -0
- package/lib/src/constants/ProjectNames.js +64 -62
- package/lib/src/constants/TeamCityBuildIDs.js +16 -15
- package/lib/src/constants/index.js +19 -19
- package/lib/src/errors/ShipItError.js +32 -32
- package/lib/src/errors/index.js +17 -17
- package/lib/src/index.js +18 -18
- package/lib/src/interfaces/Config.js +2 -2
- package/lib/src/interfaces/MergeRequestState.js +2 -2
- package/lib/src/interfaces/ProjectNames.js +2 -2
- package/lib/src/interfaces/ShipItCommand.js +2 -2
- package/lib/src/interfaces/ShipItTask.js +2 -2
- package/lib/src/interfaces/VersionType.js +2 -2
- package/lib/src/interfaces/command-cli-options/MilestoneCommandCliOptions.js +2 -2
- package/lib/src/interfaces/command-cli-options/ReleaseCommandCliOptions.js +2 -2
- package/lib/src/interfaces/command-cli-options/index.js +18 -18
- package/lib/src/interfaces/command-options/BaseCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/BumpPackagesCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/DockerMilestoneCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/MilestoneCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/ReleaseCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/ValidateMRCommandOptions.js +2 -2
- package/lib/src/interfaces/command-options/index.js +21 -21
- package/lib/src/interfaces/index.js +26 -26
- package/lib/src/interfaces/models/Branch.js +2 -2
- package/lib/src/interfaces/models/Commit.js +2 -2
- package/lib/src/interfaces/models/CommitFile.js +2 -2
- package/lib/src/interfaces/models/File.js +2 -2
- package/lib/src/interfaces/models/Label.js +2 -2
- package/lib/src/interfaces/models/MergeRequest.js +2 -2
- package/lib/src/interfaces/models/Milestone.js +2 -2
- package/lib/src/interfaces/models/Project.js +2 -2
- package/lib/src/interfaces/models/ProjectConfig.js +9 -9
- package/lib/src/interfaces/models/Release.js +2 -2
- package/lib/src/interfaces/models/Tag.js +2 -2
- package/lib/src/interfaces/models/index.js +26 -26
- package/lib/src/interfaces/view-models/MilestoneProject.js +2 -2
- package/lib/src/interfaces/view-models/index.js +17 -17
- package/lib/src/inversify.config.js +67 -67
- package/lib/src/services/GitLabService.js +498 -498
- package/lib/src/services/TeamCityService.js +37 -34
- package/lib/src/services/index.js +18 -18
- package/lib/src/startup/AddMilestoneCommand.js +95 -95
- package/lib/src/startup/GetAction.js +68 -68
- package/lib/src/startup/SetupCommands.js +128 -128
- package/lib/src/tasks/BumpPackagesTask.js +229 -229
- package/lib/src/tasks/BumpVersionTxtTask.js +110 -110
- package/lib/src/tasks/CommitPackageVersionsTask.js +116 -116
- package/lib/src/tasks/CreateBranchTask.js +104 -104
- package/lib/src/tasks/CreateMergeRequestTask.js +118 -118
- package/lib/src/tasks/CreateReleaseNotesTask.js +122 -122
- package/lib/src/tasks/CreateTestingNotesTask.js +135 -135
- package/lib/src/tasks/InstallPackagesTask.js +405 -399
- package/lib/src/tasks/ListProjectsTask.js +87 -87
- package/lib/src/tasks/StartConsumingProjectBuildsTask.js +149 -149
- package/lib/src/tasks/StartMonorepoBuildTask.js +109 -95
- package/lib/src/tasks/TagMasterTask.js +121 -121
- package/lib/src/tasks/ValidateCommitsTask.js +119 -119
- package/lib/src/tasks/ValidateDescriptionsTask.js +151 -151
- package/lib/src/tasks/ValidateMergeRequestTask.js +115 -115
- package/lib/src/tasks/ValidateTask.js +240 -240
- package/lib/src/tasks/VersionTask.js +98 -98
- package/lib/src/tasks/index.js +33 -33
- package/lib/src/types.js +49 -49
- package/lib/src/utils/BranchNames.js +11 -11
- package/lib/src/utils/Commits.js +55 -55
- package/lib/src/utils/Csv.js +54 -54
- package/lib/src/utils/Descriptions.js +237 -237
- package/lib/src/utils/GroupIds.js +6 -6
- package/lib/src/utils/Logger.js +62 -62
- package/lib/src/utils/ProjectIds.js +61 -47
- package/lib/src/utils/Versions.js +20 -20
- package/lib/src/utils/index.js +22 -22
- package/package.json +47 -47
|
@@ -1,47 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.ProjectIds = void 0;
|
|
15
|
+
var lodash_1 = require("lodash");
|
|
16
|
+
var constants_1 = require("../constants");
|
|
17
|
+
var errors_1 = require("../errors");
|
|
18
|
+
exports.ProjectIds = {
|
|
19
|
+
MONOREPO_PROJECT_ID: constants_1.PROJECT_NAMES.frontend.monorepo,
|
|
20
|
+
/**
|
|
21
|
+
* This allows project names to be passed into the CLI.
|
|
22
|
+
* For example `ship-it release -m S2 -p lite`
|
|
23
|
+
*/
|
|
24
|
+
getProjectIds: function (projects) {
|
|
25
|
+
var projectIds = [];
|
|
26
|
+
for (var _i = 0, projects_1 = projects; _i < projects_1.length; _i++) {
|
|
27
|
+
var project = projects_1[_i];
|
|
28
|
+
if (!isNaN(+project)) {
|
|
29
|
+
projectIds.push(project);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
var mappedId = getMappedId(project);
|
|
33
|
+
if (!mappedId)
|
|
34
|
+
throw new errors_1.ShipItError("Could not find project id mapping for ".concat(project));
|
|
35
|
+
projectIds.push(mappedId);
|
|
36
|
+
}
|
|
37
|
+
return (0, lodash_1.uniq)(projectIds);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function getMappedId(project) {
|
|
41
|
+
var projectNames = Object.values(constants_1.PROJECT_NAMES).reduce(function (prev, value) {
|
|
42
|
+
return __assign(__assign({}, prev), value);
|
|
43
|
+
}, {});
|
|
44
|
+
for (var projectGroup in projectNames) {
|
|
45
|
+
var projectGroupIds = projectNames[projectGroup];
|
|
46
|
+
if (projectGroupIds[project])
|
|
47
|
+
return projectGroupIds[project];
|
|
48
|
+
// Support arguments such as "emailapi"
|
|
49
|
+
if (projectGroupIds[project.replace('api', '')])
|
|
50
|
+
return projectGroupIds[project.replace('api', '')];
|
|
51
|
+
// Support arguments such as "emailservice"
|
|
52
|
+
if (projectGroupIds[project.replace('service', '')])
|
|
53
|
+
return projectGroupIds[project.replace('service', '')];
|
|
54
|
+
// Support arguments such as "launchweb"
|
|
55
|
+
if (projectGroupIds[project.replace('web', '')])
|
|
56
|
+
return projectGroupIds[project.replace('web', '')];
|
|
57
|
+
// Support arguments such as "hydrationapp"
|
|
58
|
+
if (projectGroupIds[project.replace('app', '')])
|
|
59
|
+
return projectGroupIds[project.replace('app', '')];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Versions = void 0;
|
|
7
|
-
var semver_1 = __importDefault(require("semver"));
|
|
8
|
-
exports.Versions = {
|
|
9
|
-
getNextVersion: function (currentVersion, type) {
|
|
10
|
-
var curr = new semver_1.default.SemVer(currentVersion);
|
|
11
|
-
switch (type) {
|
|
12
|
-
case 'major':
|
|
13
|
-
return "".concat(curr.major + 1, ".0.0");
|
|
14
|
-
case 'minor':
|
|
15
|
-
return "".concat(curr.major, ".").concat(curr.minor + 1, ".0");
|
|
16
|
-
case 'patch':
|
|
17
|
-
return "".concat(curr.major, ".").concat(curr.minor, ".").concat(curr.patch + 1);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Versions = void 0;
|
|
7
|
+
var semver_1 = __importDefault(require("semver"));
|
|
8
|
+
exports.Versions = {
|
|
9
|
+
getNextVersion: function (currentVersion, type) {
|
|
10
|
+
var curr = new semver_1.default.SemVer(currentVersion);
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 'major':
|
|
13
|
+
return "".concat(curr.major + 1, ".0.0");
|
|
14
|
+
case 'minor':
|
|
15
|
+
return "".concat(curr.major, ".").concat(curr.minor + 1, ".0");
|
|
16
|
+
case 'patch':
|
|
17
|
+
return "".concat(curr.major, ".").concat(curr.minor, ".").concat(curr.patch + 1);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
package/lib/src/utils/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./BranchNames"), exports);
|
|
18
|
-
__exportStar(require("./Commits"), exports);
|
|
19
|
-
__exportStar(require("./Descriptions"), exports);
|
|
20
|
-
__exportStar(require("./Logger"), exports);
|
|
21
|
-
__exportStar(require("./ProjectIds"), exports);
|
|
22
|
-
__exportStar(require("./Versions"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BranchNames"), exports);
|
|
18
|
+
__exportStar(require("./Commits"), exports);
|
|
19
|
+
__exportStar(require("./Descriptions"), exports);
|
|
20
|
+
__exportStar(require("./Logger"), exports);
|
|
21
|
+
__exportStar(require("./ProjectIds"), exports);
|
|
22
|
+
__exportStar(require("./Versions"), exports);
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@clickview/ship-it",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Release Manager",
|
|
5
|
-
"main": "./lib/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"ship-it": "./lib/src/index.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "npm run lint && ts-node --files src/index.ts",
|
|
11
|
-
"build": "npm run lint && tsc -p . && tsc-alias -p tsconfig.json",
|
|
12
|
-
"lint": "eslint . --ext .ts"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://gitlab.cvinternal.net/front-end/ship-it.git"
|
|
17
|
-
},
|
|
18
|
-
"author": "Joshua Taylor, Shale Kuzmanovski",
|
|
19
|
-
"license": "ISC",
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@gitbeaker/node": "35.6.0",
|
|
22
|
-
"chalk": "4.1.2",
|
|
23
|
-
"commander": "9.1.0",
|
|
24
|
-
"fast-csv": "4.3.6",
|
|
25
|
-
"fs-extra": "10.0.1",
|
|
26
|
-
"inversify": "6.0.1",
|
|
27
|
-
"lodash": "4.17.21",
|
|
28
|
-
"reflect-metadata": "0.1.13",
|
|
29
|
-
"semver": "7.3.5",
|
|
30
|
-
"teamcity-rest-api": "0.0.8"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@clickview/eslint-config": "1.0.3",
|
|
34
|
-
"@types/fs-extra": "9.0.13",
|
|
35
|
-
"@types/lodash": "4.14.181",
|
|
36
|
-
"@types/node": "17.0.23",
|
|
37
|
-
"@types/semver": "7.3.9",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "5.17.0",
|
|
39
|
-
"@typescript-eslint/parser": "5.17.0",
|
|
40
|
-
"eslint": "8.12.0",
|
|
41
|
-
"eslint-plugin-react-hooks": "4.4.0",
|
|
42
|
-
"ts-node": "10.7.0",
|
|
43
|
-
"tsc-alias": "1.6.6",
|
|
44
|
-
"tsconfig-paths": "3.14.1",
|
|
45
|
-
"typescript": "4.6.3"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@clickview/ship-it",
|
|
3
|
+
"version": "0.0.21",
|
|
4
|
+
"description": "Release Manager",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ship-it": "./lib/src/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "npm run lint && ts-node --files src/index.ts",
|
|
11
|
+
"build": "npm run lint && tsc -p . && tsc-alias -p tsconfig.json",
|
|
12
|
+
"lint": "eslint . --ext .ts"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://gitlab.cvinternal.net/front-end/ship-it.git"
|
|
17
|
+
},
|
|
18
|
+
"author": "Joshua Taylor, Shale Kuzmanovski",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@gitbeaker/node": "35.6.0",
|
|
22
|
+
"chalk": "4.1.2",
|
|
23
|
+
"commander": "9.1.0",
|
|
24
|
+
"fast-csv": "4.3.6",
|
|
25
|
+
"fs-extra": "10.0.1",
|
|
26
|
+
"inversify": "6.0.1",
|
|
27
|
+
"lodash": "4.17.21",
|
|
28
|
+
"reflect-metadata": "0.1.13",
|
|
29
|
+
"semver": "7.3.5",
|
|
30
|
+
"teamcity-rest-api": "0.0.8"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@clickview/eslint-config": "1.0.3",
|
|
34
|
+
"@types/fs-extra": "9.0.13",
|
|
35
|
+
"@types/lodash": "4.14.181",
|
|
36
|
+
"@types/node": "17.0.23",
|
|
37
|
+
"@types/semver": "7.3.9",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.17.0",
|
|
39
|
+
"@typescript-eslint/parser": "5.17.0",
|
|
40
|
+
"eslint": "8.12.0",
|
|
41
|
+
"eslint-plugin-react-hooks": "4.4.0",
|
|
42
|
+
"ts-node": "10.7.0",
|
|
43
|
+
"tsc-alias": "1.6.6",
|
|
44
|
+
"tsconfig-paths": "3.14.1",
|
|
45
|
+
"typescript": "4.6.3"
|
|
46
|
+
}
|
|
47
|
+
}
|