@sanity/runtime-cli 17.1.0-next.gcfbd613 → 17.2.0-blueprinit.g62f8017

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 (58) hide show
  1. package/README.md +84 -54
  2. package/SKILL.md +21 -0
  3. package/dist/actions/blueprinit/manifest.d.ts +13 -0
  4. package/dist/actions/blueprinit/manifest.js +57 -0
  5. package/dist/actions/blueprinit/studio.d.ts +6 -0
  6. package/dist/actions/blueprinit/studio.js +43 -0
  7. package/dist/actions/blueprinit/templates.d.ts +34 -0
  8. package/dist/actions/blueprinit/templates.js +83 -0
  9. package/dist/actions/blueprinit/workspace.d.ts +15 -0
  10. package/dist/actions/blueprinit/workspace.js +142 -0
  11. package/dist/actions/blueprints/assets.js +15 -24
  12. package/dist/actions/blueprints/pre-deploy.d.ts +29 -0
  13. package/dist/actions/blueprints/pre-deploy.js +164 -0
  14. package/dist/actions/sanity/datasets.d.ts +15 -0
  15. package/dist/actions/sanity/datasets.js +26 -0
  16. package/dist/baseCommands.d.ts +3 -0
  17. package/dist/baseCommands.js +17 -0
  18. package/dist/commands/blueprinit.d.ts +13 -0
  19. package/dist/commands/blueprinit.js +44 -0
  20. package/dist/commands/functions/env/add.d.ts +3 -0
  21. package/dist/commands/functions/env/add.js +6 -2
  22. package/dist/commands/functions/env/list.d.ts +3 -0
  23. package/dist/commands/functions/env/list.js +9 -3
  24. package/dist/commands/functions/env/remove.d.ts +3 -0
  25. package/dist/commands/functions/env/remove.js +9 -3
  26. package/dist/constants.d.ts +1 -0
  27. package/dist/constants.js +1 -0
  28. package/dist/cores/blueprinit/adopt.d.ts +6 -0
  29. package/dist/cores/blueprinit/adopt.js +90 -0
  30. package/dist/cores/blueprinit/finish.d.ts +14 -0
  31. package/dist/cores/blueprinit/finish.js +36 -0
  32. package/dist/cores/blueprinit/fresh.d.ts +3 -0
  33. package/dist/cores/blueprinit/fresh.js +88 -0
  34. package/dist/cores/blueprinit/prompts.d.ts +4 -0
  35. package/dist/cores/blueprinit/prompts.js +14 -0
  36. package/dist/cores/blueprinit/selection.d.ts +15 -0
  37. package/dist/cores/blueprinit/selection.js +63 -0
  38. package/dist/cores/blueprinit/types.d.ts +13 -0
  39. package/dist/cores/blueprinit/types.js +1 -0
  40. package/dist/cores/blueprinit.d.ts +7 -0
  41. package/dist/cores/blueprinit.js +39 -0
  42. package/dist/cores/blueprints/deploy.js +16 -64
  43. package/dist/utils/command-skills.d.ts +2 -0
  44. package/dist/utils/command-skills.js +17 -0
  45. package/dist/utils/functions/child-process-wrapper.js +13 -171
  46. package/dist/utils/functions/child-runtime/console.d.ts +1 -0
  47. package/dist/utils/functions/child-runtime/console.js +50 -0
  48. package/dist/utils/functions/child-runtime/invoke.d.ts +4 -0
  49. package/dist/utils/functions/child-runtime/invoke.js +47 -0
  50. package/dist/utils/functions/child-runtime/resources.d.ts +4 -0
  51. package/dist/utils/functions/child-runtime/resources.js +59 -0
  52. package/dist/utils/studios/prepare-asset.d.ts +6 -0
  53. package/dist/utils/studios/prepare-asset.js +139 -0
  54. package/dist/utils/types.d.ts +4 -7
  55. package/dist/utils/types.js +2 -3
  56. package/oclif.manifest.json +293 -7
  57. package/package.json +12 -4
  58. package/skills/blueprinit.md +40 -0
@@ -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, type BlueprintSyncTagInvalidateFunctionResource } 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 BlueprintStudioResource, 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> = {
@@ -16,12 +16,8 @@ export interface ActionResponse {
16
16
  /** @internal */
17
17
  export type FunctionGroqResource = BlueprintDocumentFunctionResource | BlueprintMediaLibraryAssetFunctionResource;
18
18
  export type FunctionResource = FunctionGroqResource | BlueprintScheduledFunctionResource | BlueprintSyncTagInvalidateFunctionResource;
19
- export interface StudioResource extends BlueprintResource {
20
- type: 'sanity.studio';
21
- src: string;
22
- }
23
19
  /** Resource types that carry a deployable asset (have src: string) */
24
- export type AssetResource = FunctionResource | StudioResource;
20
+ export type AssetResource = FunctionResource | BlueprintStudioResource;
25
21
  /** @internal */
26
22
  export interface AuthParams {
27
23
  token: string;
@@ -46,7 +42,7 @@ export declare function isProjectResource(r: unknown): r is BlueprintProjectReso
46
42
  export declare function isRobotResource(r: unknown): r is BlueprintRobotResource;
47
43
  export declare function isRoleResource(r: unknown): r is BlueprintRoleResource;
48
44
  export declare function isDatasetResource(r: unknown): r is BlueprintDatasetResource;
49
- export declare function isStudioResource(r: BlueprintResource): r is StudioResource;
45
+ export declare function isStudioResource(r: BlueprintResource): r is BlueprintStudioResource;
50
46
  export declare function isAssetResource(r: BlueprintResource): r is AssetResource;
51
47
  export declare function isWebhookResource(r: unknown): r is BlueprintDocumentWebhookResource;
52
48
  interface StackBase {
@@ -84,6 +80,7 @@ export interface StackMutation {
84
80
  resources?: BlueprintResource[];
85
81
  };
86
82
  userMessage?: string;
83
+ preDeploy?: boolean;
87
84
  }
88
85
  /** @internal */
89
86
  export interface BuildPayloadOptions {
@@ -1,5 +1,5 @@
1
1
  import { validateCorsOrigin, validateDataset, validateDocumentWebhook, validateProject, validateRobot, validateRole, } from '@sanity/blueprints';
2
- import { SANITY_FUNCTION_PREFIX } from '../constants.js';
2
+ import { SANITY_FUNCTION_PREFIX, SANITY_STUDIO } from '../constants.js';
3
3
  export function isLocalFunctionResource(r) {
4
4
  return r.type.startsWith(SANITY_FUNCTION_PREFIX);
5
5
  }
@@ -22,9 +22,8 @@ export function isRoleResource(r) {
22
22
  export function isDatasetResource(r) {
23
23
  return validateDataset(r).length === 0;
24
24
  }
25
- // TODO: update to use blueprints helpers once available
26
25
  export function isStudioResource(r) {
27
- return r.type === 'sanity.studio';
26
+ return r.type === SANITY_STUDIO;
28
27
  }
29
28
  export function isAssetResource(r) {
30
29
  return isLocalFunctionResource(r) || isStudioResource(r);
@@ -1,5 +1,111 @@
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
+ ],
11
+ "flags": {
12
+ "json": {
13
+ "description": "Format output as json",
14
+ "name": "json",
15
+ "allowNo": false,
16
+ "type": "boolean"
17
+ },
18
+ "llms": {
19
+ "aliases": [
20
+ "skill"
21
+ ],
22
+ "description": "Show agent-oriented guidance for this command",
23
+ "name": "llms",
24
+ "allowNo": false,
25
+ "type": "boolean"
26
+ },
27
+ "path": {
28
+ "aliases": [
29
+ "blueprint-path"
30
+ ],
31
+ "char": "p",
32
+ "description": "Path to a Blueprint file or directory containing one",
33
+ "env": "SANITY_BLUEPRINT_PATH",
34
+ "hidden": true,
35
+ "name": "path",
36
+ "hasDynamicHelp": false,
37
+ "multiple": false,
38
+ "type": "option"
39
+ },
40
+ "trace": {
41
+ "description": "Trace output",
42
+ "hidden": true,
43
+ "name": "trace",
44
+ "allowNo": false,
45
+ "type": "boolean"
46
+ },
47
+ "validate-resources": {
48
+ "description": "Validate resources",
49
+ "hidden": true,
50
+ "name": "validate-resources",
51
+ "allowNo": true,
52
+ "type": "boolean"
53
+ },
54
+ "verbose": {
55
+ "description": "Verbose output",
56
+ "hidden": true,
57
+ "name": "verbose",
58
+ "allowNo": false,
59
+ "type": "boolean"
60
+ },
61
+ "yes": {
62
+ "char": "y",
63
+ "description": "Skip confirmation prompts",
64
+ "name": "yes",
65
+ "allowNo": false,
66
+ "type": "boolean"
67
+ },
68
+ "organization-id": {
69
+ "aliases": [
70
+ "organization",
71
+ "organizationId",
72
+ "org"
73
+ ],
74
+ "description": "Organization to use when the account has several",
75
+ "name": "organization-id",
76
+ "hasDynamicHelp": false,
77
+ "multiple": false,
78
+ "type": "option"
79
+ },
80
+ "project-id": {
81
+ "aliases": [
82
+ "project",
83
+ "projectId"
84
+ ],
85
+ "description": "Project to use when the organization has several",
86
+ "name": "project-id",
87
+ "hasDynamicHelp": false,
88
+ "multiple": false,
89
+ "type": "option"
90
+ }
91
+ },
92
+ "hasDynamicHelp": false,
93
+ "hidden": true,
94
+ "hiddenAliases": [],
95
+ "id": "blueprinit",
96
+ "pluginAlias": "@sanity/runtime-cli",
97
+ "pluginName": "@sanity/runtime-cli",
98
+ "pluginType": "core",
99
+ "strict": true,
100
+ "summary": "Experimental blueprints-first project init",
101
+ "enableJsonFlag": true,
102
+ "isESM": true,
103
+ "relativePath": [
104
+ "dist",
105
+ "commands",
106
+ "blueprinit.js"
107
+ ]
108
+ },
3
109
  "blueprints:add": {
4
110
  "aliases": [],
5
111
  "args": {
@@ -30,6 +136,15 @@
30
136
  "allowNo": false,
31
137
  "type": "boolean"
32
138
  },
139
+ "llms": {
140
+ "aliases": [
141
+ "skill"
142
+ ],
143
+ "description": "Show agent-oriented guidance for this command",
144
+ "name": "llms",
145
+ "allowNo": false,
146
+ "type": "boolean"
147
+ },
33
148
  "path": {
34
149
  "aliases": [
35
150
  "blueprint-path"
@@ -258,6 +373,15 @@
258
373
  "allowNo": false,
259
374
  "type": "boolean"
260
375
  },
376
+ "llms": {
377
+ "aliases": [
378
+ "skill"
379
+ ],
380
+ "description": "Show agent-oriented guidance for this command",
381
+ "name": "llms",
382
+ "allowNo": false,
383
+ "type": "boolean"
384
+ },
261
385
  "path": {
262
386
  "aliases": [
263
387
  "blueprint-path"
@@ -390,6 +514,15 @@
390
514
  "allowNo": false,
391
515
  "type": "boolean"
392
516
  },
517
+ "llms": {
518
+ "aliases": [
519
+ "skill"
520
+ ],
521
+ "description": "Show agent-oriented guidance for this command",
522
+ "name": "llms",
523
+ "allowNo": false,
524
+ "type": "boolean"
525
+ },
393
526
  "path": {
394
527
  "aliases": [
395
528
  "blueprint-path"
@@ -535,6 +668,15 @@
535
668
  "allowNo": false,
536
669
  "type": "boolean"
537
670
  },
671
+ "llms": {
672
+ "aliases": [
673
+ "skill"
674
+ ],
675
+ "description": "Show agent-oriented guidance for this command",
676
+ "name": "llms",
677
+ "allowNo": false,
678
+ "type": "boolean"
679
+ },
538
680
  "path": {
539
681
  "aliases": [
540
682
  "blueprint-path"
@@ -668,6 +810,15 @@
668
810
  "allowNo": false,
669
811
  "type": "boolean"
670
812
  },
813
+ "llms": {
814
+ "aliases": [
815
+ "skill"
816
+ ],
817
+ "description": "Show agent-oriented guidance for this command",
818
+ "name": "llms",
819
+ "allowNo": false,
820
+ "type": "boolean"
821
+ },
671
822
  "path": {
672
823
  "aliases": [
673
824
  "blueprint-path"
@@ -742,6 +893,15 @@
742
893
  "allowNo": false,
743
894
  "type": "boolean"
744
895
  },
896
+ "llms": {
897
+ "aliases": [
898
+ "skill"
899
+ ],
900
+ "description": "Show agent-oriented guidance for this command",
901
+ "name": "llms",
902
+ "allowNo": false,
903
+ "type": "boolean"
904
+ },
745
905
  "path": {
746
906
  "aliases": [
747
907
  "blueprint-path"
@@ -864,6 +1024,15 @@
864
1024
  "allowNo": false,
865
1025
  "type": "boolean"
866
1026
  },
1027
+ "llms": {
1028
+ "aliases": [
1029
+ "skill"
1030
+ ],
1031
+ "description": "Show agent-oriented guidance for this command",
1032
+ "name": "llms",
1033
+ "allowNo": false,
1034
+ "type": "boolean"
1035
+ },
867
1036
  "path": {
868
1037
  "aliases": [
869
1038
  "blueprint-path"
@@ -1045,6 +1214,15 @@
1045
1214
  "allowNo": false,
1046
1215
  "type": "boolean"
1047
1216
  },
1217
+ "llms": {
1218
+ "aliases": [
1219
+ "skill"
1220
+ ],
1221
+ "description": "Show agent-oriented guidance for this command",
1222
+ "name": "llms",
1223
+ "allowNo": false,
1224
+ "type": "boolean"
1225
+ },
1048
1226
  "path": {
1049
1227
  "aliases": [
1050
1228
  "blueprint-path"
@@ -1197,6 +1375,15 @@
1197
1375
  "allowNo": false,
1198
1376
  "type": "boolean"
1199
1377
  },
1378
+ "llms": {
1379
+ "aliases": [
1380
+ "skill"
1381
+ ],
1382
+ "description": "Show agent-oriented guidance for this command",
1383
+ "name": "llms",
1384
+ "allowNo": false,
1385
+ "type": "boolean"
1386
+ },
1200
1387
  "path": {
1201
1388
  "aliases": [
1202
1389
  "blueprint-path"
@@ -1322,6 +1509,15 @@
1322
1509
  "allowNo": false,
1323
1510
  "type": "boolean"
1324
1511
  },
1512
+ "llms": {
1513
+ "aliases": [
1514
+ "skill"
1515
+ ],
1516
+ "description": "Show agent-oriented guidance for this command",
1517
+ "name": "llms",
1518
+ "allowNo": false,
1519
+ "type": "boolean"
1520
+ },
1325
1521
  "path": {
1326
1522
  "aliases": [
1327
1523
  "blueprint-path"
@@ -1431,6 +1627,15 @@
1431
1627
  "allowNo": false,
1432
1628
  "type": "boolean"
1433
1629
  },
1630
+ "llms": {
1631
+ "aliases": [
1632
+ "skill"
1633
+ ],
1634
+ "description": "Show agent-oriented guidance for this command",
1635
+ "name": "llms",
1636
+ "allowNo": false,
1637
+ "type": "boolean"
1638
+ },
1434
1639
  "path": {
1435
1640
  "aliases": [
1436
1641
  "blueprint-path"
@@ -1557,6 +1762,15 @@
1557
1762
  "allowNo": false,
1558
1763
  "type": "boolean"
1559
1764
  },
1765
+ "llms": {
1766
+ "aliases": [
1767
+ "skill"
1768
+ ],
1769
+ "description": "Show agent-oriented guidance for this command",
1770
+ "name": "llms",
1771
+ "allowNo": false,
1772
+ "type": "boolean"
1773
+ },
1560
1774
  "path": {
1561
1775
  "aliases": [
1562
1776
  "blueprint-path"
@@ -1677,6 +1891,15 @@
1677
1891
  "allowNo": false,
1678
1892
  "type": "boolean"
1679
1893
  },
1894
+ "llms": {
1895
+ "aliases": [
1896
+ "skill"
1897
+ ],
1898
+ "description": "Show agent-oriented guidance for this command",
1899
+ "name": "llms",
1900
+ "allowNo": false,
1901
+ "type": "boolean"
1902
+ },
1680
1903
  "path": {
1681
1904
  "aliases": [
1682
1905
  "blueprint-path"
@@ -1890,6 +2113,15 @@
1890
2113
  "allowNo": false,
1891
2114
  "type": "boolean"
1892
2115
  },
2116
+ "llms": {
2117
+ "aliases": [
2118
+ "skill"
2119
+ ],
2120
+ "description": "Show agent-oriented guidance for this command",
2121
+ "name": "llms",
2122
+ "allowNo": false,
2123
+ "type": "boolean"
2124
+ },
1893
2125
  "path": {
1894
2126
  "aliases": [
1895
2127
  "blueprint-path"
@@ -2025,6 +2257,15 @@
2025
2257
  "allowNo": false,
2026
2258
  "type": "boolean"
2027
2259
  },
2260
+ "llms": {
2261
+ "aliases": [
2262
+ "skill"
2263
+ ],
2264
+ "description": "Show agent-oriented guidance for this command",
2265
+ "name": "llms",
2266
+ "allowNo": false,
2267
+ "type": "boolean"
2268
+ },
2028
2269
  "path": {
2029
2270
  "aliases": [
2030
2271
  "blueprint-path"
@@ -2169,6 +2410,15 @@
2169
2410
  "allowNo": false,
2170
2411
  "type": "boolean"
2171
2412
  },
2413
+ "llms": {
2414
+ "aliases": [
2415
+ "skill"
2416
+ ],
2417
+ "description": "Show agent-oriented guidance for this command",
2418
+ "name": "llms",
2419
+ "allowNo": false,
2420
+ "type": "boolean"
2421
+ },
2172
2422
  "path": {
2173
2423
  "aliases": [
2174
2424
  "blueprint-path"
@@ -2337,6 +2587,15 @@
2337
2587
  "allowNo": false,
2338
2588
  "type": "boolean"
2339
2589
  },
2590
+ "llms": {
2591
+ "aliases": [
2592
+ "skill"
2593
+ ],
2594
+ "description": "Show agent-oriented guidance for this command",
2595
+ "name": "llms",
2596
+ "allowNo": false,
2597
+ "type": "boolean"
2598
+ },
2340
2599
  "path": {
2341
2600
  "aliases": [
2342
2601
  "blueprint-path"
@@ -2655,7 +2914,8 @@
2655
2914
  },
2656
2915
  "description": "Sets an environment variable in a deployed Sanity Function. If the variable already exists, its value is updated.\n\nEnvironment variables are useful for API keys, configuration values, and other secrets that shouldn't be hardcoded. Changes take effect on the next function invocation.",
2657
2916
  "examples": [
2658
- "<%= config.bin %> <%= command.id %> MyFunction API_URL https://api.example.com/"
2917
+ "<%= config.bin %> <%= command.id %> MyFunction API_URL https://api.example.com/",
2918
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction API_URL https://api.example.com/"
2659
2919
  ],
2660
2920
  "flags": {
2661
2921
  "json": {
@@ -2664,6 +2924,15 @@
2664
2924
  "allowNo": false,
2665
2925
  "type": "boolean"
2666
2926
  },
2927
+ "llms": {
2928
+ "aliases": [
2929
+ "skill"
2930
+ ],
2931
+ "description": "Show agent-oriented guidance for this command",
2932
+ "name": "llms",
2933
+ "allowNo": false,
2934
+ "type": "boolean"
2935
+ },
2667
2936
  "path": {
2668
2937
  "aliases": [
2669
2938
  "blueprint-path"
@@ -2700,7 +2969,6 @@
2700
2969
  },
2701
2970
  "stack": {
2702
2971
  "description": "Stack name or ID to use instead of the locally configured Stack",
2703
- "hidden": true,
2704
2972
  "name": "stack",
2705
2973
  "hasDynamicHelp": false,
2706
2974
  "multiple": false,
@@ -2771,7 +3039,8 @@
2771
3039
  },
2772
3040
  "description": "Displays all environment variables (keys only) configured in a deployed Sanity Function.\n\nUse 'functions env add' to set variables or 'functions env remove' to delete them.",
2773
3041
  "examples": [
2774
- "<%= config.bin %> <%= command.id %> MyFunction"
3042
+ "<%= config.bin %> <%= command.id %> MyFunction",
3043
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction"
2775
3044
  ],
2776
3045
  "flags": {
2777
3046
  "json": {
@@ -2780,6 +3049,15 @@
2780
3049
  "allowNo": false,
2781
3050
  "type": "boolean"
2782
3051
  },
3052
+ "llms": {
3053
+ "aliases": [
3054
+ "skill"
3055
+ ],
3056
+ "description": "Show agent-oriented guidance for this command",
3057
+ "name": "llms",
3058
+ "allowNo": false,
3059
+ "type": "boolean"
3060
+ },
2783
3061
  "path": {
2784
3062
  "aliases": [
2785
3063
  "blueprint-path"
@@ -2816,7 +3094,6 @@
2816
3094
  },
2817
3095
  "stack": {
2818
3096
  "description": "Stack name or ID to use instead of the locally configured Stack",
2819
- "hidden": true,
2820
3097
  "name": "stack",
2821
3098
  "hasDynamicHelp": false,
2822
3099
  "multiple": false,
@@ -2892,7 +3169,8 @@
2892
3169
  },
2893
3170
  "description": "Deletes an environment variable from a deployed Sanity Function. The change takes effect on the next function invocation.\n\nUse 'functions env list' to see current variables before removing.",
2894
3171
  "examples": [
2895
- "<%= config.bin %> <%= command.id %> MyFunction API_URL"
3172
+ "<%= config.bin %> <%= command.id %> MyFunction API_URL",
3173
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction API_URL"
2896
3174
  ],
2897
3175
  "flags": {
2898
3176
  "json": {
@@ -2901,6 +3179,15 @@
2901
3179
  "allowNo": false,
2902
3180
  "type": "boolean"
2903
3181
  },
3182
+ "llms": {
3183
+ "aliases": [
3184
+ "skill"
3185
+ ],
3186
+ "description": "Show agent-oriented guidance for this command",
3187
+ "name": "llms",
3188
+ "allowNo": false,
3189
+ "type": "boolean"
3190
+ },
2904
3191
  "path": {
2905
3192
  "aliases": [
2906
3193
  "blueprint-path"
@@ -2937,7 +3224,6 @@
2937
3224
  },
2938
3225
  "stack": {
2939
3226
  "description": "Stack name or ID to use instead of the locally configured Stack",
2940
- "hidden": true,
2941
3227
  "name": "stack",
2942
3228
  "hasDynamicHelp": false,
2943
3229
  "multiple": false,
@@ -2998,5 +3284,5 @@
2998
3284
  ]
2999
3285
  }
3000
3286
  },
3001
- "version": "17.1.0-next.gcfbd613"
3287
+ "version": "17.2.0-blueprinit.g62f8017"
3002
3288
  }
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.1.0-next.gcfbd613",
4
+ "version": "17.2.0-blueprinit.g62f8017",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -26,7 +26,9 @@
26
26
  "files": [
27
27
  "./bin",
28
28
  "./dist",
29
- "./oclif.manifest.json"
29
+ "./oclif.manifest.json",
30
+ "./SKILL.md",
31
+ "./skills"
30
32
  ],
31
33
  "bin": {
32
34
  "sanity-run": "bin/run.js"
@@ -40,7 +42,9 @@
40
42
  "clean": "shx rm -rf dist oclif.manifest.json",
41
43
  "copy:design-tokens": "shx rm -rf ./src/server/static/vendor/design-tokens && shx cp -r ./node_modules/@sanity-labs/design-tokens/dist/css ./src/server/static/vendor/design-tokens",
42
44
  "copy:server": "shx cp -r ./src/server/static ./dist/server",
43
- "copy:wrapper": "shx cp ./src/utils/functions/child-process-wrapper.js ./dist/utils/functions/child-process-wrapper.js",
45
+ "copy:wrapper": "npm run copy:wrapper:entry && npm run copy:wrapper:modules",
46
+ "copy:wrapper:entry": "shx cp ./src/utils/functions/child-process-wrapper.js ./dist/utils/functions/child-process-wrapper.js",
47
+ "copy:wrapper:modules": "shx rm -rf ./dist/utils/functions/child-runtime && shx cp -r ./src/utils/functions/child-runtime ./dist/utils/functions/child-runtime",
44
48
  "lint": "biome ci",
45
49
  "lint:write": "biome check --write",
46
50
  "lint:fix": "npm run lint:write",
@@ -64,8 +68,10 @@
64
68
  "@oclif/core": "^4.11.14",
65
69
  "@oclif/plugin-help": "^6.2.53",
66
70
  "@sanity-labs/design-tokens": "^0.0.2-alpha.2",
67
- "@sanity/blueprints": "^0.22.0",
71
+ "@sanity/blueprints": "^0.23.0",
68
72
  "@sanity/blueprints-parser": "^0.4.0",
73
+ "@sanity/cli-build": "^5.0.0",
74
+ "@sanity/cli-core": "^2.5.1",
69
75
  "@sanity/client": "^7.23.1",
70
76
  "adm-zip": "^0.6.0",
71
77
  "array-treeify": "^0.1.5",
@@ -78,6 +84,7 @@
78
84
  "ora": "^9.4.1",
79
85
  "signal-exit": "^4.1.0",
80
86
  "strip-ansi": "^7.2.0",
87
+ "tar-fs": "^3.1.3",
81
88
  "tar-stream": "^3.2.0",
82
89
  "vite": "^8.1.4",
83
90
  "ws": "^8.21.1",
@@ -97,6 +104,7 @@
97
104
  "@types/cardinal": "^2.1.1",
98
105
  "@types/mime-types": "^3.0.1",
99
106
  "@types/node": "^22",
107
+ "@types/tar-fs": "^2.0.4",
100
108
  "@types/tar-stream": "^3.1.4",
101
109
  "@types/ws": "^8.18.1",
102
110
  "@vitest/coverage-v8": "4.1.10",
@@ -0,0 +1,40 @@
1
+ # Blueprinit
2
+
3
+ Use `blueprinit` to scaffold a Blueprint around an existing Sanity project. The command is
4
+ experimental, hidden from root help, and available from the `blueprinit` npm dist-tag.
5
+
6
+ ## Before running
7
+
8
+ - Work in the directory that should contain the Blueprint.
9
+ - Confirm the user is signed in with `npx sanity login`.
10
+ - Confirm the account has an organization, project, and dataset.
11
+ - Treat the run as state-changing: it writes local files and creates an empty,
12
+ organization-scoped Stack.
13
+
14
+ If the directory already contains a Blueprint, the command exits without changing it. A root
15
+ `sanity.config.*` switches the command to Studio adoption instead of creating a new Studio.
16
+
17
+ ## Unattended run
18
+
19
+ When the organization and project are known, run:
20
+
21
+ ```sh
22
+ npx @sanity/runtime-cli@blueprinit blueprinit --yes \
23
+ --organization-id <organization-id> \
24
+ --project-id <project-id>
25
+ ```
26
+
27
+ Use both IDs when possible. Without them, accounts with several organizations or projects require
28
+ interactive selection. `--yes` skips confirmation and uses `studio` as the generated Studio name.
29
+
30
+ ## After running
31
+
32
+ Inspect the generated files before installing dependencies or deploying. A fresh workspace includes
33
+ `sanity.blueprint.ts`, an npm-workspace Studio, a `set-slug` function, `.gitignore`, and
34
+ `.sanity/blueprint.config.json`.
35
+
36
+ The command only creates the empty Stack remotely. Project and dataset attachment, Studio creation,
37
+ and Function creation happen later with `blueprints deploy`.
38
+
39
+ If Stack creation fails because of quota or a duplicate name, the scaffold can remain without
40
+ `.sanity/blueprint.config.json`. Inspect the workspace before retrying.