@sanity/runtime-cli 17.3.1 → 17.3.2
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 +22 -35
- package/dist/config.js +1 -2
- package/dist/utils/logger.js +5 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,30 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
Sanity's Runtime CLI for Blueprints and Functions
|
|
5
5
|
|
|
6
|
+
Typically, the `@sanity/runtime-cli` (`sanity-run`) CLI is not used directly by end-users. The main `@sanity/cli` (`sanity`) loads and uses this CLI internally.
|
|
7
|
+
All `sanity-run` commands can also be run as `sanity <command>` when `@sanity/cli` is available.
|
|
6
8
|
|
|
7
9
|
[](https://oclif.io)
|
|
8
10
|
[](https://npmjs.org/package/@sanity/runtime-cli)
|
|
9
11
|
[](https://npmjs.org/package/@sanity/runtime-cli)
|
|
10
12
|
|
|
11
|
-
|
|
12
13
|
<!-- toc -->
|
|
13
|
-
* [Usage](#usage)
|
|
14
14
|
* [Commands](#commands)
|
|
15
15
|
<!-- tocstop -->
|
|
16
|
-
|
|
17
|
-
<!-- usage -->
|
|
18
|
-
```sh-session
|
|
19
|
-
$ npm install -g @sanity/runtime-cli
|
|
20
|
-
$ sanity-run COMMAND
|
|
21
|
-
running command...
|
|
22
|
-
$ sanity-run (--version)
|
|
23
|
-
@sanity/runtime-cli/17.3.1 linux-x64 node-v24.18.0
|
|
24
|
-
$ sanity-run --help [COMMAND]
|
|
25
|
-
USAGE
|
|
26
|
-
$ sanity-run COMMAND
|
|
27
|
-
...
|
|
28
|
-
```
|
|
29
|
-
<!-- usagestop -->
|
|
16
|
+
|
|
30
17
|
# Commands
|
|
31
18
|
<!-- commands -->
|
|
32
19
|
* [`sanity-run blueprints add TYPE`](#sanity-run-blueprints-add-type)
|
|
@@ -103,7 +90,7 @@ EXAMPLES
|
|
|
103
90
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
104
91
|
```
|
|
105
92
|
|
|
106
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
93
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/add.ts)_
|
|
107
94
|
|
|
108
95
|
## `sanity-run blueprints config`
|
|
109
96
|
|
|
@@ -140,7 +127,7 @@ EXAMPLES
|
|
|
140
127
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
141
128
|
```
|
|
142
129
|
|
|
143
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
130
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/config.ts)_
|
|
144
131
|
|
|
145
132
|
## `sanity-run blueprints deploy`
|
|
146
133
|
|
|
@@ -194,7 +181,7 @@ EXAMPLES
|
|
|
194
181
|
$ sanity-run blueprints deploy --new-stack-name <new-name>
|
|
195
182
|
```
|
|
196
183
|
|
|
197
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
184
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/deploy.ts)_
|
|
198
185
|
|
|
199
186
|
## `sanity-run blueprints destroy`
|
|
200
187
|
|
|
@@ -232,7 +219,7 @@ EXAMPLES
|
|
|
232
219
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
233
220
|
```
|
|
234
221
|
|
|
235
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
222
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/destroy.ts)_
|
|
236
223
|
|
|
237
224
|
## `sanity-run blueprints doctor`
|
|
238
225
|
|
|
@@ -264,7 +251,7 @@ EXAMPLES
|
|
|
264
251
|
$ sanity-run blueprints doctor --fix
|
|
265
252
|
```
|
|
266
253
|
|
|
267
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
254
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/doctor.ts)_
|
|
268
255
|
|
|
269
256
|
## `sanity-run blueprints info`
|
|
270
257
|
|
|
@@ -301,7 +288,7 @@ EXAMPLES
|
|
|
301
288
|
$ sanity-run blueprints info --organization-id <orgId> --stack <name-or-id>
|
|
302
289
|
```
|
|
303
290
|
|
|
304
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
291
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/info.ts)_
|
|
305
292
|
|
|
306
293
|
## `sanity-run blueprints init [DIR]`
|
|
307
294
|
|
|
@@ -365,7 +352,7 @@ EXAMPLES
|
|
|
365
352
|
$ sanity-run blueprints init old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>
|
|
366
353
|
```
|
|
367
354
|
|
|
368
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
355
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/init.ts)_
|
|
369
356
|
|
|
370
357
|
## `sanity-run blueprints logs`
|
|
371
358
|
|
|
@@ -411,7 +398,7 @@ EXAMPLES
|
|
|
411
398
|
$ sanity-run blueprints logs --before 2026-05-01T00:00:00Z
|
|
412
399
|
```
|
|
413
400
|
|
|
414
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
401
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/logs.ts)_
|
|
415
402
|
|
|
416
403
|
## `sanity-run blueprints mint-deploy-token`
|
|
417
404
|
|
|
@@ -456,7 +443,7 @@ EXAMPLES
|
|
|
456
443
|
$ sanity-run blueprints mint-deploy-token --organization-id <orgId>
|
|
457
444
|
```
|
|
458
445
|
|
|
459
|
-
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
446
|
+
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/mint-deploy-token.ts)_
|
|
460
447
|
|
|
461
448
|
## `sanity-run blueprints plan`
|
|
462
449
|
|
|
@@ -489,7 +476,7 @@ EXAMPLES
|
|
|
489
476
|
$ sanity-run blueprints plan --organization-id <orgId> --stack <name-or-id>
|
|
490
477
|
```
|
|
491
478
|
|
|
492
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
479
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/plan.ts)_
|
|
493
480
|
|
|
494
481
|
## `sanity-run blueprints promote`
|
|
495
482
|
|
|
@@ -525,7 +512,7 @@ EXAMPLES
|
|
|
525
512
|
$ sanity-run blueprints promote --new-stack-name <new-name>
|
|
526
513
|
```
|
|
527
514
|
|
|
528
|
-
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
515
|
+
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/promote.ts)_
|
|
529
516
|
|
|
530
517
|
## `sanity-run blueprints stacks`
|
|
531
518
|
|
|
@@ -561,7 +548,7 @@ EXAMPLES
|
|
|
561
548
|
$ sanity-run blueprints stacks --organization-id <organizationId> --include-projects
|
|
562
549
|
```
|
|
563
550
|
|
|
564
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
551
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/blueprints/stacks.ts)_
|
|
565
552
|
|
|
566
553
|
## `sanity-run functions add`
|
|
567
554
|
|
|
@@ -613,7 +600,7 @@ EXAMPLES
|
|
|
613
600
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
614
601
|
```
|
|
615
602
|
|
|
616
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
603
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/add.ts)_
|
|
617
604
|
|
|
618
605
|
## `sanity-run functions dev`
|
|
619
606
|
|
|
@@ -648,7 +635,7 @@ EXAMPLES
|
|
|
648
635
|
$ sanity-run functions dev --timeout 60
|
|
649
636
|
```
|
|
650
637
|
|
|
651
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
638
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/dev.ts)_
|
|
652
639
|
|
|
653
640
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
654
641
|
|
|
@@ -681,7 +668,7 @@ EXAMPLES
|
|
|
681
668
|
$ sanity-run functions env add --stack <name-or-id> MyFunction API_URL https://api.example.com/
|
|
682
669
|
```
|
|
683
670
|
|
|
684
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
671
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/env/add.ts)_
|
|
685
672
|
|
|
686
673
|
## `sanity-run functions env list NAME`
|
|
687
674
|
|
|
@@ -711,7 +698,7 @@ EXAMPLES
|
|
|
711
698
|
$ sanity-run functions env list --stack <name-or-id> MyFunction
|
|
712
699
|
```
|
|
713
700
|
|
|
714
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
701
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/env/list.ts)_
|
|
715
702
|
|
|
716
703
|
## `sanity-run functions env remove NAME KEY`
|
|
717
704
|
|
|
@@ -743,7 +730,7 @@ EXAMPLES
|
|
|
743
730
|
$ sanity-run functions env remove --stack <name-or-id> MyFunction API_URL
|
|
744
731
|
```
|
|
745
732
|
|
|
746
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
733
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/env/remove.ts)_
|
|
747
734
|
|
|
748
735
|
## `sanity-run functions logs [NAME]`
|
|
749
736
|
|
|
@@ -783,7 +770,7 @@ EXAMPLES
|
|
|
783
770
|
$ sanity-run functions logs <name> --delete
|
|
784
771
|
```
|
|
785
772
|
|
|
786
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
773
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/logs.ts)_
|
|
787
774
|
|
|
788
775
|
## `sanity-run functions test [NAME]`
|
|
789
776
|
|
|
@@ -840,7 +827,7 @@ EXAMPLES
|
|
|
840
827
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
841
828
|
```
|
|
842
829
|
|
|
843
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.
|
|
830
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.3.2/src/commands/functions/test.ts)_
|
|
844
831
|
|
|
845
832
|
## `sanity-run help [COMMAND]`
|
|
846
833
|
|
package/dist/config.js
CHANGED
|
@@ -30,7 +30,6 @@ const isTest = nodeEnv === 'test';
|
|
|
30
30
|
const sanityEnv = env.SANITY_INTERNAL_ENV?.toLowerCase() ?? 'production';
|
|
31
31
|
const sanityProd = sanityEnv === 'production';
|
|
32
32
|
const isLive = sanityProd || sanityEnv === 'staging';
|
|
33
|
-
const isPublishing = isTrueish(env?.PUBLISHING);
|
|
34
33
|
// https://github.com/sanity-io/cli/blob/adf90ea6691ee6c36849e426de9729533706f47f/packages/%40sanity/cli-core/src/util/isCi.ts
|
|
35
34
|
const isCi =
|
|
36
35
|
// Travis CI, CircleCI, Gitlab CI, Appveyor, CodeShip, Travis CI, Jenkins, TeamCity
|
|
@@ -55,7 +54,7 @@ export function blueprintsUrl(path, version = BLUEPRINTS_API_VERSION) {
|
|
|
55
54
|
let _token;
|
|
56
55
|
function loadToken() {
|
|
57
56
|
let token = null;
|
|
58
|
-
if (isTest
|
|
57
|
+
if (isTest) {
|
|
59
58
|
token = 'token';
|
|
60
59
|
}
|
|
61
60
|
else {
|
package/dist/utils/logger.js
CHANGED
|
@@ -37,12 +37,16 @@ export function Logger(log, flags = {}) {
|
|
|
37
37
|
if (flags.json)
|
|
38
38
|
return createOraLineLoggingWrapper(opts, logger);
|
|
39
39
|
if (level >= LogLevel.INFO)
|
|
40
|
-
return withTerminalProgress(ora(opts));
|
|
40
|
+
return withTerminalProgress(ora(keepStdinInterruptible(opts)));
|
|
41
41
|
return createOraLineLoggingWrapper(opts, logger);
|
|
42
42
|
};
|
|
43
43
|
logger.ora = oraWrapper;
|
|
44
44
|
return logger;
|
|
45
45
|
}
|
|
46
|
+
function keepStdinInterruptible(opts) {
|
|
47
|
+
const options = typeof opts === 'string' ? { text: opts } : opts;
|
|
48
|
+
return { discardStdin: false, ...options };
|
|
49
|
+
}
|
|
46
50
|
function withTerminalProgress(spinner) {
|
|
47
51
|
const wrap = (name, effect) => {
|
|
48
52
|
if (typeof spinner[name] !== 'function')
|
package/oclif.manifest.json
CHANGED