@contentstack/cli-cm-branches 1.3.0 → 1.4.0

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 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.3.0 linux-x64 node-v22.14.0
40
+ @contentstack/cli-cm-branches/1.4.0 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
- --verbose Verbose, display information in detailed format.
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
- --source=<value> Source branch from which a new branch is to be created.
95
- --uid=<value> Branch UID (unique name) to be created.
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
- --uid=<value> Branch UID to be deleted
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> [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>
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> [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.
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
@@ -47,25 +47,24 @@ class BranchListCommand extends cli_command_1.Command {
47
47
  });
48
48
  }
49
49
  else {
50
- cli_utilities_1.cliux.table(branches, {
51
- Branch: {
52
- minWidth: 8,
50
+ const tableHeaders = [
51
+ {
52
+ value: 'Branch',
53
53
  },
54
- Source: {
55
- minWidth: 8,
54
+ {
55
+ value: 'Source',
56
56
  },
57
- Aliases: {
58
- minWidth: 8,
57
+ {
58
+ value: 'Aliases',
59
59
  },
60
- Created: {
61
- minWidth: 8,
60
+ {
61
+ value: 'Created',
62
62
  },
63
- Updated: {
64
- minWidth: 8,
63
+ {
64
+ value: 'Updated',
65
65
  },
66
- }, {
67
- printLine: cli_utilities_1.cliux.print,
68
- });
66
+ ];
67
+ cli_utilities_1.cliux.table(tableHeaders, branches);
69
68
  }
70
69
  }
71
70
  }
@@ -1,20 +1,9 @@
1
1
  {
2
- "version": "1.3.0",
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
- "hiddenAliases": [],
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
30
+ "name": "stack-api-key",
31
+ "hasDynamicHelp": false,
32
+ "multiple": false,
33
+ "type": "option"
42
34
  }
43
35
  },
44
- "args": {}
45
- },
46
- "cm:branches:delete": {
47
- "id": "cm:branches:delete",
48
- "description": "Delete a branch",
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:delete [-uid <value>] [-k <value>]",
52
- "cm:branches:delete [--uid <value>] [--stack-api-key <value>]"
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
- "pluginName": "@contentstack/cli-cm-branches",
55
- "pluginAlias": "@contentstack/cli-cm-branches",
56
- "pluginType": "core",
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
- "hiddenAliases": [],
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
- "multiple": false
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
- "multiple": false
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
- "allowNo": false
86
+ "name": "yes",
87
+ "allowNo": false,
88
+ "type": "boolean"
85
89
  }
86
90
  },
87
- "args": {}
88
- },
89
- "cm:branches:diff": {
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
- "hiddenAliases": [],
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
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
- "default": "compact-text"
174
+ "type": "option"
154
175
  }
155
176
  },
156
- "args": {}
157
- },
158
- "cm:branches": {
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
- "hiddenAliases": [],
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
- "multiple": false
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
- "allowNo": false
214
+ "name": "verbose",
215
+ "allowNo": false,
216
+ "type": "boolean"
186
217
  }
187
218
  },
188
- "args": {}
189
- },
190
- "cm:branches:merge": {
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
- "hiddenAliases": [],
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
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
- "multiple": false
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
- "allowNo": false
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
- "args": {}
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.0"
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.3.0",
4
+ "version": "1.4.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "~1.3.3",
9
- "@contentstack/cli-utilities": "~1.8.4",
10
- "@oclif/core": "^3.27.0",
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.2.4",
17
- "@oclif/plugin-help": "^5.2.20",
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": "^4.0.0",
23
+ "eslint-config-oclif": "^6.0.15",
24
24
  "mocha": "10.8.2",
25
25
  "nyc": "^15.1.0",
26
- "oclif": "^3.17.2",
26
+ "oclif": "^4.17.30",
27
27
  "sinon": "^19.0.2",
28
28
  "ts-node": "^10.9.2",
29
29
  "typescript": "^4.9.5"