@sanity/runtime-cli 17.4.0-blueprinit.g0ac8878 → 17.5.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 (72) hide show
  1. package/README.md +50 -47
  2. package/SKILL.md +50 -12
  3. package/dist/actions/blueprints/pre-deploy.d.ts +15 -6
  4. package/dist/actions/blueprints/pre-deploy.js +29 -70
  5. package/dist/actions/blueprints/process-assets.d.ts +29 -0
  6. package/dist/actions/blueprints/process-assets.js +80 -0
  7. package/dist/commands/blueprints/deploy.js +3 -1
  8. package/dist/commands/blueprints/destroy.js +1 -1
  9. package/dist/commands/blueprints/info.d.ts +1 -0
  10. package/dist/commands/blueprints/info.js +5 -0
  11. package/dist/commands/blueprints/init.js +1 -2
  12. package/dist/commands/blueprints/logs.js +1 -0
  13. package/dist/commands/functions/add.js +3 -3
  14. package/dist/commands/functions/dev.js +2 -2
  15. package/dist/commands/functions/logs.d.ts +1 -1
  16. package/dist/commands/functions/logs.js +3 -0
  17. package/dist/cores/blueprints/deploy.js +69 -19
  18. package/dist/cores/functions/add.js +1 -1
  19. package/dist/utils/display/blueprints-formatting.js +3 -3
  20. package/dist/utils/style-text.js +1 -0
  21. package/oclif.manifest.json +20 -143
  22. package/package.json +27 -17
  23. package/skills/_functions-build.md +23 -0
  24. package/skills/_functions-list.md +28 -0
  25. package/skills/blueprints-add.md +8 -0
  26. package/skills/blueprints-config.md +33 -0
  27. package/skills/blueprints-deploy.md +36 -0
  28. package/skills/blueprints-destroy.md +30 -0
  29. package/skills/blueprints-doctor.md +31 -0
  30. package/skills/blueprints-info.md +23 -0
  31. package/skills/blueprints-init.md +48 -0
  32. package/skills/blueprints-logs.md +33 -0
  33. package/skills/blueprints-mint-deploy-token.md +25 -0
  34. package/skills/blueprints-plan.md +28 -0
  35. package/skills/blueprints-promote.md +31 -0
  36. package/skills/blueprints-stacks.md +28 -0
  37. package/skills/functions-add.md +35 -0
  38. package/skills/functions-dev.md +21 -0
  39. package/skills/functions-env-add.md +29 -0
  40. package/skills/functions-env-list.md +21 -0
  41. package/skills/functions-env-remove.md +22 -0
  42. package/skills/functions-logs.md +39 -0
  43. package/skills/functions-test.md +31 -0
  44. package/dist/actions/blueprinit/manifest.d.ts +0 -15
  45. package/dist/actions/blueprinit/manifest.js +0 -76
  46. package/dist/actions/blueprinit/studio.d.ts +0 -6
  47. package/dist/actions/blueprinit/studio.js +0 -43
  48. package/dist/actions/blueprinit/templates.d.ts +0 -34
  49. package/dist/actions/blueprinit/templates.js +0 -83
  50. package/dist/actions/blueprinit/workspace.d.ts +0 -16
  51. package/dist/actions/blueprinit/workspace.js +0 -143
  52. package/dist/actions/sanity/datasets.d.ts +0 -15
  53. package/dist/actions/sanity/datasets.js +0 -26
  54. package/dist/commands/blueprinit.d.ts +0 -17
  55. package/dist/commands/blueprinit.js +0 -59
  56. package/dist/cores/blueprinit/adopt.d.ts +0 -6
  57. package/dist/cores/blueprinit/adopt.js +0 -119
  58. package/dist/cores/blueprinit/finish.d.ts +0 -14
  59. package/dist/cores/blueprinit/finish.js +0 -64
  60. package/dist/cores/blueprinit/fresh.d.ts +0 -3
  61. package/dist/cores/blueprinit/fresh.js +0 -120
  62. package/dist/cores/blueprinit/preview.d.ts +0 -15
  63. package/dist/cores/blueprinit/preview.js +0 -14
  64. package/dist/cores/blueprinit/prompts.d.ts +0 -5
  65. package/dist/cores/blueprinit/prompts.js +0 -22
  66. package/dist/cores/blueprinit/selection.d.ts +0 -15
  67. package/dist/cores/blueprinit/selection.js +0 -90
  68. package/dist/cores/blueprinit/types.d.ts +0 -16
  69. package/dist/cores/blueprinit/types.js +0 -1
  70. package/dist/cores/blueprinit.d.ts +0 -7
  71. package/dist/cores/blueprinit.js +0 -48
  72. package/skills/blueprinit.md +0 -155
@@ -0,0 +1,80 @@
1
+ import { env } from 'node:process';
2
+ import { stashAsset } from './assets.js';
3
+ const DEFAULT_ASSET_CONCURRENCY = 4;
4
+ const DEFAULT_ASSET_TIMEOUT = 180;
5
+ const assetTimeoutS = Number(env.SANITY_ASSET_TIMEOUT) || DEFAULT_ASSET_TIMEOUT;
6
+ const assetTimeoutMs = assetTimeoutS * 1000;
7
+ const warnTimeoutMs = assetTimeoutMs / 3;
8
+ export async function processAssets(options) {
9
+ const { assetResources, onProgress, onResult } = options;
10
+ const total = assetResources.length;
11
+ const processedAssets = [];
12
+ const concurrency = getAssetConcurrency();
13
+ let completed = 0;
14
+ let slow = false;
15
+ const reportProgress = () => onProgress?.({ completed, total, slow });
16
+ reportProgress();
17
+ const warnTimer = setTimeout(() => {
18
+ slow = true;
19
+ reportProgress();
20
+ }, warnTimeoutMs);
21
+ try {
22
+ for (let start = 0; start < total; start += concurrency) {
23
+ const batch = assetResources.slice(start, start + concurrency);
24
+ const batchResults = await Promise.all(batch.map(async (resource) => {
25
+ const result = await processAsset(resource, options);
26
+ completed += 1;
27
+ reportProgress();
28
+ onResult?.(result);
29
+ return result;
30
+ }));
31
+ processedAssets.push(...batchResults);
32
+ if (batchResults.some((result) => !result.success))
33
+ break;
34
+ }
35
+ }
36
+ finally {
37
+ clearTimeout(warnTimer);
38
+ }
39
+ return processedAssets;
40
+ }
41
+ function getAssetConcurrency() {
42
+ const configured = Number(env.SANITY_ASSET_CONCURRENCY);
43
+ return Number.isSafeInteger(configured) && configured > 0 ? configured : DEFAULT_ASSET_CONCURRENCY;
44
+ }
45
+ async function processAsset(resource, options) {
46
+ const { auth, blueprintFileDir, installer, logger } = options;
47
+ let assetTimeoutTimer;
48
+ let result;
49
+ try {
50
+ result = await Promise.race([
51
+ stashAsset({ resource, blueprintFileDir, auth, logger, installer }),
52
+ new Promise((_, reject) => {
53
+ assetTimeoutTimer = setTimeout(() => {
54
+ reject(new Error(`Processing ${resource.name} timed out after ${assetTimeoutS}s`));
55
+ }, assetTimeoutMs);
56
+ }),
57
+ ]);
58
+ }
59
+ catch (err) {
60
+ const msg = err instanceof Error ? err.message : String(err);
61
+ return { success: false, resource, error: msg, failureKind: 'processing' };
62
+ }
63
+ finally {
64
+ clearTimeout(assetTimeoutTimer);
65
+ }
66
+ if (result.success && result.assetId) {
67
+ return {
68
+ success: true,
69
+ resource: { ...resource, src: result.assetId },
70
+ hash: result.hash,
71
+ exists: result.exists,
72
+ };
73
+ }
74
+ return {
75
+ success: false,
76
+ resource,
77
+ error: result.error || 'Failed to process asset',
78
+ failureKind: 'upload',
79
+ };
80
+ }
@@ -14,7 +14,9 @@ Use --no-wait to queue the deployment and return immediately without waiting for
14
14
 
15
15
  Use --fn-installer to force which package manager to use when deploying functions.
16
16
 
17
- Set SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.
17
+ Set SANITY_ASSET_TIMEOUT (seconds) to override the 180-second timeout for processing resource assets.
18
+
19
+ Set SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).
18
20
 
19
21
  Exit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).`;
20
22
  static examples = [
@@ -19,7 +19,7 @@ Exit codes: 0 destroyed, 2 destruction failed, 75 destruction accepted but compl
19
19
  static flags = {
20
20
  force: Flags.boolean({
21
21
  description: 'Force Stack destruction (skip confirmation)',
22
- aliases: ['f'],
22
+ char: 'f',
23
23
  default: false,
24
24
  }),
25
25
  'project-id': Flags.string({
@@ -8,6 +8,7 @@ export default class InfoCommand extends ResolvedCommand<typeof InfoCommand> {
8
8
  stack: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  'organization-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  };
12
13
  run(): Promise<Record<string, unknown> | undefined>;
13
14
  }
@@ -23,6 +23,11 @@ Run 'blueprints stacks' to see all available Stacks in your project or organizat
23
23
  }),
24
24
  'project-id': Flags.string({ ...projectIdFlagConfig }),
25
25
  'organization-id': Flags.string({ ...organizationIdFlagConfig }),
26
+ verbose: Flags.boolean({
27
+ char: 'v',
28
+ description: 'Show resource and external IDs',
29
+ default: false,
30
+ }),
26
31
  };
27
32
  async run() {
28
33
  const result = await blueprintInfoCore({
@@ -6,10 +6,9 @@ import { validTokenOrErrorMessage } from '../../utils/validated-token.js';
6
6
  export default class InitCommand extends RuntimeCommand {
7
7
  static summary = 'Initialize a Blueprint and create a remote Stack';
8
8
  static description = `A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.
9
- [NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]
10
9
 
11
10
  This is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.
12
- Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.
11
+ Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. A .gitignore covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not ignored.
13
12
 
14
13
  After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
15
14
 
@@ -28,6 +28,7 @@ If you're not seeing expected logs, verify your Stack is deployed with 'blueprin
28
28
  char: 'w',
29
29
  description: 'Watch for new Stack logs',
30
30
  aliases: ['follow'],
31
+ exclusive: ['json'],
31
32
  }),
32
33
  limit: Flags.integer({
33
34
  char: 'l',
@@ -23,7 +23,7 @@ After adding, use 'functions dev' to test locally, then 'blueprints deploy' to p
23
23
  example: Flags.string({
24
24
  description: 'Example to use for the Function',
25
25
  aliases: ['recipe'],
26
- exclusive: ['name', 'fn-type', 'language', 'javascript', 'fn-helpers', 'fn-installer'],
26
+ exclusive: ['name', 'type', 'language', 'javascript', 'helpers', 'installer', 'install'],
27
27
  }),
28
28
  name: Flags.string({
29
29
  description: 'Name of the Function to add',
@@ -56,9 +56,9 @@ After adding, use 'functions dev' to test locally, then 'blueprints deploy' to p
56
56
  options: ['skip', ...INSTALLER_OPTIONS],
57
57
  }),
58
58
  install: Flags.boolean({
59
- description: 'Shortcut for --fn-installer npm',
59
+ description: 'Shortcut for --installer npm',
60
60
  char: 'i',
61
- exclusive: ['fn-installer'],
61
+ exclusive: ['installer'],
62
62
  }),
63
63
  };
64
64
  async run() {
@@ -9,11 +9,11 @@ export default class DevCommand extends ResolvedCommand {
9
9
 
10
10
  Open the emulator in your browser to interactively test your functions with the payload editor.
11
11
 
12
- Optionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.
12
+ Optionally, set the host and port with the --host and --port flags. Port 8974 is reserved for the emulator's live-reload WebSocket server. Function timeout can be configured with the --timeout flag.
13
13
 
14
14
  To invoke a function with the CLI, use 'functions test'.`;
15
15
  static examples = [
16
- '<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974',
16
+ '<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 3333',
17
17
  '<%= config.bin %> <%= command.id %> --timeout 60',
18
18
  ];
19
19
  static flags = {
@@ -15,5 +15,5 @@ export default class LogsCommand extends ResolvedCommand<typeof LogsCommand> {
15
15
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  watch: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
17
  };
18
- run(): Promise<Record<string, unknown> | undefined>;
18
+ run(): Promise<void | Record<string, unknown>>;
19
19
  }
@@ -46,6 +46,7 @@ Use --watch (-w) to stream logs in real-time. Use --delete to clear all logs for
46
46
  char: 'w',
47
47
  description: 'Watch for new logs (streaming mode)',
48
48
  aliases: ['follow'],
49
+ exclusive: ['json'],
49
50
  }),
50
51
  };
51
52
  async run() {
@@ -67,6 +68,8 @@ Use --watch (-w) to stream logs in real-time. Use --delete to clear all logs for
67
68
  });
68
69
  if (!result.success)
69
70
  this.coreError(result);
71
+ if (result.streaming)
72
+ return result.streaming;
70
73
  return result.json;
71
74
  }
72
75
  }
@@ -4,21 +4,21 @@ import { getStack, updateStack } from '../../actions/blueprints/stacks.js';
4
4
  import { waitForOperation } from '../../actions/blueprints/wait-for-operation.js';
5
5
  import { checkUserPermission } from '../../actions/sanity/access.js';
6
6
  import { createHintCollector } from '../../utils/blueprints/hints.js';
7
- import { niceId } from '../../utils/display/presenters.js';
7
+ import { check, niceId, severe } from '../../utils/display/presenters.js';
8
8
  import { CODE_OPERATION_UNCONFIRMED, EXIT_OPERATION_UNCONFIRMED } from '../../utils/exit-codes.js';
9
9
  import { styleText } from '../../utils/style-text.js';
10
10
  import { getWarnings } from '../../utils/warnings.js';
11
11
  export async function blueprintDeployCore(options) {
12
- const { bin = 'sanity', log, auth, stackId, scopeType, scopeId, deployedStack, blueprint, flags, } = options;
12
+ const { bin = 'sanity', log: logger, auth, stackId, scopeType, scopeId, deployedStack, blueprint, flags, } = options;
13
13
  const { verbose } = flags;
14
14
  const noWait = flags['no-wait'] || false;
15
15
  const stackName = flags['new-stack-name'] ?? deployedStack.name;
16
16
  const installer = flags['fn-installer'] || undefined;
17
17
  const blueprintFileDir = dirname(blueprint.fileInfo.blueprintFilePath);
18
18
  const workspaceWarnings = getWarnings({ dir: blueprintFileDir });
19
- log(`Deploying "${stackName}" ${niceId(deployedStack.id)}...`);
19
+ logger(`Deploying "${stackName}" ${niceId(deployedStack.id)}...`);
20
20
  try {
21
- const { ok: checkOk, stack: currentStack } = await getStack({ stackId, auth, logger: log });
21
+ const { ok: checkOk, stack: currentStack } = await getStack({ stackId, auth, logger });
22
22
  if (!checkOk) {
23
23
  return { success: false, error: 'Failed to check current Stack status' };
24
24
  }
@@ -37,20 +37,20 @@ export async function blueprintDeployCore(options) {
37
37
  const preDeployResult = await preDeploy({
38
38
  scopeType,
39
39
  scopeId,
40
- resources,
40
+ resources, // mutated by preDeploy
41
41
  stackId,
42
42
  stackName,
43
43
  auth,
44
44
  blueprintFileDir,
45
45
  installer,
46
- log,
46
+ logger,
47
47
  bin,
48
48
  verbose,
49
+ onAssetEvent: createAssetEventHandler(logger),
49
50
  });
50
- if (!preDeployResult?.success) {
51
+ if (!preDeployResult?.success)
51
52
  return preDeployResult;
52
- }
53
- const spinner = log.ora('Deploying...').start();
53
+ const deploySpinner = logger.ora('Deploying...').start();
54
54
  const { ok: deployOk, stack, error: deployError, } = await updateStack({
55
55
  stackId,
56
56
  stackMutation: {
@@ -61,10 +61,10 @@ export async function blueprintDeployCore(options) {
61
61
  userMessage: flags.message,
62
62
  },
63
63
  auth,
64
- logger: log,
64
+ logger,
65
65
  });
66
66
  if (!deployOk) {
67
- spinner.fail(`${styleText('red', 'Failed')} to update Stack deployment`);
67
+ deploySpinner.fail(`${styleText('red', 'Failed')} to update Stack deployment`);
68
68
  const hints = createHintCollector(bin);
69
69
  if (deployError) {
70
70
  hints.inspectMessage(deployError);
@@ -79,18 +79,18 @@ export async function blueprintDeployCore(options) {
79
79
  ],
80
80
  };
81
81
  }
82
- spinner.stop().clear();
82
+ deploySpinner.stop().clear();
83
83
  const legacyPermissionsNoticePromise = CHECK_LEGACY_DEPLOY_PERMISSION
84
84
  ? checkLegacyDeployPermission({
85
85
  auth,
86
86
  scopeType,
87
87
  scopeId,
88
- log,
88
+ log: logger,
89
89
  })
90
90
  : Promise.resolve(null);
91
91
  if (noWait) {
92
- log(styleText(['bold', 'green'], 'Stack deployment started!'));
93
- log(`Use \`npx ${bin} blueprints info\` to check status`);
92
+ logger(styleText(['bold', 'green'], 'Stack deployment started!'));
93
+ logger(`Use \`npx ${bin} blueprints info\` to check status`);
94
94
  const legacyWarning = await legacyPermissionsNoticePromise;
95
95
  const warnings = [...(legacyWarning ? [legacyWarning] : []), ...workspaceWarnings];
96
96
  return {
@@ -100,19 +100,19 @@ export async function blueprintDeployCore(options) {
100
100
  warnings: warnings.length ? warnings : undefined,
101
101
  };
102
102
  }
103
- log(styleText('dim', 'Stack deployment progress:'));
104
- log('');
103
+ logger(styleText('dim', 'Stack deployment progress:'));
104
+ logger('');
105
105
  const outcome = await waitForOperation({
106
106
  stackId,
107
107
  operationId: stack.operationId,
108
108
  auth,
109
- log,
109
+ log: logger,
110
110
  bin,
111
111
  verbose,
112
112
  progressNoun: 'deployment',
113
113
  });
114
114
  if (outcome.type === 'completed') {
115
- log(styleText(['bold', 'green'], 'Stack deployment completed!'));
115
+ logger(styleText(['bold', 'green'], 'Stack deployment completed!'));
116
116
  const legacyWarning = await legacyPermissionsNoticePromise;
117
117
  const warnings = [...(legacyWarning ? [legacyWarning] : []), ...workspaceWarnings];
118
118
  return {
@@ -151,6 +151,56 @@ export async function blueprintDeployCore(options) {
151
151
  return { success: false, error: errorMessage };
152
152
  }
153
153
  }
154
+ function createAssetEventHandler(logger) {
155
+ let spinner;
156
+ const results = [];
157
+ return (event) => {
158
+ switch (event.type) {
159
+ case 'progress': {
160
+ const { completed, total, slow } = event.progress;
161
+ const text = [
162
+ `Processing assets (${completed}/${total})`,
163
+ slow ? ', this can take a moment' : '',
164
+ ].join('');
165
+ if (spinner)
166
+ spinner.text = text;
167
+ else
168
+ spinner = logger.ora(text).start();
169
+ return;
170
+ }
171
+ case 'result': {
172
+ results.push(event.result);
173
+ return;
174
+ }
175
+ case 'complete': {
176
+ spinner?.stop();
177
+ spinner = undefined;
178
+ break;
179
+ }
180
+ }
181
+ // done. print report
182
+ for (const result of results) {
183
+ const { resource } = result;
184
+ if (!result.success) {
185
+ const summary = result.failureKind === 'upload'
186
+ ? `Failed uploading ${resource.name} asset`
187
+ : `Failed processing ${resource.name} asset`;
188
+ logger(` ${severe(summary)}`);
189
+ logger.error(` ${result.error}`);
190
+ continue;
191
+ }
192
+ logger(` ${check(`${resource.name} ${niceId(resource.src)}`)}`);
193
+ logger(` Source: ${resource.src}`);
194
+ if (result.hash) {
195
+ const hash = result.hash;
196
+ const h = hash.length > 24 ? `${hash.slice(0, 8)}...${hash.slice(-12)}` : hash;
197
+ logger.verbose(` Hash: ${h}`);
198
+ }
199
+ if (result.exists)
200
+ logger.verbose(' Asset unchanged');
201
+ }
202
+ };
203
+ }
154
204
  const CHECK_LEGACY_DEPLOY_PERMISSION = false;
155
205
  const BLUEPRINTS_PERMISSION_ENFORCEMENT_DATE = 'July 1, 2026';
156
206
  async function checkLegacyDeployPermission({ auth, scopeType, scopeId, log, }) {
@@ -224,7 +224,7 @@ async function promptForFunctionName() {
224
224
  const functionName = await input({
225
225
  message: 'Enter function name:',
226
226
  validate: (input) => validateFunctionName(input) ||
227
- 'Invalid function name. Must be 6+ characters, no special characters, no spaces',
227
+ 'Invalid function name. Must be 3+ characters, no special characters, no spaces',
228
228
  });
229
229
  return functionName;
230
230
  }
@@ -72,15 +72,15 @@ function resourceName(res, displayNameAttribute) {
72
72
  nameParts.push(styleText('green', `"${displayName}"`));
73
73
  return nameParts.join(' ');
74
74
  }
75
- function deployedResourceName(res, displayNameAttribute, _verbose = false) {
75
+ function deployedResourceName(res, displayNameAttribute, verbose = false) {
76
76
  const nameParts = [styleText(['bold', 'green'], res.name)];
77
77
  const displayName = displayNameAttribute &&
78
78
  typeof res.parameters[displayNameAttribute] === 'string' &&
79
79
  res.parameters[displayNameAttribute];
80
80
  if (displayName && displayName !== res.name)
81
81
  nameParts.push(styleText('green', `"${displayName}"`));
82
- // if (verbose)
83
- nameParts.push(idList(res));
82
+ if (verbose)
83
+ nameParts.push(idList(res));
84
84
  return nameParts.join(' ');
85
85
  }
86
86
  function idList(res) {
@@ -1,3 +1,4 @@
1
+ // TODO: move to ./display
1
2
  import { env } from 'node:process';
2
3
  import { styleText as nodeStyleText } from 'node:util';
3
4
  import { isInteractive } from './interactive.js';
@@ -1,133 +1,5 @@
1
1
  {
2
2
  "commands": {
3
- "blueprinit": {
4
- "aliases": [],
5
- "args": {},
6
- "description": "Scaffolds a Blueprint, Studio, and starter function around an existing Sanity project.\n\nThis hidden command is an experiment; its interface and generated files are not stable.",
7
- "examples": [
8
- "<%= config.bin %> <%= command.id %>",
9
- "<%= config.bin %> <%= command.id %> --yes",
10
- "<%= config.bin %> <%= command.id %> --project-id <id> --dataset <name> --yes"
11
- ],
12
- "flags": {
13
- "json": {
14
- "description": "Format output as json",
15
- "name": "json",
16
- "allowNo": false,
17
- "type": "boolean"
18
- },
19
- "path": {
20
- "aliases": [
21
- "blueprint-path"
22
- ],
23
- "char": "p",
24
- "description": "Path to a Blueprint file or directory containing one",
25
- "env": "SANITY_BLUEPRINT_PATH",
26
- "hidden": true,
27
- "name": "path",
28
- "hasDynamicHelp": false,
29
- "multiple": false,
30
- "type": "option"
31
- },
32
- "trace": {
33
- "description": "Trace output",
34
- "hidden": true,
35
- "name": "trace",
36
- "allowNo": false,
37
- "type": "boolean"
38
- },
39
- "validate-resources": {
40
- "description": "Validate resources",
41
- "hidden": true,
42
- "name": "validate-resources",
43
- "allowNo": true,
44
- "type": "boolean"
45
- },
46
- "verbose": {
47
- "description": "Verbose output",
48
- "hidden": true,
49
- "name": "verbose",
50
- "allowNo": false,
51
- "type": "boolean"
52
- },
53
- "llms": {
54
- "aliases": [
55
- "skill"
56
- ],
57
- "description": "Show agent-oriented guidance for this command",
58
- "name": "llms",
59
- "allowNo": false,
60
- "type": "boolean"
61
- },
62
- "yes": {
63
- "char": "y",
64
- "description": "Skip confirmation prompts",
65
- "name": "yes",
66
- "allowNo": false,
67
- "type": "boolean"
68
- },
69
- "organization-id": {
70
- "aliases": [
71
- "organization",
72
- "organizationId",
73
- "org"
74
- ],
75
- "description": "Organization to use when the account has several",
76
- "name": "organization-id",
77
- "hasDynamicHelp": false,
78
- "multiple": false,
79
- "type": "option"
80
- },
81
- "project-id": {
82
- "aliases": [
83
- "project",
84
- "projectId"
85
- ],
86
- "description": "Project to use when the organization has several",
87
- "name": "project-id",
88
- "hasDynamicHelp": false,
89
- "multiple": false,
90
- "type": "option"
91
- },
92
- "dataset": {
93
- "description": "Dataset to attach",
94
- "name": "dataset",
95
- "hasDynamicHelp": false,
96
- "multiple": false,
97
- "type": "option"
98
- },
99
- "stack-name": {
100
- "description": "Name for the new organization-scoped Stack",
101
- "name": "stack-name",
102
- "hasDynamicHelp": false,
103
- "multiple": false,
104
- "type": "option"
105
- },
106
- "studio-name": {
107
- "description": "Name and hosted slug for the Studio resource",
108
- "name": "studio-name",
109
- "hasDynamicHelp": false,
110
- "multiple": false,
111
- "type": "option"
112
- }
113
- },
114
- "hasDynamicHelp": false,
115
- "hidden": true,
116
- "hiddenAliases": [],
117
- "id": "blueprinit",
118
- "pluginAlias": "@sanity/runtime-cli",
119
- "pluginName": "@sanity/runtime-cli",
120
- "pluginType": "core",
121
- "strict": true,
122
- "summary": "Experimental blueprints-first project init",
123
- "enableJsonFlag": true,
124
- "isESM": true,
125
- "relativePath": [
126
- "dist",
127
- "commands",
128
- "blueprinit.js"
129
- ]
130
- },
131
3
  "blueprints:add": {
132
4
  "aliases": [],
133
5
  "args": {
@@ -501,7 +373,7 @@
501
373
  "blueprints:deploy": {
502
374
  "aliases": [],
503
375
  "args": {},
504
- "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.\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
376
+ "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 180-second timeout for processing resource assets.\n\nSet SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
505
377
  "examples": [
506
378
  "<%= config.bin %> <%= command.id %>",
507
379
  "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
@@ -757,9 +629,7 @@
757
629
  "type": "option"
758
630
  },
759
631
  "force": {
760
- "aliases": [
761
- "f"
762
- ],
632
+ "char": "f",
763
633
  "description": "Force Stack destruction (skip confirmation)",
764
634
  "name": "force",
765
635
  "allowNo": false,
@@ -909,8 +779,8 @@
909
779
  "type": "boolean"
910
780
  },
911
781
  "verbose": {
912
- "description": "Verbose output",
913
- "hidden": true,
782
+ "char": "v",
783
+ "description": "Show resource and external IDs",
914
784
  "name": "verbose",
915
785
  "allowNo": false,
916
786
  "type": "boolean"
@@ -983,7 +853,7 @@
983
853
  "name": "dir"
984
854
  }
985
855
  },
986
- "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
856
+ "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. A .gitignore covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not ignored.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
987
857
  "examples": [
988
858
  "<%= config.bin %> <%= command.id %>",
989
859
  "<%= config.bin %> <%= command.id %> .",
@@ -1260,6 +1130,9 @@
1260
1130
  ],
1261
1131
  "char": "w",
1262
1132
  "description": "Watch for new Stack logs",
1133
+ "exclusive": [
1134
+ "json"
1135
+ ],
1263
1136
  "name": "watch",
1264
1137
  "allowNo": false,
1265
1138
  "type": "boolean"
@@ -1896,11 +1769,12 @@
1896
1769
  "description": "Example to use for the Function",
1897
1770
  "exclusive": [
1898
1771
  "name",
1899
- "fn-type",
1772
+ "type",
1900
1773
  "language",
1901
1774
  "javascript",
1902
- "fn-helpers",
1903
- "fn-installer"
1775
+ "helpers",
1776
+ "installer",
1777
+ "install"
1904
1778
  ],
1905
1779
  "name": "example",
1906
1780
  "hasDynamicHelp": false,
@@ -1984,9 +1858,9 @@
1984
1858
  },
1985
1859
  "install": {
1986
1860
  "char": "i",
1987
- "description": "Shortcut for --fn-installer npm",
1861
+ "description": "Shortcut for --installer npm",
1988
1862
  "exclusive": [
1989
- "fn-installer"
1863
+ "installer"
1990
1864
  ],
1991
1865
  "name": "install",
1992
1866
  "allowNo": false,
@@ -2152,9 +2026,9 @@
2152
2026
  "functions:dev": {
2153
2027
  "aliases": [],
2154
2028
  "args": {},
2155
- "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
2029
+ "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Port 8974 is reserved for the emulator's live-reload WebSocket server. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
2156
2030
  "examples": [
2157
- "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
2031
+ "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 3333",
2158
2032
  "<%= config.bin %> <%= command.id %> --timeout 60"
2159
2033
  ],
2160
2034
  "flags": {
@@ -2538,6 +2412,9 @@
2538
2412
  ],
2539
2413
  "char": "w",
2540
2414
  "description": "Watch for new logs (streaming mode)",
2415
+ "exclusive": [
2416
+ "json"
2417
+ ],
2541
2418
  "name": "watch",
2542
2419
  "allowNo": false,
2543
2420
  "type": "boolean"
@@ -3248,5 +3125,5 @@
3248
3125
  ]
3249
3126
  }
3250
3127
  },
3251
- "version": "17.4.0-blueprinit.g0ac8878"
3128
+ "version": "17.5.0"
3252
3129
  }