@sanity/runtime-cli 16.0.2 → 17.0.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 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/16.0.2 linux-x64 node-v24.16.0
23
+ @sanity/runtime-cli/17.0.0 linux-x64 node-v24.16.0
24
24
  $ sanity-run --help [COMMAND]
25
25
  USAGE
26
26
  $ sanity-run COMMAND
@@ -103,7 +103,7 @@ EXAMPLES
103
103
  $ sanity-run blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
104
104
  ```
105
105
 
106
- _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/add.ts)_
106
+ _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/add.ts)_
107
107
 
108
108
  ## `sanity-run blueprints config`
109
109
 
@@ -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/v16.0.2/src/commands/blueprints/config.ts)_
143
+ _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/config.ts)_
144
144
 
145
145
  ## `sanity-run blueprints deploy`
146
146
 
@@ -194,7 +194,7 @@ EXAMPLES
194
194
  $ sanity-run blueprints deploy --new-stack-name <new-name>
195
195
  ```
196
196
 
197
- _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/deploy.ts)_
197
+ _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/deploy.ts)_
198
198
 
199
199
  ## `sanity-run blueprints destroy`
200
200
 
@@ -232,7 +232,7 @@ EXAMPLES
232
232
  $ sanity-run blueprints destroy --stack <name-or-id> --project-id <projectId> --force --no-wait
233
233
  ```
234
234
 
235
- _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/destroy.ts)_
235
+ _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/destroy.ts)_
236
236
 
237
237
  ## `sanity-run blueprints doctor`
238
238
 
@@ -263,7 +263,7 @@ EXAMPLES
263
263
  $ sanity-run blueprints doctor --fix
264
264
  ```
265
265
 
266
- _See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/doctor.ts)_
266
+ _See code: [src/commands/blueprints/doctor.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/doctor.ts)_
267
267
 
268
268
  ## `sanity-run blueprints info`
269
269
 
@@ -300,7 +300,7 @@ EXAMPLES
300
300
  $ sanity-run blueprints info --organization-id <orgId> --stack <name-or-id>
301
301
  ```
302
302
 
303
- _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/info.ts)_
303
+ _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/info.ts)_
304
304
 
305
305
  ## `sanity-run blueprints init [DIR]`
306
306
 
@@ -312,7 +312,7 @@ USAGE
312
312
  --stack-id <value> | --stack-name <value>] [--project-id <value> | --organization-id <value>]
313
313
 
314
314
  ARGUMENTS
315
- [DIR] Directory to create the local Blueprint in
315
+ [DIR] Directory to create the local Blueprint in (defaults to the current directory)
316
316
 
317
317
  FLAGS
318
318
  --blueprint-type=<option> Blueprint manifest type to use for the local Blueprint
@@ -339,9 +339,14 @@ DESCRIPTION
339
339
 
340
340
  After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
341
341
 
342
+ Running without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the
343
+ current directory without a prompt.
344
+
342
345
  EXAMPLES
343
346
  $ sanity-run blueprints init
344
347
 
348
+ $ sanity-run blueprints init .
349
+
345
350
  $ sanity-run blueprints init [directory]
346
351
 
347
352
  $ sanity-run blueprints init --blueprint-type <json|js|ts>
@@ -359,7 +364,7 @@ EXAMPLES
359
364
  $ sanity-run blueprints init old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>
360
365
  ```
361
366
 
362
- _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/init.ts)_
367
+ _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/init.ts)_
363
368
 
364
369
  ## `sanity-run blueprints logs`
365
370
 
@@ -405,7 +410,7 @@ EXAMPLES
405
410
  $ sanity-run blueprints logs --before 2026-05-01T00:00:00Z
406
411
  ```
407
412
 
408
- _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/logs.ts)_
413
+ _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/logs.ts)_
409
414
 
410
415
  ## `sanity-run blueprints mint-deploy-token`
411
416
 
@@ -450,7 +455,7 @@ EXAMPLES
450
455
  $ sanity-run blueprints mint-deploy-token --organization-id <orgId>
451
456
  ```
452
457
 
453
- _See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/mint-deploy-token.ts)_
458
+ _See code: [src/commands/blueprints/mint-deploy-token.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/mint-deploy-token.ts)_
454
459
 
455
460
  ## `sanity-run blueprints plan`
456
461
 
@@ -483,7 +488,7 @@ EXAMPLES
483
488
  $ sanity-run blueprints plan --organization-id <orgId> --stack <name-or-id>
484
489
  ```
485
490
 
486
- _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/plan.ts)_
491
+ _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/plan.ts)_
487
492
 
488
493
  ## `sanity-run blueprints promote`
489
494
 
@@ -519,7 +524,7 @@ EXAMPLES
519
524
  $ sanity-run blueprints promote --new-stack-name <new-name>
520
525
  ```
521
526
 
522
- _See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/promote.ts)_
527
+ _See code: [src/commands/blueprints/promote.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/promote.ts)_
523
528
 
524
529
  ## `sanity-run blueprints stacks`
525
530
 
@@ -555,7 +560,7 @@ EXAMPLES
555
560
  $ sanity-run blueprints stacks --organization-id <organizationId> --include-projects
556
561
  ```
557
562
 
558
- _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/blueprints/stacks.ts)_
563
+ _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/blueprints/stacks.ts)_
559
564
 
560
565
  ## `sanity-run functions add`
561
566
 
@@ -607,7 +612,7 @@ EXAMPLES
607
612
  $ sanity-run functions add --name my-function --type document-create --type document-update --lang js
608
613
  ```
609
614
 
610
- _See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/add.ts)_
615
+ _See code: [src/commands/functions/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/add.ts)_
611
616
 
612
617
  ## `sanity-run functions dev`
613
618
 
@@ -642,7 +647,7 @@ EXAMPLES
642
647
  $ sanity-run functions dev --timeout 60
643
648
  ```
644
649
 
645
- _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/dev.ts)_
650
+ _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/dev.ts)_
646
651
 
647
652
  ## `sanity-run functions env add NAME KEY VALUE`
648
653
 
@@ -672,7 +677,7 @@ EXAMPLES
672
677
  $ sanity-run functions env add MyFunction API_URL https://api.example.com/
673
678
  ```
674
679
 
675
- _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/env/add.ts)_
680
+ _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/env/add.ts)_
676
681
 
677
682
  ## `sanity-run functions env list NAME`
678
683
 
@@ -699,7 +704,7 @@ EXAMPLES
699
704
  $ sanity-run functions env list MyFunction
700
705
  ```
701
706
 
702
- _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/env/list.ts)_
707
+ _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/env/list.ts)_
703
708
 
704
709
  ## `sanity-run functions env remove NAME KEY`
705
710
 
@@ -728,7 +733,7 @@ EXAMPLES
728
733
  $ sanity-run functions env remove MyFunction API_URL
729
734
  ```
730
735
 
731
- _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/env/remove.ts)_
736
+ _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/env/remove.ts)_
732
737
 
733
738
  ## `sanity-run functions logs [NAME]`
734
739
 
@@ -768,7 +773,7 @@ EXAMPLES
768
773
  $ sanity-run functions logs <name> --delete
769
774
  ```
770
775
 
771
- _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/logs.ts)_
776
+ _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/logs.ts)_
772
777
 
773
778
  ## `sanity-run functions test [NAME]`
774
779
 
@@ -825,7 +830,7 @@ EXAMPLES
825
830
  $ sanity-run functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
826
831
  ```
827
832
 
828
- _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v16.0.2/src/commands/functions/test.ts)_
833
+ _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v17.0.0/src/commands/functions/test.ts)_
829
834
 
830
835
  ## `sanity-run help [COMMAND]`
831
836
 
@@ -845,5 +850,5 @@ DESCRIPTION
845
850
  Display help for sanity-run.
846
851
  ```
847
852
 
848
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.46/src/commands/help.ts)_
853
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.50/src/commands/help.ts)_
849
854
  <!-- commandsstop -->
@@ -11,9 +11,12 @@ export default class InitCommand extends RuntimeCommand {
11
11
  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
12
  Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.
13
13
 
14
- After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.`;
14
+ After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
15
+
16
+ Running without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.`;
15
17
  static examples = [
16
18
  '<%= config.bin %> <%= command.id %>',
19
+ '<%= config.bin %> <%= command.id %> .',
17
20
  '<%= config.bin %> <%= command.id %> [directory]',
18
21
  '<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>',
19
22
  '<%= config.bin %> <%= command.id %> --organization-id <organizationId>',
@@ -25,7 +28,7 @@ After initialization, use 'blueprints plan' to preview changes, then 'blueprints
25
28
  ];
26
29
  static args = {
27
30
  dir: Args.string({
28
- description: 'Directory to create the local Blueprint in',
31
+ description: 'Directory to create the local Blueprint in (defaults to the current directory)',
29
32
  }),
30
33
  };
31
34
  static flags = {
@@ -1,5 +1,6 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
+ import { cwd } from 'node:process';
3
4
  import { confirm } from '@inquirer/prompts';
4
5
  import { findBlueprintFile, readLocalBlueprint, writeBlueprintToDisk, } from '../../actions/blueprints/blueprint.js';
5
6
  import { writeConfigFile } from '../../actions/blueprints/config.js';
@@ -11,6 +12,7 @@ import { getProject } from '../../actions/sanity/projects.js';
11
12
  import { BLUEPRINT_CONFIG_DIR, BLUEPRINT_CONFIG_FILE } from '../../config.js';
12
13
  import { check, filePathRelativeToCwd, labeledId, warn } from '../../utils/display/presenters.js';
13
14
  import { promptForBlueprintType, promptForOrganization, promptForProjectInOrg, promptForStack, runScopeAndStackWizard, } from '../../utils/display/prompt.js';
15
+ import { isInteractive } from '../../utils/interactive.js';
14
16
  import { styleText } from '../../utils/style-text.js';
15
17
  import { blueprintConfigCore } from './config.js';
16
18
  /** Derive scope type and ID from mutually exclusive flag values. */
@@ -25,8 +27,10 @@ export async function blueprintInitCore(options) {
25
27
  const { bin = 'sanity', log, token, knownProjectId, args, flags, validateResources } = options;
26
28
  const { dir: flagDir, example: flagExample, 'blueprint-type': flagBlueprintType, 'project-id': flagProjectId, 'organization-id': flagOrganizationId, 'stack-id': flagStackId, 'stack-name': flagStackName, verbose = false, } = flags;
27
29
  const { dir: argDir } = args;
28
- const userProvidedDirName = argDir || flagDir;
29
- const blueprintDir = userProvidedDirName || '.';
30
+ const explicitDir = argDir || flagDir;
31
+ const isHere = !explicitDir || explicitDir === '.' || explicitDir === './';
32
+ const blueprintDir = isHere ? '.' : explicitDir;
33
+ const userProvidedDirName = isHere ? undefined : explicitDir;
30
34
  const validationError = validateFlags({
31
35
  stackId: flagStackId,
32
36
  stackName: flagStackName,
@@ -65,6 +69,16 @@ export async function blueprintInitCore(options) {
65
69
  });
66
70
  }
67
71
  // no blueprint on disk → create new blueprint files from scratch
72
+ if (!explicitDir && isInteractive) {
73
+ const proceed = await confirm({
74
+ message: `Initialize a Blueprint here in ${cwd()}?`,
75
+ default: true,
76
+ });
77
+ if (!proceed) {
78
+ log(`Run \`${bin} blueprints init <directory>\` to initialize in a different location.`);
79
+ return { success: false, error: 'Initialization cancelled.' };
80
+ }
81
+ }
68
82
  return handleFreshInitialization({
69
83
  blueprintDir,
70
84
  userProvidedDirName,
@@ -241,8 +241,10 @@ const app = (host, port, validateResources, executionOptions) => {
241
241
  const fileInfo = findBlueprintFile();
242
242
  if (!fileInfo)
243
243
  return;
244
- watchFile(fileInfo.blueprintFilePath, { interval: 2007 }, () => {
245
- ws.send('reload-blueprint');
244
+ watchFile(fileInfo.blueprintFilePath, { interval: 2007 }, (curr, prev) => {
245
+ // watchFile can also fire on access-time (atime); gate on modified-time (mtime)
246
+ if (curr.mtimeMs !== prev.mtimeMs)
247
+ ws.send('reload-blueprint');
246
248
  });
247
249
  });
248
250
  };
@@ -37,39 +37,39 @@
37
37
  --gray-800: #252837;
38
38
  --gray-900: #1b1d27;
39
39
  --gray-950: #13141b;
40
- --green-100: #dcfce7;
41
- --green-200: #bbf7d0;
42
- --green-300: #86efac;
43
- --green-400: #4ade80;
44
- --green-50: #f0fdf4;
45
- --green-500: #22c55e;
40
+ --green-100: #c5fce8;
41
+ --green-200: #a9f9dc;
42
+ --green-300: #59f3ba;
43
+ --green-400: #0ff0a1;
44
+ --green-50: #e7fef5;
45
+ --green-500: #04b97a;
46
46
  --green-600: #01794f;
47
47
  --green-700: #015133;
48
48
  --green-800: #023120;
49
49
  --green-900: #06231a;
50
50
  --green-950: #071715;
51
- --magenta-100: #fde8f1;
52
- --magenta-200: #fcd5e8;
53
- --magenta-300: #f7a5cc;
54
- --magenta-400: #f06dac;
51
+ --magenta-100: #fde8ef;
52
+ --magenta-200: #fcdee9;
53
+ --magenta-300: #f7abc5;
54
+ --magenta-400: #f0709b;
55
55
  --magenta-50: #fef6f9;
56
- --magenta-500: #e03d8d;
57
- --magenta-600: #c41e72;
58
- --magenta-700: #8c1452;
59
- --magenta-800: #560d34;
60
- --magenta-900: #380b24;
61
- --magenta-950: #230717;
62
- --orange-100: #ffecd9;
63
- --orange-200: #ffdfc0;
64
- --orange-300: #ffbe85;
65
- --orange-400: #ff9c47;
56
+ --magenta-500: #e72767;
57
+ --magenta-600: #b11651;
58
+ --magenta-700: #7c1342;
59
+ --magenta-800: #4b1130;
60
+ --magenta-900: #341325;
61
+ --magenta-950: #1f0f14;
62
+ --orange-100: #ffeadb;
63
+ --orange-200: #ffddc7;
64
+ --orange-300: #ffb685;
65
+ --orange-400: #ff8e42;
66
66
  --orange-50: #fff7f0;
67
- --orange-500: #f57c1f;
68
- --orange-600: #d95f07;
69
- --orange-700: #9e4204;
70
- --orange-800: #4f2204;
71
- --orange-900: #341803;
72
- --orange-950: #200f02;
67
+ --orange-500: #fa6400;
68
+ --orange-600: #b14802;
69
+ --orange-700: #7c3404;
70
+ --orange-800: #461e07;
71
+ --orange-900: #32160b;
72
+ --orange-950: #21120d;
73
73
  --purple-100: #f1ebff;
74
74
  --purple-200: #ece1fe;
75
75
  --purple-300: #ccb1fc;
@@ -81,27 +81,27 @@
81
81
  --purple-800: #2f1862;
82
82
  --purple-900: #23173f;
83
83
  --purple-950: #181128;
84
- --red-100: #ffe5e5;
85
- --red-200: #ffd5d5;
86
- --red-300: #ffaaaa;
87
- --red-400: #ff7b7b;
88
- --red-50: #fff5f5;
89
- --red-500: #f94f4f;
90
- --red-600: #e42f2f;
91
- --red-700: #a81e1e;
92
- --red-800: #551212;
93
- --red-900: #380d0d;
94
- --red-950: #230808;
84
+ --red-100: #ffe7e5;
85
+ --red-200: #ffdedc;
86
+ --red-300: #fdada5;
87
+ --red-400: #f77769;
88
+ --red-50: #fff6f5;
89
+ --red-500: #ef4434;
90
+ --red-600: #cc2819;
91
+ --red-700: #8b2018;
92
+ --red-800: #4d1714;
93
+ --red-900: #321615;
94
+ --red-950: #1e1011;
95
95
  --white: #ffffff;
96
- --yellow-100: #fef9c3;
97
- --yellow-200: #fef08a;
98
- --yellow-300: #fde047;
99
- --yellow-400: #facc15;
100
- --yellow-50: #fefce8;
101
- --yellow-500: #eab308;
102
- --yellow-600: #ca8a04;
103
- --yellow-700: #a16207;
104
- --yellow-800: #713f12;
105
- --yellow-900: #422006;
106
- --yellow-950: #27130a;
96
+ --yellow-100: #fcf3bb;
97
+ --yellow-200: #f9e994;
98
+ --yellow-300: #f7d455;
99
+ --yellow-400: #f9bc15;
100
+ --yellow-50: #fefae1;
101
+ --yellow-500: #d28a04;
102
+ --yellow-600: #965908;
103
+ --yellow-700: #653a0b;
104
+ --yellow-800: #3b220c;
105
+ --yellow-900: #271a11;
106
+ --yellow-950: #181410;
107
107
  }
@@ -7,7 +7,6 @@
7
7
  @import "./container.css";
8
8
  @import "./fontFamily.css";
9
9
  @import "./fontWeight.css";
10
- @import "./index.css";
11
10
  @import "./radius.css";
12
11
  @import "./shadow.css";
13
12
  @import "./space.css";