@sanity/runtime-cli 16.0.3 → 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.
@@ -0,0 +1 @@
1
+ export declare const isInteractive: boolean;
@@ -0,0 +1,4 @@
1
+ function testIsInteractive() {
2
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
3
+ }
4
+ export const isInteractive = testIsInteractive();
@@ -5,6 +5,7 @@ export declare function Logger(log: (msg: string) => void, flags?: {
5
5
  json?: boolean;
6
6
  }): {
7
7
  (msg: string): void;
8
+ isTraceEnabled: boolean;
8
9
  trace(formatter: unknown, ...args: unknown[]): false | void;
9
10
  verbose(formatter: unknown, ...args: unknown[]): false | void;
10
11
  info(formatter: unknown, ...args: unknown[]): false | void;
@@ -13,6 +13,7 @@ export function Logger(log, flags = {}) {
13
13
  log(msg);
14
14
  };
15
15
  const level = flags.verbose ? LogLevel.VERBOSE : flags.trace ? LogLevel.TRACE : LogLevel.INFO;
16
+ logger.isTraceEnabled = level <= LogLevel.TRACE;
16
17
  logger.trace = (formatter, ...args) => level <= LogLevel.TRACE && logger(format(formatter, ...args));
17
18
  logger.verbose = (formatter, ...args) => level <= LogLevel.VERBOSE && logger(format(formatter, ...args));
18
19
  logger.info = (formatter, ...args) => level <= LogLevel.INFO && logger(format(formatter, ...args));
@@ -1,5 +1,6 @@
1
- import { env, stdout } from 'node:process';
1
+ import { env } from 'node:process';
2
2
  import { styleText as nodeStyleText } from 'node:util';
3
+ import { isInteractive } from './interactive.js';
3
4
  function supportsColor() {
4
5
  /*
5
6
  * https://force-color.org
@@ -32,10 +33,8 @@ function supportsColor() {
32
33
  if (env.NODE_DISABLE_COLORS !== undefined && env.NODE_DISABLE_COLORS !== '') {
33
34
  return false;
34
35
  }
35
- /*
36
- * If the stdout is a TTY, use colors.
37
- */
38
- return typeof stdout?.isTTY === 'boolean' && stdout.isTTY;
36
+ // if interactive, use colors
37
+ return isInteractive;
39
38
  }
40
39
  export const styleText = (format, text) => {
41
40
  if (!supportsColor())
@@ -173,6 +173,8 @@ export function createTracedFetch(logger, options) {
173
173
  ...options,
174
174
  };
175
175
  return async (input, init) => {
176
+ if (!logger.isTraceEnabled)
177
+ return fetch(input, init);
176
178
  const requestId = randomUUID().slice(0, 3);
177
179
  const url = typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url;
178
180
  const method = init?.method || 'GET';
@@ -839,13 +839,14 @@
839
839
  "aliases": [],
840
840
  "args": {
841
841
  "dir": {
842
- "description": "Directory to create the local Blueprint in",
842
+ "description": "Directory to create the local Blueprint in (defaults to the current directory)",
843
843
  "name": "dir"
844
844
  }
845
845
  },
846
- "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis 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.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.",
846
+ "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis 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.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
847
847
  "examples": [
848
848
  "<%= config.bin %> <%= command.id %>",
849
+ "<%= config.bin %> <%= command.id %> .",
849
850
  "<%= config.bin %> <%= command.id %> [directory]",
850
851
  "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
851
852
  "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
@@ -2996,5 +2997,5 @@
2996
2997
  ]
2997
2998
  }
2998
2999
  },
2999
- "version": "16.0.3"
3000
+ "version": "17.0.0"
3000
3001
  }
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": "16.0.3",
4
+ "version": "17.0.0",
5
5
  "author": "Sanity Runtime Team",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "engines": {
24
- "node": ">=20.19"
24
+ "node": ">=22.12"
25
25
  },
26
26
  "files": [
27
27
  "./bin",
@@ -58,27 +58,27 @@
58
58
  "watch": "tsc --watch"
59
59
  },
60
60
  "dependencies": {
61
- "@architect/hydrate": "^5.0.2",
62
- "@architect/inventory": "^5.0.0",
63
- "@inquirer/prompts": "^8.4.2",
64
- "@oclif/core": "^4.11.0",
65
- "@oclif/plugin-help": "^6.2.46",
61
+ "@architect/hydrate": "~6.0.0",
62
+ "@architect/inventory": "~6.0.0",
63
+ "@inquirer/prompts": "^8.5.2",
64
+ "@oclif/core": "^4.11.6",
65
+ "@oclif/plugin-help": "^6.2.50",
66
66
  "@sanity-labs/design-tokens": "^0.0.2-alpha.2",
67
67
  "@sanity/blueprints": "^0.20.1",
68
68
  "@sanity/blueprints-parser": "^0.4.0",
69
- "@sanity/client": "^7.22.0",
69
+ "@sanity/client": "^7.22.1",
70
70
  "adm-zip": "^0.5.17",
71
71
  "array-treeify": "^0.1.5",
72
72
  "cardinal": "^2.1.1",
73
- "empathic": "^2.0.0",
73
+ "empathic": "^2.0.1",
74
74
  "eventsource": "^4.1.0",
75
- "groq-js": "^1.30.1",
75
+ "groq-js": "^1.30.2",
76
76
  "jiti": "^2.7.0",
77
77
  "mime-types": "^3.0.2",
78
78
  "ora": "^9.4.0",
79
79
  "tar-stream": "^3.2.0",
80
80
  "vite": "^8.0.16",
81
- "ws": "^8.20.0",
81
+ "ws": "^8.21.0",
82
82
  "xdg-basedir": "^5.1.0"
83
83
  },
84
84
  "devDependencies": {
@@ -94,10 +94,10 @@
94
94
  "@types/adm-zip": "^0.5.8",
95
95
  "@types/cardinal": "^2.1.1",
96
96
  "@types/mime-types": "^3.0.1",
97
- "@types/node": "20",
97
+ "@types/node": "^22",
98
98
  "@types/tar-stream": "^3.1.4",
99
99
  "@types/ws": "^8.18.1",
100
- "@vitest/coverage-v8": "^4.1.5",
100
+ "@vitest/coverage-v8": "4.1.9",
101
101
  "codemirror": "^6.0.2",
102
102
  "mentoss": "^0.13.0",
103
103
  "oclif": "^4.23.0",
@@ -107,7 +107,7 @@
107
107
  "shx": "^0.4.0",
108
108
  "ts-node": "^10.9.2",
109
109
  "typescript": "^6.0.3",
110
- "vitest": "4.1.5"
110
+ "vitest": "4.1.9"
111
111
  },
112
112
  "oclif": {
113
113
  "bin": "sanity-run",