@sanity/runtime-cli 10.1.2 → 10.1.4

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 (41) hide show
  1. package/README.md +17 -17
  2. package/dist/actions/blueprints/blueprint.js +3 -3
  3. package/dist/actions/blueprints/index.d.ts +5 -6
  4. package/dist/actions/blueprints/index.js +4 -4
  5. package/dist/actions/blueprints/logs.js +1 -1
  6. package/dist/actions/blueprints/resources.js +1 -2
  7. package/dist/actions/functions/logs.js +1 -1
  8. package/dist/actions/sanity/examples.js +2 -2
  9. package/dist/baseCommands.d.ts +1 -1
  10. package/dist/config.js +1 -1
  11. package/dist/cores/blueprints/add.js +1 -1
  12. package/dist/cores/blueprints/config.js +2 -2
  13. package/dist/cores/blueprints/destroy.js +1 -1
  14. package/dist/cores/blueprints/index.d.ts +9 -9
  15. package/dist/cores/blueprints/init.js +1 -1
  16. package/dist/cores/blueprints/logs.js +1 -2
  17. package/dist/cores/functions/index.d.ts +7 -7
  18. package/dist/cores/functions/index.js +1 -1
  19. package/dist/cores/functions/logs.js +3 -3
  20. package/dist/server/app.js +3 -4
  21. package/dist/server/static/components/api-base.js +1 -0
  22. package/dist/server/static/components/app.css +12 -12
  23. package/dist/server/static/components/codemirror-theme.js +2 -3
  24. package/dist/server/static/components/payload-panel.js +2 -2
  25. package/dist/server/static/components/response-panel.js +3 -3
  26. package/dist/server/static/components/rule-panel.js +2 -2
  27. package/dist/server/static/hot-reload.js +1 -0
  28. package/dist/server/static/vendor/vendor.bundle.js +2 -1
  29. package/dist/utils/child-process-wrapper.js +1 -1
  30. package/dist/utils/display/blueprints-logs-streaming.js +1 -1
  31. package/dist/utils/display/colors.d.ts +1 -1
  32. package/dist/utils/display/colors.js +1 -1
  33. package/dist/utils/display/index.d.ts +2 -2
  34. package/dist/utils/display/index.js +2 -2
  35. package/dist/utils/get-headers.js +1 -1
  36. package/dist/utils/index.d.ts +1 -1
  37. package/dist/utils/index.js +1 -1
  38. package/dist/utils/invoke-local.js +3 -3
  39. package/dist/utils/other/npmjs.js +1 -1
  40. package/oclif.manifest.json +1 -1
  41. package/package.json +20 -20
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/10.1.2 linux-x64 node-v22.17.1
23
+ @sanity/runtime-cli/10.1.4 linux-x64 node-v22.18.0
24
24
  $ sanity-run --help [COMMAND]
25
25
  USAGE
26
26
  $ sanity-run COMMAND
@@ -86,7 +86,7 @@ EXAMPLES
86
86
  $ sanity-run blueprints add function --name my-function --fn-type document-publish --lang js
87
87
  ```
88
88
 
89
- _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/add.ts)_
89
+ _See code: [src/commands/blueprints/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/add.ts)_
90
90
 
91
91
  ## `sanity-run blueprints config`
92
92
 
@@ -117,7 +117,7 @@ EXAMPLES
117
117
  $ sanity-run blueprints config --edit --project-id <projectId> --stack-id <stackId>
118
118
  ```
119
119
 
120
- _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/config.ts)_
120
+ _See code: [src/commands/blueprints/config.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/config.ts)_
121
121
 
122
122
  ## `sanity-run blueprints deploy`
123
123
 
@@ -139,7 +139,7 @@ EXAMPLES
139
139
  $ sanity-run blueprints deploy --no-wait
140
140
  ```
141
141
 
142
- _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/deploy.ts)_
142
+ _See code: [src/commands/blueprints/deploy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/deploy.ts)_
143
143
 
144
144
  ## `sanity-run blueprints destroy`
145
145
 
@@ -164,7 +164,7 @@ EXAMPLES
164
164
  $ sanity-run blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
165
165
  ```
166
166
 
167
- _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/destroy.ts)_
167
+ _See code: [src/commands/blueprints/destroy.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/destroy.ts)_
168
168
 
169
169
  ## `sanity-run blueprints info`
170
170
 
@@ -186,7 +186,7 @@ EXAMPLES
186
186
  $ sanity-run blueprints info --stack-id <stackId>
187
187
  ```
188
188
 
189
- _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/info.ts)_
189
+ _See code: [src/commands/blueprints/info.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/info.ts)_
190
190
 
191
191
  ## `sanity-run blueprints init [DIR]`
192
192
 
@@ -224,7 +224,7 @@ EXAMPLES
224
224
  $ sanity-run blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
225
225
  ```
226
226
 
227
- _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/init.ts)_
227
+ _See code: [src/commands/blueprints/init.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/init.ts)_
228
228
 
229
229
  ## `sanity-run blueprints logs`
230
230
 
@@ -246,7 +246,7 @@ EXAMPLES
246
246
  $ sanity-run blueprints logs --watch
247
247
  ```
248
248
 
249
- _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/logs.ts)_
249
+ _See code: [src/commands/blueprints/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/logs.ts)_
250
250
 
251
251
  ## `sanity-run blueprints plan`
252
252
 
@@ -263,7 +263,7 @@ EXAMPLES
263
263
  $ sanity-run blueprints plan
264
264
  ```
265
265
 
266
- _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/plan.ts)_
266
+ _See code: [src/commands/blueprints/plan.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/plan.ts)_
267
267
 
268
268
  ## `sanity-run blueprints stacks`
269
269
 
@@ -285,7 +285,7 @@ EXAMPLES
285
285
  $ sanity-run blueprints stacks --project-id <projectId>
286
286
  ```
287
287
 
288
- _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/blueprints/stacks.ts)_
288
+ _See code: [src/commands/blueprints/stacks.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/blueprints/stacks.ts)_
289
289
 
290
290
  ## `sanity-run functions dev`
291
291
 
@@ -305,7 +305,7 @@ EXAMPLES
305
305
  $ sanity-run functions dev --port 8974
306
306
  ```
307
307
 
308
- _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/dev.ts)_
308
+ _See code: [src/commands/functions/dev.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/dev.ts)_
309
309
 
310
310
  ## `sanity-run functions env add NAME KEY VALUE`
311
311
 
@@ -327,7 +327,7 @@ EXAMPLES
327
327
  $ sanity-run functions env add MyFunction API_URL https://api.example.com/
328
328
  ```
329
329
 
330
- _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/env/add.ts)_
330
+ _See code: [src/commands/functions/env/add.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/env/add.ts)_
331
331
 
332
332
  ## `sanity-run functions env list NAME`
333
333
 
@@ -347,7 +347,7 @@ EXAMPLES
347
347
  $ sanity-run functions env list MyFunction
348
348
  ```
349
349
 
350
- _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/env/list.ts)_
350
+ _See code: [src/commands/functions/env/list.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/env/list.ts)_
351
351
 
352
352
  ## `sanity-run functions env remove NAME KEY`
353
353
 
@@ -368,7 +368,7 @@ EXAMPLES
368
368
  $ sanity-run functions env remove MyFunction API_URL
369
369
  ```
370
370
 
371
- _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/env/remove.ts)_
371
+ _See code: [src/commands/functions/env/remove.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/env/remove.ts)_
372
372
 
373
373
  ## `sanity-run functions logs NAME`
374
374
 
@@ -402,7 +402,7 @@ EXAMPLES
402
402
  $ sanity-run functions logs <name> --delete
403
403
  ```
404
404
 
405
- _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/logs.ts)_
405
+ _See code: [src/commands/functions/logs.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/logs.ts)_
406
406
 
407
407
  ## `sanity-run functions test NAME`
408
408
 
@@ -437,7 +437,7 @@ EXAMPLES
437
437
  $ sanity-run functions test <name> --data '{ "id": 1 }' --timeout 60
438
438
  ```
439
439
 
440
- _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.2/src/commands/functions/test.ts)_
440
+ _See code: [src/commands/functions/test.ts](https://github.com/sanity-io/runtime-cli/blob/v10.1.4/src/commands/functions/test.ts)_
441
441
 
442
442
  ## `sanity-run help [COMMAND]`
443
443
 
@@ -457,5 +457,5 @@ DESCRIPTION
457
457
  Display help for sanity-run.
458
458
  ```
459
459
 
460
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.28/src/commands/help.ts)_
460
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.32/src/commands/help.ts)_
461
461
  <!-- commandsstop -->
@@ -227,7 +227,7 @@ export function readConfigFile(blueprintFilePath) {
227
227
  const config = JSON.parse(readFileSync(configPath, 'utf8'));
228
228
  return { configPath, ...config };
229
229
  }
230
- catch (err) {
230
+ catch {
231
231
  return null;
232
232
  }
233
233
  }
@@ -239,7 +239,7 @@ export function readConfigFile(blueprintFilePath) {
239
239
  const config = JSON.parse(readFileSync(configFilePath, 'utf8'));
240
240
  return config || null;
241
241
  }
242
- catch (err) {
242
+ catch {
243
243
  return null;
244
244
  }
245
245
  }
@@ -255,7 +255,7 @@ export function writeConfigFile({ blueprintFilePath, projectId, stackId, }) {
255
255
  try {
256
256
  config = JSON.parse(readFileSync(configPath, 'utf8'));
257
257
  }
258
- catch (err) {
258
+ catch {
259
259
  // config broken, start fresh
260
260
  }
261
261
  }
@@ -1,15 +1,14 @@
1
+ /**
2
+ * @deprecated Use actions/sanity/projects.js instead
3
+ */
4
+ export * as projects from '../sanity/projects.js';
1
5
  export * as assets from './assets.js';
2
6
  export * as blueprint from './blueprint.js';
3
7
  export * as logs from './logs.js';
4
8
  export * as operations from './operations.js';
5
9
  export * as resources from './resources.js';
6
10
  export * as stacks from './stacks.js';
7
- /**
8
- * @deprecated Use actions/sanity/projects.js instead
9
- */
10
- export * as projects from '../sanity/projects.js';
11
- import type { Stack } from '../../utils/types.js';
12
- import type { BlueprintParserError } from '../../utils/types.js';
11
+ import type { BlueprintParserError, Stack } from '../../utils/types.js';
13
12
  import { readLocalBlueprint } from './blueprint.js';
14
13
  export type BlueprintIssue = {
15
14
  code: 'NO_STACK_ID' | 'NO_PROJECT_ID' | 'NO_STACK' | 'PARSE_ERROR';
@@ -1,13 +1,13 @@
1
+ /**
2
+ * @deprecated Use actions/sanity/projects.js instead
3
+ */
4
+ export * as projects from '../sanity/projects.js';
1
5
  export * as assets from './assets.js';
2
6
  export * as blueprint from './blueprint.js';
3
7
  export * as logs from './logs.js';
4
8
  export * as operations from './operations.js';
5
9
  export * as resources from './resources.js';
6
10
  export * as stacks from './stacks.js';
7
- /**
8
- * @deprecated Use actions/sanity/projects.js instead
9
- */
10
- export * as projects from '../sanity/projects.js';
11
11
  import { readLocalBlueprint } from './blueprint.js';
12
12
  import { getStack } from './stacks.js';
13
13
  /**
@@ -81,7 +81,7 @@ export function streamLogs({ stackId, after, auth, onLog, onOpen, onError, }) {
81
81
  console.error('Error parsing logs event:', err);
82
82
  }
83
83
  });
84
- eventSource.onerror = (err) => {
84
+ eventSource.onerror = () => {
85
85
  onError('Connection to log stream failed or was closed');
86
86
  if (eventSource.readyState === eventSource.CLOSED) {
87
87
  console.log('Connection is CLOSED');
@@ -1,6 +1,5 @@
1
1
  import { spawn } from 'node:child_process';
2
- import { mkdirSync, writeFileSync } from 'node:fs';
3
- import { existsSync } from 'node:fs';
2
+ import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
4
3
  import { dirname, join } from 'node:path';
5
4
  import { cwd } from 'node:process';
6
5
  import chalk from 'chalk';
@@ -66,7 +66,7 @@ export function streamLogs(id, auth, onLog, onOpen, onError) {
66
66
  console.error('Error parsing logs event:', err);
67
67
  }
68
68
  });
69
- eventSource.onerror = (err) => {
69
+ eventSource.onerror = () => {
70
70
  onError('Connection to log stream failed or was closed');
71
71
  if (eventSource.readyState === eventSource.CLOSED) {
72
72
  console.log('Connection is CLOSED');
@@ -124,7 +124,7 @@ function extractFunctionConfig(exampleFiles) {
124
124
  packageJsonContent.blueprintResourceItem = undefined;
125
125
  exampleFiles['package.json'] = JSON.stringify(packageJsonContent, null, 2);
126
126
  }
127
- catch (error) {
127
+ catch {
128
128
  return null;
129
129
  }
130
130
  return functionConfig;
@@ -144,7 +144,7 @@ function extractInstructions(exampleFiles) {
144
144
  packageJsonContent.exampleInstructions = undefined;
145
145
  exampleFiles['package.json'] = JSON.stringify(packageJsonContent, null, 2);
146
146
  }
147
- catch (error) {
147
+ catch {
148
148
  return null;
149
149
  }
150
150
  return instructions;
@@ -1,5 +1,5 @@
1
- import { Command } from '@oclif/core';
2
1
  import type { Interfaces } from '@oclif/core';
2
+ import { Command } from '@oclif/core';
3
3
  import type { readLocalBlueprint } from './actions/blueprints/blueprint.js';
4
4
  import type { AuthParams, Stack } from './utils/types.js';
5
5
  export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BlueprintCommand)['baseFlags'] & T['flags']>;
package/dist/config.js CHANGED
@@ -14,7 +14,7 @@ const apiUrls = {
14
14
  default: 'http://api.sanity/',
15
15
  };
16
16
  const apiUrl = apiUrls[sanityEnv] ?? apiUrls.default;
17
- let _token = undefined;
17
+ let _token;
18
18
  function loadToken() {
19
19
  let token = null;
20
20
  if (isTest || isPublishing) {
@@ -18,7 +18,7 @@ const FUNCTION_BLUEPRINT_RESOURCE_TEMPLATE = `
18
18
  `;
19
19
  export async function blueprintAddCore(options) {
20
20
  const root = cwd();
21
- const { bin = 'sanity', log, blueprint, args, flags } = options;
21
+ const { log, blueprint, args, flags } = options;
22
22
  const { blueprintFilePath } = blueprint.fileInfo;
23
23
  const { type: resourceType } = args;
24
24
  const { example: flagExample, name: flagResourceName, 'fn-type': flagFnType, javascript: flagJs, 'fn-helpers': flagFnHelpers, install: flagI, 'fn-installer': flagFnInstaller, // can be 'skip'!
@@ -119,7 +119,7 @@ export async function blueprintConfigCore(options) {
119
119
  log('Configuration updated successfully.');
120
120
  return { success: true };
121
121
  }
122
- catch (error) {
122
+ catch {
123
123
  log(`Unable to update config. These values should be set in ${BLUEPRINT_DIR}/${BLUEPRINT_CONFIG_FILE}`);
124
124
  log(highlight(JSON.stringify({ metadata: { projectId: updatedProjectId, stackId: updatedStackId } }, null, 2)));
125
125
  return {
@@ -131,7 +131,7 @@ export async function blueprintConfigCore(options) {
131
131
  // Default return (shouldn't reach here with proper flow control)
132
132
  return { success: true };
133
133
  }
134
- catch (error) {
134
+ catch {
135
135
  return { success: false, error: 'Unknown error' };
136
136
  }
137
137
  }
@@ -6,7 +6,7 @@ import { destroyStack, getStack } from '../../actions/blueprints/stacks.js';
6
6
  import { setupLogStreaming } from '../../utils/display/blueprints-logs-streaming.js';
7
7
  import { niceId } from '../../utils/display/presenters.js';
8
8
  export async function blueprintDestroyCore(options) {
9
- const { bin = 'sanity', log, token, blueprint, flags } = options;
9
+ const { log, token, blueprint, flags } = options;
10
10
  const { force = false, 'project-id': flagProjectId, 'stack-id': flagStackId, 'no-wait': noWait = false, } = flags;
11
11
  // 3-flag combo: just destroy it
12
12
  if (flagProjectId && flagStackId && force) {
@@ -1,18 +1,18 @@
1
- export { blueprintAddCore } from './add.js';
2
1
  export type { BlueprintAddOptions } from './add.js';
3
- export { blueprintConfigCore } from './config.js';
2
+ export { blueprintAddCore } from './add.js';
4
3
  export type { BlueprintConfigOptions } from './config.js';
5
- export { blueprintDeployCore } from './deploy.js';
4
+ export { blueprintConfigCore } from './config.js';
6
5
  export type { BlueprintDeployOptions } from './deploy.js';
7
- export { blueprintDestroyCore } from './destroy.js';
6
+ export { blueprintDeployCore } from './deploy.js';
8
7
  export type { BlueprintDestroyOptions } from './destroy.js';
9
- export { blueprintInfoCore } from './info.js';
8
+ export { blueprintDestroyCore } from './destroy.js';
10
9
  export type { BlueprintInfoOptions } from './info.js';
11
- export { blueprintInitCore } from './init.js';
10
+ export { blueprintInfoCore } from './info.js';
12
11
  export type { BlueprintInitOptions } from './init.js';
13
- export { blueprintLogsCore } from './logs.js';
12
+ export { blueprintInitCore } from './init.js';
14
13
  export type { BlueprintLogsOptions } from './logs.js';
15
- export { blueprintPlanCore } from './plan.js';
14
+ export { blueprintLogsCore } from './logs.js';
16
15
  export type { BlueprintPlanOptions } from './plan.js';
17
- export { blueprintStacksCore } from './stacks.js';
16
+ export { blueprintPlanCore } from './plan.js';
18
17
  export type { BlueprintStacksOptions } from './stacks.js';
18
+ export { blueprintStacksCore } from './stacks.js';
@@ -138,7 +138,7 @@ export async function blueprintInitCore(options) {
138
138
  });
139
139
  log(check(`${chalk.bold('Added dependency:')} @sanity/blueprints`));
140
140
  }
141
- catch (err) {
141
+ catch {
142
142
  log(warn('Unable to add @sanity/blueprints to your project.'));
143
143
  }
144
144
  }
@@ -30,13 +30,12 @@ export async function blueprintLogsCore(options) {
30
30
  log(`No recent logs found for deployment ${niceId(stackId)}`);
31
31
  }
32
32
  // Set up streaming log display
33
- const streamCleanup = await setupLogStreaming({
33
+ await setupLogStreaming({
34
34
  stackId,
35
35
  auth,
36
36
  log,
37
37
  showBanner: true,
38
38
  });
39
- // Note: don't call streamCleanup() here, it will close the stream
40
39
  // Return a special key for streaming mode
41
40
  return {
42
41
  success: true,
@@ -1,12 +1,12 @@
1
- export { functionEnvAddCore } from './env/add.js';
1
+ export type { FunctionDevOptions } from './dev.js';
2
+ export { functionDevCore } from './dev.js';
2
3
  export type { FunctionEnvAddOptions as EnvAddOptions } from './env/add.js';
3
- export { functionEnvListCore } from './env/list.js';
4
+ export { functionEnvAddCore } from './env/add.js';
4
5
  export type { FunctionEnvListOptions as EnvListOptions } from './env/list.js';
5
- export { functionEnvRemoveCore } from './env/remove.js';
6
+ export { functionEnvListCore } from './env/list.js';
6
7
  export type { FunctionEnvRemoveOptions as EnvRemoveOptions } from './env/remove.js';
7
- export { functionLogsCore } from './logs.js';
8
+ export { functionEnvRemoveCore } from './env/remove.js';
8
9
  export type { FunctionLogsOptions } from './logs.js';
9
- export { functionTestCore } from './test.js';
10
+ export { functionLogsCore } from './logs.js';
10
11
  export type { FunctionTestOptions } from './test.js';
11
- export { functionDevCore } from './dev.js';
12
- export type { FunctionDevOptions } from './dev.js';
12
+ export { functionTestCore } from './test.js';
@@ -1,6 +1,6 @@
1
+ export { functionDevCore } from './dev.js';
1
2
  export { functionEnvAddCore } from './env/add.js';
2
3
  export { functionEnvListCore } from './env/list.js';
3
4
  export { functionEnvRemoveCore } from './env/remove.js';
4
5
  export { functionLogsCore } from './logs.js';
5
6
  export { functionTestCore } from './test.js';
6
- export { functionDevCore } from './dev.js';
@@ -16,7 +16,7 @@ export async function functionLogsCore(options) {
16
16
  return streamLogs({ name, externalId, auth, json, utc, log });
17
17
  return getLogs({ name, externalId, auth, limit, json, utc, log });
18
18
  }
19
- async function deleteLogs({ name, externalId, auth, force, log, }) {
19
+ async function deleteLogs({ name, externalId, auth, force, }) {
20
20
  if (!force) {
21
21
  const { certain } = await inquirer.prompt({
22
22
  type: 'confirm',
@@ -36,14 +36,14 @@ async function deleteLogs({ name, externalId, auth, force, log, }) {
36
36
  spinner.succeed('Logs deleted');
37
37
  return { success: true };
38
38
  }
39
- async function streamLogs({ name, externalId, auth, json, utc, log, }) {
39
+ async function streamLogs({ name, externalId, auth, log, }) {
40
40
  const spinner = ora(`Setting up streaming logs session for function ${niceId(name)}`).start();
41
41
  try {
42
42
  spinner.stop();
43
43
  log(`Streaming log session for function ${niceId(name)}`);
44
44
  log(`Watching for new logs... ${chalk.bold('ctrl+c')} to stop`);
45
45
  const onOpen = () => {
46
- // TODO delete line 97 and uncomment 101 when Fns service is updated
46
+ // TODO delete log("Watching for new logs...") and uncomment this when Fns service is updated
47
47
  // log(`Watching for new logs... ${chalk.bold('ctrl+c')} to stop`)
48
48
  };
49
49
  const renderLog = (logEntry) => {
@@ -39,7 +39,6 @@ const app = (port) => {
39
39
  context.clientOptions.token = config.token || undefined;
40
40
  }
41
41
  else {
42
- // biome-ignore lint/performance/noDelete:
43
42
  delete context.clientOptions.token;
44
43
  }
45
44
  const start = performance.now();
@@ -82,7 +81,7 @@ const app = (port) => {
82
81
  res.writeHead(200);
83
82
  res.end(JSON.stringify(json));
84
83
  }
85
- catch (error) {
84
+ catch {
86
85
  res.writeHead(200);
87
86
  res.end(JSON.stringify([]));
88
87
  }
@@ -106,7 +105,7 @@ const app = (port) => {
106
105
  res.writeHead(200);
107
106
  res.end(JSON.stringify(json));
108
107
  }
109
- catch (error) {
108
+ catch {
110
109
  res.writeHead(200);
111
110
  res.end(JSON.stringify([]));
112
111
  }
@@ -135,7 +134,7 @@ const app = (port) => {
135
134
  res.writeHead(200);
136
135
  res.end(JSON.stringify(json));
137
136
  }
138
- catch (error) {
137
+ catch {
139
138
  res.writeHead(200);
140
139
  res.end(JSON.stringify([]));
141
140
  }
@@ -1,5 +1,6 @@
1
1
  /* globals HTMLElement */
2
2
  import apiConstructor from '../api.js'
3
+
3
4
  const api = apiConstructor()
4
5
 
5
6
  export class ApiBaseElement extends HTMLElement {
@@ -431,7 +431,7 @@
431
431
  /* ---------------------------------- */
432
432
  /* Unitless values are recommended for line-height. */
433
433
  /* Scale derived from font sizes, may need adjustment/simplification. */
434
- --line-height-1: 1.0; /* 15 / 15 */
434
+ --line-height-1: 1; /* 15 / 15 */
435
435
  --line-height-2: 1.03; /* 14 / 13.6 */
436
436
  --line-height-3: 1.06; /* 13 / 12.25 */
437
437
  --line-height-4: 1.11; /* 12 / 10.8 */
@@ -471,14 +471,14 @@
471
471
  --text-2: 13px / 1.4615, var(--font-family-text);
472
472
  --text-3: 15px / 1.5333, var(--font-family-text);
473
473
  --text-4: 18px / 1.5, var(--font-family-text);
474
- --text-4: 21px / 1.4761, var(--font-family-text);
474
+ --text-5: 21px / 1.4761, var(--font-family-text);
475
475
 
476
476
  --heading-1: 13px / 1.4615, var(--font-family-heading);
477
477
  --heading-2: 16px / 1.4375, var(--font-family-heading);
478
478
  --heading-3: 21px / 1.3809, var(--font-family-heading);
479
479
  --heading-4: 27px / 1.2962, var(--font-family-heading);
480
- --heading-4: 33px / 1.2424, var(--font-family-heading);
481
- --heading-4: 38px / 1.2368, var(--font-family-heading);
480
+ --heading-5: 33px / 1.2424, var(--font-family-heading);
481
+ --heading-6: 38px / 1.2368, var(--font-family-heading);
482
482
 
483
483
  --label-1: 8.1px / 1.2345, var(--font-family-text);
484
484
  --label-2: 9.5px / 1.1578, var(--font-family-text);
@@ -761,22 +761,22 @@ body {
761
761
  }
762
762
 
763
763
  /* Layout */
764
- body > header {
764
+ header {
765
765
  grid-area: header;
766
766
  }
767
- body > filters-component {
767
+ filters-component {
768
768
  grid-area: filters;
769
769
  }
770
- body > nav {
770
+ nav {
771
771
  grid-area: left-sidebar;
772
772
  }
773
- body > main {
773
+ main {
774
774
  grid-area: main;
775
775
  /* Ensure main takes up available space if body is grid/flex */
776
776
  overflow: hidden; /* Prevent main itself from scrolling */
777
777
  min-height: 0; /* Needed for grid children height */
778
778
  }
779
- body > footer {
779
+ footer {
780
780
  grid-area: footer;
781
781
  }
782
782
 
@@ -977,7 +977,7 @@ footer {
977
977
  text-transform: uppercase;
978
978
  font-size: 11px;
979
979
  font-weight: 500;
980
- letter-spacing: .5px;
980
+ letter-spacing: 0.5px;
981
981
  }
982
982
 
983
983
  .config-label span {
@@ -988,7 +988,7 @@ footer {
988
988
  .function-list-item {
989
989
  color: light-dark(var(--gray-800), var(--gray-400));
990
990
  padding: 8px;
991
- font-size: .875rem;
991
+ font-size: 0.875rem;
992
992
  border-radius: 3px;
993
993
  margin: 0 0 1px 0;
994
994
  cursor: pointer;
@@ -1049,7 +1049,7 @@ m-tabs {
1049
1049
  .tab {
1050
1050
  font-size: 11px;
1051
1051
  font-weight: 500;
1052
- border-radius: .1875rem;
1052
+ border-radius: 0.1875rem;
1053
1053
  padding: 8px;
1054
1054
  border: 0 !important;
1055
1055
  }
@@ -1,8 +1,7 @@
1
- import {HighlightStyle, syntaxHighlighting} from '../vendor/vendor.bundle.js'
2
- import {tags as t} from '../vendor/vendor.bundle.js'
1
+ import {HighlightStyle, syntaxHighlighting, tags as t} from '../vendor/vendor.bundle.js'
3
2
 
4
3
  const red = 'light-dark(var(--red-600), var(--red-400))'
5
- const orange = 'light-dark(var(--orange-600), var(--orange-400))'
4
+ // const orange = 'light-dark(var(--orange-600), var(--orange-400))'
6
5
  const yellow = 'light-dark(var(--yellow-600), var(--yellow-400))'
7
6
  const green = 'light-dark(var(--green-600), var(--green-400))'
8
7
  const blue = 'light-dark(var(--blue-600), var(--blue-400))'
@@ -1,8 +1,8 @@
1
1
  /* globals customElements document */
2
- import {sanityCodeMirrorTheme} from './codemirror-theme.js'
3
2
 
4
- import {EditorView, basicSetup, json} from '../vendor/vendor.bundle.js'
3
+ import {basicSetup, EditorView, json} from '../vendor/vendor.bundle.js'
5
4
  import {ApiBaseElement} from './api-base.js'
5
+ import {sanityCodeMirrorTheme} from './codemirror-theme.js'
6
6
 
7
7
  const template = `<div class="gutter-gradient relative h-100 max-h-100 y-scroll border-top border-top-none-l">
8
8
  <div class="bg gutter-gradient sticky top-0 right-0 left-0 z-100">
@@ -1,16 +1,16 @@
1
1
  /* globals customElements document */
2
2
  /* eslint-disable unicorn/prefer-dom-node-text-content */
3
- import {sanityCodeMirrorTheme} from './codemirror-theme.js'
4
3
 
5
4
  import {
5
+ basicSetup,
6
6
  EditorState,
7
7
  EditorView,
8
- basicSetup,
9
8
  json,
10
9
  prettyBytes,
11
10
  prettyMilliseconds,
12
11
  } from '../vendor/vendor.bundle.js'
13
12
  import {ApiBaseElement} from './api-base.js'
13
+ import {sanityCodeMirrorTheme} from './codemirror-theme.js'
14
14
 
15
15
  const template = `<div class="border-left border-top border-top-none-l h-100 gutter-gradient" style='height: 100%; max-height: 100%; overflow: hidden; display:grid;grid-template-rows: auto 1fr; grid-template-columns: 1fr;' >
16
16
  <!-- Response Section -->
@@ -36,7 +36,7 @@ class ResponsePanel extends ApiBaseElement {
36
36
  updateResponse = ({result}) => {
37
37
  if (!result) return
38
38
 
39
- const {error, json, time, timings} = result
39
+ const {error, json, timings} = result
40
40
  if (!error) {
41
41
  const transaction = this.api.store.response.state.update({
42
42
  changes: {
@@ -1,9 +1,9 @@
1
1
  /* globals customElements document */
2
2
  /* eslint-disable unicorn/prefer-dom-node-text-content */
3
- import {sanityCodeMirrorTheme} from './codemirror-theme.js'
4
3
 
5
- import {EditorState, EditorView, basicSetup, json} from '../vendor/vendor.bundle.js'
4
+ import {basicSetup, EditorState, EditorView, json} from '../vendor/vendor.bundle.js'
6
5
  import {ApiBaseElement} from './api-base.js'
6
+ import {sanityCodeMirrorTheme} from './codemirror-theme.js'
7
7
 
8
8
  const template = `<div style='overflow-y:scroll; min-height: 0;'>
9
9
  <div>
@@ -1,4 +1,5 @@
1
1
  import apiConstructor from '../api.js'
2
+
2
3
  const api = apiConstructor()
3
4
 
4
5
  // Create WebSocket connection.
@@ -26710,7 +26710,8 @@ function prettyBytes(number, options) {
26710
26710
  number = divide(number, (options.binary ? 1024 : 1000) ** exponent);
26711
26711
 
26712
26712
  if (!localeOptions) {
26713
- number = number.toPrecision(3);
26713
+ const minPrecision = Math.max(3, Number.parseInt(number, 10).toString().length);
26714
+ number = number.toPrecision(minPrecision);
26714
26715
  }
26715
26716
 
26716
26717
  const numberString = toLocaleString(Number(number), options.locale, localeOptions);
@@ -50,7 +50,7 @@ console.table = (data, columns) => {
50
50
  const originalWrite = process.stdout.write.bind(process.stdout)
51
51
  let buffer = ''
52
52
 
53
- process.stdout.write = (chunk, encoding, callback) => {
53
+ process.stdout.write = (chunk, _encoding, callback) => {
54
54
  buffer += chunk
55
55
  if (typeof callback === 'function') callback()
56
56
  }
@@ -8,7 +8,7 @@ import { formatLogEntry } from './logs-formatting.js';
8
8
  */
9
9
  export async function setupLogStreaming(config) {
10
10
  const { stackId, auth, log, showBanner, after } = config;
11
- let newestTimestamp = new Date().getTime();
11
+ let newestTimestamp = Date.now();
12
12
  const onLogReceived = (logEntry) => {
13
13
  if (!isNewerLog(logEntry, newestTimestamp))
14
14
  return;
@@ -1,4 +1,4 @@
1
- export { info, niceId, warn, severe } from './presenters.js';
1
+ export { info, niceId, severe, warn } from './presenters.js';
2
2
  /** @deprecated Use `chalk.bold` directly */
3
3
  export declare function bold(str: string): string;
4
4
  /** @deprecated Use `chalk.underline` directly */
@@ -1,5 +1,5 @@
1
1
  import chalk from 'chalk';
2
- export { info, niceId, warn, severe } from './presenters.js';
2
+ export { info, niceId, severe, warn } from './presenters.js';
3
3
  /** @deprecated Use `chalk.bold` directly */
4
4
  export function bold(str) {
5
5
  return chalk.bold(str);
@@ -1,6 +1,6 @@
1
1
  export * as blueprintsFormatting from './blueprints-formatting.js';
2
2
  export * as colors from './colors.js';
3
- export * as presenters from './presenters.js';
4
3
  export * as dates from './dates.js';
5
- export * as logsFormatting from './logs-formatting.js';
6
4
  export * as errors from './errors.js';
5
+ export * as logsFormatting from './logs-formatting.js';
6
+ export * as presenters from './presenters.js';
@@ -1,6 +1,6 @@
1
1
  export * as blueprintsFormatting from './blueprints-formatting.js';
2
2
  export * as colors from './colors.js';
3
- export * as presenters from './presenters.js';
4
3
  export * as dates from './dates.js';
5
- export * as logsFormatting from './logs-formatting.js';
6
4
  export * as errors from './errors.js';
5
+ export * as logsFormatting from './logs-formatting.js';
6
+ export * as presenters from './presenters.js';
@@ -4,7 +4,7 @@ async function getUserAgent() {
4
4
  const pkg = await (await import('../../package.json', { with: { type: 'json' } })).default;
5
5
  return `${pkg.name}@${pkg.version}`;
6
6
  }
7
- catch (err) {
7
+ catch {
8
8
  return 'unknown@0.0.0';
9
9
  }
10
10
  }
@@ -3,5 +3,5 @@ export * as findFunction from './find-function.js';
3
3
  export * as invokeLocal from './invoke-local.js';
4
4
  export * as types from './types.js';
5
5
  export * as validate from './validate/index.js';
6
- export * as vendor from './vendor/index.js';
7
6
  export * as validatedToken from './validated-token.js';
7
+ export * as vendor from './vendor/index.js';
@@ -3,5 +3,5 @@ export * as findFunction from './find-function.js';
3
3
  export * as invokeLocal from './invoke-local.js';
4
4
  export * as types from './types.js';
5
5
  export * as validate from './validate/index.js';
6
- export * as vendor from './vendor/index.js';
7
6
  export * as validatedToken from './validated-token.js';
7
+ export * as vendor from './vendor/index.js';
@@ -43,7 +43,7 @@ export async function applyGroqRule(resource, data) {
43
43
  const event = getEvent(resource.event);
44
44
  if (!isDefaultGROQRule(event)) {
45
45
  const hasProjection = event.projection?.length;
46
- const projection = hasProjection ? `{${event?.projection}}` : '';
46
+ const projection = hasProjection ? `${event?.projection}` : '';
47
47
  const query = `*[${event?.filter}]${projection}`;
48
48
  try {
49
49
  const rule = groq.parse(query);
@@ -52,7 +52,7 @@ export async function applyGroqRule(resource, data) {
52
52
  // TODO can this be multiple documents?
53
53
  return currentFunctionDocumentSet[0] || {};
54
54
  }
55
- catch (e) {
55
+ catch {
56
56
  // parsing/validating the groq rule we do up front as part of functions HTTP API
57
57
  // so this likely would be triggered by evaluating the query, if anything
58
58
  throw Error('⚠️ failed parsing/evaluating GROQ rule! Skipping invoke.');
@@ -69,7 +69,7 @@ export default async function invoke(resource, data, context, options) {
69
69
  const filteredData = await applyGroqRule(resource, data);
70
70
  let cleanupBundle = async () => { };
71
71
  let functionPath = '';
72
- let bundleTimings = undefined;
72
+ let bundleTimings;
73
73
  // If no package.json exists we will create a temporary one to avoid the
74
74
  // Module Type warning from node
75
75
  const existingPackageJson = doesPackageJsonExists(resource);
@@ -7,7 +7,7 @@ export async function getLatestNpmVersion(pkg) {
7
7
  const data = await res.json();
8
8
  return data.version;
9
9
  }
10
- catch (error) {
10
+ catch {
11
11
  return 'latest';
12
12
  }
13
13
  }
@@ -901,5 +901,5 @@
901
901
  ]
902
902
  }
903
903
  },
904
- "version": "10.1.2"
904
+ "version": "10.1.4"
905
905
  }
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": "10.1.2",
4
+ "version": "10.1.4",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -77,54 +77,54 @@
77
77
  "dependencies": {
78
78
  "@architect/hydrate": "^4.0.8",
79
79
  "@architect/inventory": "^4.0.9",
80
- "@oclif/core": "^4.3.0",
81
- "@oclif/plugin-help": "^6.2.28",
82
- "@sanity/client": "^7.3.0",
80
+ "@oclif/core": "^4.5.2",
81
+ "@oclif/plugin-help": "^6.2.32",
82
+ "@sanity/client": "^7.8.2",
83
83
  "adm-zip": "^0.5.16",
84
84
  "array-treeify": "^0.1.5",
85
85
  "cardinal": "^2.1.1",
86
- "chalk": "^5.4.1",
86
+ "chalk": "^5.5.0",
87
87
  "eventsource": "^4.0.0",
88
88
  "find-up": "^7.0.0",
89
89
  "get-folder-size": "^5.0.0",
90
- "groq-js": "^1.16.1",
91
- "inquirer": "^12.6.1",
92
- "jiti": "^2.4.2",
90
+ "groq-js": "^1.17.3",
91
+ "inquirer": "^12.9.2",
92
+ "jiti": "^2.5.1",
93
93
  "mime-types": "^3.0.1",
94
94
  "ora": "^8.2.0",
95
95
  "tar-stream": "^3.1.7",
96
- "vite": "^6.3.5",
96
+ "vite": "^7.1.2",
97
97
  "vite-tsconfig-paths": "^5.1.4",
98
- "ws": "^8.18.2",
98
+ "ws": "^8.18.3",
99
99
  "xdg-basedir": "^5.1.0"
100
100
  },
101
101
  "devDependencies": {
102
- "@biomejs/biome": "1.9.4",
103
- "@codemirror/lang-json": "^6.0.1",
102
+ "@biomejs/biome": "2.2.0",
103
+ "@codemirror/lang-json": "^6.0.2",
104
104
  "@codemirror/state": "^6.5.2",
105
105
  "@enhance/store": "^1.0.2",
106
106
  "@lezer/highlight": "^1.2.1",
107
107
  "@oclif/test": "^4.1.13",
108
- "@playwright/test": "^1.52.0",
108
+ "@playwright/test": "^1.54.2",
109
109
  "@rollup/plugin-node-resolve": "^16.0.1",
110
110
  "@sanity/blueprints": "^0.1.0",
111
111
  "@sanity/functions": "^1.0.3",
112
112
  "@types/adm-zip": "^0.5.7",
113
113
  "@types/cardinal": "^2.1.1",
114
- "@types/mime-types": "^2.1.4",
114
+ "@types/mime-types": "^3.0.1",
115
115
  "@types/node": "20",
116
116
  "@types/tar-stream": "^3.1.4",
117
117
  "@types/ws": "^8.18.1",
118
- "codemirror": "^6.0.1",
118
+ "codemirror": "^6.0.2",
119
119
  "mentoss": "^0.11.0",
120
- "oclif": "^4.17.46",
121
- "pretty-bytes": "^7.0.0",
120
+ "oclif": "^4.22.9",
121
+ "pretty-bytes": "^7.0.1",
122
122
  "pretty-ms": "^9.2.0",
123
- "rollup": "^4.41.0",
123
+ "rollup": "^4.46.2",
124
124
  "shx": "^0.4.0",
125
125
  "ts-node": "^10.9.2",
126
- "typescript": "^5.8.3",
127
- "vitest": "3.1.4"
126
+ "typescript": "^5.9.2",
127
+ "vitest": "3.2.4"
128
128
  },
129
129
  "oclif": {
130
130
  "bin": "sanity-run",