@sanity/runtime-cli 7.6.7 → 8.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.
Files changed (35) hide show
  1. package/README.md +65 -25
  2. package/bin/dev.cmd +1 -1
  3. package/bin/dev.js +1 -1
  4. package/dist/actions/blueprints/blueprint.d.ts +20 -2
  5. package/dist/actions/blueprints/blueprint.js +88 -35
  6. package/dist/actions/blueprints/resources.js +1 -13
  7. package/dist/actions/blueprints/stacks.d.ts +6 -0
  8. package/dist/actions/blueprints/stacks.js +17 -3
  9. package/dist/commands/blueprints/add.d.ts +1 -1
  10. package/dist/commands/blueprints/add.js +2 -5
  11. package/dist/commands/blueprints/config.js +1 -3
  12. package/dist/commands/blueprints/destroy.js +1 -4
  13. package/dist/commands/blueprints/info.js +1 -3
  14. package/dist/commands/blueprints/init.js +2 -6
  15. package/dist/commands/blueprints/stacks.d.ts +1 -2
  16. package/dist/commands/blueprints/stacks.js +3 -5
  17. package/dist/cores/blueprints/add.js +26 -7
  18. package/dist/cores/blueprints/config.js +3 -28
  19. package/dist/cores/blueprints/init.js +45 -75
  20. package/dist/cores/blueprints/plan.js +3 -3
  21. package/dist/cores/blueprints/stacks.d.ts +1 -1
  22. package/dist/cores/blueprints/stacks.js +2 -2
  23. package/dist/utils/display/blueprints-formatting.js +3 -3
  24. package/dist/utils/display/presenters.d.ts +1 -0
  25. package/dist/utils/display/presenters.js +6 -3
  26. package/dist/utils/display/prompt.d.ts +4 -0
  27. package/dist/utils/display/prompt.js +44 -1
  28. package/dist/utils/other/npmjs.d.ts +1 -0
  29. package/dist/utils/other/npmjs.js +13 -0
  30. package/oclif.manifest.json +18 -19
  31. package/package.json +6 -7
  32. package/dist/utils/format-error.d.ts +0 -4
  33. package/dist/utils/format-error.js +0 -9
  34. package/dist/utils/is-dependency.d.ts +0 -1
  35. package/dist/utils/is-dependency.js +0 -7
@@ -45,15 +45,14 @@
45
45
  ],
46
46
  "type": "option"
47
47
  },
48
- "language": {
48
+ "fn-language": {
49
49
  "aliases": [
50
- "fn-language",
51
50
  "function-language",
52
51
  "language",
53
52
  "lang"
54
53
  ],
55
54
  "description": "Language of the new Function",
56
- "name": "language",
55
+ "name": "fn-language",
57
56
  "default": "ts",
58
57
  "hasDynamicHelp": false,
59
58
  "multiple": false,
@@ -133,7 +132,8 @@
133
132
  "<%= config.bin %> <%= command.id %>",
134
133
  "<%= config.bin %> <%= command.id %> --test-config",
135
134
  "<%= config.bin %> <%= command.id %> --edit",
136
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>"
135
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
136
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack-id <stackId>"
137
137
  ],
138
138
  "flags": {
139
139
  "test-config": {
@@ -177,7 +177,6 @@
177
177
  "edit"
178
178
  ],
179
179
  "description": "Update the Stack ID in the configuration. Requires --edit flag",
180
- "hidden": true,
181
180
  "name": "stack-id",
182
181
  "hasDynamicHelp": false,
183
182
  "multiple": false,
@@ -235,7 +234,8 @@
235
234
  "args": {},
236
235
  "description": "Destroy a Blueprint deployment (will not delete local files)",
237
236
  "examples": [
238
- "<%= config.bin %> <%= command.id %>"
237
+ "<%= config.bin %> <%= command.id %>",
238
+ "<%= config.bin %> <%= command.id %> --stack-id <stackId> --project-id <projectId> --force --no-wait"
239
239
  ],
240
240
  "flags": {
241
241
  "force": {
@@ -257,7 +257,6 @@
257
257
  "force"
258
258
  ],
259
259
  "description": "Project associated with the Stack (defaults to current Project)",
260
- "hidden": true,
261
260
  "name": "project-id",
262
261
  "hasDynamicHelp": false,
263
262
  "multiple": false,
@@ -269,7 +268,6 @@
269
268
  "stack"
270
269
  ],
271
270
  "description": "Stack ID to destroy (defaults to current Stack)",
272
- "hidden": true,
273
271
  "name": "stack-id",
274
272
  "hasDynamicHelp": false,
275
273
  "multiple": false,
@@ -302,12 +300,12 @@
302
300
  "args": {},
303
301
  "description": "Show information about a Blueprint deployment",
304
302
  "examples": [
305
- "<%= config.bin %> <%= command.id %>"
303
+ "<%= config.bin %> <%= command.id %>",
304
+ "<%= config.bin %> <%= command.id %> --stack-id <stackId>"
306
305
  ],
307
306
  "flags": {
308
307
  "id": {
309
308
  "description": "Stack ID to show info for (defaults to current stack)",
310
- "hidden": true,
311
309
  "name": "id",
312
310
  "hasDynamicHelp": false,
313
311
  "multiple": false,
@@ -342,7 +340,8 @@
342
340
  "<%= config.bin %> <%= command.id %>",
343
341
  "<%= config.bin %> <%= command.id %> [directory]",
344
342
  "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
345
- "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --project-id <projectId>"
343
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --project-id <projectId> --stack-id <stackId>",
344
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts> --stack-name <stackName>"
346
345
  ],
347
346
  "flags": {
348
347
  "dir": {
@@ -390,7 +389,6 @@
390
389
  "exclusive": [
391
390
  "stack-name"
392
391
  ],
393
- "hidden": true,
394
392
  "name": "stack-id",
395
393
  "hasDynamicHelp": false,
396
394
  "multiple": false,
@@ -404,7 +402,6 @@
404
402
  "exclusive": [
405
403
  "stack-id"
406
404
  ],
407
- "hidden": true,
408
405
  "name": "stack-name",
409
406
  "hasDynamicHelp": false,
410
407
  "multiple": false,
@@ -491,20 +488,22 @@
491
488
  "description": "List all Blueprint stacks",
492
489
  "examples": [
493
490
  "<%= config.bin %> <%= command.id %>",
494
- "<%= config.bin %> <%= command.id %> --projectId a1b2c3"
491
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>"
495
492
  ],
496
493
  "flags": {
497
- "projectId": {
494
+ "project-id": {
495
+ "aliases": [
496
+ "projectId",
497
+ "project"
498
+ ],
498
499
  "description": "Project ID to show stacks for",
499
- "name": "projectId",
500
- "required": false,
500
+ "name": "project-id",
501
501
  "hasDynamicHelp": false,
502
502
  "multiple": false,
503
503
  "type": "option"
504
504
  }
505
505
  },
506
506
  "hasDynamicHelp": false,
507
- "hidden": true,
508
507
  "hiddenAliases": [],
509
508
  "id": "blueprints:stacks",
510
509
  "pluginAlias": "@sanity/runtime-cli",
@@ -839,5 +838,5 @@
839
838
  ]
840
839
  }
841
840
  },
842
- "version": "7.6.7"
841
+ "version": "8.0.0"
843
842
  }
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": "7.6.7",
4
+ "version": "8.0.0",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -45,10 +45,7 @@
45
45
  }
46
46
  },
47
47
  "engines": {
48
- "node": ">=18.20.0"
49
- },
50
- "optionalPeerDependencies": {
51
- "tsx": "^4.19.3"
48
+ "node": ">=20.11.0"
52
49
  },
53
50
  "files": [
54
51
  "./bin",
@@ -80,12 +77,13 @@
80
77
  "@oclif/plugin-help": "^6.2.28",
81
78
  "adm-zip": "^0.5.16",
82
79
  "array-treeify": "^0.1.5",
80
+ "cardinal": "^2.1.1",
83
81
  "chalk": "^5.4.1",
84
- "color-json": "^3.0.5",
85
82
  "eventsource": "^4.0.0",
86
83
  "find-up": "^7.0.0",
87
84
  "groq-js": "^1.16.1",
88
85
  "inquirer": "^12.6.1",
86
+ "jiti": "^2.4.2",
89
87
  "mime-types": "^3.0.1",
90
88
  "ora": "^8.2.0",
91
89
  "vite": "^6.3.5",
@@ -100,9 +98,11 @@
100
98
  "@enhance/store": "^1.0.2",
101
99
  "@lezer/highlight": "^1.2.1",
102
100
  "@oclif/test": "^4.1.13",
101
+ "@playwright/test": "^1.52.0",
103
102
  "@rollup/plugin-node-resolve": "^16.0.1",
104
103
  "@sanity/client": "^7.3.0",
105
104
  "@types/adm-zip": "^0.5.7",
105
+ "@types/cardinal": "^2.1.1",
106
106
  "@types/mime-types": "^2.1.4",
107
107
  "@types/node": "20",
108
108
  "@types/ws": "^8.18.1",
@@ -114,7 +114,6 @@
114
114
  "rollup": "^4.41.0",
115
115
  "shx": "^0.4.0",
116
116
  "ts-node": "^10.9.2",
117
- "tsx": "^4.19.4",
118
117
  "typescript": "^5.8.3",
119
118
  "vitest": "3.1.4"
120
119
  },
@@ -1,4 +0,0 @@
1
- import type { BlueprintParserError } from './types.js';
2
- export default function formatError(response: Response, json: {
3
- error: BlueprintParserError;
4
- }): string | null;
@@ -1,9 +0,0 @@
1
- export default function formatError(response, json) {
2
- if (response.ok) {
3
- return null;
4
- }
5
- if (response.status === 401 || response.status === 403) {
6
- return 'Please login to the Sanity CLI to run this command';
7
- }
8
- return json?.error?.message || 'Unknown Error';
9
- }
@@ -1 +0,0 @@
1
- export default function isDependency(filePath: string): boolean;
@@ -1,7 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import { cwd } from 'node:process';
4
- export default function isDependency(filePath) {
5
- const path = join(cwd(), 'node_modules/@sanity/runtime-cli/dist/', filePath);
6
- return existsSync(path);
7
- }