@knocklabs/cli 0.1.0-rc.2 → 0.1.0-rc.4
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 +82 -6
- package/dist/commands/commit/index.js +4 -18
- package/dist/commands/commit/promote.js +4 -17
- package/dist/commands/translation/list.js +82 -0
- package/dist/commands/translation/pull.js +124 -0
- package/dist/commands/translation/push.js +130 -0
- package/dist/commands/translation/validate.js +122 -0
- package/dist/commands/workflow/activate.js +5 -18
- package/dist/commands/workflow/new.js +3 -3
- package/dist/commands/workflow/pull.js +70 -17
- package/dist/commands/workflow/push.js +3 -3
- package/dist/commands/workflow/validate.js +3 -3
- package/dist/lib/api-v1.js +38 -2
- package/dist/lib/base-command.js +2 -2
- package/dist/lib/helpers/error.js +16 -8
- package/dist/lib/helpers/flag.js +63 -3
- package/dist/lib/helpers/fs.js +52 -0
- package/dist/lib/helpers/json.js +6 -2
- package/dist/lib/helpers/object.js +43 -0
- package/dist/lib/helpers/page.js +3 -1
- package/dist/lib/helpers/request.js +17 -49
- package/dist/lib/helpers/ux.js +42 -0
- package/dist/lib/marshal/translation/helpers.js +185 -0
- package/dist/lib/marshal/translation/index.js +19 -0
- package/dist/lib/marshal/translation/reader.js +118 -0
- package/dist/lib/marshal/translation/types.js +4 -0
- package/dist/lib/marshal/translation/writer.js +86 -0
- package/dist/lib/marshal/workflow/generator.js +46 -5
- package/dist/lib/marshal/workflow/helpers.js +2 -0
- package/dist/lib/marshal/workflow/reader.js +136 -117
- package/dist/lib/marshal/workflow/writer.js +235 -98
- package/dist/lib/{helpers/dir-context.js → run-context/helpers.js} +1 -1
- package/dist/lib/run-context/index.js +22 -0
- package/dist/lib/{run-context.js → run-context/loader.js} +22 -7
- package/dist/lib/run-context/types.js +4 -0
- package/oclif.manifest.json +253 -1
- package/package.json +11 -10
- package/dist/lib/helpers/spinner.js +0 -20
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.0-rc.
|
|
2
|
+
"version": "0.1.0-rc.4",
|
|
3
3
|
"commands": {
|
|
4
4
|
"ping": {
|
|
5
5
|
"id": "ping",
|
|
@@ -114,6 +114,240 @@
|
|
|
114
114
|
},
|
|
115
115
|
"args": {}
|
|
116
116
|
},
|
|
117
|
+
"translation:list": {
|
|
118
|
+
"id": "translation:list",
|
|
119
|
+
"strict": true,
|
|
120
|
+
"pluginName": "@knocklabs/cli",
|
|
121
|
+
"pluginAlias": "@knocklabs/cli",
|
|
122
|
+
"pluginType": "core",
|
|
123
|
+
"aliases": [],
|
|
124
|
+
"flags": {
|
|
125
|
+
"service-token": {
|
|
126
|
+
"name": "service-token",
|
|
127
|
+
"type": "option",
|
|
128
|
+
"summary": "The service token to authenticate with",
|
|
129
|
+
"required": true,
|
|
130
|
+
"multiple": false
|
|
131
|
+
},
|
|
132
|
+
"api-origin": {
|
|
133
|
+
"name": "api-origin",
|
|
134
|
+
"type": "option",
|
|
135
|
+
"hidden": true,
|
|
136
|
+
"required": false,
|
|
137
|
+
"multiple": false
|
|
138
|
+
},
|
|
139
|
+
"environment": {
|
|
140
|
+
"name": "environment",
|
|
141
|
+
"type": "option",
|
|
142
|
+
"multiple": false,
|
|
143
|
+
"default": "development"
|
|
144
|
+
},
|
|
145
|
+
"hide-uncommitted-changes": {
|
|
146
|
+
"name": "hide-uncommitted-changes",
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"allowNo": false
|
|
149
|
+
},
|
|
150
|
+
"after": {
|
|
151
|
+
"name": "after",
|
|
152
|
+
"type": "option",
|
|
153
|
+
"multiple": false
|
|
154
|
+
},
|
|
155
|
+
"before": {
|
|
156
|
+
"name": "before",
|
|
157
|
+
"type": "option",
|
|
158
|
+
"multiple": false
|
|
159
|
+
},
|
|
160
|
+
"limit": {
|
|
161
|
+
"name": "limit",
|
|
162
|
+
"type": "option",
|
|
163
|
+
"multiple": false
|
|
164
|
+
},
|
|
165
|
+
"json": {
|
|
166
|
+
"name": "json",
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"description": "Format output as json.",
|
|
169
|
+
"helpGroup": "GLOBAL",
|
|
170
|
+
"allowNo": false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"args": {}
|
|
174
|
+
},
|
|
175
|
+
"translation:pull": {
|
|
176
|
+
"id": "translation:pull",
|
|
177
|
+
"strict": true,
|
|
178
|
+
"pluginName": "@knocklabs/cli",
|
|
179
|
+
"pluginAlias": "@knocklabs/cli",
|
|
180
|
+
"pluginType": "core",
|
|
181
|
+
"aliases": [],
|
|
182
|
+
"flags": {
|
|
183
|
+
"service-token": {
|
|
184
|
+
"name": "service-token",
|
|
185
|
+
"type": "option",
|
|
186
|
+
"summary": "The service token to authenticate with",
|
|
187
|
+
"required": true,
|
|
188
|
+
"multiple": false
|
|
189
|
+
},
|
|
190
|
+
"api-origin": {
|
|
191
|
+
"name": "api-origin",
|
|
192
|
+
"type": "option",
|
|
193
|
+
"hidden": true,
|
|
194
|
+
"required": false,
|
|
195
|
+
"multiple": false
|
|
196
|
+
},
|
|
197
|
+
"environment": {
|
|
198
|
+
"name": "environment",
|
|
199
|
+
"type": "option",
|
|
200
|
+
"multiple": false,
|
|
201
|
+
"default": "development"
|
|
202
|
+
},
|
|
203
|
+
"all": {
|
|
204
|
+
"name": "all",
|
|
205
|
+
"type": "boolean",
|
|
206
|
+
"allowNo": false
|
|
207
|
+
},
|
|
208
|
+
"translations-dir": {
|
|
209
|
+
"name": "translations-dir",
|
|
210
|
+
"type": "option",
|
|
211
|
+
"multiple": false,
|
|
212
|
+
"dependsOn": [
|
|
213
|
+
"all"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"hide-uncommitted-changes": {
|
|
217
|
+
"name": "hide-uncommitted-changes",
|
|
218
|
+
"type": "boolean",
|
|
219
|
+
"allowNo": false
|
|
220
|
+
},
|
|
221
|
+
"force": {
|
|
222
|
+
"name": "force",
|
|
223
|
+
"type": "boolean",
|
|
224
|
+
"allowNo": false
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"args": {}
|
|
228
|
+
},
|
|
229
|
+
"translation:push": {
|
|
230
|
+
"id": "translation:push",
|
|
231
|
+
"strict": true,
|
|
232
|
+
"pluginName": "@knocklabs/cli",
|
|
233
|
+
"pluginAlias": "@knocklabs/cli",
|
|
234
|
+
"pluginType": "core",
|
|
235
|
+
"aliases": [],
|
|
236
|
+
"flags": {
|
|
237
|
+
"service-token": {
|
|
238
|
+
"name": "service-token",
|
|
239
|
+
"type": "option",
|
|
240
|
+
"summary": "The service token to authenticate with",
|
|
241
|
+
"required": true,
|
|
242
|
+
"multiple": false
|
|
243
|
+
},
|
|
244
|
+
"api-origin": {
|
|
245
|
+
"name": "api-origin",
|
|
246
|
+
"type": "option",
|
|
247
|
+
"hidden": true,
|
|
248
|
+
"required": false,
|
|
249
|
+
"multiple": false
|
|
250
|
+
},
|
|
251
|
+
"environment": {
|
|
252
|
+
"name": "environment",
|
|
253
|
+
"type": "option",
|
|
254
|
+
"summary": "Pushing a translation is only allowed in the development environment",
|
|
255
|
+
"multiple": false,
|
|
256
|
+
"options": [
|
|
257
|
+
"development"
|
|
258
|
+
],
|
|
259
|
+
"default": "development"
|
|
260
|
+
},
|
|
261
|
+
"all": {
|
|
262
|
+
"name": "all",
|
|
263
|
+
"type": "boolean",
|
|
264
|
+
"allowNo": false
|
|
265
|
+
},
|
|
266
|
+
"translations-dir": {
|
|
267
|
+
"name": "translations-dir",
|
|
268
|
+
"type": "option",
|
|
269
|
+
"multiple": false,
|
|
270
|
+
"dependsOn": [
|
|
271
|
+
"all"
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
"commit": {
|
|
275
|
+
"name": "commit",
|
|
276
|
+
"type": "boolean",
|
|
277
|
+
"summary": "Push and commit the translation(s) at the same time",
|
|
278
|
+
"allowNo": false
|
|
279
|
+
},
|
|
280
|
+
"commit-message": {
|
|
281
|
+
"name": "commit-message",
|
|
282
|
+
"type": "option",
|
|
283
|
+
"char": "m",
|
|
284
|
+
"summary": "Use the given value as the commit message",
|
|
285
|
+
"multiple": false,
|
|
286
|
+
"dependsOn": [
|
|
287
|
+
"commit"
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"args": {
|
|
292
|
+
"translationRef": {
|
|
293
|
+
"name": "translationRef",
|
|
294
|
+
"required": false
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"translation:validate": {
|
|
299
|
+
"id": "translation:validate",
|
|
300
|
+
"strict": true,
|
|
301
|
+
"pluginName": "@knocklabs/cli",
|
|
302
|
+
"pluginAlias": "@knocklabs/cli",
|
|
303
|
+
"pluginType": "core",
|
|
304
|
+
"aliases": [],
|
|
305
|
+
"flags": {
|
|
306
|
+
"service-token": {
|
|
307
|
+
"name": "service-token",
|
|
308
|
+
"type": "option",
|
|
309
|
+
"summary": "The service token to authenticate with",
|
|
310
|
+
"required": true,
|
|
311
|
+
"multiple": false
|
|
312
|
+
},
|
|
313
|
+
"api-origin": {
|
|
314
|
+
"name": "api-origin",
|
|
315
|
+
"type": "option",
|
|
316
|
+
"hidden": true,
|
|
317
|
+
"required": false,
|
|
318
|
+
"multiple": false
|
|
319
|
+
},
|
|
320
|
+
"environment": {
|
|
321
|
+
"name": "environment",
|
|
322
|
+
"type": "option",
|
|
323
|
+
"summary": "Validating a workflow is only done in the development environment",
|
|
324
|
+
"multiple": false,
|
|
325
|
+
"options": [
|
|
326
|
+
"development"
|
|
327
|
+
],
|
|
328
|
+
"default": "development"
|
|
329
|
+
},
|
|
330
|
+
"all": {
|
|
331
|
+
"name": "all",
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"allowNo": false
|
|
334
|
+
},
|
|
335
|
+
"translations-dir": {
|
|
336
|
+
"name": "translations-dir",
|
|
337
|
+
"type": "option",
|
|
338
|
+
"multiple": false,
|
|
339
|
+
"dependsOn": [
|
|
340
|
+
"all"
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"args": {
|
|
345
|
+
"translationRef": {
|
|
346
|
+
"name": "translationRef",
|
|
347
|
+
"required": false
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
117
351
|
"workflow:activate": {
|
|
118
352
|
"id": "workflow:activate",
|
|
119
353
|
"strict": true,
|
|
@@ -343,10 +577,28 @@
|
|
|
343
577
|
"multiple": false,
|
|
344
578
|
"default": "development"
|
|
345
579
|
},
|
|
580
|
+
"all": {
|
|
581
|
+
"name": "all",
|
|
582
|
+
"type": "boolean",
|
|
583
|
+
"allowNo": false
|
|
584
|
+
},
|
|
585
|
+
"workflows-dir": {
|
|
586
|
+
"name": "workflows-dir",
|
|
587
|
+
"type": "option",
|
|
588
|
+
"multiple": false,
|
|
589
|
+
"dependsOn": [
|
|
590
|
+
"all"
|
|
591
|
+
]
|
|
592
|
+
},
|
|
346
593
|
"hide-uncommitted-changes": {
|
|
347
594
|
"name": "hide-uncommitted-changes",
|
|
348
595
|
"type": "boolean",
|
|
349
596
|
"allowNo": false
|
|
597
|
+
},
|
|
598
|
+
"force": {
|
|
599
|
+
"name": "force",
|
|
600
|
+
"type": "boolean",
|
|
601
|
+
"allowNo": false
|
|
350
602
|
}
|
|
351
603
|
},
|
|
352
604
|
"args": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/cli",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.4",
|
|
4
4
|
"description": "Knock CLI",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"bin": {
|
|
@@ -19,25 +19,26 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@oclif/core": "^1.26.2",
|
|
21
21
|
"@oclif/plugin-help": "^5",
|
|
22
|
-
"@oclif/plugin-plugins": "^2.
|
|
23
|
-
"@prantlf/jsonlint": "^11.7.
|
|
24
|
-
"axios": "^1.
|
|
22
|
+
"@oclif/plugin-plugins": "^2.4.7",
|
|
23
|
+
"@prantlf/jsonlint": "^11.7.2",
|
|
24
|
+
"axios": "^1.4.0",
|
|
25
25
|
"date-fns": "^2.29.3",
|
|
26
26
|
"enquirer": "^2.3.6",
|
|
27
27
|
"fs-extra": "^10.1.0",
|
|
28
|
-
"liquidjs": "^10.
|
|
28
|
+
"liquidjs": "^10.7.1",
|
|
29
|
+
"locale-codes": "^1.3.1",
|
|
29
30
|
"lodash": "^4.17.21",
|
|
30
31
|
"yup": "^0.32.11"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@oclif/test": "^2.3.
|
|
34
|
+
"@oclif/test": "^2.3.15",
|
|
34
35
|
"@swc/cli": "^0.1.62",
|
|
35
36
|
"@swc/core": "^1.3.37",
|
|
36
37
|
"@swc/helpers": "^0.4.14",
|
|
37
38
|
"@types/chai": "^4",
|
|
38
39
|
"@types/fs-extra": "^9.0.13",
|
|
39
40
|
"@types/mocha": "^9.0.0",
|
|
40
|
-
"@types/node": "^16.18.
|
|
41
|
+
"@types/node": "^16.18.24",
|
|
41
42
|
"chai": "^4",
|
|
42
43
|
"eslint": "^7.32.0",
|
|
43
44
|
"eslint-config-oclif": "^4",
|
|
@@ -48,11 +49,11 @@
|
|
|
48
49
|
"mocha": "^9",
|
|
49
50
|
"nock": "^13.3.0",
|
|
50
51
|
"oclif": "^3",
|
|
51
|
-
"prettier": "2.8.
|
|
52
|
+
"prettier": "2.8.8",
|
|
52
53
|
"shx": "^0.3.4",
|
|
53
|
-
"sinon": "^15.0.
|
|
54
|
+
"sinon": "^15.0.4",
|
|
54
55
|
"ts-node": "^10.9.1",
|
|
55
|
-
"tsconfig-paths": "^4.
|
|
56
|
+
"tsconfig-paths": "^4.2.0",
|
|
56
57
|
"tslib": "^2.5.0",
|
|
57
58
|
"typescript": "^4.9.5"
|
|
58
59
|
},
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
start: ()=>start,
|
|
13
|
-
stop: ()=>stop
|
|
14
|
-
});
|
|
15
|
-
const _core = require("@oclif/core");
|
|
16
|
-
const _const = require("./const");
|
|
17
|
-
const start = (action)=>{
|
|
18
|
-
if (!_const.isTestEnv) _core.CliUx.ux.action.start(action);
|
|
19
|
-
};
|
|
20
|
-
const stop = ()=>_core.CliUx.ux.action.stop();
|