@sanity/runtime-cli 14.8.2 → 14.8.3
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 +18 -18
- package/dist/cores/blueprints/deploy.js +11 -10
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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/14.8.
|
|
23
|
+
@sanity/runtime-cli/14.8.3 linux-x64 node-v24.14.0
|
|
24
24
|
$ sanity-run --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ sanity-run COMMAND
|
|
@@ -101,7 +101,7 @@ EXAMPLES
|
|
|
101
101
|
$ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
104
|
+
_See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/add.ts)_
|
|
105
105
|
|
|
106
106
|
## `sanity-run blueprints config`
|
|
107
107
|
|
|
@@ -140,7 +140,7 @@ EXAMPLES
|
|
|
140
140
|
$ sanity-run blueprints config --edit --project-id <projectId> --stack <name-or-id>
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
143
|
+
_See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/config.ts)_
|
|
144
144
|
|
|
145
145
|
## `sanity-run blueprints deploy`
|
|
146
146
|
|
|
@@ -179,7 +179,7 @@ EXAMPLES
|
|
|
179
179
|
$ sanity-run blueprints deploy --fn-installer npm
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
182
|
+
_See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/deploy.ts)_
|
|
183
183
|
|
|
184
184
|
## `sanity-run blueprints destroy`
|
|
185
185
|
|
|
@@ -215,7 +215,7 @@ EXAMPLES
|
|
|
215
215
|
$ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
218
|
+
_See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/destroy.ts)_
|
|
219
219
|
|
|
220
220
|
## `sanity-run blueprints doctor`
|
|
221
221
|
|
|
@@ -242,7 +242,7 @@ DESCRIPTION
|
|
|
242
242
|
issues.
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
245
|
+
_See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/doctor.ts)_
|
|
246
246
|
|
|
247
247
|
## `sanity-run blueprints info`
|
|
248
248
|
|
|
@@ -274,7 +274,7 @@ EXAMPLES
|
|
|
274
274
|
$ sanity-run blueprints info --stack <name-or-id>
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
277
|
+
_See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/info.ts)_
|
|
278
278
|
|
|
279
279
|
## `sanity-run blueprints init [DIR]`
|
|
280
280
|
|
|
@@ -328,7 +328,7 @@ EXAMPLES
|
|
|
328
328
|
$ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
|
|
329
329
|
```
|
|
330
330
|
|
|
331
|
-
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
331
|
+
_See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/init.ts)_
|
|
332
332
|
|
|
333
333
|
## `sanity-run blueprints logs`
|
|
334
334
|
|
|
@@ -359,7 +359,7 @@ EXAMPLES
|
|
|
359
359
|
$ sanity-run blueprints logs --watch
|
|
360
360
|
```
|
|
361
361
|
|
|
362
|
-
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
362
|
+
_See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/logs.ts)_
|
|
363
363
|
|
|
364
364
|
## `sanity-run blueprints plan`
|
|
365
365
|
|
|
@@ -387,7 +387,7 @@ EXAMPLES
|
|
|
387
387
|
$ sanity-run blueprints plan
|
|
388
388
|
```
|
|
389
389
|
|
|
390
|
-
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
390
|
+
_See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/plan.ts)_
|
|
391
391
|
|
|
392
392
|
## `sanity-run blueprints stacks`
|
|
393
393
|
|
|
@@ -419,7 +419,7 @@ EXAMPLES
|
|
|
419
419
|
$ sanity-run blueprints stacks --organization-id <organizationId>
|
|
420
420
|
```
|
|
421
421
|
|
|
422
|
-
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
422
|
+
_See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/blueprints/stacks.ts)_
|
|
423
423
|
|
|
424
424
|
## `sanity-run functions add`
|
|
425
425
|
|
|
@@ -472,7 +472,7 @@ EXAMPLES
|
|
|
472
472
|
$ sanity-run functions add --name my-function --type document-create --type document-update --lang js
|
|
473
473
|
```
|
|
474
474
|
|
|
475
|
-
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
475
|
+
_See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/add.ts)_
|
|
476
476
|
|
|
477
477
|
## `sanity-run functions dev`
|
|
478
478
|
|
|
@@ -508,7 +508,7 @@ EXAMPLES
|
|
|
508
508
|
$ sanity-run functions dev --timeout 60
|
|
509
509
|
```
|
|
510
510
|
|
|
511
|
-
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
511
|
+
_See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/dev.ts)_
|
|
512
512
|
|
|
513
513
|
## `sanity-run functions env add NAME KEY VALUE`
|
|
514
514
|
|
|
@@ -539,7 +539,7 @@ EXAMPLES
|
|
|
539
539
|
$ sanity-run functions env add MyFunction API_URL https://api.example.com/
|
|
540
540
|
```
|
|
541
541
|
|
|
542
|
-
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
542
|
+
_See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/env/add.ts)_
|
|
543
543
|
|
|
544
544
|
## `sanity-run functions env list NAME`
|
|
545
545
|
|
|
@@ -567,7 +567,7 @@ EXAMPLES
|
|
|
567
567
|
$ sanity-run functions env list MyFunction
|
|
568
568
|
```
|
|
569
569
|
|
|
570
|
-
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
570
|
+
_See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/env/list.ts)_
|
|
571
571
|
|
|
572
572
|
## `sanity-run functions env remove NAME KEY`
|
|
573
573
|
|
|
@@ -597,7 +597,7 @@ EXAMPLES
|
|
|
597
597
|
$ sanity-run functions env remove MyFunction API_URL
|
|
598
598
|
```
|
|
599
599
|
|
|
600
|
-
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
600
|
+
_See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/env/remove.ts)_
|
|
601
601
|
|
|
602
602
|
## `sanity-run functions logs [NAME]`
|
|
603
603
|
|
|
@@ -639,7 +639,7 @@ EXAMPLES
|
|
|
639
639
|
$ sanity-run functions logs <name> --delete
|
|
640
640
|
```
|
|
641
641
|
|
|
642
|
-
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
642
|
+
_See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/logs.ts)_
|
|
643
643
|
|
|
644
644
|
## `sanity-run functions test [NAME]`
|
|
645
645
|
|
|
@@ -697,7 +697,7 @@ EXAMPLES
|
|
|
697
697
|
$ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
|
|
698
698
|
```
|
|
699
699
|
|
|
700
|
-
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.
|
|
700
|
+
_See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v14.8.3/src/commands/functions/test.ts)_
|
|
701
701
|
|
|
702
702
|
## `sanity-run help [COMMAND]`
|
|
703
703
|
|
|
@@ -35,8 +35,11 @@ export async function blueprintDeployCore(options) {
|
|
|
35
35
|
log('Processing assets...');
|
|
36
36
|
for (const resource of preDeployResources) {
|
|
37
37
|
const preDeployResult = await preDeploy(resource, { auth, installer, log });
|
|
38
|
-
if (preDeployResult.success
|
|
38
|
+
if (!preDeployResult.success)
|
|
39
39
|
return preDeployResult;
|
|
40
|
+
const idx = validResources.indexOf(resource);
|
|
41
|
+
if (idx !== -1) {
|
|
42
|
+
validResources[idx] = preDeployResult.resource;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -152,9 +155,9 @@ async function preDeploy(resource, options) {
|
|
|
152
155
|
clearTimeout(assetTimeoutTimer);
|
|
153
156
|
}
|
|
154
157
|
if (result.success && result.assetId) {
|
|
155
|
-
const
|
|
156
|
-
fnSpinner.succeed(`${
|
|
157
|
-
log(` Source: ${
|
|
158
|
+
const updatedResource = { ...resource, src: result.assetId };
|
|
159
|
+
fnSpinner.succeed(`${updatedResource.name} ${niceId(result.assetId)}`);
|
|
160
|
+
log(` Source: ${updatedResource.src}`);
|
|
158
161
|
if (result.hash) {
|
|
159
162
|
if (result.hash.length > 24) {
|
|
160
163
|
log.verbose(` Hash: ${result.hash.slice(0, 8)}...${result.hash.slice(-12)}`);
|
|
@@ -165,11 +168,9 @@ async function preDeploy(resource, options) {
|
|
|
165
168
|
}
|
|
166
169
|
if (result.exists)
|
|
167
170
|
log.verbose(' Asset unchanged');
|
|
171
|
+
return { success: true, resource: updatedResource };
|
|
168
172
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return { success: false, error: result.error || 'Failed to process asset' };
|
|
173
|
-
}
|
|
174
|
-
return { success: true };
|
|
173
|
+
const errorMsg = `Failed uploading ${resource.name} asset, deploy has stopped`;
|
|
174
|
+
fnSpinner.fail(errorMsg);
|
|
175
|
+
return { success: false, error: result.error || 'Failed to process asset' };
|
|
175
176
|
}
|
package/oclif.manifest.json
CHANGED