@sanity/runtime-cli 7.0.1 → 7.0.3

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/7.0.1 linux-x64 node-v22.15.0
23
+ @sanity/runtime-cli/7.0.3 linux-x64 node-v22.15.0
24
24
  $ sanity-run --help [COMMAND]
25
25
  USAGE
26
26
  $ sanity-run COMMAND
@@ -84,7 +84,7 @@ EXAMPLES
84
84
  $ sanity-run blueprints add function --name my-function --fn-type document-publish --lang js
85
85
  ```
86
86
 
87
- _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/add.ts)_
87
+ _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/add.ts)_
88
88
 
89
89
  ## `sanity-run blueprints config`
90
90
 
@@ -112,7 +112,7 @@ EXAMPLES
112
112
  $ sanity-run blueprints config --edit --project-id <projectId>
113
113
  ```
114
114
 
115
- _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/config.ts)_
115
+ _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/config.ts)_
116
116
 
117
117
  ## `sanity-run blueprints deploy`
118
118
 
@@ -134,7 +134,7 @@ EXAMPLES
134
134
  $ sanity-run blueprints deploy --no-wait
135
135
  ```
136
136
 
137
- _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/deploy.ts)_
137
+ _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/deploy.ts)_
138
138
 
139
139
  ## `sanity-run blueprints destroy`
140
140
 
@@ -155,7 +155,7 @@ EXAMPLES
155
155
  $ sanity-run blueprints destroy
156
156
  ```
157
157
 
158
- _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/destroy.ts)_
158
+ _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/destroy.ts)_
159
159
 
160
160
  ## `sanity-run blueprints info`
161
161
 
@@ -172,7 +172,7 @@ EXAMPLES
172
172
  $ sanity-run blueprints info
173
173
  ```
174
174
 
175
- _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/info.ts)_
175
+ _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/info.ts)_
176
176
 
177
177
  ## `sanity-run blueprints init [DIR]`
178
178
 
@@ -204,7 +204,7 @@ EXAMPLES
204
204
  $ sanity-run blueprints init --blueprint-type <json|js|ts> --project-id <projectId>
205
205
  ```
206
206
 
207
- _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/init.ts)_
207
+ _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/init.ts)_
208
208
 
209
209
  ## `sanity-run blueprints logs`
210
210
 
@@ -226,7 +226,7 @@ EXAMPLES
226
226
  $ sanity-run blueprints logs --watch
227
227
  ```
228
228
 
229
- _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/logs.ts)_
229
+ _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/logs.ts)_
230
230
 
231
231
  ## `sanity-run blueprints plan`
232
232
 
@@ -243,7 +243,7 @@ EXAMPLES
243
243
  $ sanity-run blueprints plan
244
244
  ```
245
245
 
246
- _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/blueprints/plan.ts)_
246
+ _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/blueprints/plan.ts)_
247
247
 
248
248
  ## `sanity-run functions dev`
249
249
 
@@ -263,7 +263,7 @@ EXAMPLES
263
263
  $ sanity-run functions dev --port 8974
264
264
  ```
265
265
 
266
- _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/dev.ts)_
266
+ _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/dev.ts)_
267
267
 
268
268
  ## `sanity-run functions env add NAME KEY VALUE`
269
269
 
@@ -285,7 +285,7 @@ EXAMPLES
285
285
  $ sanity-run functions env add MyFunction API_URL https://api.example.com/
286
286
  ```
287
287
 
288
- _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/env/add.ts)_
288
+ _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/env/add.ts)_
289
289
 
290
290
  ## `sanity-run functions env list NAME`
291
291
 
@@ -305,7 +305,7 @@ EXAMPLES
305
305
  $ sanity-run functions env list MyFunction
306
306
  ```
307
307
 
308
- _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/env/list.ts)_
308
+ _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/env/list.ts)_
309
309
 
310
310
  ## `sanity-run functions env remove NAME KEY`
311
311
 
@@ -326,7 +326,7 @@ EXAMPLES
326
326
  $ sanity-run functions env remove MyFunction API_URL
327
327
  ```
328
328
 
329
- _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/env/remove.ts)_
329
+ _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/env/remove.ts)_
330
330
 
331
331
  ## `sanity-run functions logs NAME`
332
332
 
@@ -359,7 +359,7 @@ EXAMPLES
359
359
  $ sanity-run functions logs <name> --delete
360
360
  ```
361
361
 
362
- _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/logs.ts)_
362
+ _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/logs.ts)_
363
363
 
364
364
  ## `sanity-run functions test NAME`
365
365
 
@@ -392,7 +392,7 @@ EXAMPLES
392
392
  $ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60
393
393
  ```
394
394
 
395
- _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.1/src/commands/functions/test.ts)_
395
+ _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v7.0.3/src/commands/functions/test.ts)_
396
396
 
397
397
  ## `sanity-run help [COMMAND]`
398
398
 
@@ -27,11 +27,15 @@ export class BlueprintCommand extends Command {
27
27
  if (tokenErr)
28
28
  this.error(tokenErr.message);
29
29
  this.sanityToken = token;
30
- const result = await initBlueprintConfig(this.config.bin, (msg) => this.log(msg), token);
30
+ const result = await initBlueprintConfig({
31
+ bin: this.config.bin,
32
+ log: (msg) => this.log(msg),
33
+ token,
34
+ });
31
35
  if (!result.ok) {
32
36
  this.error(result.error);
33
37
  }
34
- this.sanityToken = result.value.sanityToken;
38
+ this.sanityToken = result.value.token;
35
39
  this.blueprint = result.value.blueprint;
36
40
  }
37
41
  async catch(err) {
@@ -60,7 +64,7 @@ export class DeployedBlueprintCommand extends BlueprintCommand {
60
64
  bin: this.config.bin,
61
65
  blueprint: this.blueprint,
62
66
  log: (msg) => this.log(msg),
63
- sanityToken: this.sanityToken,
67
+ token: this.sanityToken,
64
68
  });
65
69
  if (!result.ok) {
66
70
  this.error(result.error);
@@ -20,7 +20,7 @@ export default class EnvAddCommand extends DeployedBlueprintCommand {
20
20
  blueprint: this.blueprint,
21
21
  deployedStack: this.deployedStack,
22
22
  projectId: this.projectId,
23
- sanityToken: this.sanityToken,
23
+ token: this.sanityToken,
24
24
  stackId: this.stackId,
25
25
  });
26
26
  if (!success)
@@ -16,7 +16,7 @@ export default class EnvListCommand extends DeployedBlueprintCommand {
16
16
  blueprint: this.blueprint,
17
17
  deployedStack: this.deployedStack,
18
18
  projectId: this.projectId,
19
- sanityToken: this.sanityToken,
19
+ token: this.sanityToken,
20
20
  stackId: this.stackId,
21
21
  });
22
22
  if (!success)
@@ -17,7 +17,7 @@ export default class EnvRemoveCommand extends DeployedBlueprintCommand {
17
17
  blueprint: this.blueprint,
18
18
  deployedStack: this.deployedStack,
19
19
  projectId: this.projectId,
20
- sanityToken: this.sanityToken,
20
+ token: this.sanityToken,
21
21
  stackId: this.stackId,
22
22
  });
23
23
  if (!success)
@@ -24,7 +24,7 @@ export async function blueprintAddCore(options) {
24
24
  error: 'Cannot use -i flag with the --fn-installer flag',
25
25
  };
26
26
  }
27
- if (flagI && !flagFnHelpers) {
27
+ if (flagI && flagFnHelpers === false) {
28
28
  return {
29
29
  success: false,
30
30
  error: 'Cannot use -i flag with the --no-fn-helpers flag',
@@ -9,7 +9,7 @@ export interface CoreConfig {
9
9
  log: (message: string) => void;
10
10
  }
11
11
  export interface BlueprintConfig extends CoreConfig {
12
- sanityToken: string;
12
+ token: string;
13
13
  blueprint: ReadBlueprintResult;
14
14
  }
15
15
  export interface DeployedBlueprintConfig extends BlueprintConfig {
@@ -31,5 +31,9 @@ export type CoreResult = {
31
31
  streaming?: Promise<void>;
32
32
  error?: never;
33
33
  };
34
- export declare function initBlueprintConfig(bin: string, log: (msg: string) => void, token: string): Promise<Result<BlueprintConfig>>;
35
- export declare function initDeployedBlueprintConfig(config: Partial<BlueprintConfig> & Pick<BlueprintConfig, 'bin' | 'log' | 'sanityToken'>): Promise<Result<DeployedBlueprintConfig>>;
34
+ export declare function initBlueprintConfig({ bin, log, token, }: {
35
+ bin: string;
36
+ log: (msg: string) => void;
37
+ token: string;
38
+ }): Promise<Result<BlueprintConfig>>;
39
+ export declare function initDeployedBlueprintConfig(config: Partial<BlueprintConfig> & Pick<BlueprintConfig, 'bin' | 'log' | 'token'>): Promise<Result<DeployedBlueprintConfig>>;
@@ -4,7 +4,7 @@ import { presentBlueprintParserErrors } from '../utils/display/errors.js';
4
4
  import { niceId } from '../utils/display/presenters.js';
5
5
  export * as blueprintsCores from './blueprints/index.js';
6
6
  export * as functionsCores from './functions/index.js';
7
- export async function initBlueprintConfig(bin, log, token) {
7
+ export async function initBlueprintConfig({ bin, log, token, }) {
8
8
  const blueprint = await readLocalBlueprint();
9
9
  if (blueprint.errors.length > 0) {
10
10
  log(presentBlueprintParserErrors(blueprint.errors));
@@ -16,18 +16,18 @@ export async function initBlueprintConfig(bin, log, token) {
16
16
  bin,
17
17
  blueprint,
18
18
  log,
19
- sanityToken: token,
19
+ token,
20
20
  },
21
21
  };
22
22
  }
23
23
  export async function initDeployedBlueprintConfig(config) {
24
24
  if (!config.blueprint) {
25
- const blueprintResult = await initBlueprintConfig(config.bin, config.log, config.sanityToken);
25
+ const blueprintResult = await initBlueprintConfig(config);
26
26
  if (!blueprintResult.ok) {
27
27
  return blueprintResult;
28
28
  }
29
29
  config.blueprint = blueprintResult.value.blueprint;
30
- config.sanityToken = blueprintResult.value.sanityToken;
30
+ config.token = blueprintResult.value.token;
31
31
  }
32
32
  const { projectId, stackId } = config.blueprint;
33
33
  if (!(projectId && stackId)) {
@@ -37,7 +37,7 @@ export async function initDeployedBlueprintConfig(config) {
37
37
  if (!stackId)
38
38
  return { ok: false, error: 'Missing deployment configuration for Blueprint' };
39
39
  }
40
- const auth = { token: config.sanityToken, projectId };
40
+ const auth = { token: config.token, projectId };
41
41
  const stackResponse = await getStack({ stackId, auth });
42
42
  if (!stackResponse.ok) {
43
43
  config.log(`Could not retrieve deployment info for ${niceId(stackId)}. Was it destroyed?`);
@@ -50,7 +50,7 @@ export async function initDeployedBlueprintConfig(config) {
50
50
  bin: config.bin,
51
51
  log: config.log,
52
52
  blueprint: config.blueprint,
53
- sanityToken: config.sanityToken,
53
+ token: config.token,
54
54
  projectId,
55
55
  stackId,
56
56
  auth,
@@ -829,5 +829,5 @@
829
829
  ]
830
830
  }
831
831
  },
832
- "version": "7.0.1"
832
+ "version": "7.0.3"
833
833
  }
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.0.1",
4
+ "version": "7.0.3",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -78,9 +78,9 @@
78
78
  "array-treeify": "^0.1.5",
79
79
  "chalk": "^5.4.1",
80
80
  "color-json": "^3.0.5",
81
- "eventsource": "^3.0.6",
81
+ "eventsource": "^3.0.7",
82
82
  "find-up": "^7.0.0",
83
- "inquirer": "^12.6.0",
83
+ "inquirer": "^12.6.1",
84
84
  "mime-types": "^3.0.1",
85
85
  "ora": "^8.2.0",
86
86
  "vite": "^6.3.5",
@@ -95,7 +95,7 @@
95
95
  "@lezer/highlight": "^1.2.1",
96
96
  "@oclif/test": "^4.1.12",
97
97
  "@rollup/plugin-node-resolve": "^16.0.1",
98
- "@sanity/client": "^7.1.0",
98
+ "@sanity/client": "^7.2.1",
99
99
  "@types/adm-zip": "^0.5.7",
100
100
  "@types/mime-types": "^2.1.4",
101
101
  "@types/node": "18",