@contentstack/cli-cm-branches 1.3.1 → 1.4.1
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 +20 -20
- package/lib/branch/merge-handler.js +22 -1
- package/lib/commands/cm/branches/index.js +13 -14
- package/lib/utils/branch-diff-utility.js +9 -3
- package/oclif.manifest.json +187 -122
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ npm install -g @contentstack/cli-cm-branches
|
|
|
37
37
|
$ csdx COMMAND
|
|
38
38
|
running command...
|
|
39
39
|
$ csdx (--version)
|
|
40
|
-
@contentstack/cli-cm-branches/1.
|
|
40
|
+
@contentstack/cli-cm-branches/1.4.1 linux-x64 node-v22.14.0
|
|
41
41
|
$ csdx --help [COMMAND]
|
|
42
42
|
USAGE
|
|
43
43
|
$ csdx COMMAND
|
|
@@ -64,7 +64,7 @@ USAGE
|
|
|
64
64
|
|
|
65
65
|
FLAGS
|
|
66
66
|
-k, --stack-api-key=<value> Stack API key
|
|
67
|
-
|
|
67
|
+
--verbose Verbose, display information in detailed format.
|
|
68
68
|
|
|
69
69
|
DESCRIPTION
|
|
70
70
|
List the branches
|
|
@@ -91,8 +91,8 @@ USAGE
|
|
|
91
91
|
|
|
92
92
|
FLAGS
|
|
93
93
|
-k, --stack-api-key=<value> Stack API key
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
--source=<value> Source branch from which a new branch is to be created.
|
|
95
|
+
--uid=<value> Branch UID (unique name) to be created.
|
|
96
96
|
|
|
97
97
|
DESCRIPTION
|
|
98
98
|
Create a new branch
|
|
@@ -119,7 +119,7 @@ USAGE
|
|
|
119
119
|
FLAGS
|
|
120
120
|
-k, --stack-api-key=<value> Stack API key
|
|
121
121
|
-y, --yes Force the deletion of the branch by skipping the confirmation
|
|
122
|
-
|
|
122
|
+
--uid=<value> Branch UID to be deleted
|
|
123
123
|
|
|
124
124
|
DESCRIPTION
|
|
125
125
|
Delete a branch
|
|
@@ -145,14 +145,14 @@ USAGE
|
|
|
145
145
|
$ csdx cm:branches:diff [--base-branch <value>] [--compare-branch <value>] [-k <value>][--module <value>]
|
|
146
146
|
|
|
147
147
|
FLAGS
|
|
148
|
-
-k, --stack-api-key=<value>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
-k, --stack-api-key=<value> [optional] Provide the stack API key to show the difference between branches.
|
|
149
|
+
--base-branch=<value> [optional] Base branch (Target branch).
|
|
150
|
+
--compare-branch=<value> [optional] Compare branch (Source branch).
|
|
151
|
+
--format=<option> [default: compact-text] [default: compact-text] [optional] Type of flags to show the
|
|
152
|
+
difference between two branches. <options: compact-text, detailed-text>
|
|
153
|
+
<options: compact-text|detailed-text>
|
|
154
|
+
--module=<option> [optional] Module. <options: content-types, global-fields, all>
|
|
155
|
+
<options: content-types|global-fields|all>
|
|
156
156
|
|
|
157
157
|
DESCRIPTION
|
|
158
158
|
Differences between two branches
|
|
@@ -195,13 +195,13 @@ USAGE
|
|
|
195
195
|
[--use-merge-summary <value>] [--comment <value>] [--base-branch <value>]
|
|
196
196
|
|
|
197
197
|
FLAGS
|
|
198
|
-
-k, --stack-api-key=<value>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
198
|
+
-k, --stack-api-key=<value> [optional] Provide stack API key to show the difference between the branches.
|
|
199
|
+
--base-branch=<value> [optional] Base branch (Target branch).
|
|
200
|
+
--comment=<value> [optional] Pass a comment.
|
|
201
|
+
--compare-branch=<value> [optional] Compare branch (Source branch).
|
|
202
|
+
--export-summary-path=<value> [optional] Export summary file path.
|
|
203
|
+
--no-revert [optional] If passed, will not create the new revert branch.
|
|
204
|
+
--use-merge-summary=<value> [optional] Path of merge summary file.
|
|
205
205
|
|
|
206
206
|
DESCRIPTION
|
|
207
207
|
Merge changes from a branch
|
|
@@ -5,6 +5,7 @@ const os_1 = tslib_1.__importDefault(require("os"));
|
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const forEach_1 = tslib_1.__importDefault(require("lodash/forEach"));
|
|
7
7
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
9
|
const utils_1 = require("../utils");
|
|
9
10
|
class MergeHandler {
|
|
10
11
|
constructor(options) {
|
|
@@ -83,6 +84,10 @@ class MergeHandler {
|
|
|
83
84
|
deleted: [],
|
|
84
85
|
};
|
|
85
86
|
const selectedItems = await (0, utils_1.selectCustomPreferences)(module, this.branchCompareData[module]);
|
|
87
|
+
if (!selectedItems.length) {
|
|
88
|
+
cli_utilities_1.cliux.print(chalk_1.default.red('No items were selected'));
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
86
91
|
(0, forEach_1.default)(selectedItems, (item) => {
|
|
87
92
|
this.mergeSettings.mergeContent[module][item.status].push(item.value);
|
|
88
93
|
this.mergeSettings.itemMergeStrategies.push(item.value);
|
|
@@ -115,7 +120,12 @@ class MergeHandler {
|
|
|
115
120
|
else if (this.strategy === 'overwrite_with_compare') {
|
|
116
121
|
this.mergeSettings.strategy = 'overwrite_with_compare';
|
|
117
122
|
}
|
|
118
|
-
|
|
123
|
+
if (this.checkEmptySelection()) {
|
|
124
|
+
cli_utilities_1.cliux.print(chalk_1.default.red('No items selected'));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
await this.displayMergeSummary();
|
|
128
|
+
}
|
|
119
129
|
if (!this.executeOption) {
|
|
120
130
|
const executionResponse = await (0, utils_1.selectMergeExecution)();
|
|
121
131
|
if (executionResponse === 'previous') {
|
|
@@ -135,6 +145,17 @@ class MergeHandler {
|
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
147
|
}
|
|
148
|
+
checkEmptySelection() {
|
|
149
|
+
var _a, _b, _c, _d, _e, _f;
|
|
150
|
+
for (let module in this.branchCompareData) {
|
|
151
|
+
if (((_b = (_a = this.mergeSettings.mergeContent[module]) === null || _a === void 0 ? void 0 : _a.modified) === null || _b === void 0 ? void 0 : _b.length)
|
|
152
|
+
|| ((_d = (_c = this.mergeSettings.mergeContent[module]) === null || _c === void 0 ? void 0 : _c.added) === null || _d === void 0 ? void 0 : _d.length)
|
|
153
|
+
|| ((_f = (_e = this.mergeSettings.mergeContent[module]) === null || _e === void 0 ? void 0 : _e.deleted) === null || _f === void 0 ? void 0 : _f.length)) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
138
159
|
displayMergeSummary() {
|
|
139
160
|
if (this.mergeSettings.strategy !== 'ignore') {
|
|
140
161
|
for (let module in this.branchCompareData) {
|
|
@@ -47,25 +47,24 @@ class BranchListCommand extends cli_command_1.Command {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const tableHeaders = [
|
|
51
|
+
{
|
|
52
|
+
value: 'Branch',
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
{
|
|
55
|
+
value: 'Source',
|
|
56
56
|
},
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
{
|
|
58
|
+
value: 'Aliases',
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
{
|
|
61
|
+
value: 'Created',
|
|
62
62
|
},
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
{
|
|
64
|
+
value: 'Updated',
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
66
|
+
];
|
|
67
|
+
cli_utilities_1.cliux.table(tableHeaders, branches);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}
|
|
@@ -181,13 +181,19 @@ function printCompactTextView(branchTextRes) {
|
|
|
181
181
|
if (((_a = branchTextRes.modified) === null || _a === void 0 ? void 0 : _a.length) || ((_b = branchTextRes.added) === null || _b === void 0 ? void 0 : _b.length) || ((_c = branchTextRes.deleted) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
182
182
|
cli_utilities_1.cliux.print(' ');
|
|
183
183
|
(0, forEach_1.default)(branchTextRes.added, (diff) => {
|
|
184
|
-
|
|
184
|
+
if (diff.merge_strategy !== 'ignore') {
|
|
185
|
+
cli_utilities_1.cliux.print(chalk_1.default.green(`+ '${diff.title}' ${(0, startCase_1.default)((0, camelCase_1.default)(diff.type))}`));
|
|
186
|
+
}
|
|
185
187
|
});
|
|
186
188
|
(0, forEach_1.default)(branchTextRes.modified, (diff) => {
|
|
187
|
-
|
|
189
|
+
if (diff.merge_strategy !== 'ignore') {
|
|
190
|
+
cli_utilities_1.cliux.print(chalk_1.default.blue(`± '${diff.title}' ${(0, startCase_1.default)((0, camelCase_1.default)(diff.type))}`));
|
|
191
|
+
}
|
|
188
192
|
});
|
|
189
193
|
(0, forEach_1.default)(branchTextRes.deleted, (diff) => {
|
|
190
|
-
|
|
194
|
+
if (diff.merge_strategy !== 'ignore') {
|
|
195
|
+
cli_utilities_1.cliux.print(chalk_1.default.red(`- '${diff.title}' ${(0, startCase_1.default)((0, camelCase_1.default)(diff.type))}`));
|
|
196
|
+
}
|
|
191
197
|
});
|
|
192
198
|
}
|
|
193
199
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.3.1",
|
|
3
2
|
"commands": {
|
|
4
3
|
"cm:branches:create": {
|
|
5
|
-
"id": "cm:branches:create",
|
|
6
|
-
"description": "Create a new branch",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"usage": [
|
|
9
|
-
"cm:branches:create",
|
|
10
|
-
"cm:branches:create [--source <value>] [--uid <value>] [-k <value>]",
|
|
11
|
-
"cm:branches:create [--source <value>] [--uid <value>] [--stack-api-key <value>]"
|
|
12
|
-
],
|
|
13
|
-
"pluginName": "@contentstack/cli-cm-branches",
|
|
14
|
-
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
15
|
-
"pluginType": "core",
|
|
16
4
|
"aliases": [],
|
|
17
|
-
"
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Create a new branch",
|
|
18
7
|
"examples": [
|
|
19
8
|
"csdx cm:branches:create",
|
|
20
9
|
"csdx cm:branches:create --source main -uid new_branch -k bltxxxxxxxx",
|
|
@@ -22,40 +11,53 @@
|
|
|
22
11
|
],
|
|
23
12
|
"flags": {
|
|
24
13
|
"uid": {
|
|
25
|
-
"name": "uid",
|
|
26
|
-
"type": "option",
|
|
27
14
|
"description": "Branch UID (unique name) to be created.",
|
|
28
|
-
"
|
|
15
|
+
"name": "uid",
|
|
16
|
+
"hasDynamicHelp": false,
|
|
17
|
+
"multiple": false,
|
|
18
|
+
"type": "option"
|
|
29
19
|
},
|
|
30
20
|
"source": {
|
|
31
|
-
"name": "source",
|
|
32
|
-
"type": "option",
|
|
33
21
|
"description": "Source branch from which a new branch is to be created.",
|
|
34
|
-
"
|
|
22
|
+
"name": "source",
|
|
23
|
+
"hasDynamicHelp": false,
|
|
24
|
+
"multiple": false,
|
|
25
|
+
"type": "option"
|
|
35
26
|
},
|
|
36
27
|
"stack-api-key": {
|
|
37
|
-
"name": "stack-api-key",
|
|
38
|
-
"type": "option",
|
|
39
28
|
"char": "k",
|
|
40
29
|
"description": "Stack API key",
|
|
41
|
-
"
|
|
30
|
+
"name": "stack-api-key",
|
|
31
|
+
"hasDynamicHelp": false,
|
|
32
|
+
"multiple": false,
|
|
33
|
+
"type": "option"
|
|
42
34
|
}
|
|
43
35
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
36
|
+
"hasDynamicHelp": false,
|
|
37
|
+
"hiddenAliases": [],
|
|
38
|
+
"id": "cm:branches:create",
|
|
39
|
+
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
40
|
+
"pluginName": "@contentstack/cli-cm-branches",
|
|
41
|
+
"pluginType": "core",
|
|
49
42
|
"strict": true,
|
|
50
43
|
"usage": [
|
|
51
|
-
"cm:branches:
|
|
52
|
-
"cm:branches:
|
|
44
|
+
"cm:branches:create",
|
|
45
|
+
"cm:branches:create [--source <value>] [--uid <value>] [-k <value>]",
|
|
46
|
+
"cm:branches:create [--source <value>] [--uid <value>] [--stack-api-key <value>]"
|
|
53
47
|
],
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
48
|
+
"isESM": false,
|
|
49
|
+
"relativePath": [
|
|
50
|
+
"lib",
|
|
51
|
+
"commands",
|
|
52
|
+
"cm",
|
|
53
|
+
"branches",
|
|
54
|
+
"create.js"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"cm:branches:delete": {
|
|
57
58
|
"aliases": [],
|
|
58
|
-
"
|
|
59
|
+
"args": {},
|
|
60
|
+
"description": "Delete a branch",
|
|
59
61
|
"examples": [
|
|
60
62
|
"csdx cm:branches:delete",
|
|
61
63
|
"csdx cm:branches:delete --uid main -k bltxxxxxxxx",
|
|
@@ -64,38 +66,52 @@
|
|
|
64
66
|
],
|
|
65
67
|
"flags": {
|
|
66
68
|
"uid": {
|
|
67
|
-
"name": "uid",
|
|
68
|
-
"type": "option",
|
|
69
69
|
"description": "Branch UID to be deleted",
|
|
70
|
-
"
|
|
70
|
+
"name": "uid",
|
|
71
|
+
"hasDynamicHelp": false,
|
|
72
|
+
"multiple": false,
|
|
73
|
+
"type": "option"
|
|
71
74
|
},
|
|
72
75
|
"stack-api-key": {
|
|
73
|
-
"name": "stack-api-key",
|
|
74
|
-
"type": "option",
|
|
75
76
|
"char": "k",
|
|
76
77
|
"description": "Stack API key",
|
|
77
|
-
"
|
|
78
|
+
"name": "stack-api-key",
|
|
79
|
+
"hasDynamicHelp": false,
|
|
80
|
+
"multiple": false,
|
|
81
|
+
"type": "option"
|
|
78
82
|
},
|
|
79
83
|
"yes": {
|
|
80
|
-
"name": "yes",
|
|
81
|
-
"type": "boolean",
|
|
82
84
|
"char": "y",
|
|
83
85
|
"description": "Force the deletion of the branch by skipping the confirmation",
|
|
84
|
-
"
|
|
86
|
+
"name": "yes",
|
|
87
|
+
"allowNo": false,
|
|
88
|
+
"type": "boolean"
|
|
85
89
|
}
|
|
86
90
|
},
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"id": "cm:branches:diff",
|
|
91
|
-
"description": "Differences between two branches",
|
|
92
|
-
"strict": true,
|
|
93
|
-
"usage": "cm:branches:diff [--base-branch <value>] [--compare-branch <value>] [-k <value>][--module <value>]",
|
|
94
|
-
"pluginName": "@contentstack/cli-cm-branches",
|
|
91
|
+
"hasDynamicHelp": false,
|
|
92
|
+
"hiddenAliases": [],
|
|
93
|
+
"id": "cm:branches:delete",
|
|
95
94
|
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
95
|
+
"pluginName": "@contentstack/cli-cm-branches",
|
|
96
96
|
"pluginType": "core",
|
|
97
|
+
"strict": true,
|
|
98
|
+
"usage": [
|
|
99
|
+
"cm:branches:delete [-uid <value>] [-k <value>]",
|
|
100
|
+
"cm:branches:delete [--uid <value>] [--stack-api-key <value>]"
|
|
101
|
+
],
|
|
102
|
+
"isESM": false,
|
|
103
|
+
"relativePath": [
|
|
104
|
+
"lib",
|
|
105
|
+
"commands",
|
|
106
|
+
"cm",
|
|
107
|
+
"branches",
|
|
108
|
+
"delete.js"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"cm:branches:diff": {
|
|
97
112
|
"aliases": [],
|
|
98
|
-
"
|
|
113
|
+
"args": {},
|
|
114
|
+
"description": "Differences between two branches",
|
|
99
115
|
"examples": [
|
|
100
116
|
"csdx cm:branches:diff",
|
|
101
117
|
"csdx cm:branches:diff --stack-api-key \"bltxxxxxxxx\"",
|
|
@@ -112,59 +128,73 @@
|
|
|
112
128
|
],
|
|
113
129
|
"flags": {
|
|
114
130
|
"base-branch": {
|
|
115
|
-
"name": "base-branch",
|
|
116
|
-
"type": "option",
|
|
117
131
|
"description": "[optional] Base branch (Target branch).",
|
|
118
|
-
"
|
|
132
|
+
"name": "base-branch",
|
|
133
|
+
"hasDynamicHelp": false,
|
|
134
|
+
"multiple": false,
|
|
135
|
+
"type": "option"
|
|
119
136
|
},
|
|
120
137
|
"compare-branch": {
|
|
121
|
-
"name": "compare-branch",
|
|
122
|
-
"type": "option",
|
|
123
138
|
"description": "[optional] Compare branch (Source branch).",
|
|
124
|
-
"
|
|
139
|
+
"name": "compare-branch",
|
|
140
|
+
"hasDynamicHelp": false,
|
|
141
|
+
"multiple": false,
|
|
142
|
+
"type": "option"
|
|
125
143
|
},
|
|
126
144
|
"module": {
|
|
127
|
-
"name": "module",
|
|
128
|
-
"type": "option",
|
|
129
145
|
"description": "[optional] Module. <options: content-types, global-fields, all>",
|
|
146
|
+
"name": "module",
|
|
147
|
+
"hasDynamicHelp": false,
|
|
130
148
|
"multiple": false,
|
|
131
149
|
"options": [
|
|
132
150
|
"content-types",
|
|
133
151
|
"global-fields",
|
|
134
152
|
"all"
|
|
135
|
-
]
|
|
153
|
+
],
|
|
154
|
+
"type": "option"
|
|
136
155
|
},
|
|
137
156
|
"stack-api-key": {
|
|
138
|
-
"name": "stack-api-key",
|
|
139
|
-
"type": "option",
|
|
140
157
|
"char": "k",
|
|
141
158
|
"description": "[optional] Provide the stack API key to show the difference between branches.",
|
|
142
|
-
"
|
|
159
|
+
"name": "stack-api-key",
|
|
160
|
+
"hasDynamicHelp": false,
|
|
161
|
+
"multiple": false,
|
|
162
|
+
"type": "option"
|
|
143
163
|
},
|
|
144
164
|
"format": {
|
|
145
|
-
"name": "format",
|
|
146
|
-
"type": "option",
|
|
147
165
|
"description": "[default: compact-text] [optional] Type of flags to show the difference between two branches. <options: compact-text, detailed-text>",
|
|
166
|
+
"name": "format",
|
|
167
|
+
"default": "compact-text",
|
|
168
|
+
"hasDynamicHelp": false,
|
|
148
169
|
"multiple": false,
|
|
149
170
|
"options": [
|
|
150
171
|
"compact-text",
|
|
151
172
|
"detailed-text"
|
|
152
173
|
],
|
|
153
|
-
"
|
|
174
|
+
"type": "option"
|
|
154
175
|
}
|
|
155
176
|
},
|
|
156
|
-
"
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
"id": "cm:branches",
|
|
160
|
-
"description": "List the branches",
|
|
161
|
-
"strict": true,
|
|
162
|
-
"usage": "cm:branches",
|
|
163
|
-
"pluginName": "@contentstack/cli-cm-branches",
|
|
177
|
+
"hasDynamicHelp": false,
|
|
178
|
+
"hiddenAliases": [],
|
|
179
|
+
"id": "cm:branches:diff",
|
|
164
180
|
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
181
|
+
"pluginName": "@contentstack/cli-cm-branches",
|
|
165
182
|
"pluginType": "core",
|
|
183
|
+
"strict": true,
|
|
184
|
+
"usage": "cm:branches:diff [--base-branch <value>] [--compare-branch <value>] [-k <value>][--module <value>]",
|
|
185
|
+
"isESM": false,
|
|
186
|
+
"relativePath": [
|
|
187
|
+
"lib",
|
|
188
|
+
"commands",
|
|
189
|
+
"cm",
|
|
190
|
+
"branches",
|
|
191
|
+
"diff.js"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"cm:branches": {
|
|
166
195
|
"aliases": [],
|
|
167
|
-
"
|
|
196
|
+
"args": {},
|
|
197
|
+
"description": "List the branches",
|
|
168
198
|
"examples": [
|
|
169
199
|
"csdx cm:branches",
|
|
170
200
|
"csdx cm:branches --verbose",
|
|
@@ -172,31 +202,41 @@
|
|
|
172
202
|
],
|
|
173
203
|
"flags": {
|
|
174
204
|
"stack-api-key": {
|
|
175
|
-
"name": "stack-api-key",
|
|
176
|
-
"type": "option",
|
|
177
205
|
"char": "k",
|
|
178
206
|
"description": "Stack API key",
|
|
179
|
-
"
|
|
207
|
+
"name": "stack-api-key",
|
|
208
|
+
"hasDynamicHelp": false,
|
|
209
|
+
"multiple": false,
|
|
210
|
+
"type": "option"
|
|
180
211
|
},
|
|
181
212
|
"verbose": {
|
|
182
|
-
"name": "verbose",
|
|
183
|
-
"type": "boolean",
|
|
184
213
|
"description": "Verbose, display information in detailed format.",
|
|
185
|
-
"
|
|
214
|
+
"name": "verbose",
|
|
215
|
+
"allowNo": false,
|
|
216
|
+
"type": "boolean"
|
|
186
217
|
}
|
|
187
218
|
},
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"id": "cm:branches:merge",
|
|
192
|
-
"description": "Merge changes from a branch",
|
|
193
|
-
"strict": true,
|
|
194
|
-
"usage": "cm:branches:merge [-k <value>][--compare-branch <value>] [--no-revert] [--export-summary-path <value>] [--use-merge-summary <value>] [--comment <value>] [--base-branch <value>]",
|
|
195
|
-
"pluginName": "@contentstack/cli-cm-branches",
|
|
219
|
+
"hasDynamicHelp": false,
|
|
220
|
+
"hiddenAliases": [],
|
|
221
|
+
"id": "cm:branches",
|
|
196
222
|
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
223
|
+
"pluginName": "@contentstack/cli-cm-branches",
|
|
197
224
|
"pluginType": "core",
|
|
225
|
+
"strict": true,
|
|
226
|
+
"usage": "cm:branches",
|
|
227
|
+
"isESM": false,
|
|
228
|
+
"relativePath": [
|
|
229
|
+
"lib",
|
|
230
|
+
"commands",
|
|
231
|
+
"cm",
|
|
232
|
+
"branches",
|
|
233
|
+
"index.js"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"cm:branches:merge": {
|
|
198
237
|
"aliases": [],
|
|
199
|
-
"
|
|
238
|
+
"args": {},
|
|
239
|
+
"description": "Merge changes from a branch",
|
|
200
240
|
"examples": [
|
|
201
241
|
"csdx cm:branches:merge --stack-api-key bltxxxxxxxx --compare-branch feature-branch",
|
|
202
242
|
"csdx cm:branches:merge --stack-api-key bltxxxxxxxx --comment \"merge comment\"",
|
|
@@ -208,87 +248,112 @@
|
|
|
208
248
|
],
|
|
209
249
|
"flags": {
|
|
210
250
|
"compare-branch": {
|
|
211
|
-
"name": "compare-branch",
|
|
212
|
-
"type": "option",
|
|
213
251
|
"description": "[optional] Compare branch (Source branch).",
|
|
214
|
-
"
|
|
252
|
+
"name": "compare-branch",
|
|
253
|
+
"hasDynamicHelp": false,
|
|
254
|
+
"multiple": false,
|
|
255
|
+
"type": "option"
|
|
215
256
|
},
|
|
216
257
|
"base-branch": {
|
|
217
|
-
"name": "base-branch",
|
|
218
|
-
"type": "option",
|
|
219
258
|
"description": "[optional] Base branch (Target branch).",
|
|
220
|
-
"
|
|
259
|
+
"name": "base-branch",
|
|
260
|
+
"hasDynamicHelp": false,
|
|
261
|
+
"multiple": false,
|
|
262
|
+
"type": "option"
|
|
221
263
|
},
|
|
222
264
|
"comment": {
|
|
223
|
-
"name": "comment",
|
|
224
|
-
"type": "option",
|
|
225
265
|
"description": "[optional] Pass a comment.",
|
|
226
|
-
"
|
|
266
|
+
"name": "comment",
|
|
267
|
+
"hasDynamicHelp": false,
|
|
268
|
+
"multiple": false,
|
|
269
|
+
"type": "option"
|
|
227
270
|
},
|
|
228
271
|
"stack-api-key": {
|
|
229
|
-
"name": "stack-api-key",
|
|
230
|
-
"type": "option",
|
|
231
272
|
"char": "k",
|
|
232
273
|
"description": "[optional] Provide stack API key to show the difference between the branches.",
|
|
233
|
-
"
|
|
274
|
+
"name": "stack-api-key",
|
|
275
|
+
"hasDynamicHelp": false,
|
|
276
|
+
"multiple": false,
|
|
277
|
+
"type": "option"
|
|
234
278
|
},
|
|
235
279
|
"export-summary-path": {
|
|
236
|
-
"name": "export-summary-path",
|
|
237
|
-
"type": "option",
|
|
238
280
|
"description": "[optional] Export summary file path.",
|
|
239
|
-
"
|
|
281
|
+
"name": "export-summary-path",
|
|
282
|
+
"hasDynamicHelp": false,
|
|
283
|
+
"multiple": false,
|
|
284
|
+
"type": "option"
|
|
240
285
|
},
|
|
241
286
|
"use-merge-summary": {
|
|
242
|
-
"name": "use-merge-summary",
|
|
243
|
-
"type": "option",
|
|
244
287
|
"description": "[optional] Path of merge summary file.",
|
|
245
|
-
"
|
|
288
|
+
"name": "use-merge-summary",
|
|
289
|
+
"hasDynamicHelp": false,
|
|
290
|
+
"multiple": false,
|
|
291
|
+
"type": "option"
|
|
246
292
|
},
|
|
247
293
|
"no-revert": {
|
|
248
|
-
"name": "no-revert",
|
|
249
|
-
"type": "boolean",
|
|
250
294
|
"description": "[optional] If passed, will not create the new revert branch.",
|
|
251
|
-
"
|
|
295
|
+
"name": "no-revert",
|
|
296
|
+
"allowNo": false,
|
|
297
|
+
"type": "boolean"
|
|
252
298
|
},
|
|
253
299
|
"strategy": {
|
|
254
|
-
"name": "strategy",
|
|
255
|
-
"type": "option",
|
|
256
300
|
"description": "[hidden] Merge strategy.",
|
|
257
301
|
"hidden": true,
|
|
302
|
+
"name": "strategy",
|
|
303
|
+
"hasDynamicHelp": false,
|
|
258
304
|
"multiple": false,
|
|
259
305
|
"options": [
|
|
260
306
|
"merge_prefer_base",
|
|
261
307
|
"merge_prefer_compare",
|
|
262
308
|
"overwrite_with_compare",
|
|
263
309
|
"custom_preferences"
|
|
264
|
-
]
|
|
310
|
+
],
|
|
311
|
+
"type": "option"
|
|
265
312
|
},
|
|
266
313
|
"strategy-sub-options": {
|
|
267
|
-
"name": "strategy-sub-options",
|
|
268
|
-
"type": "option",
|
|
269
314
|
"description": "[hidden] Merge strategy sub options.",
|
|
270
315
|
"hidden": true,
|
|
316
|
+
"name": "strategy-sub-options",
|
|
317
|
+
"hasDynamicHelp": false,
|
|
271
318
|
"multiple": false,
|
|
272
319
|
"options": [
|
|
273
320
|
"new",
|
|
274
321
|
"modified",
|
|
275
322
|
"both"
|
|
276
|
-
]
|
|
323
|
+
],
|
|
324
|
+
"type": "option"
|
|
277
325
|
},
|
|
278
326
|
"merge-action": {
|
|
279
|
-
"name": "merge-action",
|
|
280
|
-
"type": "option",
|
|
281
327
|
"description": "[hidden] Merge action.",
|
|
282
328
|
"hidden": true,
|
|
329
|
+
"name": "merge-action",
|
|
330
|
+
"hasDynamicHelp": false,
|
|
283
331
|
"multiple": false,
|
|
284
332
|
"options": [
|
|
285
333
|
"export",
|
|
286
334
|
"execute",
|
|
287
335
|
"both"
|
|
288
|
-
]
|
|
336
|
+
],
|
|
337
|
+
"type": "option"
|
|
289
338
|
}
|
|
290
339
|
},
|
|
291
|
-
"
|
|
340
|
+
"hasDynamicHelp": false,
|
|
341
|
+
"hiddenAliases": [],
|
|
342
|
+
"id": "cm:branches:merge",
|
|
343
|
+
"pluginAlias": "@contentstack/cli-cm-branches",
|
|
344
|
+
"pluginName": "@contentstack/cli-cm-branches",
|
|
345
|
+
"pluginType": "core",
|
|
346
|
+
"strict": true,
|
|
347
|
+
"usage": "cm:branches:merge [-k <value>][--compare-branch <value>] [--no-revert] [--export-summary-path <value>] [--use-merge-summary <value>] [--comment <value>] [--base-branch <value>]",
|
|
348
|
+
"isESM": false,
|
|
349
|
+
"relativePath": [
|
|
350
|
+
"lib",
|
|
351
|
+
"commands",
|
|
352
|
+
"cm",
|
|
353
|
+
"branches",
|
|
354
|
+
"merge.js"
|
|
355
|
+
]
|
|
292
356
|
}
|
|
293
|
-
}
|
|
357
|
+
},
|
|
358
|
+
"version": "1.4.1"
|
|
294
359
|
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-branches",
|
|
3
3
|
"description": "Contentstack CLI plugin to do branches operations",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~1.
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
8
|
+
"@contentstack/cli-command": "~1.5.0",
|
|
9
|
+
"@oclif/core": "^4.2.7",
|
|
10
|
+
"@contentstack/cli-utilities": "~1.11.0",
|
|
11
11
|
"chalk": "^4.1.2",
|
|
12
12
|
"just-diff": "^6.0.2",
|
|
13
13
|
"lodash": "^4.17.21"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@contentstack/cli-dev-dependencies": "~1.
|
|
17
|
-
"@oclif/plugin-help": "^
|
|
16
|
+
"@contentstack/cli-dev-dependencies": "~1.3.0",
|
|
17
|
+
"@oclif/plugin-help": "^6.2.25",
|
|
18
18
|
"@types/flat": "^5.0.5",
|
|
19
19
|
"chai": "^4.5.0",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"dotenv-expand": "^9.0.0",
|
|
22
22
|
"eslint": "^8.57.1",
|
|
23
|
-
"eslint-config-oclif": "^
|
|
23
|
+
"eslint-config-oclif": "^6.0.15",
|
|
24
24
|
"mocha": "10.8.2",
|
|
25
25
|
"nyc": "^15.1.0",
|
|
26
|
-
"oclif": "^
|
|
26
|
+
"oclif": "^4.17.30",
|
|
27
27
|
"sinon": "^19.0.2",
|
|
28
28
|
"ts-node": "^10.9.2",
|
|
29
29
|
"typescript": "^4.9.5"
|