@sanity/cli-core 3.14.2 → 3.15.1

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.
@@ -1,5 +1,5 @@
1
1
  import { n as ProjectCliClientOptions, t as GlobalCliClientOptions } from "./apiClient-DXlF5ZV3.js";
2
- import { r as CliConfig } from "./cliConfig-BZgn8ge1.js";
2
+ import { r as CliConfig } from "./cliConfig-DXI15-0E.js";
3
3
  import { t as ProjectRootResult } from "./recursivelyResolveProjectRoot-BE54uEP6.js";
4
4
  import { t as CLITelemetryStore } from "./types-ZNH3prAd.js";
5
5
  import { t as Output } from "./types-ii6VUp6a.js";
@@ -1,5 +1,5 @@
1
- import { i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-BZgn8ge1.js";
2
- import { _ as CliTokenInfo, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as setCliUserConfig, h as getUserConfig, i as isStudioConfig, l as getCliConfigSync, m as getCliUserConfig, n as tryFindStudioConfigPath, o as getStudioConfig, p as getCliTokenInfo, r as findPathForFiles, s as findProjectRootSync, t as findStudioConfigPath, u as getCliConfig, v as clearCliTokenCache } from "../findStudioConfigPath-B35la6W9.js";
3
- import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-DFUFhE7a.js";
1
+ import { i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-DXI15-0E.js";
2
+ import { _ as CliTokenInfo, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as setCliUserConfig, h as getUserConfig, i as isStudioConfig, l as getCliConfigSync, m as getCliUserConfig, n as tryFindStudioConfigPath, o as getStudioConfig, p as getCliTokenInfo, r as findPathForFiles, s as findProjectRootSync, t as findStudioConfigPath, u as getCliConfig, v as clearCliTokenCache } from "../findStudioConfigPath-BzVcTUST.js";
3
+ import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-DJfB1FCE.js";
4
4
  import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
5
5
  export { type CliConfig, type CliTokenInfo, type ConfigStore, type TypeGenConfig, type TypeGenResource, clearCliTokenCache, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliToken, getCliTokenInfo, getCliUserConfig, getSanityConfigDir, getSanityDataDir, getSanityEnvVar, getSanityUrl, getStudioConfig, getStudioWorkspaces, getUserConfig, getWorkspace, isStudioConfig, isWorkbenchApp, parseWorkbenchCliConfig, setCliUserConfig, tryFindStudioConfigPath };
@@ -1,12 +1,12 @@
1
1
  import { i as getProjectCliClient, n as ProjectCliClientOptions, r as getGlobalCliClient, t as GlobalCliClientOptions } from "../apiClient-DXlF5ZV3.js";
2
- import { c as UserViteConfig, i as ConfigStore, n as AppVisibility, r as CliConfig, t as APP_VISIBILITIES } from "../cliConfig-BZgn8ge1.js";
2
+ import { c as UserViteConfig, i as ConfigStore, n as AppVisibility, r as CliConfig, t as APP_VISIBILITIES } from "../cliConfig-DXI15-0E.js";
3
3
  import { t as ProjectRootResult } from "../recursivelyResolveProjectRoot-BE54uEP6.js";
4
4
  import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
5
5
  import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-ii6VUp6a.js";
6
6
  import { SanityCommand, SanityCommandInterface } from "../SanityCommand.js";
7
7
  import { t as mockBrowserEnvironment } from "../mockBrowserEnvironment-BjFQPb2W.js";
8
- import { _ as CliTokenInfo, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as setCliUserConfig, h as getUserConfig, i as isStudioConfig, l as getCliConfigSync, m as getCliUserConfig, n as tryFindStudioConfigPath, o as getStudioConfig, p as getCliTokenInfo, r as findPathForFiles, s as findProjectRootSync, t as findStudioConfigPath, u as getCliConfig, v as clearCliTokenCache } from "../findStudioConfigPath-B35la6W9.js";
9
- import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-DFUFhE7a.js";
8
+ import { _ as CliTokenInfo, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as setCliUserConfig, h as getUserConfig, i as isStudioConfig, l as getCliConfigSync, m as getCliUserConfig, n as tryFindStudioConfigPath, o as getStudioConfig, p as getCliTokenInfo, r as findPathForFiles, s as findProjectRootSync, t as findStudioConfigPath, u as getCliConfig, v as clearCliTokenCache } from "../findStudioConfigPath-BzVcTUST.js";
9
+ import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-DJfB1FCE.js";
10
10
  import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
11
11
  import { debug, subdebug } from "./debug.js";
12
12
  import { t as NonInteractiveError } from "../NonInteractiveError-CSLT5y93.js";
@@ -18,7 +18,7 @@ import { a as isCi, i as isInteractive, n as normalizePath, o as importModule, r
18
18
  import { a as getLocalPackageVersion, i as getLocalPackageDir, n as resolveLocalPackageFrom, r as resolveLocalPackagePath, t as resolveLocalPackage } from "../resolveLocalPackage-Dr-TNTyk.js";
19
19
  import { n as ReadPackageJsonOptions, r as readPackageJson, t as PackageJson } from "../readPackageJson-Cr_lbjVR.js";
20
20
  import { n as colorizeJson, t as getTimer } from "../timer-Dwu2TIgB.js";
21
- import { i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-CCgh6idL.js";
21
+ import { i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-Cgl_4hRt.js";
22
22
  import { WorkerOptions } from "node:worker_threads";
23
23
  interface PromisifyWorkerOptions extends WorkerOptions {
24
24
  /**
@@ -1,2 +1,2 @@
1
- import { a as cliConfigSchema, i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-CCgh6idL.js";
1
+ import { a as cliConfigSchema, i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-Cgl_4hRt.js";
2
2
  export { type CoreAppManifest, type StudioManifest, cliConfigSchema, coreAppManifestSchema, studioManifestSchema };
@@ -1,9 +1,9 @@
1
- import { a as ReactCompilerConfig, c as UserViteConfig, i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-BZgn8ge1.js";
1
+ import { a as ReactCompilerConfig, c as UserViteConfig, i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-DXI15-0E.js";
2
2
  import { t as ProjectRootResult } from "../recursivelyResolveProjectRoot-BE54uEP6.js";
3
3
  import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
4
4
  import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-ii6VUp6a.js";
5
5
  import { SanityCommandInterface } from "../SanityCommand.js";
6
- import { t as ApplicationType } from "../workbenchApp-DFUFhE7a.js";
6
+ import { t as ApplicationType } from "../workbenchApp-DJfB1FCE.js";
7
7
  import { n as ReadPackageJsonOptions, t as PackageJson } from "../readPackageJson-Cr_lbjVR.js";
8
- import { n as StudioManifest, t as CoreAppManifest } from "../schemas-CCgh6idL.js";
8
+ import { n as StudioManifest, t as CoreAppManifest } from "../schemas-Cgl_4hRt.js";
9
9
  export type { ApplicationType, CLITelemetryStore, CliConfig, ConfigStore, ConsentInformation, CoreAppManifest, Output, PackageJson, ProjectRootResult, ReactCompilerConfig, ReadPackageJsonOptions, RequireProps, SanityCommandInterface, SanityOrgUser, StudioManifest, TelemetryUserProperties, TypeGenConfig, TypeGenResource, UserViteConfig };
@@ -238,6 +238,17 @@ interface CliConfig {
238
238
  * {@link https://vite.dev/guide/rolldown#full-bundle-mode}
239
239
  */
240
240
  unstable_bundledDev?: boolean;
241
+ /**
242
+ * Whether `sanity dev` and `sanity build` render a custom HTML document component from
243
+ * `_document.js` or `_document.tsx` in the project root. Defaults to `true`.
244
+ *
245
+ * Set to `false` to skip the lookup and always render the default document. Custom document
246
+ * components are being phased out: customize the HTML with a Vite plugin in the `vite`
247
+ * option instead.
248
+ *
249
+ * Unstable: will be removed once custom document components are no longer supported.
250
+ */
251
+ unstable_documentComponent?: boolean;
241
252
  /** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */
242
253
  vite?: UserViteConfig;
243
254
  }
@@ -257,4 +268,4 @@ interface ConfigStore {
257
268
  set: (key: string, value: unknown) => void;
258
269
  }
259
270
  export { ReactCompilerConfig as a, UserViteConfig as c, ConfigStore as i, AppVisibility as n, TypeGenConfig as o, CliConfig as r, TypeGenResource as s, APP_VISIBILITIES as t };
260
- //# sourceMappingURL=cliConfig-BZgn8ge1.d.ts.map
271
+ //# sourceMappingURL=cliConfig-DXI15-0E.d.ts.map
@@ -1,4 +1,4 @@
1
- import { mkdirSync } from 'node:fs';
1
+ import { chmodSync, mkdirSync, statSync } from 'node:fs';
2
2
  import { dirname, join as joinPath } from 'node:path';
3
3
  import { z } from 'zod/mini';
4
4
  import { debug } from '../../_exports/debug.js';
@@ -59,6 +59,15 @@ export const _internals = {
59
59
  setCachedTokenInfo(tokenInfo);
60
60
  return tokenInfo;
61
61
  }
62
+ // The config file holds the CLI auth token, so keep it readable by its owner only
63
+ const CONFIG_DIR_OPTIONS = {
64
+ mode: 0o700,
65
+ recursive: true
66
+ };
67
+ const CONFIG_WRITE_OPTIONS = {
68
+ mode: 0o600,
69
+ pretty: true
70
+ };
62
71
  const cliUserConfigSchema = {
63
72
  authToken: z.optional(z.string())
64
73
  };
@@ -78,23 +87,17 @@ const cliUserConfigSchema = {
78
87
  throw new Error(`Invalid value for config property "${prop}": ${message}`);
79
88
  }
80
89
  const configPath = getCliUserConfigPath();
81
- mkdirSync(dirname(configPath), {
82
- recursive: true
83
- });
90
+ mkdirSync(dirname(configPath), CONFIG_DIR_OPTIONS);
84
91
  // When value is undefined, explicitly delete the key rather than relying
85
92
  // on JSON.stringify silently dropping undefined values.
86
93
  if (value === undefined) {
87
94
  const { [prop]: _, ...rest } = config;
88
- writeJsonFileSync(configPath, rest, {
89
- pretty: true
90
- });
95
+ writeJsonFileSync(configPath, rest, CONFIG_WRITE_OPTIONS);
91
96
  } else {
92
97
  writeJsonFileSync(configPath, {
93
98
  ...config,
94
99
  [prop]: value
95
- }, {
96
- pretty: true
97
- });
100
+ }, CONFIG_WRITE_OPTIONS);
98
101
  }
99
102
  // Invalidate the in-process token cache so subsequent getCliToken() calls
100
103
  // pick up the new value from disk.
@@ -140,15 +143,11 @@ const cliUserConfigSchema = {
140
143
  set (key, value) {
141
144
  const config = readConfig();
142
145
  const configPath = getCliUserConfigPath();
143
- mkdirSync(dirname(configPath), {
144
- recursive: true
145
- });
146
+ mkdirSync(dirname(configPath), CONFIG_DIR_OPTIONS);
146
147
  writeJsonFileSync(configPath, {
147
148
  ...config,
148
149
  [key]: value
149
- }, {
150
- pretty: true
151
- });
150
+ }, CONFIG_WRITE_OPTIONS);
152
151
  if (key === 'authToken') clearCliTokenCache();
153
152
  },
154
153
  // No mkdirSync needed: if readConfig() succeeded the directory already exists.
@@ -156,9 +155,7 @@ const cliUserConfigSchema = {
156
155
  const config = readConfig();
157
156
  if (!(key in config)) return;
158
157
  const { [key]: _, ...rest } = config;
159
- writeJsonFileSync(getCliUserConfigPath(), rest, {
160
- pretty: true
161
- });
158
+ writeJsonFileSync(getCliUserConfigPath(), rest, CONFIG_WRITE_OPTIONS);
162
159
  if (key === 'authToken') clearCliTokenCache();
163
160
  }
164
161
  };
@@ -177,8 +174,10 @@ function assertCanAccessHostUserConfig() {
177
174
  * @returns The whole CLI configuration.
178
175
  * @internal
179
176
  */ function readConfig() {
177
+ const configPath = getCliUserConfigPath();
178
+ restrictConfigFilePermissions(configPath);
180
179
  try {
181
- const config = readJsonFileSync(getCliUserConfigPath());
180
+ const config = readJsonFileSync(configPath);
182
181
  if (!config || typeof config !== 'object' || Array.isArray(config)) {
183
182
  throw new Error('Invalid config file - expected an object');
184
183
  }
@@ -188,6 +187,25 @@ function assertCanAccessHostUserConfig() {
188
187
  return {};
189
188
  }
190
189
  }
190
+ /**
191
+ * Remove group and other access from an existing config file. CLI versions from
192
+ * 6.0.0 created it with the default umask mode (usually 0644), exposing the auth
193
+ * token to other local users. Only touches files owned by the current user, and
194
+ * never adds permissions.
195
+ *
196
+ * @param configPath - Path to the CLI configuration file
197
+ */ function restrictConfigFilePermissions(configPath) {
198
+ // No POSIX permissions to fix on Windows
199
+ if (typeof process.getuid !== 'function') return;
200
+ try {
201
+ const { mode, uid } = statSync(configPath);
202
+ if (uid !== process.getuid() || (mode & 0o077) === 0) return;
203
+ chmodSync(configPath, mode & 0o700);
204
+ debug('Restricted permissions of %s to owner only', configPath);
205
+ } catch (err) {
206
+ debug('Could not restrict permissions of CLI config file: %s', err instanceof Error ? err.message : `${err}`);
207
+ }
208
+ }
191
209
  /**
192
210
  * Get the file system location for the CLI user configuration file.
193
211
  * Takes into account the active environment (staging vs production).
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/cli/cliUserConfig.ts"],"sourcesContent":["import {mkdirSync} from 'node:fs'\nimport {dirname, join as joinPath} from 'node:path'\n\nimport {z} from 'zod/mini'\n\nimport {debug} from '../../_exports/debug.js'\nimport {getCliExecutionContext} from '../../executionContext.js'\nimport {getSanityConfigDir} from '../../util/getSanityConfigDir.js'\nimport {readJsonFileSync} from '../../util/readJsonFileSync.js'\nimport {writeJsonFileSync} from '../../util/writeJsonFileSync.js'\nimport {\n clearCliTokenCache,\n type CliTokenInfo,\n getCachedTokenInfo,\n setCachedTokenInfo,\n} from './cliTokenCache.js'\nimport {type ConfigStore} from './types/cliConfig.js'\n\n// Re-export so existing consumers don't break\nexport {clearCliTokenCache} from './cliTokenCache.js'\nexport {type CliTokenInfo} from './cliTokenCache.js'\n\n// Only used for testing\nexport const _internals = {\n getCliUserConfig,\n}\n\n/**\n * Get the CLI authentication token selected for the current invocation.\n *\n * @returns A promise that resolves to a CLI token, or undefined if no token is found\n * @internal\n */\nexport async function getCliToken(): Promise<string | undefined> {\n return (await getCliTokenInfo())?.token\n}\n\n/**\n * Get the CLI authentication token and where it was resolved from.\n *\n * @returns A promise that resolves to the token and its source, or undefined if no token is found\n * @internal\n */\nexport async function getCliTokenInfo(): Promise<CliTokenInfo | undefined> {\n // A per-invocation execution context token (e.g. per-request from an MCP\n // server) takes precedence and must bypass the process-wide cache entirely:\n // reading the cache would leak another invocation's token, and writing it\n // would leak this one's.\n const context = getCliExecutionContext()\n if (context) {\n return context.token === undefined\n ? undefined\n : {source: 'CLI execution context', token: context.token}\n }\n\n const cachedTokenInfo = getCachedTokenInfo()\n if (cachedTokenInfo !== undefined) {\n return cachedTokenInfo\n }\n\n const token = process.env.SANITY_AUTH_TOKEN\n if (token) {\n const tokenInfo = {\n source: 'SANITY_AUTH_TOKEN environment variable',\n token: token.trim(),\n }\n setCachedTokenInfo(tokenInfo)\n return tokenInfo\n }\n\n const configToken = _internals.getCliUserConfig('authToken')\n const tokenInfo =\n configToken === undefined ? undefined : {source: getCliUserConfigPath(), token: configToken}\n setCachedTokenInfo(tokenInfo)\n return tokenInfo\n}\nconst cliUserConfigSchema = {\n authToken: z.optional(z.string()),\n}\n\n/**\n * Set the config value for the given property.\n * Validates that the passed value adheres to the defined CLI config schema.\n *\n * @param prop - The property to set the value for\n * @param value - The value to set\n * @internal\n */\nexport function setCliUserConfig(prop: 'authToken', value: string | undefined): void {\n assertCanAccessHostUserConfig()\n const config = readConfig()\n const result = cliUserConfigSchema[prop].safeParse(value)\n if (!result.success) {\n const message = result.error.issues\n .map(({message, path}) => `[${path.join('.')}] ${message}`)\n .join('\\n')\n\n throw new Error(`Invalid value for config property \"${prop}\": ${message}`)\n }\n\n const configPath = getCliUserConfigPath()\n mkdirSync(dirname(configPath), {recursive: true})\n\n // When value is undefined, explicitly delete the key rather than relying\n // on JSON.stringify silently dropping undefined values.\n if (value === undefined) {\n const {[prop]: _, ...rest} = config\n writeJsonFileSync(configPath, rest, {pretty: true})\n } else {\n writeJsonFileSync(configPath, {...config, [prop]: value}, {pretty: true})\n }\n\n // Invalidate the in-process token cache so subsequent getCliToken() calls\n // pick up the new value from disk.\n clearCliTokenCache()\n}\n\n/**\n * Get the config value for the given property\n *\n * @param prop - The property to get the value for\n * @returns The value of the given property\n */\nexport function getCliUserConfig(prop: 'authToken'): string | undefined {\n assertCanAccessHostUserConfig()\n const config = readConfig()\n const result = cliUserConfigSchema[prop].safeParse(config[prop])\n if (!result.success) {\n debug('Ignoring invalid stored value for \"%s\", returning undefined', prop)\n return undefined\n }\n\n return result.data\n}\n\n/**\n * Get a key-value store backed by the CLI user configuration file\n * (`~/.config/sanity/config.json`).\n *\n * Each call to `get`, `set`, or `delete` performs a full synchronous\n * read-modify-write cycle. This is intentional: sync I/O prevents\n * intra-process race conditions that occurred with the previous async\n * (configstore-backed) implementation.\n *\n * Note: there is no file-level locking, so concurrent writes from\n * separate CLI processes could still conflict. In practice this is\n * unlikely since CLI config writes are rare and user-initiated.\n *\n * @returns A {@link ConfigStore} for the CLI config file\n * @public\n */\nexport function getUserConfig(): ConfigStore {\n assertCanAccessHostUserConfig()\n return {\n get(key: string): unknown {\n const config = readConfig()\n return config[key]\n },\n\n set(key: string, value: unknown): void {\n const config = readConfig()\n const configPath = getCliUserConfigPath()\n mkdirSync(dirname(configPath), {recursive: true})\n writeJsonFileSync(configPath, {...config, [key]: value}, {pretty: true})\n if (key === 'authToken') clearCliTokenCache()\n },\n\n // No mkdirSync needed: if readConfig() succeeded the directory already exists.\n delete(key: string): void {\n const config = readConfig()\n if (!(key in config)) return\n const {[key]: _, ...rest} = config\n writeJsonFileSync(getCliUserConfigPath(), rest, {pretty: true})\n if (key === 'authToken') clearCliTokenCache()\n },\n }\n}\n\nfunction assertCanAccessHostUserConfig(): void {\n if (getCliExecutionContext()) {\n throw new Error('Host CLI user configuration is unavailable during programmatic invocations')\n }\n}\n\n/**\n * Read the whole configuration from file system. If the file does not exist,\n * is corrupt, or otherwise unreadable, an empty object is returned. This is\n * intentional: the config only holds recoverable data (auth tokens, telemetry\n * consent) so silently resetting is preferable to blocking the user.\n *\n * @returns The whole CLI configuration.\n * @internal\n */\nfunction readConfig(): Record<string, unknown> {\n try {\n const config = readJsonFileSync(getCliUserConfigPath())\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new Error('Invalid config file - expected an object')\n }\n return config\n } catch (err: unknown) {\n debug('Failed to read CLI config file: %s', err instanceof Error ? err.message : `${err}`)\n return {}\n }\n}\n\n/**\n * Get the file system location for the CLI user configuration file.\n * Takes into account the active environment (staging vs production).\n * The file is located in the user's home directory under the `.config` directory.\n *\n * @returns The path to the CLI configuration file.\n * @internal\n */\nfunction getCliUserConfigPath() {\n return process.env.SANITY_CLI_CONFIG_PATH || joinPath(getSanityConfigDir(), 'config.json')\n}\n"],"names":["mkdirSync","dirname","join","joinPath","z","debug","getCliExecutionContext","getSanityConfigDir","readJsonFileSync","writeJsonFileSync","clearCliTokenCache","getCachedTokenInfo","setCachedTokenInfo","_internals","getCliUserConfig","getCliToken","getCliTokenInfo","token","context","undefined","source","cachedTokenInfo","process","env","SANITY_AUTH_TOKEN","tokenInfo","trim","configToken","getCliUserConfigPath","cliUserConfigSchema","authToken","optional","string","setCliUserConfig","prop","value","assertCanAccessHostUserConfig","config","readConfig","result","safeParse","success","message","error","issues","map","path","Error","configPath","recursive","_","rest","pretty","data","getUserConfig","get","key","set","delete","Array","isArray","err","SANITY_CLI_CONFIG_PATH"],"mappings":"AAAA,SAAQA,SAAS,QAAO,UAAS;AACjC,SAAQC,OAAO,EAAEC,QAAQC,QAAQ,QAAO,YAAW;AAEnD,SAAQC,CAAC,QAAO,WAAU;AAE1B,SAAQC,KAAK,QAAO,0BAAyB;AAC7C,SAAQC,sBAAsB,QAAO,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+C,aAAa;gBAACC,WAAW;YAAI;YAC/CxC,kBAAkBuC,YAAY;gBAAC,GAAGX,MAAM;gBAAE,CAACmB,IAAI,EAAErB;YAAK,GAAG;gBAACiB,QAAQ;YAAI;YACtE,IAAII,QAAQ,aAAa9C;QAC3B;QAEA,+EAA+E;QAC/EgD,QAAOF,GAAW;YAChB,MAAMnB,SAASC;YACf,IAAI,CAAEkB,CAAAA,OAAOnB,MAAK,GAAI;YACtB,MAAM,EAAC,CAACmB,IAAI,EAAEN,CAAC,EAAE,GAAGC,MAAK,GAAGd;YAC5B5B,kBAAkBmB,wBAAwBuB,MAAM;gBAACC,QAAQ;YAAI;YAC7D,IAAII,QAAQ,aAAa9C;QAC3B;IACF;AACF;AAEA,SAAS0B;IACP,IAAI9B,0BAA0B;QAC5B,MAAM,IAAIyC,MAAM;IAClB;AACF;AAEA;;;;;;;;CAQC,GACD,SAAST;IACP,IAAI;QACF,MAAMD,SAAS7B,iBAAiBoB;QAChC,IAAI,CAACS,UAAU,OAAOA,WAAW,YAAYsB,MAAMC,OAAO,CAACvB,SAAS;YAClE,MAAM,IAAIU,MAAM;QAClB;QACA,OAAOV;IACT,EAAE,OAAOwB,KAAc;QACrBxD,MAAM,sCAAsCwD,eAAed,QAAQc,IAAInB,OAAO,GAAG,GAAGmB,KAAK;QACzF,OAAO,CAAC;IACV;AACF;AAEA;;;;;;;CAOC,GACD,SAASjC;IACP,OAAON,QAAQC,GAAG,CAACuC,sBAAsB,IAAI3D,SAASI,sBAAsB;AAC9E"}
1
+ {"version":3,"sources":["../../../src/config/cli/cliUserConfig.ts"],"sourcesContent":["import {chmodSync, mkdirSync, statSync} from 'node:fs'\nimport {dirname, join as joinPath} from 'node:path'\n\nimport {z} from 'zod/mini'\n\nimport {debug} from '../../_exports/debug.js'\nimport {getCliExecutionContext} from '../../executionContext.js'\nimport {getSanityConfigDir} from '../../util/getSanityConfigDir.js'\nimport {readJsonFileSync} from '../../util/readJsonFileSync.js'\nimport {writeJsonFileSync} from '../../util/writeJsonFileSync.js'\nimport {\n clearCliTokenCache,\n type CliTokenInfo,\n getCachedTokenInfo,\n setCachedTokenInfo,\n} from './cliTokenCache.js'\nimport {type ConfigStore} from './types/cliConfig.js'\n\n// Re-export so existing consumers don't break\nexport {clearCliTokenCache} from './cliTokenCache.js'\nexport {type CliTokenInfo} from './cliTokenCache.js'\n\n// Only used for testing\nexport const _internals = {\n getCliUserConfig,\n}\n\n/**\n * Get the CLI authentication token selected for the current invocation.\n *\n * @returns A promise that resolves to a CLI token, or undefined if no token is found\n * @internal\n */\nexport async function getCliToken(): Promise<string | undefined> {\n return (await getCliTokenInfo())?.token\n}\n\n/**\n * Get the CLI authentication token and where it was resolved from.\n *\n * @returns A promise that resolves to the token and its source, or undefined if no token is found\n * @internal\n */\nexport async function getCliTokenInfo(): Promise<CliTokenInfo | undefined> {\n // A per-invocation execution context token (e.g. per-request from an MCP\n // server) takes precedence and must bypass the process-wide cache entirely:\n // reading the cache would leak another invocation's token, and writing it\n // would leak this one's.\n const context = getCliExecutionContext()\n if (context) {\n return context.token === undefined\n ? undefined\n : {source: 'CLI execution context', token: context.token}\n }\n\n const cachedTokenInfo = getCachedTokenInfo()\n if (cachedTokenInfo !== undefined) {\n return cachedTokenInfo\n }\n\n const token = process.env.SANITY_AUTH_TOKEN\n if (token) {\n const tokenInfo = {\n source: 'SANITY_AUTH_TOKEN environment variable',\n token: token.trim(),\n }\n setCachedTokenInfo(tokenInfo)\n return tokenInfo\n }\n\n const configToken = _internals.getCliUserConfig('authToken')\n const tokenInfo =\n configToken === undefined ? undefined : {source: getCliUserConfigPath(), token: configToken}\n setCachedTokenInfo(tokenInfo)\n return tokenInfo\n}\n\n// The config file holds the CLI auth token, so keep it readable by its owner only\nconst CONFIG_DIR_OPTIONS = {mode: 0o700, recursive: true}\nconst CONFIG_WRITE_OPTIONS = {mode: 0o600, pretty: true}\n\nconst cliUserConfigSchema = {\n authToken: z.optional(z.string()),\n}\n\n/**\n * Set the config value for the given property.\n * Validates that the passed value adheres to the defined CLI config schema.\n *\n * @param prop - The property to set the value for\n * @param value - The value to set\n * @internal\n */\nexport function setCliUserConfig(prop: 'authToken', value: string | undefined): void {\n assertCanAccessHostUserConfig()\n const config = readConfig()\n const result = cliUserConfigSchema[prop].safeParse(value)\n if (!result.success) {\n const message = result.error.issues\n .map(({message, path}) => `[${path.join('.')}] ${message}`)\n .join('\\n')\n\n throw new Error(`Invalid value for config property \"${prop}\": ${message}`)\n }\n\n const configPath = getCliUserConfigPath()\n mkdirSync(dirname(configPath), CONFIG_DIR_OPTIONS)\n\n // When value is undefined, explicitly delete the key rather than relying\n // on JSON.stringify silently dropping undefined values.\n if (value === undefined) {\n const {[prop]: _, ...rest} = config\n writeJsonFileSync(configPath, rest, CONFIG_WRITE_OPTIONS)\n } else {\n writeJsonFileSync(configPath, {...config, [prop]: value}, CONFIG_WRITE_OPTIONS)\n }\n\n // Invalidate the in-process token cache so subsequent getCliToken() calls\n // pick up the new value from disk.\n clearCliTokenCache()\n}\n\n/**\n * Get the config value for the given property\n *\n * @param prop - The property to get the value for\n * @returns The value of the given property\n */\nexport function getCliUserConfig(prop: 'authToken'): string | undefined {\n assertCanAccessHostUserConfig()\n const config = readConfig()\n const result = cliUserConfigSchema[prop].safeParse(config[prop])\n if (!result.success) {\n debug('Ignoring invalid stored value for \"%s\", returning undefined', prop)\n return undefined\n }\n\n return result.data\n}\n\n/**\n * Get a key-value store backed by the CLI user configuration file\n * (`~/.config/sanity/config.json`).\n *\n * Each call to `get`, `set`, or `delete` performs a full synchronous\n * read-modify-write cycle. This is intentional: sync I/O prevents\n * intra-process race conditions that occurred with the previous async\n * (configstore-backed) implementation.\n *\n * Note: there is no file-level locking, so concurrent writes from\n * separate CLI processes could still conflict. In practice this is\n * unlikely since CLI config writes are rare and user-initiated.\n *\n * @returns A {@link ConfigStore} for the CLI config file\n * @public\n */\nexport function getUserConfig(): ConfigStore {\n assertCanAccessHostUserConfig()\n return {\n get(key: string): unknown {\n const config = readConfig()\n return config[key]\n },\n\n set(key: string, value: unknown): void {\n const config = readConfig()\n const configPath = getCliUserConfigPath()\n mkdirSync(dirname(configPath), CONFIG_DIR_OPTIONS)\n writeJsonFileSync(configPath, {...config, [key]: value}, CONFIG_WRITE_OPTIONS)\n if (key === 'authToken') clearCliTokenCache()\n },\n\n // No mkdirSync needed: if readConfig() succeeded the directory already exists.\n delete(key: string): void {\n const config = readConfig()\n if (!(key in config)) return\n const {[key]: _, ...rest} = config\n writeJsonFileSync(getCliUserConfigPath(), rest, CONFIG_WRITE_OPTIONS)\n if (key === 'authToken') clearCliTokenCache()\n },\n }\n}\n\nfunction assertCanAccessHostUserConfig(): void {\n if (getCliExecutionContext()) {\n throw new Error('Host CLI user configuration is unavailable during programmatic invocations')\n }\n}\n\n/**\n * Read the whole configuration from file system. If the file does not exist,\n * is corrupt, or otherwise unreadable, an empty object is returned. This is\n * intentional: the config only holds recoverable data (auth tokens, telemetry\n * consent) so silently resetting is preferable to blocking the user.\n *\n * @returns The whole CLI configuration.\n * @internal\n */\nfunction readConfig(): Record<string, unknown> {\n const configPath = getCliUserConfigPath()\n restrictConfigFilePermissions(configPath)\n try {\n const config = readJsonFileSync(configPath)\n if (!config || typeof config !== 'object' || Array.isArray(config)) {\n throw new Error('Invalid config file - expected an object')\n }\n return config\n } catch (err: unknown) {\n debug('Failed to read CLI config file: %s', err instanceof Error ? err.message : `${err}`)\n return {}\n }\n}\n\n/**\n * Remove group and other access from an existing config file. CLI versions from\n * 6.0.0 created it with the default umask mode (usually 0644), exposing the auth\n * token to other local users. Only touches files owned by the current user, and\n * never adds permissions.\n *\n * @param configPath - Path to the CLI configuration file\n */\nfunction restrictConfigFilePermissions(configPath: string): void {\n // No POSIX permissions to fix on Windows\n if (typeof process.getuid !== 'function') return\n\n try {\n const {mode, uid} = statSync(configPath)\n if (uid !== process.getuid() || (mode & 0o077) === 0) return\n\n chmodSync(configPath, mode & 0o700)\n debug('Restricted permissions of %s to owner only', configPath)\n } catch (err: unknown) {\n debug(\n 'Could not restrict permissions of CLI config file: %s',\n err instanceof Error ? err.message : `${err}`,\n )\n }\n}\n\n/**\n * Get the file system location for the CLI user configuration file.\n * Takes into account the active environment (staging vs production).\n * The file is located in the user's home directory under the `.config` directory.\n *\n * @returns The path to the CLI configuration file.\n * @internal\n */\nfunction getCliUserConfigPath() {\n return process.env.SANITY_CLI_CONFIG_PATH || joinPath(getSanityConfigDir(), 'config.json')\n}\n"],"names":["chmodSync","mkdirSync","statSync","dirname","join","joinPath","z","debug","getCliExecutionContext","getSanityConfigDir","readJsonFileSync","writeJsonFileSync","clearCliTokenCache","getCachedTokenInfo","setCachedTokenInfo","_internals","getCliUserConfig","getCliToken","getCliTokenInfo","token","context","undefined","source","cachedTokenInfo","process","env","SANITY_AUTH_TOKEN","tokenInfo","trim","configToken","getCliUserConfigPath","CONFIG_DIR_OPTIONS","mode","recursive","CONFIG_WRITE_OPTIONS","pretty","cliUserConfigSchema","authToken","optional","string","setCliUserConfig","prop","value","assertCanAccessHostUserConfig","config","readConfig","result","safeParse","success","message","error","issues","map","path","Error","configPath","_","rest","data","getUserConfig","get","key","set","delete","restrictConfigFilePermissions","Array","isArray","err","getuid","uid","SANITY_CLI_CONFIG_PATH"],"mappings":"AAAA,SAAQA,SAAS,EAAEC,SAAS,EAAEC,QAAQ,QAAO,UAAS;AACtD,SAAQC,OAAO,EAAEC,QAAQC,QAAQ,QAAO,YAAW;AAEnD,SAAQC,CAAC,QAAO,WAAU;AAE1B,SAAQC,KAAK,QAAO,0BAAyB;AAC7C,SAAQC,sBAAsB,QAAO,4BAA2B;AAChE,SAAQC,kBAAkB,QAAO,mCAAkC;AACnE,SAAQC,gBAAgB,QAAO,iCAAgC;AAC/D,SAAQC,iBAAiB,QAAO,kCAAiC;AACjE,SACEC,kBAAkB,EAElBC,kBAAkB,EAClBC,kBAAkB,QACb,qBAAoB;AAG3B,8CAA8C;AAC9C,SAAQF,kBAAkB,QAAO,qBAAoB;AAGrD,wB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types/cliConfig.js';
58
58
  })),
59
59
  studioHost: z.optional(z.string()),
60
60
  unstable_bundledDev: z.optional(z.boolean()),
61
+ unstable_documentComponent: z.optional(z.boolean()),
61
62
  vite: z.optional(z.custom()),
62
63
  typegen: z.optional(z.custom())
63
64
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {z} from 'zod/mini'\n\nimport {APP_VISIBILITIES, type CliConfig, type ReactCompilerConfig} from './types/cliConfig.js'\nimport {type UserViteConfig} from './types/userViteConfig'\n\n/**\n * @public\n */\nexport const cliConfigSchema = z.object({\n api: z.optional(\n z.object({\n dataset: z.optional(z.string()),\n projectId: z.optional(z.string()),\n }),\n ),\n\n app: z.optional(\n z.object({\n entry: z.optional(z.string()),\n icon: z.optional(z.string()),\n id: z.optional(z.string()),\n organizationId: z.optional(z.string()),\n title: z.optional(z.string()),\n visibility: z.optional(z.enum(APP_VISIBILITIES)),\n }),\n ),\n\n autoUpdates: z.optional(z.boolean()),\n\n deployment: z.optional(\n z.object({\n appId: z.optional(z.string()),\n autoUpdates: z.optional(z.boolean()),\n studioHost: z.optional(\n z.never({\n error:\n 'deployment.studioHost is not supported. Move studioHost to the top level of sanity.cli.ts, or pass --url <hostname> to sanity deploy.',\n }),\n ),\n }),\n ),\n\n graphql: z.optional(\n z.array(\n z.object({\n filterSuffix: z.optional(z.string()),\n generation: z.optional(z.enum(['gen1', 'gen2', 'gen3'])),\n id: z.optional(z.string()),\n nonNullDocumentFields: z.optional(z.boolean()),\n playground: z.optional(z.boolean()),\n source: z.optional(z.string()),\n tag: z.optional(z.string()),\n workspace: z.optional(z.string()),\n }),\n ),\n ),\n\n mediaLibrary: z.optional(\n z.object({\n aspectsPath: z.optional(z.string()),\n }),\n ),\n\n project: z.optional(\n z.object({\n basePath: z.optional(z.string()),\n }),\n ),\n\n reactCompiler: z.optional(z.custom<boolean | ReactCompilerConfig>()),\n\n reactStrictMode: z.optional(z.boolean()),\n\n schemaExtraction: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n enforceRequiredFields: z.optional(z.boolean()),\n path: z.optional(z.string()),\n watchPatterns: z.optional(z.array(z.string())),\n workspace: z.optional(z.string()),\n }),\n ),\n\n server: z.optional(\n z.object({\n hostname: z.optional(z.string()),\n port: z.optional(z.number()),\n }),\n ),\n\n studioHost: z.optional(z.string()),\n\n unstable_bundledDev: z.optional(z.boolean()),\n\n vite: z.optional(z.custom<UserViteConfig>()),\n\n typegen: z.optional(z.custom<NonNullable<CliConfig['typegen']>>()),\n}) satisfies z.core.$ZodType<CliConfig>\n"],"names":["z","APP_VISIBILITIES","cliConfigSchema","object","api","optional","dataset","string","projectId","app","entry","icon","id","organizationId","title","visibility","enum","autoUpdates","boolean","deployment","appId","studioHost","never","error","graphql","array","filterSuffix","generation","nonNullDocumentFields","playground","source","tag","workspace","mediaLibrary","aspectsPath","project","basePath","reactCompiler","custom","reactStrictMode","schemaExtraction","enabled","enforceRequiredFields","path","watchPatterns","server","hostname","port","number","unstable_bundledDev","vite","typegen"],"mappings":"AAAA,SAAQA,CAAC,QAAO,WAAU;AAE1B,SAAQC,gBAAgB,QAAiD,uBAAsB;AAG/F;;CAEC,GACD,OAAO,MAAMC,kBAAkBF,EAAEG,MAAM,CAAC;IACtCC,KAAKJ,EAAEK,QAAQ,CACbL,EAAEG,MAAM,CAAC;QACPG,SAASN,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC5BC,WAAWR,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAChC;IAGFE,KAAKT,EAAEK,QAAQ,CACbL,EAAEG,MAAM,CAAC;QACPO,OAAOV,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC1BI,MAAMX,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACzBK,IAAIZ,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACvBM,gBAAgBb,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACnCO,OAAOd,EAAEK,QAAQ,CAACL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BAAkBxC,EAAEK,QAAQ,CAC1BL,EAAEG,MAAM,CAAC;QACPsC,SAASzC,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAC7BwB,uBAAuB1C,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAC3CyB,MAAM3C,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACzBqC,eAAe5C,EAAEK,QAAQ,CAACL,EAAEyB,KAAK,CAACzB,EAAEO,MAAM;QAC1CyB,WAAWhC,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAChC;IAGFsC,QAAQ7C,EAAEK,QAAQ,CAChBL,EAAEG,MAAM,CAAC;QACP2C,UAAU9C,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC7BwC,MAAM/C,EAAEK,QAAQ,CAACL,EAAEgD,MAAM;IAC3B;IAGF3B,YAAYrB,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAE/B0C,qBAAqBjD,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;IAEzCgC,MAAMlD,EAAEK,QAAQ,CAACL,EAAEsC,MAAM;IAEzBa,SAASnD,EAAEK,QAAQ,CAACL,EAAEsC,MAAM;AAC9B,GAAuC"}
1
+ {"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {z} from 'zod/mini'\n\nimport {APP_VISIBILITIES, type CliConfig, type ReactCompilerConfig} from './types/cliConfig.js'\nimport {type UserViteConfig} from './types/userViteConfig'\n\n/**\n * @public\n */\nexport const cliConfigSchema = z.object({\n api: z.optional(\n z.object({\n dataset: z.optional(z.string()),\n projectId: z.optional(z.string()),\n }),\n ),\n\n app: z.optional(\n z.object({\n entry: z.optional(z.string()),\n icon: z.optional(z.string()),\n id: z.optional(z.string()),\n organizationId: z.optional(z.string()),\n title: z.optional(z.string()),\n visibility: z.optional(z.enum(APP_VISIBILITIES)),\n }),\n ),\n\n autoUpdates: z.optional(z.boolean()),\n\n deployment: z.optional(\n z.object({\n appId: z.optional(z.string()),\n autoUpdates: z.optional(z.boolean()),\n studioHost: z.optional(\n z.never({\n error:\n 'deployment.studioHost is not supported. Move studioHost to the top level of sanity.cli.ts, or pass --url <hostname> to sanity deploy.',\n }),\n ),\n }),\n ),\n\n graphql: z.optional(\n z.array(\n z.object({\n filterSuffix: z.optional(z.string()),\n generation: z.optional(z.enum(['gen1', 'gen2', 'gen3'])),\n id: z.optional(z.string()),\n nonNullDocumentFields: z.optional(z.boolean()),\n playground: z.optional(z.boolean()),\n source: z.optional(z.string()),\n tag: z.optional(z.string()),\n workspace: z.optional(z.string()),\n }),\n ),\n ),\n\n mediaLibrary: z.optional(\n z.object({\n aspectsPath: z.optional(z.string()),\n }),\n ),\n\n project: z.optional(\n z.object({\n basePath: z.optional(z.string()),\n }),\n ),\n\n reactCompiler: z.optional(z.custom<boolean | ReactCompilerConfig>()),\n\n reactStrictMode: z.optional(z.boolean()),\n\n schemaExtraction: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n enforceRequiredFields: z.optional(z.boolean()),\n path: z.optional(z.string()),\n watchPatterns: z.optional(z.array(z.string())),\n workspace: z.optional(z.string()),\n }),\n ),\n\n server: z.optional(\n z.object({\n hostname: z.optional(z.string()),\n port: z.optional(z.number()),\n }),\n ),\n\n studioHost: z.optional(z.string()),\n\n unstable_bundledDev: z.optional(z.boolean()),\n\n unstable_documentComponent: z.optional(z.boolean()),\n\n vite: z.optional(z.custom<UserViteConfig>()),\n\n typegen: z.optional(z.custom<NonNullable<CliConfig['typegen']>>()),\n}) satisfies z.core.$ZodType<CliConfig>\n"],"names":["z","APP_VISIBILITIES","cliConfigSchema","object","api","optional","dataset","string","projectId","app","entry","icon","id","organizationId","title","visibility","enum","autoUpdates","boolean","deployment","appId","studioHost","never","error","graphql","array","filterSuffix","generation","nonNullDocumentFields","playground","source","tag","workspace","mediaLibrary","aspectsPath","project","basePath","reactCompiler","custom","reactStrictMode","schemaExtraction","enabled","enforceRequiredFields","path","watchPatterns","server","hostname","port","number","unstable_bundledDev","unstable_documentCom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QAAQ,CAACL,EAAEkB,OAAO;IAEhDiC,MAAMnD,EAAEK,QAAQ,CAACL,EAAEsC,MAAM;IAEzBc,SAASpD,EAAEK,QAAQ,CAACL,EAAEsC,MAAM;AAC9B,GAAuC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/config/cli/types/cliConfig.ts"],"sourcesContent":["import {type PluginOptions as BabelReactCompilerOptions} from 'babel-plugin-react-compiler'\nimport {type ReactCompilerOptions as OxcReactCompilerOptions} from 'oxc-transform-react'\n\nimport {type UserViteConfig} from './userViteConfig'\n\n/**\n * An optional peer dependency's options type, or `unknown` when the peer's\n * typings did not resolve.\n *\n * `babel-plugin-react-compiler` and `oxc-transform-react` are optional peer\n * dependencies, so the type-only imports above only resolve in projects that\n * install them. When one is missing, TypeScript degrades its import to `any`\n * (the unresolved-module error is suppressed inside declaration files under\n * `skipLibCheck`), and intersecting `any` into a {@link ReactCompilerConfig}\n * branch would collapse the whole union to `any` — silently disabling type\n * checking of the `reactCompiler` option, including for the compiler that IS\n * installed. Mapping a missing peer's options to `unknown` (the identity\n * under intersection) instead reduces that branch to just its `transform`\n * discriminator, keeping the other branch fully checked.\n *\n * `unknown extends T` is only true when `T` degraded to `any`/`unknown`;\n * resolved options types pass through untouched. (`0 extends 1 & T` — the\n * usual any-detector — does not work here: an unresolved import produces the\n * checker's error type, which that intersection propagates.)\n */\ntype OptionalPeerOptions<T> = unknown extends T ? unknown : T\n\n/**\n * Configuration for React Compiler.\n *\n * The `transform` field selects which React Compiler transform to run; the\n * remaining options are passed to the selected transform:\n *\n * - `'babel'` (default) - the Babel plugin\n * ({@link https://www.npmjs.com/package/babel-plugin-react-compiler | babel-plugin-react-compiler}\n * must be installed in your project)\n * - `'oxc'` (experimental) - the native Rust port\n * ({@link https://www.npmjs.com/package/oxc-transform-react | oxc-transform-react}\n * must be installed in your project)\n *\n * Each branch's options are only type-checked when the corresponding package\n * is installed; a missing package reduces its branch to just the `transform`\n * discriminator.\n *\n * @public\n */\nexport type ReactCompilerConfig =\n | (OptionalPeerOptions<BabelReactCompilerOptions> & {transform?: 'babel'})\n | (OptionalPeerOptions<OxcReactCompilerOptions> & {transform: 'oxc'})\n\nexport interface TypeGenConfig {\n formatGeneratedCode: boolean\n generates: string\n overloadClientMethods: boolean\n path: string | string[]\n schema: string\n}\n\n/**\n * A dataset to generate types for. Each resource gets its own output file, with its schema\n * and query types registered under its `projectId.dataset` key.\n *\n * @beta\n */\nexport interface TypeGenResource {\n /** The dataset name. */\n dataset: string\n\n /** Where to write this resource's generated types. Must be unique across resources. */\n generates: string\n\n /** The project ID. */\n projectId: string\n\n /**\n * Treat fields with a required rule as non-optional, like\n * `sanity schema extract --enforce-required-fields`. Only applies to a schema fetched from\n * the dataset; a local `schema` file already records this.\n * Defaults to `false`\n */\n enforceRequiredFields?: boolean\n\n /**\n * Glob pattern(s) for the files whose queries belong to this resource.\n * Defaults to the top-level `typegen.path`.\n */\n path?: string | string[]\n\n /**\n * Path to a schema extracted with `sanity schema extract`. When omitted, the schema bound to\n * the dataset is fetched.\n */\n schema?: string\n}\n\n/**\n * Dashboard visibility an application can declare. Mirrors Brett's canonical\n * `VISIBILITIES` — the source of truth lives in the application service.\n * @public\n */\nexport const APP_VISIBILITIES = ['default', 'unlisted', 'disabled'] as const\n/** @public */\nexport type AppVisibility = (typeof APP_VISIBILITIES)[number]\n\n/**\n * @public\n */\nexport interface CliConfig {\n /** The project ID and dataset the Sanity CLI should use to run its commands */\n api?: {\n dataset?: string\n projectId?: string\n }\n\n /** Configuration for custom Sanity apps built with the App SDK */\n app?: {\n /** The entrypoint for your custom app. By default, `src/App.tsx` */\n entry?: string\n /**\n * Path to an icon file relative to project root.\n * The file must be an SVG.\n */\n icon?: string\n /** @deprecated Use deployment.appId */\n id?: string\n /** The ID for the Sanity organization that manages this application */\n organizationId?: string\n /** The title of the custom app, as it is seen in Dashboard UI */\n title?: string\n /** Dashboard visibility of the application. Defaults to `default`. */\n visibility?: AppVisibility\n }\n\n /** @deprecated Use deployment.autoUpdates */\n autoUpdates?: boolean\n\n /** Options for custom app and Studio deployments */\n deployment?: {\n /**\n * The ID for your custom app or Studio. Generated when deploying your app or Studio for the first time.\n * Get your app ID by either:\n * 1. Checking the output of `sanity deploy`, or\n * 2. Checking your project’s Studio tab at https://sanity.io/manage\n *\n * @remarks This is required for all custom app deployments, and for Studios opting in to fine grained version control.\n * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k0896ed4574b7}\n */\n appId?: string\n /**\n * Enable automatic updates for your Studio or custom app’s Sanity dependencies.\n * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity}\n */\n autoUpdates?: boolean\n }\n\n /** Define the GraphQL APIs that the CLI can deploy and interact with */\n graphql?: Array<{\n filterSuffix?: string\n generation?: 'gen1' | 'gen2' | 'gen3'\n id?: string\n nonNullDocumentFields?: boolean\n playground?: boolean\n source?: string\n tag?: string\n workspace?: string\n }>\n\n /** Configuration for the Media Library */\n mediaLibrary?: {\n /** The path to the Media Library aspects directory. When using the CLI to manage aspects, this is the directory they will be read from and written to. */\n aspectsPath?: string\n }\n\n /** Contains the property `basePath` which lets you change the top-level slug for the Studio. You typically need to set this if you embed the Studio in another application where it is one of many routes. Defaults to an empty string. */\n project?: {\n basePath?: string\n }\n\n /**\n * Configuration options for React Compiler. Pass `true` to enable it with\n * the default (babel) transform, or an object to configure it — see\n * {@link ReactCompilerConfig} for choosing between the babel and the\n * experimental oxc transform.\n */\n reactCompiler?: boolean | ReactCompilerConfig\n\n /** Wraps the Studio in \\<React.StrictMode\\> root to aid in flagging potential problems related to concurrent features (startTransition, useTransition, useDeferredValue, Suspense). Can also be enabled by setting SANITY_STUDIO_REACT_STRICT_MODE=\"true\"|\"false\". It only applies to sanity dev in development mode and is ignored in sanity build and in production. Defaults to true. */\n reactStrictMode?: boolean\n\n /**\n * Configuration for schema extraction (`sanity schema extract`)\n */\n schemaExtraction?: {\n /**\n * Enable schema extraction as part of sanity dev and sanity build\n */\n enabled?: boolean\n\n /**\n * When true, schema fields marked as required will be non-optional in the output.\n * Defaults to `false`\n */\n enforceRequiredFields?: boolean\n\n /**\n * Output path for the extracted schema file.\n * Defaults to `schema.json` in the working directory.\n */\n path?: string\n\n /**\n * Additional glob patterns to watch for schema changes in watch mode.\n * These extend the default patterns:\n * - `sanity.config.{js,jsx,ts,tsx,mjs}`\n * - `schema*\\/**\\/*.{js,jsx,ts,tsx,mjs}`\n */\n watchPatterns?: string[]\n\n /**\n * The name of the workspace to generate a schema for. Required if your Sanity project has more than one\n * workspace.\n */\n workspace?: string\n }\n\n /** Defines the hostname and port that the development server should run on. hostname defaults to localhost, and port to 3333. */\n server?: {\n hostname?: string\n port?: number\n }\n\n /** @deprecated Use deployment.appId */\n studioHost?: string\n\n /**\n * Configuration for Sanity typegen\n */\n typegen?: Partial<TypeGenConfig> & {\n /**\n * Enable typegen as part of sanity dev and sanity build.\n * When enabled, types are generated on startup and when files change.\n * Defaults to `false`\n */\n enabled?: boolean\n\n /**\n * Generate types separately for each listed dataset. When set, the top-level `schema` and\n * `generates` are not used, and `overloadClientMethods` defaults to `false`.\n *\n * @beta\n */\n resources?: TypeGenResource[]\n }\n\n /**\n * Enable Vite's experimental bundled dev mode for `sanity dev`. This serves bundled\n * files during development, which can speed up startup and reloads for large projects.\n * Defaults to `false`.\n *\n * Unstable: may change or be removed without notice while the underlying Vite\n * feature (`experimental.bundledDev`) is experimental.\n * {@link https://vite.dev/guide/rolldown#full-bundle-mode}\n */\n unstable_bundledDev?: boolean\n\n /** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */\n vite?: UserViteConfig\n}\n\n/**\n * A raw key-value store for CLI user configuration.\n * Unlike the typed `getCliUserConfig`/`setCliUserConfig`, this operates on\n * arbitrary keys without schema validation.\n *\n * @public\n */\nexport interface ConfigStore {\n /** Remove a key from the config file. */\n delete: (key: string) => void\n /** Read a value by key. Returns `undefined` if the key does not exist. */\n get: (key: string) => unknown\n /** Write a value by key, merging it into the existing config. */\n set: (key: string, value: unknown) => void\n}\n"],"names":["APP_VISIBILITIES"],"mappings":"AA+FA;;;;CAIC,GACD,OAAO,MAAMA,mBAAmB;IAAC;IAAW;IAAY;CAAW,CAAS"}
1
+ {"version":3,"sources":["../../../../src/config/cli/types/cliConfig.ts"],"sourcesContent":["import {type PluginOptions as BabelReactCompilerOptions} from 'babel-plugin-react-compiler'\nimport {type ReactCompilerOptions as OxcReactCompilerOptions} from 'oxc-transform-react'\n\nimport {type UserViteConfig} from './userViteConfig'\n\n/**\n * An optional peer dependency's options type, or `unknown` when the peer's\n * typings did not resolve.\n *\n * `babel-plugin-react-compiler` and `oxc-transform-react` are optional peer\n * dependencies, so the type-only imports above only resolve in projects that\n * install them. When one is missing, TypeScript degrades its import to `any`\n * (the unresolved-module error is suppressed inside declaration files under\n * `skipLibCheck`), and intersecting `any` into a {@link ReactCompilerConfig}\n * branch would collapse the whole union to `any` — silently disabling type\n * checking of the `reactCompiler` option, including for the compiler that IS\n * installed. Mapping a missing peer's options to `unknown` (the identity\n * under intersection) instead reduces that branch to just its `transform`\n * discriminator, keeping the other branch fully checked.\n *\n * `unknown extends T` is only true when `T` degraded to `any`/`unknown`;\n * resolved options types pass through untouched. (`0 extends 1 & T` — the\n * usual any-detector — does not work here: an unresolved import produces the\n * checker's error type, which that intersection propagates.)\n */\ntype OptionalPeerOptions<T> = unknown extends T ? unknown : T\n\n/**\n * Configuration for React Compiler.\n *\n * The `transform` field selects which React Compiler transform to run; the\n * remaining options are passed to the selected transform:\n *\n * - `'babel'` (default) - the Babel plugin\n * ({@link https://www.npmjs.com/package/babel-plugin-react-compiler | babel-plugin-react-compiler}\n * must be installed in your project)\n * - `'oxc'` (experimental) - the native Rust port\n * ({@link https://www.npmjs.com/package/oxc-transform-react | oxc-transform-react}\n * must be installed in your project)\n *\n * Each branch's options are only type-checked when the corresponding package\n * is installed; a missing package reduces its branch to just the `transform`\n * discriminator.\n *\n * @public\n */\nexport type ReactCompilerConfig =\n | (OptionalPeerOptions<BabelReactCompilerOptions> & {transform?: 'babel'})\n | (OptionalPeerOptions<OxcReactCompilerOptions> & {transform: 'oxc'})\n\nexport interface TypeGenConfig {\n formatGeneratedCode: boolean\n generates: string\n overloadClientMethods: boolean\n path: string | string[]\n schema: string\n}\n\n/**\n * A dataset to generate types for. Each resource gets its own output file, with its schema\n * and query types registered under its `projectId.dataset` key.\n *\n * @beta\n */\nexport interface TypeGenResource {\n /** The dataset name. */\n dataset: string\n\n /** Where to write this resource's generated types. Must be unique across resources. */\n generates: string\n\n /** The project ID. */\n projectId: string\n\n /**\n * Treat fields with a required rule as non-optional, like\n * `sanity schema extract --enforce-required-fields`. Only applies to a schema fetched from\n * the dataset; a local `schema` file already records this.\n * Defaults to `false`\n */\n enforceRequiredFields?: boolean\n\n /**\n * Glob pattern(s) for the files whose queries belong to this resource.\n * Defaults to the top-level `typegen.path`.\n */\n path?: string | string[]\n\n /**\n * Path to a schema extracted with `sanity schema extract`. When omitted, the schema bound to\n * the dataset is fetched.\n */\n schema?: string\n}\n\n/**\n * Dashboard visibility an application can declare. Mirrors Brett's canonical\n * `VISIBILITIES` — the source of truth lives in the application service.\n * @public\n */\nexport const APP_VISIBILITIES = ['default', 'unlisted', 'disabled'] as const\n/** @public */\nexport type AppVisibility = (typeof APP_VISIBILITIES)[number]\n\n/**\n * @public\n */\nexport interface CliConfig {\n /** The project ID and dataset the Sanity CLI should use to run its commands */\n api?: {\n dataset?: string\n projectId?: string\n }\n\n /** Configuration for custom Sanity apps built with the App SDK */\n app?: {\n /** The entrypoint for your custom app. By default, `src/App.tsx` */\n entry?: string\n /**\n * Path to an icon file relative to project root.\n * The file must be an SVG.\n */\n icon?: string\n /** @deprecated Use deployment.appId */\n id?: string\n /** The ID for the Sanity organization that manages this application */\n organizationId?: string\n /** The title of the custom app, as it is seen in Dashboard UI */\n title?: string\n /** Dashboard visibility of the application. Defaults to `default`. */\n visibility?: AppVisibility\n }\n\n /** @deprecated Use deployment.autoUpdates */\n autoUpdates?: boolean\n\n /** Options for custom app and Studio deployments */\n deployment?: {\n /**\n * The ID for your custom app or Studio. Generated when deploying your app or Studio for the first time.\n * Get your app ID by either:\n * 1. Checking the output of `sanity deploy`, or\n * 2. Checking your project’s Studio tab at https://sanity.io/manage\n *\n * @remarks This is required for all custom app deployments, and for Studios opting in to fine grained version control.\n * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k0896ed4574b7}\n */\n appId?: string\n /**\n * Enable automatic updates for your Studio or custom app’s Sanity dependencies.\n * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity}\n */\n autoUpdates?: boolean\n }\n\n /** Define the GraphQL APIs that the CLI can deploy and interact with */\n graphql?: Array<{\n filterSuffix?: string\n generation?: 'gen1' | 'gen2' | 'gen3'\n id?: string\n nonNullDocumentFields?: boolean\n playground?: boolean\n source?: string\n tag?: string\n workspace?: string\n }>\n\n /** Configuration for the Media Library */\n mediaLibrary?: {\n /** The path to the Media Library aspects directory. When using the CLI to manage aspects, this is the directory they will be read from and written to. */\n aspectsPath?: string\n }\n\n /** Contains the property `basePath` which lets you change the top-level slug for the Studio. You typically need to set this if you embed the Studio in another application where it is one of many routes. Defaults to an empty string. */\n project?: {\n basePath?: string\n }\n\n /**\n * Configuration options for React Compiler. Pass `true` to enable it with\n * the default (babel) transform, or an object to configure it — see\n * {@link ReactCompilerConfig} for choosing between the babel and the\n * experimental oxc transform.\n */\n reactCompiler?: boolean | ReactCompilerConfig\n\n /** Wraps the Studio in \\<React.StrictMode\\> root to aid in flagging potential problems related to concurrent features (startTransition, useTransition, useDeferredValue, Suspense). Can also be enabled by setting SANITY_STUDIO_REACT_STRICT_MODE=\"true\"|\"false\". It only applies to sanity dev in development mode and is ignored in sanity build and in production. Defaults to true. */\n reactStrictMode?: boolean\n\n /**\n * Configuration for schema extraction (`sanity schema extract`)\n */\n schemaExtraction?: {\n /**\n * Enable schema extraction as part of sanity dev and sanity build\n */\n enabled?: boolean\n\n /**\n * When true, schema fields marked as required will be non-optional in the output.\n * Defaults to `false`\n */\n enforceRequiredFields?: boolean\n\n /**\n * Output path for the extracted schema file.\n * Defaults to `schema.json` in the working directory.\n */\n path?: string\n\n /**\n * Additional glob patterns to watch for schema changes in watch mode.\n * These extend the default patterns:\n * - `sanity.config.{js,jsx,ts,tsx,mjs}`\n * - `schema*\\/**\\/*.{js,jsx,ts,tsx,mjs}`\n */\n watchPatterns?: string[]\n\n /**\n * The name of the workspace to generate a schema for. Required if your Sanity project has more than one\n * workspace.\n */\n workspace?: string\n }\n\n /** Defines the hostname and port that the development server should run on. hostname defaults to localhost, and port to 3333. */\n server?: {\n hostname?: string\n port?: number\n }\n\n /** @deprecated Use deployment.appId */\n studioHost?: string\n\n /**\n * Configuration for Sanity typegen\n */\n typegen?: Partial<TypeGenConfig> & {\n /**\n * Enable typegen as part of sanity dev and sanity build.\n * When enabled, types are generated on startup and when files change.\n * Defaults to `false`\n */\n enabled?: boolean\n\n /**\n * Generate types separately for each listed dataset. When set, the top-level `schema` and\n * `generates` are not used, and `overloadClientMethods` defaults to `false`.\n *\n * @beta\n */\n resources?: TypeGenResource[]\n }\n\n /**\n * Enable Vite's experimental bundled dev mode for `sanity dev`. This serves bundled\n * files during development, which can speed up startup and reloads for large projects.\n * Defaults to `false`.\n *\n * Unstable: may change or be removed without notice while the underlying Vite\n * feature (`experimental.bundledDev`) is experimental.\n * {@link https://vite.dev/guide/rolldown#full-bundle-mode}\n */\n unstable_bundledDev?: boolean\n\n /**\n * Whether `sanity dev` and `sanity build` render a custom HTML document component from\n * `_document.js` or `_document.tsx` in the project root. Defaults to `true`.\n *\n * Set to `false` to skip the lookup and always render the default document. Custom document\n * components are being phased out: customize the HTML with a Vite plugin in the `vite`\n * option instead.\n *\n * Unstable: will be removed once custom document components are no longer supported.\n */\n unstable_documentComponent?: boolean\n\n /** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */\n vite?: UserViteConfig\n}\n\n/**\n * A raw key-value store for CLI user configuration.\n * Unlike the typed `getCliUserConfig`/`setCliUserConfig`, this operates on\n * arbitrary keys without schema validation.\n *\n * @public\n */\nexport interface ConfigStore {\n /** Remove a key from the config file. */\n delete: (key: string) => void\n /** Read a value by key. Returns `undefined` if the key does not exist. */\n get: (key: string) => unknown\n /** Write a value by key, merging it into the existing config. */\n set: (key: string, value: unknown) => void\n}\n"],"names":["APP_VISIBILITIES"],"mappings":"AA+FA;;;;CAIC,GACD,OAAO,MAAMA,mBAAmB;IAAC;IAAW;IAAY;CAAW,CAAS"}
@@ -1,4 +1,4 @@
1
- import { i as ConfigStore, r as CliConfig } from "./cliConfig-BZgn8ge1.js";
1
+ import { i as ConfigStore, r as CliConfig } from "./cliConfig-DXI15-0E.js";
2
2
  import { t as ProjectRootResult } from "./recursivelyResolveProjectRoot-BE54uEP6.js";
3
3
  import { z } from "zod/mini";
4
4
  import { Workspace } from "sanity";
@@ -280,4 +280,4 @@ declare function findStudioConfigPath(basePath: string): Promise<string>;
280
280
  */
281
281
  declare function tryFindStudioConfigPath(basePath: string): Promise<string | undefined>;
282
282
  export { CliTokenInfo as _, getStudioWorkspaces as a, findProjectRoot as c, getCliConfigUncached as d, getCliToken as f, setCliUserConfig as g, getUserConfig as h, isStudioConfig as i, getCliConfigSync as l, getCliUserConfig as m, tryFindStudioConfigPath as n, getStudioConfig as o, getCliTokenInfo as p, findPathForFiles as r, findProjectRootSync as s, findStudioConfigPath as t, getCliConfig as u, clearCliTokenCache as v };
283
- //# sourceMappingURL=findStudioConfigPath-B35la6W9.d.ts.map
283
+ //# sourceMappingURL=findStudioConfigPath-BzVcTUST.d.ts.map
@@ -1,4 +1,4 @@
1
- import { a as ReactCompilerConfig, c as UserViteConfig, o as TypeGenConfig, s as TypeGenResource } from "./cliConfig-BZgn8ge1.js";
1
+ import { a as ReactCompilerConfig, c as UserViteConfig, o as TypeGenConfig, s as TypeGenResource } from "./cliConfig-DXI15-0E.js";
2
2
  import { z } from "zod/mini";
3
3
  /**
4
4
  * @public
@@ -61,6 +61,7 @@ declare const cliConfigSchema: z.ZodMiniObject<{
61
61
  }, z.core.$strip>>;
62
62
  studioHost: z.ZodMiniOptional<z.ZodMiniString<string>>;
63
63
  unstable_bundledDev: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
64
+ unstable_documentComponent: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
64
65
  vite: z.ZodMiniOptional<z.ZodMiniCustom<UserViteConfig, UserViteConfig>>;
65
66
  typegen: z.ZodMiniOptional<z.ZodMiniCustom<Partial<TypeGenConfig> & {
66
67
  enabled?: boolean;
@@ -106,4 +107,4 @@ type CoreAppManifest = z.infer<typeof coreAppManifestSchema>;
106
107
  declare const studioManifestSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
107
108
  type StudioManifest = z.infer<typeof studioManifestSchema>;
108
109
  export { cliConfigSchema as a, studioManifestSchema as i, StudioManifest as n, coreAppManifestSchema as r, CoreAppManifest as t };
109
- //# sourceMappingURL=schemas-CCgh6idL.d.ts.map
110
+ //# sourceMappingURL=schemas-Cgl_4hRt.d.ts.map
@@ -1,14 +1,20 @@
1
- import { writeFileSync } from 'node:fs';
1
+ import { chmodSync, writeFileSync } from 'node:fs';
2
2
  /**
3
3
  * Serialize the given `data` as JSON and write it synchronously to the given path.
4
4
  *
5
5
  * @param filePath - Path to JSON file to write
6
+ * @param options - `mode` sets the file mode, both for new files and for files that already exist
6
7
  * @internal
7
8
  */ export function writeJsonFileSync(filePath, data, options = {}) {
8
- const { pretty = false } = options;
9
+ const { mode, pretty = false } = options;
9
10
  try {
10
11
  const stringified = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data);
11
- writeFileSync(filePath, `${stringified}\n`, 'utf8');
12
+ writeFileSync(filePath, `${stringified}\n`, mode === undefined ? 'utf8' : {
13
+ encoding: 'utf8',
14
+ mode
15
+ });
16
+ // `writeFileSync` only applies `mode` when it creates the file
17
+ if (mode !== undefined) chmodSync(filePath, mode);
12
18
  } catch (err) {
13
19
  throw new Error(`Failed to write "${filePath}"`, {
14
20
  cause: err
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/util/writeJsonFileSync.ts"],"sourcesContent":["import {writeFileSync} from 'node:fs'\n\n/**\n * Serialize the given `data` as JSON and write it synchronously to the given path.\n *\n * @param filePath - Path to JSON file to write\n * @internal\n */\nexport function writeJsonFileSync(\n filePath: string,\n data: unknown,\n options: {pretty?: boolean} = {},\n): void {\n const {pretty = false} = options\n try {\n const stringified = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data)\n writeFileSync(filePath, `${stringified}\\n`, 'utf8')\n } catch (err: unknown) {\n throw new Error(`Failed to write \"${filePath}\"`, {cause: err})\n }\n}\n"],"names":["writeFileSync","writeJsonFileSync","filePath","data","options","pretty","stringified","JSON","stringify","err","Error","cause"],"mappings":"AAAA,SAAQA,aAAa,QAAO,UAAS;AAErC;;;;;CAKC,GACD,OAAO,SAASC,kBACdC,QAAgB,EAChBC,IAAa,EACbC,UAA8B,CAAC,CAAC;IAEhC,MAAM,EAACC,SAAS,KAAK,EAAC,GAAGD;IACzB,IAAI;QACF,MAAME,cAAcD,SAASE,KAAKC,SAAS,CAACL,MAAM,MAAM,KAAKI,KAAKC,SAAS,CAACL;QAC5EH,cAAcE,UAAU,GAAGI,YAAY,EAAE,CAAC,EAAE;IAC9C,EAAE,OAAOG,KAAc;QACrB,MAAM,IAAIC,MAAM,CAAC,iBAAiB,EAAER,SAAS,CAAC,CAAC,EAAE;YAACS,OAAOF;QAAG;IAC9D;AACF"}
1
+ {"version":3,"sources":["../../src/util/writeJsonFileSync.ts"],"sourcesContent":["import {chmodSync, writeFileSync} from 'node:fs'\n\n/**\n * Serialize the given `data` as JSON and write it synchronously to the given path.\n *\n * @param filePath - Path to JSON file to write\n * @param options - `mode` sets the file mode, both for new files and for files that already exist\n * @internal\n */\nexport function writeJsonFileSync(\n filePath: string,\n data: unknown,\n options: {mode?: number; pretty?: boolean} = {},\n): void {\n const {mode, pretty = false} = options\n try {\n const stringified = pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data)\n writeFileSync(\n filePath,\n `${stringified}\\n`,\n mode === undefined ? 'utf8' : {encoding: 'utf8', mode},\n )\n // `writeFileSync` only applies `mode` when it creates the file\n if (mode !== undefined) chmodSync(filePath, mode)\n } catch (err: unknown) {\n throw new Error(`Failed to write \"${filePath}\"`, {cause: err})\n }\n}\n"],"names":["chmodSync","writeFileSync","writeJsonFileSync","filePath","data","options","mode","pretty","stringified","JSON","stringify","undefined","encoding","err","Error","cause"],"mappings":"AAAA,SAAQA,SAAS,EAAEC,aAAa,QAAO,UAAS;AAEhD;;;;;;CAMC,GACD,OAAO,SAASC,kBACdC,QAAgB,EAChBC,IAAa,EACbC,UAA6C,CAAC,CAAC;IAE/C,MAAM,EAACC,IAAI,EAAEC,SAAS,KAAK,EAAC,GAAGF;IAC/B,IAAI;QACF,MAAMG,cAAcD,SAASE,KAAKC,SAAS,CAACN,MAAM,MAAM,KAAKK,KAAKC,SAAS,CAACN;QAC5EH,cACEE,UACA,GAAGK,YAAY,EAAE,CAAC,EAClBF,SAASK,YAAY,SAAS;YAACC,UAAU;YAAQN;QAAI;QAEvD,+DAA+D;QAC/D,IAAIA,SAASK,WAAWX,UAAUG,UAAUG;IAC9C,EAAE,OAAOO,KAAc;QACrB,MAAM,IAAIC,MAAM,CAAC,iBAAiB,EAAEX,SAAS,CAAC,CAAC,EAAE;YAACY,OAAOF;QAAG;IAC9D;AACF"}
@@ -1,4 +1,4 @@
1
- import { r as CliConfig } from "./cliConfig-BZgn8ge1.js";
1
+ import { r as CliConfig } from "./cliConfig-DXI15-0E.js";
2
2
  import { z } from "zod/mini";
3
3
  /**
4
4
  * Boolean brand check — used for config-load routing, kept exported for
@@ -25,4 +25,4 @@ type ApplicationType = z.infer<typeof applicationTypeSchema>;
25
25
  */
26
26
  declare function parseWorkbenchCliConfig(cliConfig: unknown, projectDir: string): CliConfig;
27
27
  export { isWorkbenchApp as n, parseWorkbenchCliConfig as r, ApplicationType as t };
28
- //# sourceMappingURL=workbenchApp-DFUFhE7a.d.ts.map
28
+ //# sourceMappingURL=workbenchApp-DJfB1FCE.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli-core",
3
- "version": "3.14.2",
3
+ "version": "3.15.1",
4
4
  "description": "Sanity CLI core package",
5
5
  "keywords": [
6
6
  "cli",
@@ -119,13 +119,13 @@
119
119
  "access": "public"
120
120
  },
121
121
  "dependencies": {
122
- "@inquirer/core": "^12.0.5",
123
- "@inquirer/prompts": "^8.7.4",
124
- "@oclif/core": "^4.11.14",
122
+ "@inquirer/core": "^12.0.6",
123
+ "@inquirer/prompts": "^8.7.5",
124
+ "@oclif/core": "^4.14.0",
125
125
  "@sanity/client": "^8.15.0",
126
126
  "boxen": "^8.0.1",
127
- "empathic": "^2.0.1",
128
- "get-it": "^9.5.4",
127
+ "empathic": "^2.1.0",
128
+ "get-it": "^9.7.0",
129
129
  "get-tsconfig": "^4.14.3",
130
130
  "import-meta-resolve": "^4.2.0",
131
131
  "jiti": "^2.7.0",
@@ -135,7 +135,7 @@
135
135
  "obug": "^3.0.0",
136
136
  "ora": "^9.0.0",
137
137
  "rxjs": "^7.8.2",
138
- "vite": "^8.3.6",
138
+ "vite": "^8.3.8",
139
139
  "wrap-ansi": "^9.0.2",
140
140
  "zod": "^4.6.7"
141
141
  },
@@ -146,13 +146,13 @@
146
146
  "@sanity/eslint-config-cli": "1.1.3",
147
147
  "@sanity/pkg-utils": "^12.3.4",
148
148
  "@sanity/telemetry": "^1.1.0",
149
- "@swc/cli": "^0.8.1",
150
- "@swc/core": "^1.15.43",
149
+ "@swc/cli": "^0.8.2",
150
+ "@swc/core": "^1.16.22",
151
151
  "@types/jsdom": "^28.0.3",
152
152
  "@types/node": "^22.20.5",
153
153
  "babel-plugin-react-compiler": "^1.0.0",
154
154
  "eslint": "^10.7.0",
155
- "oxc-transform-react": "^0.156.0",
155
+ "oxc-transform-react": "^0.158.0",
156
156
  "publint": "^0.3.21",
157
157
  "sanity": "^6.22.0",
158
158
  "typescript": "^6.0.3",