@sanity/runtime-cli 1.8.1 → 2.0.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 +16 -412
- package/bin/dev.cmd +1 -1
- package/bin/dev.js +1 -1
- package/dist/actions/blueprints/blueprint.js +1 -2
- package/dist/actions/blueprints/index.d.ts +16 -0
- package/dist/actions/blueprints/index.js +16 -0
- package/dist/actions/functions/index.d.ts +10 -0
- package/dist/actions/functions/index.js +10 -0
- package/dist/commands/blueprints/add.js +1 -1
- package/dist/commands/blueprints/config.js +1 -1
- package/dist/commands/blueprints/deploy.js +8 -10
- package/dist/commands/blueprints/info.js +5 -39
- package/dist/commands/blueprints/init.js +1 -2
- package/dist/commands/blueprints/logs.js +18 -16
- package/dist/commands/blueprints/plan.js +2 -4
- package/dist/commands/blueprints/stacks.js +2 -2
- package/dist/commands/functions/invoke.js +4 -5
- package/dist/commands/functions/logs.js +4 -5
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/server/static/vendor/vendor.bundle.d.ts +3 -3
- package/dist/utils/display/blueprints-formatting.d.ts +1 -2
- package/dist/utils/display/blueprints-formatting.js +53 -42
- package/dist/utils/display/colors.d.ts +1 -0
- package/dist/utils/display/colors.js +3 -0
- package/dist/utils/display/dates.js +4 -8
- package/dist/utils/display/index.d.ts +10 -0
- package/dist/utils/display/index.js +10 -0
- package/dist/utils/display/logs-formatting.d.ts +1 -1
- package/dist/utils/display/logs-formatting.js +13 -18
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/vendor/index.d.ts +4 -0
- package/dist/utils/vendor/index.js +4 -0
- package/dist/utils/vendor/parser-validator.d.ts +1 -2
- package/dist/utils/vendor/parser-validator.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +24 -26
- /package/dist/actions/blueprints/{stash-asset.d.ts → assets.d.ts} +0 -0
- /package/dist/actions/blueprints/{stash-asset.js → assets.js} +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@sanity/runtime-cli
|
|
2
|
-
|
|
2
|
+
===================
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Sanity's Runtime CLI for Blueprints and Functions
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
[](https://oclif.io)
|
|
@@ -20,7 +20,7 @@ $ npm install -g @sanity/runtime-cli
|
|
|
20
20
|
$ sanity-run COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ sanity-run (--version)
|
|
23
|
-
@sanity/runtime-cli/
|
|
23
|
+
@sanity/runtime-cli/2.0.0 linux-x64 node-v22.14.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -42,16 +42,6 @@ USAGE
|
|
|
42
42
|
* [`sanity-run functions logs NAME`](#sanity-run-functions-logs-name)
|
|
43
43
|
* [`sanity-run functions test NAME`](#sanity-run-functions-test-name)
|
|
44
44
|
* [`sanity-run help [COMMAND]`](#sanity-run-help-command)
|
|
45
|
-
* [`sanity-run plugins`](#sanity-run-plugins)
|
|
46
|
-
* [`sanity-run plugins add PLUGIN`](#sanity-run-plugins-add-plugin)
|
|
47
|
-
* [`sanity-run plugins:inspect PLUGIN...`](#sanity-run-pluginsinspect-plugin)
|
|
48
|
-
* [`sanity-run plugins install PLUGIN`](#sanity-run-plugins-install-plugin)
|
|
49
|
-
* [`sanity-run plugins link PATH`](#sanity-run-plugins-link-path)
|
|
50
|
-
* [`sanity-run plugins remove [PLUGIN]`](#sanity-run-plugins-remove-plugin)
|
|
51
|
-
* [`sanity-run plugins reset`](#sanity-run-plugins-reset)
|
|
52
|
-
* [`sanity-run plugins uninstall [PLUGIN]`](#sanity-run-plugins-uninstall-plugin)
|
|
53
|
-
* [`sanity-run plugins unlink [PLUGIN]`](#sanity-run-plugins-unlink-plugin)
|
|
54
|
-
* [`sanity-run plugins update`](#sanity-run-plugins-update)
|
|
55
45
|
|
|
56
46
|
## `sanity-run blueprints add TYPE`
|
|
57
47
|
|
|
@@ -71,7 +61,7 @@ EXAMPLES
|
|
|
71
61
|
$ sanity-run blueprints add function
|
|
72
62
|
```
|
|
73
63
|
|
|
74
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
64
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/add.ts)_
|
|
75
65
|
|
|
76
66
|
## `sanity-run blueprints config`
|
|
77
67
|
|
|
@@ -93,7 +83,7 @@ EXAMPLES
|
|
|
93
83
|
$ sanity-run blueprints config --edit
|
|
94
84
|
```
|
|
95
85
|
|
|
96
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
86
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/config.ts)_
|
|
97
87
|
|
|
98
88
|
## `sanity-run blueprints deploy`
|
|
99
89
|
|
|
@@ -110,7 +100,7 @@ EXAMPLES
|
|
|
110
100
|
$ sanity-run blueprints deploy
|
|
111
101
|
```
|
|
112
102
|
|
|
113
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
103
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/deploy.ts)_
|
|
114
104
|
|
|
115
105
|
## `sanity-run blueprints info`
|
|
116
106
|
|
|
@@ -132,7 +122,7 @@ EXAMPLES
|
|
|
132
122
|
$ sanity-run blueprints info --id abc123
|
|
133
123
|
```
|
|
134
124
|
|
|
135
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
125
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/info.ts)_
|
|
136
126
|
|
|
137
127
|
## `sanity-run blueprints init`
|
|
138
128
|
|
|
@@ -149,7 +139,7 @@ EXAMPLES
|
|
|
149
139
|
$ sanity-run blueprints init
|
|
150
140
|
```
|
|
151
141
|
|
|
152
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
142
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/init.ts)_
|
|
153
143
|
|
|
154
144
|
## `sanity-run blueprints logs`
|
|
155
145
|
|
|
@@ -171,7 +161,7 @@ EXAMPLES
|
|
|
171
161
|
$ sanity-run blueprints logs --watch
|
|
172
162
|
```
|
|
173
163
|
|
|
174
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
164
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/logs.ts)_
|
|
175
165
|
|
|
176
166
|
## `sanity-run blueprints plan`
|
|
177
167
|
|
|
@@ -188,7 +178,7 @@ EXAMPLES
|
|
|
188
178
|
$ sanity-run blueprints plan
|
|
189
179
|
```
|
|
190
180
|
|
|
191
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
181
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/plan.ts)_
|
|
192
182
|
|
|
193
183
|
## `sanity-run blueprints stacks`
|
|
194
184
|
|
|
@@ -205,7 +195,7 @@ EXAMPLES
|
|
|
205
195
|
$ sanity-run blueprints stacks
|
|
206
196
|
```
|
|
207
197
|
|
|
208
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
198
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/blueprints/stacks.ts)_
|
|
209
199
|
|
|
210
200
|
## `sanity-run functions dev`
|
|
211
201
|
|
|
@@ -225,7 +215,7 @@ EXAMPLES
|
|
|
225
215
|
$ sanity-run functions dev --port 8974
|
|
226
216
|
```
|
|
227
217
|
|
|
228
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
218
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/functions/dev.ts)_
|
|
229
219
|
|
|
230
220
|
## `sanity-run functions invoke NAME`
|
|
231
221
|
|
|
@@ -251,7 +241,7 @@ EXAMPLES
|
|
|
251
241
|
$ sanity-run functions invoke <ID> --file 'payload.json'
|
|
252
242
|
```
|
|
253
243
|
|
|
254
|
-
_See code: [src/commands/functions/invoke.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
244
|
+
_See code: [src/commands/functions/invoke.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/functions/invoke.ts)_
|
|
255
245
|
|
|
256
246
|
## `sanity-run functions logs NAME`
|
|
257
247
|
|
|
@@ -271,7 +261,7 @@ EXAMPLES
|
|
|
271
261
|
$ sanity-run functions logs <ID>
|
|
272
262
|
```
|
|
273
263
|
|
|
274
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
264
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/functions/logs.ts)_
|
|
275
265
|
|
|
276
266
|
## `sanity-run functions test NAME`
|
|
277
267
|
|
|
@@ -300,7 +290,7 @@ EXAMPLES
|
|
|
300
290
|
$ sanity-run functions test echo-fn --data '{ "id": 1 }' --timeout 60
|
|
301
291
|
```
|
|
302
292
|
|
|
303
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/
|
|
293
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v2.0.0/src/commands/functions/test.ts)_
|
|
304
294
|
|
|
305
295
|
## `sanity-run help [COMMAND]`
|
|
306
296
|
|
|
@@ -320,391 +310,5 @@ DESCRIPTION
|
|
|
320
310
|
Display help for sanity-run.
|
|
321
311
|
```
|
|
322
312
|
|
|
323
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.
|
|
324
|
-
|
|
325
|
-
## `sanity-run plugins`
|
|
326
|
-
|
|
327
|
-
List installed plugins.
|
|
328
|
-
|
|
329
|
-
```
|
|
330
|
-
USAGE
|
|
331
|
-
$ sanity-run plugins [--json] [--core]
|
|
332
|
-
|
|
333
|
-
FLAGS
|
|
334
|
-
--core Show core plugins.
|
|
335
|
-
|
|
336
|
-
GLOBAL FLAGS
|
|
337
|
-
--json Format output as json.
|
|
338
|
-
|
|
339
|
-
DESCRIPTION
|
|
340
|
-
List installed plugins.
|
|
341
|
-
|
|
342
|
-
EXAMPLES
|
|
343
|
-
$ sanity-run plugins
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/index.ts)_
|
|
347
|
-
|
|
348
|
-
## `sanity-run plugins add PLUGIN`
|
|
349
|
-
|
|
350
|
-
Installs a plugin into sanity-run.
|
|
351
|
-
|
|
352
|
-
```
|
|
353
|
-
USAGE
|
|
354
|
-
$ sanity-run plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
355
|
-
|
|
356
|
-
ARGUMENTS
|
|
357
|
-
PLUGIN... Plugin to install.
|
|
358
|
-
|
|
359
|
-
FLAGS
|
|
360
|
-
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
361
|
-
-h, --help Show CLI help.
|
|
362
|
-
-s, --silent Silences npm output.
|
|
363
|
-
-v, --verbose Show verbose npm output.
|
|
364
|
-
|
|
365
|
-
GLOBAL FLAGS
|
|
366
|
-
--json Format output as json.
|
|
367
|
-
|
|
368
|
-
DESCRIPTION
|
|
369
|
-
Installs a plugin into sanity-run.
|
|
370
|
-
|
|
371
|
-
Uses npm to install plugins.
|
|
372
|
-
|
|
373
|
-
Installation of a user-installed plugin will override a core plugin.
|
|
374
|
-
|
|
375
|
-
Use the SANITY_RUN_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
376
|
-
Use the SANITY_RUN_NPM_REGISTRY environment variable to set the npm registry.
|
|
377
|
-
|
|
378
|
-
ALIASES
|
|
379
|
-
$ sanity-run plugins add
|
|
380
|
-
|
|
381
|
-
EXAMPLES
|
|
382
|
-
Install a plugin from npm registry.
|
|
383
|
-
|
|
384
|
-
$ sanity-run plugins add myplugin
|
|
385
|
-
|
|
386
|
-
Install a plugin from a github url.
|
|
387
|
-
|
|
388
|
-
$ sanity-run plugins add https://github.com/someuser/someplugin
|
|
389
|
-
|
|
390
|
-
Install a plugin from a github slug.
|
|
391
|
-
|
|
392
|
-
$ sanity-run plugins add someuser/someplugin
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
## `sanity-run plugins:inspect PLUGIN...`
|
|
396
|
-
|
|
397
|
-
Displays installation properties of a plugin.
|
|
398
|
-
|
|
399
|
-
```
|
|
400
|
-
USAGE
|
|
401
|
-
$ sanity-run plugins inspect PLUGIN...
|
|
402
|
-
|
|
403
|
-
ARGUMENTS
|
|
404
|
-
PLUGIN... [default: .] Plugin to inspect.
|
|
405
|
-
|
|
406
|
-
FLAGS
|
|
407
|
-
-h, --help Show CLI help.
|
|
408
|
-
-v, --verbose
|
|
409
|
-
|
|
410
|
-
GLOBAL FLAGS
|
|
411
|
-
--json Format output as json.
|
|
412
|
-
|
|
413
|
-
DESCRIPTION
|
|
414
|
-
Displays installation properties of a plugin.
|
|
415
|
-
|
|
416
|
-
EXAMPLES
|
|
417
|
-
$ sanity-run plugins inspect myplugin
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/inspect.ts)_
|
|
421
|
-
|
|
422
|
-
## `sanity-run plugins install PLUGIN`
|
|
423
|
-
|
|
424
|
-
Installs a plugin into sanity-run.
|
|
425
|
-
|
|
426
|
-
```
|
|
427
|
-
USAGE
|
|
428
|
-
$ sanity-run plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
|
|
429
|
-
|
|
430
|
-
ARGUMENTS
|
|
431
|
-
PLUGIN... Plugin to install.
|
|
432
|
-
|
|
433
|
-
FLAGS
|
|
434
|
-
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
|
|
435
|
-
-h, --help Show CLI help.
|
|
436
|
-
-s, --silent Silences npm output.
|
|
437
|
-
-v, --verbose Show verbose npm output.
|
|
438
|
-
|
|
439
|
-
GLOBAL FLAGS
|
|
440
|
-
--json Format output as json.
|
|
441
|
-
|
|
442
|
-
DESCRIPTION
|
|
443
|
-
Installs a plugin into sanity-run.
|
|
444
|
-
|
|
445
|
-
Uses npm to install plugins.
|
|
446
|
-
|
|
447
|
-
Installation of a user-installed plugin will override a core plugin.
|
|
448
|
-
|
|
449
|
-
Use the SANITY_RUN_NPM_LOG_LEVEL environment variable to set the npm loglevel.
|
|
450
|
-
Use the SANITY_RUN_NPM_REGISTRY environment variable to set the npm registry.
|
|
451
|
-
|
|
452
|
-
ALIASES
|
|
453
|
-
$ sanity-run plugins add
|
|
454
|
-
|
|
455
|
-
EXAMPLES
|
|
456
|
-
Install a plugin from npm registry.
|
|
457
|
-
|
|
458
|
-
$ sanity-run plugins install myplugin
|
|
459
|
-
|
|
460
|
-
Install a plugin from a github url.
|
|
461
|
-
|
|
462
|
-
$ sanity-run plugins install https://github.com/someuser/someplugin
|
|
463
|
-
|
|
464
|
-
Install a plugin from a github slug.
|
|
465
|
-
|
|
466
|
-
$ sanity-run plugins install someuser/someplugin
|
|
467
|
-
```
|
|
468
|
-
|
|
469
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/install.ts)_
|
|
470
|
-
|
|
471
|
-
## `sanity-run plugins link PATH`
|
|
472
|
-
|
|
473
|
-
Links a plugin into the CLI for development.
|
|
474
|
-
|
|
475
|
-
```
|
|
476
|
-
USAGE
|
|
477
|
-
$ sanity-run plugins link PATH [-h] [--install] [-v]
|
|
478
|
-
|
|
479
|
-
ARGUMENTS
|
|
480
|
-
PATH [default: .] path to plugin
|
|
481
|
-
|
|
482
|
-
FLAGS
|
|
483
|
-
-h, --help Show CLI help.
|
|
484
|
-
-v, --verbose
|
|
485
|
-
--[no-]install Install dependencies after linking the plugin.
|
|
486
|
-
|
|
487
|
-
DESCRIPTION
|
|
488
|
-
Links a plugin into the CLI for development.
|
|
489
|
-
|
|
490
|
-
Installation of a linked plugin will override a user-installed or core plugin.
|
|
491
|
-
|
|
492
|
-
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
|
|
493
|
-
command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
EXAMPLES
|
|
497
|
-
$ sanity-run plugins link myplugin
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/link.ts)_
|
|
501
|
-
|
|
502
|
-
## `sanity-run plugins remove [PLUGIN]`
|
|
503
|
-
|
|
504
|
-
Removes a plugin from the CLI.
|
|
505
|
-
|
|
506
|
-
```
|
|
507
|
-
USAGE
|
|
508
|
-
$ sanity-run plugins remove [PLUGIN...] [-h] [-v]
|
|
509
|
-
|
|
510
|
-
ARGUMENTS
|
|
511
|
-
PLUGIN... plugin to uninstall
|
|
512
|
-
|
|
513
|
-
FLAGS
|
|
514
|
-
-h, --help Show CLI help.
|
|
515
|
-
-v, --verbose
|
|
516
|
-
|
|
517
|
-
DESCRIPTION
|
|
518
|
-
Removes a plugin from the CLI.
|
|
519
|
-
|
|
520
|
-
ALIASES
|
|
521
|
-
$ sanity-run plugins unlink
|
|
522
|
-
$ sanity-run plugins remove
|
|
523
|
-
|
|
524
|
-
EXAMPLES
|
|
525
|
-
$ sanity-run plugins remove myplugin
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
## `sanity-run plugins reset`
|
|
529
|
-
|
|
530
|
-
Remove all user-installed and linked plugins.
|
|
531
|
-
|
|
532
|
-
```
|
|
533
|
-
USAGE
|
|
534
|
-
$ sanity-run plugins reset [--hard] [--reinstall]
|
|
535
|
-
|
|
536
|
-
FLAGS
|
|
537
|
-
--hard Delete node_modules and package manager related files in addition to uninstalling plugins.
|
|
538
|
-
--reinstall Reinstall all plugins after uninstalling.
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/reset.ts)_
|
|
542
|
-
|
|
543
|
-
## `sanity-run plugins uninstall [PLUGIN]`
|
|
544
|
-
|
|
545
|
-
Removes a plugin from the CLI.
|
|
546
|
-
|
|
547
|
-
```
|
|
548
|
-
USAGE
|
|
549
|
-
$ sanity-run plugins uninstall [PLUGIN...] [-h] [-v]
|
|
550
|
-
|
|
551
|
-
ARGUMENTS
|
|
552
|
-
PLUGIN... plugin to uninstall
|
|
553
|
-
|
|
554
|
-
FLAGS
|
|
555
|
-
-h, --help Show CLI help.
|
|
556
|
-
-v, --verbose
|
|
557
|
-
|
|
558
|
-
DESCRIPTION
|
|
559
|
-
Removes a plugin from the CLI.
|
|
560
|
-
|
|
561
|
-
ALIASES
|
|
562
|
-
$ sanity-run plugins unlink
|
|
563
|
-
$ sanity-run plugins remove
|
|
564
|
-
|
|
565
|
-
EXAMPLES
|
|
566
|
-
$ sanity-run plugins uninstall myplugin
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/uninstall.ts)_
|
|
570
|
-
|
|
571
|
-
## `sanity-run plugins unlink [PLUGIN]`
|
|
572
|
-
|
|
573
|
-
Removes a plugin from the CLI.
|
|
574
|
-
|
|
575
|
-
```
|
|
576
|
-
USAGE
|
|
577
|
-
$ sanity-run plugins unlink [PLUGIN...] [-h] [-v]
|
|
578
|
-
|
|
579
|
-
ARGUMENTS
|
|
580
|
-
PLUGIN... plugin to uninstall
|
|
581
|
-
|
|
582
|
-
FLAGS
|
|
583
|
-
-h, --help Show CLI help.
|
|
584
|
-
-v, --verbose
|
|
585
|
-
|
|
586
|
-
DESCRIPTION
|
|
587
|
-
Removes a plugin from the CLI.
|
|
588
|
-
|
|
589
|
-
ALIASES
|
|
590
|
-
$ sanity-run plugins unlink
|
|
591
|
-
$ sanity-run plugins remove
|
|
592
|
-
|
|
593
|
-
EXAMPLES
|
|
594
|
-
$ sanity-run plugins unlink myplugin
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
## `sanity-run plugins update`
|
|
598
|
-
|
|
599
|
-
Update installed plugins.
|
|
600
|
-
|
|
601
|
-
```
|
|
602
|
-
USAGE
|
|
603
|
-
$ sanity-run plugins update [-h] [-v]
|
|
604
|
-
|
|
605
|
-
FLAGS
|
|
606
|
-
-h, --help Show CLI help.
|
|
607
|
-
-v, --verbose
|
|
608
|
-
|
|
609
|
-
DESCRIPTION
|
|
610
|
-
Update installed plugins.
|
|
611
|
-
```
|
|
612
|
-
|
|
613
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.34/src/commands/plugins/update.ts)_
|
|
313
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.27/src/commands/help.ts)_
|
|
614
314
|
<!-- commandsstop -->
|
|
615
|
-
* [`sanity functions dev`](#sanity-functions-dev)
|
|
616
|
-
* [`sanity functions invoke`](#sanity-functions-invoke)
|
|
617
|
-
* [`sanity functions logs`](#sanity-functions-logs)
|
|
618
|
-
* [`sanity functions test`](#sanity-functions-test)
|
|
619
|
-
|
|
620
|
-
## `sanity functions dev`
|
|
621
|
-
|
|
622
|
-
Start the Sanity Function emulator
|
|
623
|
-
|
|
624
|
-
```
|
|
625
|
-
USAGE
|
|
626
|
-
$ sanity functions dev [-p <value>]
|
|
627
|
-
|
|
628
|
-
FLAGS
|
|
629
|
-
-p, --port=<value> Port to start emulator on
|
|
630
|
-
|
|
631
|
-
DESCRIPTION
|
|
632
|
-
Start the Sanity Function emulator
|
|
633
|
-
|
|
634
|
-
EXAMPLES
|
|
635
|
-
$ sanity functions dev --port 8974
|
|
636
|
-
```
|
|
637
|
-
|
|
638
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli-demos/blob/v0.0.0/src/commands/functions/dev.ts)_
|
|
639
|
-
|
|
640
|
-
## `sanity functions invoke`
|
|
641
|
-
|
|
642
|
-
Invoke a remote Sanity Function
|
|
643
|
-
|
|
644
|
-
```
|
|
645
|
-
USAGE
|
|
646
|
-
$ sanity functions invoke ID [-d <value>] [-f <value>]
|
|
647
|
-
|
|
648
|
-
ARGUMENTS
|
|
649
|
-
ID The ID of the function to invoke
|
|
650
|
-
|
|
651
|
-
FLAGS
|
|
652
|
-
-d, --data=<value> Data to send to the function
|
|
653
|
-
-f, --file=<value> Read data from file and send to the function
|
|
654
|
-
|
|
655
|
-
DESCRIPTION
|
|
656
|
-
Invoke a remote Sanity Function
|
|
657
|
-
|
|
658
|
-
EXAMPLES
|
|
659
|
-
$ sanity functions invoke <ID> --data '{ "id": 1 }'
|
|
660
|
-
|
|
661
|
-
$ sanity functions invoke <ID> --file 'payload.json'
|
|
662
|
-
```
|
|
663
|
-
|
|
664
|
-
_See code: [src/commands/functions/invoke.ts](https://github.com/sanity-io/runtime-cli-demos/blob/v0.0.0/src/commands/functions/invoke.ts)_
|
|
665
|
-
|
|
666
|
-
## `sanity functions logs`
|
|
667
|
-
|
|
668
|
-
Retrieve logs for a Sanity Function
|
|
669
|
-
|
|
670
|
-
```
|
|
671
|
-
USAGE
|
|
672
|
-
$ sanity functions logs ID
|
|
673
|
-
|
|
674
|
-
ARGUMENTS
|
|
675
|
-
ID The ID of the function to retrieve logs for
|
|
676
|
-
|
|
677
|
-
DESCRIPTION
|
|
678
|
-
Retrieve logs for a Sanity Function
|
|
679
|
-
|
|
680
|
-
EXAMPLES
|
|
681
|
-
$ sanity functions logs <ID>
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli-demos/blob/v0.0.0/src/commands/functions/logs.ts)_
|
|
685
|
-
|
|
686
|
-
## `sanity functions test`
|
|
687
|
-
|
|
688
|
-
Invoke a local Sanity Function
|
|
689
|
-
|
|
690
|
-
```
|
|
691
|
-
USAGE
|
|
692
|
-
$ sanity functions test PATH [-d <value>] [-f <value>]
|
|
693
|
-
|
|
694
|
-
ARGUMENTS
|
|
695
|
-
PATH The path to the function source code
|
|
696
|
-
|
|
697
|
-
FLAGS
|
|
698
|
-
-d, --data=<value> Data to send to the function
|
|
699
|
-
-f, --file=<value> Read data from file and send to the function
|
|
700
|
-
|
|
701
|
-
DESCRIPTION
|
|
702
|
-
Invoke a local Sanity Function
|
|
703
|
-
|
|
704
|
-
EXAMPLES
|
|
705
|
-
$ sanity functions test ./test.ts --data '{ "id": 1 }'
|
|
706
|
-
|
|
707
|
-
$ sanity functions test ./test.js --file 'payload.json'
|
|
708
|
-
```
|
|
709
|
-
|
|
710
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli-demos/blob/v0.0.0/src/commands/functions/test.ts)_
|
package/bin/dev.cmd
CHANGED
package/bin/dev.js
CHANGED
|
@@ -3,8 +3,7 @@ import { createRequire } from 'node:module';
|
|
|
3
3
|
import { dirname, extname, join } from 'node:path';
|
|
4
4
|
import { cwd } from 'node:process';
|
|
5
5
|
import { BlueprintErrorType } from '../../utils/types.js';
|
|
6
|
-
|
|
7
|
-
import blueprintParserValidator from '../../utils/vendor/parser-validator.js';
|
|
6
|
+
import { blueprintParserValidator } from '../../utils/vendor/parser-validator.js';
|
|
8
7
|
import { getStack as getStackById } from './stacks.js';
|
|
9
8
|
const SUPPORTED_FILE_NAMES_IN_PRIORITY_ORDER = [
|
|
10
9
|
'blueprint.json',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as assets from './assets.js';
|
|
2
|
+
import * as blueprint from './blueprint.js';
|
|
3
|
+
import * as logs from './logs.js';
|
|
4
|
+
import * as operations from './operations.js';
|
|
5
|
+
import * as projects from './projects.js';
|
|
6
|
+
import * as resources from './resources.js';
|
|
7
|
+
import * as stacks from './stacks.js';
|
|
8
|
+
export declare const blueprintsActions: {
|
|
9
|
+
assets: typeof assets;
|
|
10
|
+
blueprint: typeof blueprint;
|
|
11
|
+
logs: typeof logs;
|
|
12
|
+
operations: typeof operations;
|
|
13
|
+
projects: typeof projects;
|
|
14
|
+
resources: typeof resources;
|
|
15
|
+
stacks: typeof stacks;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as assets from './assets.js';
|
|
2
|
+
import * as blueprint from './blueprint.js';
|
|
3
|
+
import * as logs from './logs.js';
|
|
4
|
+
import * as operations from './operations.js';
|
|
5
|
+
import * as projects from './projects.js';
|
|
6
|
+
import * as resources from './resources.js';
|
|
7
|
+
import * as stacks from './stacks.js';
|
|
8
|
+
export const blueprintsActions = {
|
|
9
|
+
assets,
|
|
10
|
+
blueprint,
|
|
11
|
+
logs,
|
|
12
|
+
operations,
|
|
13
|
+
projects,
|
|
14
|
+
resources,
|
|
15
|
+
stacks,
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as dev from './dev.js';
|
|
2
|
+
import * as invoke from './invoke.js';
|
|
3
|
+
import * as logs from './logs.js';
|
|
4
|
+
import * as test from './test.js';
|
|
5
|
+
export declare const functionsActions: {
|
|
6
|
+
dev: typeof dev;
|
|
7
|
+
invoke: typeof invoke;
|
|
8
|
+
logs: typeof logs;
|
|
9
|
+
test: typeof test;
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Command } from '@oclif/core';
|
|
2
|
+
import highlight from 'color-json';
|
|
2
3
|
import inquirer from 'inquirer';
|
|
3
|
-
import { highlight } from 'tinyhighlight/picocolors';
|
|
4
4
|
import { findBlueprintFile } from '../../actions/blueprints/blueprint.js';
|
|
5
5
|
import { createFunctionResource } from '../../actions/blueprints/resources.js';
|
|
6
6
|
export default class Add extends Command {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import highlight from 'color-json';
|
|
2
3
|
import inquirer from 'inquirer';
|
|
3
|
-
import { highlight } from 'tinyhighlight/picocolors';
|
|
4
4
|
import { readConfigFile, writeConfigFile } from '../../actions/blueprints/blueprint.js';
|
|
5
5
|
import { listProjects } from '../../actions/blueprints/projects.js';
|
|
6
6
|
import { listStacks } from '../../actions/blueprints/stacks.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import
|
|
3
|
+
import Spinner from 'yocto-spinner';
|
|
4
|
+
import { stashAsset } from '../../actions/blueprints/assets.js';
|
|
4
5
|
import { readBlueprintOnDisk, writeConfigFile } from '../../actions/blueprints/blueprint.js';
|
|
5
6
|
import { createStack, updateStack } from '../../actions/blueprints/stacks.js';
|
|
6
|
-
import { stashAsset } from '../../actions/blueprints/stash-asset.js';
|
|
7
7
|
import { bold, green, red, yellow } from '../../utils/display/colors.js';
|
|
8
8
|
export default class Deploy extends Command {
|
|
9
9
|
static description = 'Deploy a Blueprint';
|
|
@@ -51,17 +51,16 @@ export default class Deploy extends Command {
|
|
|
51
51
|
// First stash all function assets
|
|
52
52
|
if (functionResources.length > 0) {
|
|
53
53
|
for (const resource of functionResources) {
|
|
54
|
-
const fnSpinner =
|
|
55
|
-
fnSpinner.start();
|
|
54
|
+
const fnSpinner = Spinner({ text: `Processing ${resource.name}...` }).start();
|
|
56
55
|
const result = await stashAsset({ resource, projectId });
|
|
57
56
|
if (result.success) {
|
|
58
57
|
const src = resource.src;
|
|
59
58
|
resource.src = result.assetId; // TODO: properly reference asset - for now, the API expects the assetId
|
|
60
|
-
fnSpinner.
|
|
59
|
+
fnSpinner.success(`${resource.name} <${yellow(result.assetId)}>`);
|
|
61
60
|
this.log(` Source: ${src}`);
|
|
62
61
|
}
|
|
63
62
|
else {
|
|
64
|
-
fnSpinner.
|
|
63
|
+
fnSpinner.error(`Failed to process ${resource.name}`);
|
|
65
64
|
this.log(` Error: ${result.error}`);
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
@@ -73,14 +72,13 @@ export default class Deploy extends Command {
|
|
|
73
72
|
document: { resources: validResources },
|
|
74
73
|
};
|
|
75
74
|
this.debug('BLUEPRINT DOCUMENT:', blueprint);
|
|
76
|
-
const spinner =
|
|
77
|
-
spinner.start();
|
|
75
|
+
const spinner = Spinner({ text: 'Deploying stack...' }).start();
|
|
78
76
|
const { ok: deployOk, stack, error: deployError, } = deployedStack
|
|
79
77
|
? await updateStack({ stackId: deployedStack.id, blueprint, projectId })
|
|
80
78
|
: await createStack({ blueprint, projectId });
|
|
81
79
|
this.debug('STACK RESPONSE:', stack);
|
|
82
80
|
if (deployOk) {
|
|
83
|
-
spinner.
|
|
81
|
+
spinner.success(`${green('Success!')} Stack "${bold(stack.name)}" ${deployedStack ? 'updated' : 'created'} <${yellow(stack.id)}>`);
|
|
84
82
|
writeConfigFile({
|
|
85
83
|
projectId,
|
|
86
84
|
stackId: stack.id,
|
|
@@ -89,7 +87,7 @@ export default class Deploy extends Command {
|
|
|
89
87
|
}
|
|
90
88
|
else {
|
|
91
89
|
this.debug('STACK ERROR RESPONSE:', stack);
|
|
92
|
-
spinner.
|
|
90
|
+
spinner.error(`${red('Failed')} to ${deployedStack ? 'update' : 'create'} stack`);
|
|
93
91
|
this.log(`Error: ${deployError || JSON.stringify(stack, null, 2) || 'Unknown error'}`);
|
|
94
92
|
}
|
|
95
93
|
}
|