@sanity/runtime-cli 14.8.6 → 14.9.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.
Files changed (41) hide show
  1. package/README.md +35 -30
  2. package/dist/baseCommands.d.ts +21 -8
  3. package/dist/baseCommands.js +54 -15
  4. package/dist/commands/blueprints/add.js +3 -3
  5. package/dist/commands/blueprints/config.js +4 -4
  6. package/dist/commands/blueprints/deploy.js +5 -5
  7. package/dist/commands/blueprints/destroy.js +5 -5
  8. package/dist/commands/blueprints/doctor.d.ts +1 -1
  9. package/dist/commands/blueprints/doctor.js +7 -5
  10. package/dist/commands/blueprints/info.js +5 -5
  11. package/dist/commands/blueprints/init.js +4 -4
  12. package/dist/commands/blueprints/logs.js +6 -6
  13. package/dist/commands/blueprints/plan.js +5 -5
  14. package/dist/commands/blueprints/promote.js +8 -6
  15. package/dist/commands/blueprints/stacks.js +5 -5
  16. package/dist/commands/functions/add.js +3 -3
  17. package/dist/commands/functions/build.js +4 -4
  18. package/dist/commands/functions/dev.js +5 -5
  19. package/dist/commands/functions/env/add.js +4 -4
  20. package/dist/commands/functions/env/list.js +4 -4
  21. package/dist/commands/functions/env/remove.js +4 -4
  22. package/dist/commands/functions/logs.js +4 -4
  23. package/dist/commands/functions/test.js +4 -4
  24. package/dist/constants.d.ts +1 -0
  25. package/dist/constants.js +1 -0
  26. package/dist/cores/blueprints/config.js +0 -1
  27. package/dist/cores/blueprints/deploy.js +29 -4
  28. package/dist/cores/blueprints/destroy.js +18 -3
  29. package/dist/cores/blueprints/doctor.js +9 -2
  30. package/dist/cores/blueprints/plan.js +18 -10
  31. package/dist/cores/blueprints/promote.js +11 -3
  32. package/dist/cores/blueprints/stacks.js +14 -3
  33. package/dist/cores/functions/test.js +7 -1
  34. package/dist/cores/index.d.ts +6 -0
  35. package/dist/cores/index.js +0 -3
  36. package/dist/utils/display/blueprints-formatting.js +2 -1
  37. package/dist/utils/display/resources-formatting.js +8 -3
  38. package/dist/utils/invoke-local.js +1 -1
  39. package/dist/utils/types.d.ts +2 -2
  40. package/oclif.manifest.json +13 -10
  41. package/package.json +1 -1
@@ -19,15 +19,20 @@ function arrayifyEvent(event) {
19
19
  }
20
20
  }
21
21
  else {
22
- if (event.on) {
22
+ if ('on' in event && event.on) {
23
23
  details.push(formatLabeledValue('on', event.on.map((o) => `"${o}"`).join(', ')));
24
24
  }
25
- if (event.filter) {
25
+ if ('filter' in event && event.filter) {
26
26
  details.push(formatLabeledValue('filter', event.filter));
27
27
  }
28
- if (event.projection) {
28
+ if ('projection' in event && event.projection) {
29
29
  details.push(formatLabeledValue('projection', event.projection));
30
30
  }
31
+ // TODO: expose event.resource details once we are ready
32
+ // https://linear.app/sanity/issue/RUN-1246/cli-should-show-eventresource-details-in-blueprints-infoplans
33
+ // if (event.resource) {
34
+ // details.push(formatLabeledValue('resource', JSON.stringify(event.resource)))
35
+ // }
31
36
  }
32
37
  return details;
33
38
  }
@@ -150,7 +150,7 @@ export default async function invoke(resource, payload, context, options) {
150
150
  });
151
151
  timer = setTimeout(() => {
152
152
  shutdown();
153
- reject(new Error(`Timeout: The process exceeded your current timeout limit of ${timeout} seconds. Learn to adjust your Blueprint's timeout settings here: https://www.sanity.io/docs/help/functions-timeout`));
153
+ reject(new Error(`Timeout: Function exceeded the ${timeout}-second time limit.`));
154
154
  }, timeout * 1000);
155
155
  const payload = {
156
156
  data: { ...filteredData },
@@ -1,4 +1,4 @@
1
- import { type BlueprintCorsOriginResource, type BlueprintDatasetResource, type BlueprintDocumentFunctionResource, type BlueprintDocumentWebhookResource, type BlueprintMediaLibraryAssetFunctionResource, type BlueprintProjectResource, type BlueprintResource, type BlueprintRobotResource, type BlueprintRoleResource, type BlueprintScheduledFunctionResource } from '@sanity/blueprints';
1
+ import { type BlueprintCorsOriginResource, type BlueprintDatasetResource, type BlueprintDocumentFunctionResource, type BlueprintDocumentWebhookResource, type BlueprintMediaLibraryAssetFunctionResource, type BlueprintProjectResource, type BlueprintResource, type BlueprintRobotResource, type BlueprintRoleResource, type BlueprintScheduledFunctionResource, type BlueprintSyncTagInvalidateFunctionResource } from '@sanity/blueprints';
2
2
  export type ScopeType = 'organization' | 'project';
3
3
  /** Result utility type */
4
4
  export type Result<T, E = string> = {
@@ -15,7 +15,7 @@ export interface ActionResponse {
15
15
  }
16
16
  /** @internal */
17
17
  export type FunctionGroqResource = BlueprintDocumentFunctionResource | BlueprintMediaLibraryAssetFunctionResource;
18
- export type FunctionResource = FunctionGroqResource | BlueprintScheduledFunctionResource;
18
+ export type FunctionResource = FunctionGroqResource | BlueprintScheduledFunctionResource | BlueprintSyncTagInvalidateFunctionResource;
19
19
  export interface StudioResource extends BlueprintResource {
20
20
  type: 'sanity.studio';
21
21
  src: string;
@@ -314,7 +314,7 @@
314
314
  "blueprints:deploy": {
315
315
  "aliases": [],
316
316
  "args": {},
317
- "description": "Pushes your local Blueprint configuration to the remote Stack; provisioning, updating, or destroying resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.",
317
+ "description": "Applies your local Blueprint to the remote Stack, creating, updating, or removing resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.",
318
318
  "examples": [
319
319
  "<%= config.bin %> <%= command.id %>",
320
320
  "<%= config.bin %> <%= command.id %> --no-wait",
@@ -536,7 +536,7 @@
536
536
  "pluginName": "@sanity/runtime-cli",
537
537
  "pluginType": "core",
538
538
  "strict": true,
539
- "summary": "Destroy the remote Stack deployment and its resources (will not delete local files)",
539
+ "summary": "Destroy a remote Stack deployment and its resources",
540
540
  "enableJsonFlag": true,
541
541
  "isESM": true,
542
542
  "relativePath": [
@@ -550,7 +550,10 @@
550
550
  "aliases": [],
551
551
  "args": {},
552
552
  "description": "Analyzes your local Blueprint and remote Stack configuration for common issues, such as missing authentication, invalid project references, or misconfigured resources.\n\nRun this command when encountering errors with other Blueprint commands. Use --fix to interactively resolve detected issues.",
553
- "examples": [],
553
+ "examples": [
554
+ "<%= config.bin %> <%= command.id %>",
555
+ "<%= config.bin %> <%= command.id %> --fix"
556
+ ],
554
557
  "flags": {
555
558
  "json": {
556
559
  "description": "Format output as json",
@@ -681,7 +684,7 @@
681
684
  "pluginName": "@sanity/runtime-cli",
682
685
  "pluginType": "core",
683
686
  "strict": true,
684
- "summary": "Show information about the local Blueprint's remote Stack deployment",
687
+ "summary": "Display the status and resources of the remote Stack deployment",
685
688
  "enableJsonFlag": true,
686
689
  "isESM": true,
687
690
  "relativePath": [
@@ -841,7 +844,7 @@
841
844
  "pluginName": "@sanity/runtime-cli",
842
845
  "pluginType": "core",
843
846
  "strict": true,
844
- "summary": "Initialize a local Blueprint and optionally provision a remote Stack deployment",
847
+ "summary": "Initialize a Blueprint and create a remote Stack",
845
848
  "enableJsonFlag": true,
846
849
  "isESM": true,
847
850
  "relativePath": [
@@ -998,7 +1001,7 @@
998
1001
  "pluginName": "@sanity/runtime-cli",
999
1002
  "pluginType": "core",
1000
1003
  "strict": true,
1001
- "summary": "Enumerate resources to be deployed to the remote Stack - will not modify any resources",
1004
+ "summary": "Preview changes that will be applied to the remote Stack",
1002
1005
  "enableJsonFlag": true,
1003
1006
  "isESM": true,
1004
1007
  "relativePath": [
@@ -1011,7 +1014,7 @@
1011
1014
  "blueprints:promote": {
1012
1015
  "aliases": [],
1013
1016
  "args": {},
1014
- "description": "EXPERIMENTAL! Promotes a Stack, changing its scope from project to organization. This is a one-way trip.",
1017
+ "description": "Promotes a deployed Stack to organization scope, enabling management of org-level resources. Promotion cannot be reversed.\n\nYour local Blueprint configuration will be updated to reflect the new scope.",
1015
1018
  "examples": [
1016
1019
  "<%= config.bin %> <%= command.id %>",
1017
1020
  "<%= config.bin %> <%= command.id %> --stack <name-or-id>"
@@ -1081,7 +1084,7 @@
1081
1084
  "pluginName": "@sanity/runtime-cli",
1082
1085
  "pluginType": "core",
1083
1086
  "strict": true,
1084
- "summary": "Promote a Stack deployment to a broader scope",
1087
+ "summary": "Promote a Stack from project scope to organization scope",
1085
1088
  "enableJsonFlag": true,
1086
1089
  "isESM": true,
1087
1090
  "relativePath": [
@@ -1177,7 +1180,7 @@
1177
1180
  "pluginName": "@sanity/runtime-cli",
1178
1181
  "pluginType": "core",
1179
1182
  "strict": true,
1180
- "summary": "List all remote Stack deployments (defaults to the current Blueprint's project scope)",
1183
+ "summary": "List remote Stack deployments for your project or organization",
1181
1184
  "enableJsonFlag": true,
1182
1185
  "isESM": true,
1183
1186
  "relativePath": [
@@ -2235,5 +2238,5 @@
2235
2238
  ]
2236
2239
  }
2237
2240
  },
2238
- "version": "14.8.6"
2241
+ "version": "14.9.0"
2239
2242
  }
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": "14.8.6",
4
+ "version": "14.9.0",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",