@sanity/runtime-cli 17.10.0-next.g5e0bba6 → 17.11.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 +20 -20
- package/dist/actions/sanity/examples.js +9 -2
- package/dist/server/static/vendor/vendor.bundle.js +13 -6
- package/oclif.manifest.json +1 -1
- package/package.json +20 -21
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ EXAMPLES
|
|
|
90
90
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
93
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/add.ts)_
|
|
94
94
|
|
|
95
95
|
## `sanity-run blueprints config`
|
|
96
96
|
|
|
@@ -127,7 +127,7 @@ EXAMPLES
|
|
|
127
127
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
130
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/config.ts)_
|
|
131
131
|
|
|
132
132
|
## `sanity-run blueprints deploy`
|
|
133
133
|
|
|
@@ -183,7 +183,7 @@ EXAMPLES
|
|
|
183
183
|
$ sanity-run blueprints deploy --new-stack-name <new-name>
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
186
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/deploy.ts)_
|
|
187
187
|
|
|
188
188
|
## `sanity-run blueprints destroy`
|
|
189
189
|
|
|
@@ -221,7 +221,7 @@ EXAMPLES
|
|
|
221
221
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
224
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/destroy.ts)_
|
|
225
225
|
|
|
226
226
|
## `sanity-run blueprints doctor`
|
|
227
227
|
|
|
@@ -253,7 +253,7 @@ EXAMPLES
|
|
|
253
253
|
$ sanity-run blueprints doctor --fix
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
256
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/doctor.ts)_
|
|
257
257
|
|
|
258
258
|
## `sanity-run blueprints info`
|
|
259
259
|
|
|
@@ -291,7 +291,7 @@ EXAMPLES
|
|
|
291
291
|
$ sanity-run blueprints info --organization-id <orgId> --stack <name-or-id>
|
|
292
292
|
```
|
|
293
293
|
|
|
294
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
294
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/info.ts)_
|
|
295
295
|
|
|
296
296
|
## `sanity-run blueprints init [DIR]`
|
|
297
297
|
|
|
@@ -355,7 +355,7 @@ EXAMPLES
|
|
|
355
355
|
$ sanity-run blueprints init old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
358
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/init.ts)_
|
|
359
359
|
|
|
360
360
|
## `sanity-run blueprints logs`
|
|
361
361
|
|
|
@@ -401,7 +401,7 @@ EXAMPLES
|
|
|
401
401
|
$ sanity-run blueprints logs --before 2026-05-01T00:00:00Z
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
404
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/logs.ts)_
|
|
405
405
|
|
|
406
406
|
## `sanity-run blueprints mint-deploy-token`
|
|
407
407
|
|
|
@@ -446,7 +446,7 @@ EXAMPLES
|
|
|
446
446
|
$ sanity-run blueprints mint-deploy-token --organization-id <orgId>
|
|
447
447
|
```
|
|
448
448
|
|
|
449
|
-
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
449
|
+
_See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/mint-deploy-token.ts)_
|
|
450
450
|
|
|
451
451
|
## `sanity-run blueprints plan`
|
|
452
452
|
|
|
@@ -479,7 +479,7 @@ EXAMPLES
|
|
|
479
479
|
$ sanity-run blueprints plan --organization-id <orgId> --stack <name-or-id>
|
|
480
480
|
```
|
|
481
481
|
|
|
482
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
482
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/plan.ts)_
|
|
483
483
|
|
|
484
484
|
## `sanity-run blueprints promote`
|
|
485
485
|
|
|
@@ -515,7 +515,7 @@ EXAMPLES
|
|
|
515
515
|
$ sanity-run blueprints promote --new-stack-name <new-name>
|
|
516
516
|
```
|
|
517
517
|
|
|
518
|
-
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
518
|
+
_See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/promote.ts)_
|
|
519
519
|
|
|
520
520
|
## `sanity-run blueprints stacks`
|
|
521
521
|
|
|
@@ -556,7 +556,7 @@ EXAMPLES
|
|
|
556
556
|
$ sanity-run blueprints stacks --organization-id <organizationId> --include-projects
|
|
557
557
|
```
|
|
558
558
|
|
|
559
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
559
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/blueprints/stacks.ts)_
|
|
560
560
|
|
|
561
561
|
## `sanity-run functions add`
|
|
562
562
|
|
|
@@ -608,7 +608,7 @@ EXAMPLES
|
|
|
608
608
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
609
609
|
```
|
|
610
610
|
|
|
611
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
611
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/add.ts)_
|
|
612
612
|
|
|
613
613
|
## `sanity-run functions dev`
|
|
614
614
|
|
|
@@ -643,7 +643,7 @@ EXAMPLES
|
|
|
643
643
|
$ sanity-run functions dev --timeout 60
|
|
644
644
|
```
|
|
645
645
|
|
|
646
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
646
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/dev.ts)_
|
|
647
647
|
|
|
648
648
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
649
649
|
|
|
@@ -676,7 +676,7 @@ EXAMPLES
|
|
|
676
676
|
$ sanity-run functions env add --stack <name-or-id> MyFunction API_URL https://api.example.com/
|
|
677
677
|
```
|
|
678
678
|
|
|
679
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
679
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/env/add.ts)_
|
|
680
680
|
|
|
681
681
|
## `sanity-run functions env list NAME`
|
|
682
682
|
|
|
@@ -706,7 +706,7 @@ EXAMPLES
|
|
|
706
706
|
$ sanity-run functions env list --stack <name-or-id> MyFunction
|
|
707
707
|
```
|
|
708
708
|
|
|
709
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
709
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/env/list.ts)_
|
|
710
710
|
|
|
711
711
|
## `sanity-run functions env remove NAME KEY`
|
|
712
712
|
|
|
@@ -738,7 +738,7 @@ EXAMPLES
|
|
|
738
738
|
$ sanity-run functions env remove --stack <name-or-id> MyFunction API_URL
|
|
739
739
|
```
|
|
740
740
|
|
|
741
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
741
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/env/remove.ts)_
|
|
742
742
|
|
|
743
743
|
## `sanity-run functions logs [NAME]`
|
|
744
744
|
|
|
@@ -778,7 +778,7 @@ EXAMPLES
|
|
|
778
778
|
$ sanity-run functions logs <name> --delete
|
|
779
779
|
```
|
|
780
780
|
|
|
781
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
781
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/logs.ts)_
|
|
782
782
|
|
|
783
783
|
## `sanity-run functions test [NAME]`
|
|
784
784
|
|
|
@@ -836,7 +836,7 @@ EXAMPLES
|
|
|
836
836
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
837
837
|
```
|
|
838
838
|
|
|
839
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.
|
|
839
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.11.0/src/commands/functions/test.ts)_
|
|
840
840
|
|
|
841
841
|
## `sanity-run help [COMMAND]`
|
|
842
842
|
|
|
@@ -856,5 +856,5 @@ DESCRIPTION
|
|
|
856
856
|
Display help for sanity-run.
|
|
857
857
|
```
|
|
858
858
|
|
|
859
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.
|
|
859
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.3.0/src/commands/help.ts)_
|
|
860
860
|
<!-- commandsstop -->
|
|
@@ -71,7 +71,13 @@ async function extractExampleFromArchive({ archiveStream, exampleType, exampleNa
|
|
|
71
71
|
if (cleanPath.startsWith(`${fullPath}/`) || cleanPath === fullPath) {
|
|
72
72
|
if (type === 'file') {
|
|
73
73
|
const chunks = [];
|
|
74
|
-
stream.on('data', (chunk) =>
|
|
74
|
+
stream.on('data', (chunk) => {
|
|
75
|
+
if (!(chunk instanceof Uint8Array)) {
|
|
76
|
+
stream.destroy(new TypeError('Expected archive entry data to be a Uint8Array'));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
chunks.push(chunk);
|
|
80
|
+
});
|
|
75
81
|
stream.on('end', () => {
|
|
76
82
|
const content = Buffer.concat(chunks).toString('utf8');
|
|
77
83
|
files[cleanPath.replace(`${fullPath}/`, '')] = content;
|
|
@@ -88,7 +94,8 @@ async function extractExampleFromArchive({ archiveStream, exampleType, exampleNa
|
|
|
88
94
|
next();
|
|
89
95
|
}
|
|
90
96
|
});
|
|
91
|
-
//
|
|
97
|
+
// not ideal to cast as unknown as Writable...
|
|
98
|
+
// but tar-stream uses streamx, which interoperates with Node streams
|
|
92
99
|
await pipeline(archiveStream, createGunzip(), extractStream);
|
|
93
100
|
if (Object.keys(files).length === 0)
|
|
94
101
|
return null;
|
|
@@ -27598,17 +27598,23 @@ function prettyBytes(number, options) {
|
|
|
27598
27598
|
}
|
|
27599
27599
|
|
|
27600
27600
|
const localeOptions = buildLocaleOptions(options);
|
|
27601
|
+
const base = options.binary ? 1024 : 1000;
|
|
27601
27602
|
|
|
27602
27603
|
let exponent = 0;
|
|
27603
27604
|
if (number >= 1) {
|
|
27604
|
-
exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(
|
|
27605
|
+
exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(base) : log10(number) / 3), UNITS.length - 1);
|
|
27605
27606
|
}
|
|
27606
27607
|
|
|
27607
|
-
number = divide(number,
|
|
27608
|
+
number = divide(number, base ** exponent);
|
|
27608
27609
|
|
|
27609
27610
|
if (!localeOptions) {
|
|
27610
|
-
const
|
|
27611
|
-
number = Number(number.toPrecision(
|
|
27611
|
+
const minimumPrecision = Math.max(3, Math.floor(number).toString().length);
|
|
27612
|
+
number = Number(number.toPrecision(minimumPrecision));
|
|
27613
|
+
|
|
27614
|
+
if (number >= base && exponent < UNITS.length - 1) {
|
|
27615
|
+
number /= base;
|
|
27616
|
+
exponent += 1;
|
|
27617
|
+
}
|
|
27612
27618
|
}
|
|
27613
27619
|
|
|
27614
27620
|
const numberString = toLocaleString(number, options.locale, localeOptions);
|
|
@@ -27769,10 +27775,11 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
27769
27775
|
const roundedMilliseconds = millisecondsAndBelow >= 1
|
|
27770
27776
|
? Math.round(millisecondsAndBelow)
|
|
27771
27777
|
: Math.ceil(millisecondsAndBelow);
|
|
27778
|
+
const maximumMilliseconds = 1000 - (10 ** -millisecondsDecimalDigits);
|
|
27772
27779
|
|
|
27773
27780
|
const millisecondsString = millisecondsDecimalDigits
|
|
27774
|
-
? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)
|
|
27775
|
-
: roundedMilliseconds;
|
|
27781
|
+
? Math.min(millisecondsAndBelow, maximumMilliseconds).toFixed(millisecondsDecimalDigits)
|
|
27782
|
+
: Math.min(roundedMilliseconds, maximumMilliseconds);
|
|
27776
27783
|
|
|
27777
27784
|
add(
|
|
27778
27785
|
Number.parseFloat(millisecondsString),
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/runtime-cli",
|
|
3
3
|
"description": "Sanity's Runtime CLI for Blueprints and Functions",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.11.0",
|
|
5
5
|
"author": "Sanity Runtime Team",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -64,21 +64,20 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@architect/hydrate": "~6.0.2",
|
|
66
66
|
"@architect/inventory": "~6.1.0",
|
|
67
|
-
"@inquirer/prompts": "^8.
|
|
68
|
-
"@oclif/core": "^4.
|
|
69
|
-
"@oclif/plugin-help": "^6.
|
|
70
|
-
"@sanity-labs/design-tokens": "^0.0.2-alpha.2",
|
|
67
|
+
"@inquirer/prompts": "^8.7.0",
|
|
68
|
+
"@oclif/core": "^4.14.0",
|
|
69
|
+
"@oclif/plugin-help": "^6.3.0",
|
|
71
70
|
"@sanity-labs/oclif-plugin-skills-flag": "^0.2.1",
|
|
72
|
-
"@sanity/blueprints": "^0.
|
|
71
|
+
"@sanity/blueprints": "^0.24.0",
|
|
73
72
|
"@sanity/blueprints-parser": "^0.5.0",
|
|
74
73
|
"@sanity/cli-build": "^5.2.0",
|
|
75
|
-
"@sanity/cli-core": "^3.
|
|
76
|
-
"@sanity/client": "^8.
|
|
74
|
+
"@sanity/cli-core": "^3.5.0",
|
|
75
|
+
"@sanity/client": "^8.4.0",
|
|
77
76
|
"adm-zip": "^0.6.0",
|
|
78
77
|
"array-treeify": "^0.2.0",
|
|
79
78
|
"cardinal": "^2.1.1",
|
|
80
79
|
"empathic": "^2.0.1",
|
|
81
|
-
"eventsource": "^5.1.
|
|
80
|
+
"eventsource": "^5.1.1",
|
|
82
81
|
"groq-js": "^2.0.0",
|
|
83
82
|
"jiti": "^2.7.0",
|
|
84
83
|
"mime-types": "^3.0.2",
|
|
@@ -86,38 +85,38 @@
|
|
|
86
85
|
"signal-exit": "^4.1.0",
|
|
87
86
|
"strip-ansi": "^7.2.0",
|
|
88
87
|
"tar-fs": "^3.1.3",
|
|
89
|
-
"tar-stream": "^3.2.
|
|
90
|
-
"vite": "^8.2.
|
|
88
|
+
"tar-stream": "^3.2.1",
|
|
89
|
+
"vite": "^8.2.2",
|
|
91
90
|
"ws": "^8.21.3",
|
|
92
91
|
"xdg-basedir": "^5.1.0"
|
|
93
92
|
},
|
|
94
93
|
"devDependencies": {
|
|
95
|
-
"@biomejs/biome": "2.5.
|
|
94
|
+
"@biomejs/biome": "2.5.11",
|
|
96
95
|
"@codemirror/lang-json": "^6.0.2",
|
|
96
|
+
"@codemirror/language": "^6.12.4",
|
|
97
97
|
"@codemirror/state": "^6.7.1",
|
|
98
98
|
"@enhance/store": "^1.0.2",
|
|
99
99
|
"@lezer/highlight": "^1.2.3",
|
|
100
|
-
"@oclif/test": "^4.
|
|
100
|
+
"@oclif/test": "^4.2.0",
|
|
101
101
|
"@playwright/test": "^1.62.1",
|
|
102
102
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
103
|
+
"@sanity-labs/design-tokens": "^0.0.2-alpha.2",
|
|
103
104
|
"@sanity/functions": "^1.7.1",
|
|
104
|
-
"@types/adm-zip": "^0.5.8",
|
|
105
105
|
"@types/cardinal": "^2.1.1",
|
|
106
106
|
"@types/mime-types": "^3.0.1",
|
|
107
107
|
"@types/node": "^22",
|
|
108
108
|
"@types/tar-fs": "^2.0.4",
|
|
109
|
-
"@types/tar-stream": "^3.1.4",
|
|
110
109
|
"@types/ws": "^8.18.1",
|
|
111
|
-
"@vitest/coverage-v8": "4.1.
|
|
110
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
112
111
|
"codemirror": "^6.0.2",
|
|
113
112
|
"mentoss": "^0.13.0",
|
|
114
|
-
"oclif": "^4.
|
|
115
|
-
"pretty-bytes": "^7.1.
|
|
116
|
-
"pretty-ms": "^9.3.
|
|
117
|
-
"rollup": "^4.
|
|
113
|
+
"oclif": "^4.24.0",
|
|
114
|
+
"pretty-bytes": "^7.1.2",
|
|
115
|
+
"pretty-ms": "^9.3.1",
|
|
116
|
+
"rollup": "^4.63.1",
|
|
118
117
|
"shx": "^0.4.0",
|
|
119
118
|
"typescript": "^7.0.2",
|
|
120
|
-
"vitest": "4.1.
|
|
119
|
+
"vitest": "4.1.11"
|
|
121
120
|
},
|
|
122
121
|
"oclif": {
|
|
123
122
|
"bin": "sanity-run",
|