@sanity/cli-core 3.18.0 → 3.19.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.
- package/dist/SanityCommand.d.ts +1 -1
- package/dist/_exports/config.d.ts +4 -4
- package/dist/_exports/config.js +1 -1
- package/dist/_exports/config.js.map +1 -1
- package/dist/_exports/index.d.ts +10 -10
- package/dist/_exports/schemas.d.ts +1 -1
- package/dist/_exports/types.d.ts +4 -4
- package/dist/_exports/util.d.ts +1 -1
- package/dist/{cliConfig-DXI15-0E.d.ts → cliConfig-CKGvbIpi.d.ts} +5 -1
- package/dist/config/cli/cliUserConfig.js +1 -2
- package/dist/config/cli/cliUserConfig.js.map +1 -1
- package/dist/config/cli/types/cliConfig.js.map +1 -1
- package/dist/config/studio/readStudioConfig.js +3 -2
- package/dist/config/studio/readStudioConfig.js.map +1 -1
- package/dist/{findStudioConfigPath-BzVcTUST.d.ts → findStudioConfigPath-DqY9KOaP.d.ts} +13 -5
- package/dist/{schemas-Cgl_4hRt.d.ts → schemas-D1wUpzFC.d.ts} +2 -2
- package/dist/{workbenchApp-DJfB1FCE.d.ts → workbenchApp-BTcMIyPl.d.ts} +2 -2
- package/package.json +5 -5
package/dist/SanityCommand.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as ProjectCliClientOptions, t as GlobalCliClientOptions } from "./apiClient-DXlF5ZV3.js";
|
|
2
|
-
import { r as CliConfig } from "./cliConfig-
|
|
2
|
+
import { r as CliConfig } from "./cliConfig-CKGvbIpi.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
|
|
2
|
-
import {
|
|
3
|
-
import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-
|
|
1
|
+
import { _ as setCliUserConfig, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as getUserConfig, h as getCliUserConfigPath, 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 CliTokenInfo, y as clearCliTokenCache } from "../findStudioConfigPath-DqY9KOaP.js";
|
|
2
|
+
import { i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-CKGvbIpi.js";
|
|
3
|
+
import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-BTcMIyPl.js";
|
|
4
4
|
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
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 };
|
|
5
|
+
export { type CliConfig, type CliTokenInfo, type ConfigStore, type TypeGenConfig, type TypeGenResource, clearCliTokenCache, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliToken, getCliTokenInfo, getCliUserConfig, getCliUserConfigPath, getSanityConfigDir, getSanityDataDir, getSanityEnvVar, getSanityUrl, getStudioConfig, getStudioWorkspaces, getUserConfig, getWorkspace, isStudioConfig, isWorkbenchApp, parseWorkbenchCliConfig, setCliUserConfig, tryFindStudioConfigPath };
|
package/dist/_exports/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Exports related to retrieving CLI, studio, app or workbench configuration or paths.
|
|
2
|
-
export { clearCliTokenCache, getCliToken, getCliTokenInfo, getCliUserConfig, getUserConfig, setCliUserConfig } from '../config/cli/cliUserConfig.js';
|
|
2
|
+
export { clearCliTokenCache, getCliToken, getCliTokenInfo, getCliUserConfig, getCliUserConfigPath, getUserConfig, setCliUserConfig } from '../config/cli/cliUserConfig.js';
|
|
3
3
|
export { getCliConfig, getCliConfigUncached } from '../config/cli/getCliConfig.js';
|
|
4
4
|
export { getCliConfigSync } from '../config/cli/getCliConfigSync.js';
|
|
5
5
|
export { isWorkbenchApp, parseWorkbenchCliConfig } from '../config/cli/workbenchApp.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/config.ts"],"sourcesContent":["// Exports related to retrieving CLI, studio, app or workbench configuration or paths.\n\nexport {\n clearCliTokenCache,\n type CliTokenInfo,\n getCliToken,\n getCliTokenInfo,\n getCliUserConfig,\n getUserConfig,\n setCliUserConfig,\n} from '../config/cli/cliUserConfig.js'\nexport {getCliConfig, getCliConfigUncached} from '../config/cli/getCliConfig.js'\nexport {getCliConfigSync} from '../config/cli/getCliConfigSync.js'\nexport {\n type CliConfig,\n type ConfigStore,\n type TypeGenConfig,\n type TypeGenResource,\n} from '../config/cli/types/cliConfig.js'\nexport {isWorkbenchApp, parseWorkbenchCliConfig} from '../config/cli/workbenchApp.js'\nexport {findProjectRoot} from '../config/findProjectRoot.js'\nexport {findProjectRootSync} from '../config/findProjectRootSync.js'\nexport {getStudioConfig} from '../config/studio/getStudioConfig.js'\nexport {getStudioWorkspaces} from '../config/studio/getStudioWorkspaces.js'\nexport {isStudioConfig} from '../config/studio/isStudioConfig.js'\nexport {findPathForFiles} from '../config/util/findConfigsPaths.js'\nexport {findStudioConfigPath, tryFindStudioConfigPath} from '../config/util/findStudioConfigPath.js'\nexport {getSanityConfigDir, getSanityDataDir} from '../util/getSanityConfigDir.js'\nexport {getSanityEnvVar} from '../util/getSanityEnvVar.js'\nexport {getSanityUrl} from '../util/getSanityUrl.js'\nexport {getWorkspace} from '../util/getWorkspace.js'\n"],"names":["clearCliTokenCache","getCliToken","getCliTokenInfo","getCliUserConfig","getUserConfig","setCliUserConfig","getCliConfig","getCliConfigUncached","getCliConfigSync","isWorkbenchApp","parseWorkbenchCliConfig","findProjectRoot","findProjectRootSync","getStudioConfig","getStudioWorkspaces","isStudioConfig","findPathForFiles","findStudioConfigPath","tryFindStudioConfigPath","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace"],"mappings":"AAAA,sFAAsF;AAEtF,SACEA,kBAAkB,EAElBC,WAAW,EACXC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,iCAAgC;AACvC,SAAQC,YAAY,EAAEC,oBAAoB,QAAO,gCAA+B;AAChF,SAAQC,gBAAgB,QAAO,oCAAmC;AAOlE,SAAQC,cAAc,EAAEC,uBAAuB,QAAO,gCAA+B;AACrF,SAAQC,eAAe,QAAO,+BAA8B;AAC5D,SAAQC,mBAAmB,QAAO,mCAAkC;AACpE,SAAQC,eAAe,QAAO,sCAAqC;AACnE,SAAQC,mBAAmB,QAAO,0CAAyC;AAC3E,SAAQC,cAAc,QAAO,qCAAoC;AACjE,SAAQC,gBAAgB,QAAO,qCAAoC;AACnE,SAAQC,oBAAoB,EAAEC,uBAAuB,QAAO,yCAAwC;AACpG,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,gCAA+B;AAClF,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB"}
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/config.ts"],"sourcesContent":["// Exports related to retrieving CLI, studio, app or workbench configuration or paths.\n\nexport {\n clearCliTokenCache,\n type CliTokenInfo,\n getCliToken,\n getCliTokenInfo,\n getCliUserConfig,\n getCliUserConfigPath,\n getUserConfig,\n setCliUserConfig,\n} from '../config/cli/cliUserConfig.js'\nexport {getCliConfig, getCliConfigUncached} from '../config/cli/getCliConfig.js'\nexport {getCliConfigSync} from '../config/cli/getCliConfigSync.js'\nexport {\n type CliConfig,\n type ConfigStore,\n type TypeGenConfig,\n type TypeGenResource,\n} from '../config/cli/types/cliConfig.js'\nexport {isWorkbenchApp, parseWorkbenchCliConfig} from '../config/cli/workbenchApp.js'\nexport {findProjectRoot} from '../config/findProjectRoot.js'\nexport {findProjectRootSync} from '../config/findProjectRootSync.js'\nexport {getStudioConfig} from '../config/studio/getStudioConfig.js'\nexport {getStudioWorkspaces} from '../config/studio/getStudioWorkspaces.js'\nexport {isStudioConfig} from '../config/studio/isStudioConfig.js'\nexport {findPathForFiles} from '../config/util/findConfigsPaths.js'\nexport {findStudioConfigPath, tryFindStudioConfigPath} from '../config/util/findStudioConfigPath.js'\nexport {getSanityConfigDir, getSanityDataDir} from '../util/getSanityConfigDir.js'\nexport {getSanityEnvVar} from '../util/getSanityEnvVar.js'\nexport {getSanityUrl} from '../util/getSanityUrl.js'\nexport {getWorkspace} from '../util/getWorkspace.js'\n"],"names":["clearCliTokenCache","getCliToken","getCliTokenInfo","getCliUserConfig","getCliUserConfigPath","getUserConfig","setCliUserConfig","getCliConfig","getCliConfigUncached","getCliConfigSync","isWorkbenchApp","parseWorkbenchCliConfig","findProjectRoot","findProjectRootSync","getStudioConfig","getStudioWorkspaces","isStudioConfig","findPathForFiles","findStudioConfigPath","tryFindStudioConfigPath","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace"],"mappings":"AAAA,sFAAsF;AAEtF,SACEA,kBAAkB,EAElBC,WAAW,EACXC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,QACX,iCAAgC;AACvC,SAAQC,YAAY,EAAEC,oBAAoB,QAAO,gCAA+B;AAChF,SAAQC,gBAAgB,QAAO,oCAAmC;AAOlE,SAAQC,cAAc,EAAEC,uBAAuB,QAAO,gCAA+B;AACrF,SAAQC,eAAe,QAAO,+BAA8B;AAC5D,SAAQC,mBAAmB,QAAO,mCAAkC;AACpE,SAAQC,eAAe,QAAO,sCAAqC;AACnE,SAAQC,mBAAmB,QAAO,0CAAyC;AAC3E,SAAQC,cAAc,QAAO,qCAAoC;AACjE,SAAQC,gBAAgB,QAAO,qCAAoC;AACnE,SAAQC,oBAAoB,EAAEC,uBAAuB,QAAO,yCAAwC;AACpG,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,gCAA+B;AAClF,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB"}
|
package/dist/_exports/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { i as getProjectCliClient, n as ProjectCliClientOptions, r as getGlobalCliClient, t as GlobalCliClientOptions } from "../apiClient-DXlF5ZV3.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { _ as setCliUserConfig, a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g 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 CliTokenInfo, y as clearCliTokenCache } from "../findStudioConfigPath-DqY9KOaP.js";
|
|
3
|
+
import { c as UserViteConfig, i as ConfigStore, n as AppVisibility, r as CliConfig, t as APP_VISIBILITIES } from "../cliConfig-CKGvbIpi.js";
|
|
4
|
+
import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-BTcMIyPl.js";
|
|
3
5
|
import { t as ProjectRootResult } from "../recursivelyResolveProjectRoot-BE54uEP6.js";
|
|
4
|
-
import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
|
|
5
|
-
import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-ii6VUp6a.js";
|
|
6
|
-
import { SanityCommand, SanityCommandInterface } from "../SanityCommand.js";
|
|
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-BzVcTUST.js";
|
|
9
|
-
import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-DJfB1FCE.js";
|
|
10
|
-
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
11
|
-
import { debug, subdebug } from "./debug.js";
|
|
12
6
|
import { t as NonInteractiveError } from "../NonInteractiveError-CSLT5y93.js";
|
|
13
7
|
import { i as isNotFoundError, n as isProjectRootNotFoundError, r as NotFoundError, t as ProjectRootNotFoundError } from "../ProjectRootNotFoundError-RgthN9uy.js";
|
|
14
8
|
import { exitCodes } from "../exitCodes.js";
|
|
15
9
|
import { n as createStudioWorker, r as studioWorkerTask, t as tsxWorkerTask } from "../tsxWorkerTask-DQQSOYCZ.js";
|
|
10
|
+
import { SanityCommand, SanityCommandInterface } from "../SanityCommand.js";
|
|
16
11
|
import { a as getCliTelemetry, i as clearCliTelemetry, n as getTelemetryBaseInfo, o as reportCliTraceError, r as CLI_TELEMETRY_SYMBOL, s as setCliTelemetry, t as noopLogger } from "../noopTelemetry-BJRIvASI.js";
|
|
12
|
+
import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
|
|
13
|
+
import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-ii6VUp6a.js";
|
|
17
14
|
import { a as isCi, i as isInteractive, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-BixYyg4K.js";
|
|
15
|
+
import { t as mockBrowserEnvironment } from "../mockBrowserEnvironment-BjFQPb2W.js";
|
|
18
16
|
import { a as loadStudioCliTooling, i as StudioCliTooling, n as resolveLocalPackageFrom, o as getLocalPackageDir, r as resolveLocalPackagePath, s as getLocalPackageVersion, t as resolveLocalPackage } from "../resolveLocalPackage-a4ME8Uju.js";
|
|
17
|
+
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
19
18
|
import { n as ReadPackageJsonOptions, r as readPackageJson, t as PackageJson } from "../readPackageJson-Cr_lbjVR.js";
|
|
20
19
|
import { n as colorizeJson, t as getTimer } from "../timer-Dwu2TIgB.js";
|
|
21
|
-
import {
|
|
20
|
+
import { debug, subdebug } from "./debug.js";
|
|
21
|
+
import { i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-D1wUpzFC.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-
|
|
1
|
+
import { a as cliConfigSchema, i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-D1wUpzFC.js";
|
|
2
2
|
export { type CoreAppManifest, type StudioManifest, cliConfigSchema, coreAppManifestSchema, studioManifestSchema };
|
package/dist/_exports/types.d.ts
CHANGED
|
@@ -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-
|
|
1
|
+
import { a as ReactCompilerConfig, c as UserViteConfig, i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as TypeGenResource } from "../cliConfig-CKGvbIpi.js";
|
|
2
|
+
import { t as ApplicationType } from "../workbenchApp-BTcMIyPl.js";
|
|
2
3
|
import { t as ProjectRootResult } from "../recursivelyResolveProjectRoot-BE54uEP6.js";
|
|
4
|
+
import { SanityCommandInterface } from "../SanityCommand.js";
|
|
3
5
|
import { n as ConsentInformation, r as TelemetryUserProperties, t as CLITelemetryStore } from "../types-ZNH3prAd.js";
|
|
4
6
|
import { n as RequireProps, r as SanityOrgUser, t as Output } from "../types-ii6VUp6a.js";
|
|
5
|
-
import { SanityCommandInterface } from "../SanityCommand.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-
|
|
8
|
+
import { n as StudioManifest, t as CoreAppManifest } from "../schemas-D1wUpzFC.js";
|
|
9
9
|
export type { ApplicationType, CLITelemetryStore, CliConfig, ConfigStore, ConsentInformation, CoreAppManifest, Output, PackageJson, ProjectRootResult, ReactCompilerConfig, ReadPackageJsonOptions, RequireProps, SanityCommandInterface, SanityOrgUser, StudioManifest, TelemetryUserProperties, TypeGenConfig, TypeGenResource, UserViteConfig };
|
package/dist/_exports/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
2
1
|
import { a as isCi, i as isInteractive$1, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-BixYyg4K.js";
|
|
2
|
+
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
3
3
|
declare function getCoreAppUrl(organizationId: string, appId: string): string;
|
|
4
4
|
declare function getSanityEnv(): string;
|
|
5
5
|
/**
|
|
@@ -150,6 +150,10 @@ interface CliConfig {
|
|
|
150
150
|
id?: string;
|
|
151
151
|
nonNullDocumentFields?: boolean;
|
|
152
152
|
playground?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated Studio v7 removes workspace sources. Configure the source as its own workspace
|
|
155
|
+
* and select it with `workspace` instead.
|
|
156
|
+
*/
|
|
153
157
|
source?: string;
|
|
154
158
|
tag?: string;
|
|
155
159
|
workspace?: string;
|
|
@@ -268,4 +272,4 @@ interface ConfigStore {
|
|
|
268
272
|
set: (key: string, value: unknown) => void;
|
|
269
273
|
}
|
|
270
274
|
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 };
|
|
271
|
-
//# sourceMappingURL=cliConfig-
|
|
275
|
+
//# sourceMappingURL=cliConfig-CKGvbIpi.d.ts.map
|
|
@@ -212,8 +212,7 @@ function assertCanAccessHostUserConfig() {
|
|
|
212
212
|
* The file is located in the user's home directory under the `.config` directory.
|
|
213
213
|
*
|
|
214
214
|
* @returns The path to the CLI configuration file.
|
|
215
|
-
|
|
216
|
-
*/ function getCliUserConfigPath() {
|
|
215
|
+
*/ export function getCliUserConfigPath() {
|
|
217
216
|
return process.env.SANITY_CLI_CONFIG_PATH || joinPath(getSanityConfigDir(), 'config.json');
|
|
218
217
|
}
|
|
219
218
|
|
|
@@ -1 +1 @@
|
|
|
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,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A4D,eAAeb,QAAQa,IAAIlB,OAAO,GAAG,GAAGkB,KAAK;IAEjD;AACF;AAEA;;;;;;;CAOC,GACD,SAASrC;IACP,OAAON,QAAQC,GAAG,CAAC6C,sBAAsB,IAAIjE,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 */\nexport function getCliUserConfigPath(): string {\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"],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IAAI;QACF,MAAM,EAACpC,IAAI,EAAEqC,GAAG,EAAC,GAAGnE,SAASqD;QAC7B,IAAIc,QAAQ7C,QAAQ4C,MAAM,MAAM,AAACpC,CAAAA,OAAO,KAAI,MAAO,GAAG;QAEtDhC,UAAUuD,YAAYvB,OAAO;QAC7BzB,MAAM,8CAA8CgD;IACtD,EAAE,OAAOY,KAAc;QACrB5D,MACE,yDACA4D,eAAeb,QAAQa,IAAIlB,OAAO,GAAG,GAAGkB,KAAK;IAEjD;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAASrC;IACd,OAAON,QAAQC,GAAG,CAAC6C,sBAAsB,IAAIjE,SAASI,sBAAsB;AAC9E"}
|
|
@@ -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 /**\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
|
+
{"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 /**\n * @deprecated Studio v7 removes workspace sources. Configure the source as its own workspace\n * and select it with `workspace` instead.\n */\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"}
|
|
@@ -22,14 +22,15 @@ const rawWorkspaceSchema = z.looseObject({
|
|
|
22
22
|
title: z.optional(z.string()),
|
|
23
23
|
unstable_sources: z.optional(z.array(sourceSchema))
|
|
24
24
|
});
|
|
25
|
-
// Resolved config schema (resolvePlugins: true)
|
|
25
|
+
// Resolved config schema (resolvePlugins: true). Only Studio v6 resolves `unstable_sources`:
|
|
26
|
+
// v7 workspaces carry the project, dataset and schema themselves.
|
|
26
27
|
const resolvedWorkspaceSchema = z.looseObject({
|
|
27
28
|
...sourceSchema.shape,
|
|
28
29
|
basePath: z.string(),
|
|
29
30
|
name: z.string(),
|
|
30
31
|
plugins: z.optional(z.array(z.unknown())),
|
|
31
32
|
title: z.string(),
|
|
32
|
-
unstable_sources: z.array(sourceSchema)
|
|
33
|
+
unstable_sources: z.optional(z.array(sourceSchema))
|
|
33
34
|
});
|
|
34
35
|
const rawConfigSchema = z.union([
|
|
35
36
|
z.array(rawWorkspaceSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/studio/readStudioConfig.ts"],"sourcesContent":["import {dirname} from 'node:path'\n\nimport {z} from 'zod/mini'\n\nimport {studioWorkerTask} from '../../loaders/studio/studioWorkerTask.js'\n\nconst schemaSchema = z.looseObject({\n name: z.optional(z.string()),\n types: z.array(z.looseObject({})),\n})\n\nconst sourceSchema = z.looseObject({\n dataset: z.string(),\n projectId: z.string(),\n schema: z.looseObject({_original: schemaSchema}),\n})\n\n// Raw workspace schema (resolvePlugins: false) - unstable_sources not yet populated\nconst rawWorkspaceSchema = z.looseObject({\n ...sourceSchema.shape,\n basePath: z.optional(z.string()),\n name: z.optional(z.string()),\n plugins: z.optional(z.array(z.unknown())),\n schema: z.optional(schemaSchema),\n title: z.optional(z.string()),\n unstable_sources: z.optional(z.array(sourceSchema)),\n})\n\n// Resolved config schema (resolvePlugins: true)
|
|
1
|
+
{"version":3,"sources":["../../../src/config/studio/readStudioConfig.ts"],"sourcesContent":["import {dirname} from 'node:path'\n\nimport {z} from 'zod/mini'\n\nimport {studioWorkerTask} from '../../loaders/studio/studioWorkerTask.js'\n\nconst schemaSchema = z.looseObject({\n name: z.optional(z.string()),\n types: z.array(z.looseObject({})),\n})\n\nconst sourceSchema = z.looseObject({\n dataset: z.string(),\n projectId: z.string(),\n schema: z.looseObject({_original: schemaSchema}),\n})\n\n// Raw workspace schema (resolvePlugins: false) - unstable_sources not yet populated\nconst rawWorkspaceSchema = z.looseObject({\n ...sourceSchema.shape,\n basePath: z.optional(z.string()),\n name: z.optional(z.string()),\n plugins: z.optional(z.array(z.unknown())),\n schema: z.optional(schemaSchema),\n title: z.optional(z.string()),\n unstable_sources: z.optional(z.array(sourceSchema)),\n})\n\n// Resolved config schema (resolvePlugins: true). Only Studio v6 resolves `unstable_sources`:\n// v7 workspaces carry the project, dataset and schema themselves.\nconst resolvedWorkspaceSchema = z.looseObject({\n ...sourceSchema.shape,\n basePath: z.string(),\n name: z.string(),\n plugins: z.optional(z.array(z.unknown())),\n title: z.string(),\n unstable_sources: z.optional(z.array(sourceSchema)),\n})\n\nconst rawConfigSchema = z.union([z.array(rawWorkspaceSchema), rawWorkspaceSchema])\nconst resolvedConfigSchema = z.array(resolvedWorkspaceSchema)\n\nexport type RawStudioConfig = z.infer<typeof rawConfigSchema>\nexport type ResolvedStudioConfig = z.infer<typeof resolvedConfigSchema>\n\nexport interface ReadStudioConfigOptions {\n /**\n * Whether or not to resolve the plugins defined in the config.\n *\n * In some cases, you need this in order to have the full picture of what the studio\n * would \"see\". As an example, plugins can define schema types that are not explicitly\n * defined in the users' schema types. In order to get the full picture, you need to\n * resolve the plugins, which is an asyncronous operation.\n *\n * In other cases, it might be enough to only do a shallow pass. As an example, if you\n * only need to know about the defined workspace, or the user-defined schema types,\n * this can be set to `false` - which should resolve faster (and potentially \"safer\")\n * in terms of not triggering all kinds of browser behavior that may or may not be\n * loaded as the plugins are resolved.\n */\n resolvePlugins: boolean\n}\n\nexport async function readStudioConfig(\n configPath: string,\n options: {resolvePlugins: true},\n): Promise<ResolvedStudioConfig>\n\nexport async function readStudioConfig(\n configPath: string,\n options: {resolvePlugins: false},\n): Promise<RawStudioConfig>\n\nexport async function readStudioConfig(\n configPath: string,\n options: ReadStudioConfigOptions,\n): Promise<RawStudioConfig | ResolvedStudioConfig> {\n const result = await studioWorkerTask(new URL('readStudioConfig.worker.js', import.meta.url), {\n name: 'studioConfig',\n studioRootPath: dirname(configPath),\n workerData: {configPath, resolvePlugins: options.resolvePlugins},\n })\n\n try {\n return options.resolvePlugins\n ? resolvedConfigSchema.parse(result)\n : rawConfigSchema.parse(result)\n } catch (err) {\n if (err instanceof z.core.$ZodError) {\n throw new TypeError(\n `Invalid studio config at ${configPath}:\\n${formatZodIssues(err.issues)}`,\n {\n cause: err,\n },\n )\n }\n\n throw err\n }\n}\n\n/**\n * Recursively extracts leaf-level messages from Zod issues, including\n * those nested inside union errors. Note that `prettifyError` from Zod\n * only gives a high-level summary for union errors, so this function is\n * needed to get the full details of all validation issues in a readable format.\n *\n * @internal exported for testing only\n */\nexport function formatZodIssues(issues: z.core.$ZodIssue[], indent = 2): string {\n const lines: string[] = []\n const prefix = ' '.repeat(indent)\n\n for (const issue of issues) {\n if (issue.code === 'invalid_union' && 'errors' in issue && Array.isArray(issue.errors)) {\n for (const [i, unionIssues] of issue.errors.entries()) {\n lines.push(`${prefix}Union option ${i + 1}:`, formatZodIssues(unionIssues, indent + 2))\n }\n } else {\n const path = issue.path.length > 0 ? ` at \"${issue.path.join('.')}\"` : ''\n lines.push(`${prefix}- ${issue.message}${path}`)\n }\n }\n\n return lines.join('\\n')\n}\n"],"names":["dirname","z","studioWorkerTask","schemaSchema","looseObject","name","optional","string","types","array","sourceSchema","dataset","projectId","schema","_original","rawWorkspaceSchema","shape","basePath","plugins","unknown","title","unstable_sources","resolvedWorkspaceSchema","rawConfigSchema","union","resolvedConfigSchema","readStudioConfig","configPath","options","result","URL","url","studioRootPath","workerData","resolvePlugins","parse","err","core","$ZodError","TypeError","formatZodIssues","issues","cause","indent","lines","prefix","repeat","issue","code","Array","isArray","errors","i","unionIssues","entries","push","path","length","join","message"],"mappings":"AAAA,SAAQA,OAAO,QAAO,YAAW;AAEjC,SAAQC,CAAC,QAAO,WAAU;AAE1B,SAAQC,gBAAgB,QAAO,2CAA0C;AAEzE,MAAMC,eAAeF,EAAEG,WAAW,CAAC;IACjCC,MAAMJ,EAAEK,QAAQ,CAACL,EAAEM,MAAM;IACzBC,OAAOP,EAAEQ,KAAK,CAACR,EAAEG,WAAW,CAAC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import { t as ProjectRootResult } from "./recursivelyResolveProjectRoot-BE54uEP6.js";
|
|
3
3
|
import { z } from "zod/mini";
|
|
4
4
|
import { Workspace } from "sanity";
|
|
@@ -69,6 +69,14 @@ declare function getCliUserConfig(prop: 'authToken'): string | undefined;
|
|
|
69
69
|
* @public
|
|
70
70
|
*/
|
|
71
71
|
declare function getUserConfig(): ConfigStore;
|
|
72
|
+
/**
|
|
73
|
+
* Get the file system location for the CLI user configuration file.
|
|
74
|
+
* Takes into account the active environment (staging vs production).
|
|
75
|
+
* The file is located in the user's home directory under the `.config` directory.
|
|
76
|
+
*
|
|
77
|
+
* @returns The path to the CLI configuration file.
|
|
78
|
+
*/
|
|
79
|
+
declare function getCliUserConfigPath(): string;
|
|
72
80
|
/**
|
|
73
81
|
* Get the CLI config for a project, given the root path.
|
|
74
82
|
*
|
|
@@ -193,7 +201,7 @@ declare const resolvedConfigSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
193
201
|
name: z.ZodMiniString<string>;
|
|
194
202
|
plugins: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnknown>>;
|
|
195
203
|
title: z.ZodMiniString<string>;
|
|
196
|
-
unstable_sources: z.ZodMiniArray<z.ZodMiniObject<{
|
|
204
|
+
unstable_sources: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
197
205
|
dataset: z.ZodMiniString<string>;
|
|
198
206
|
projectId: z.ZodMiniString<string>;
|
|
199
207
|
schema: z.ZodMiniObject<{
|
|
@@ -202,7 +210,7 @@ declare const resolvedConfigSchema: z.ZodMiniArray<z.ZodMiniObject<{
|
|
|
202
210
|
types: z.ZodMiniArray<z.ZodMiniObject<{}, z.core.$loose>>;
|
|
203
211
|
}, z.core.$loose>;
|
|
204
212
|
}, z.core.$loose>;
|
|
205
|
-
}, z.core.$loose
|
|
213
|
+
}, z.core.$loose>>>;
|
|
206
214
|
dataset: z.ZodMiniString<string>;
|
|
207
215
|
projectId: z.ZodMiniString<string>;
|
|
208
216
|
schema: z.ZodMiniObject<{
|
|
@@ -279,5 +287,5 @@ declare function findStudioConfigPath(basePath: string): Promise<string>;
|
|
|
279
287
|
* @internal
|
|
280
288
|
*/
|
|
281
289
|
declare function tryFindStudioConfigPath(basePath: string): Promise<string | undefined>;
|
|
282
|
-
export {
|
|
283
|
-
//# sourceMappingURL=findStudioConfigPath-
|
|
290
|
+
export { setCliUserConfig as _, getStudioWorkspaces as a, findProjectRoot as c, getCliConfigUncached as d, getCliToken as f, getUserConfig as g, getCliUserConfigPath 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, CliTokenInfo as v, clearCliTokenCache as y };
|
|
291
|
+
//# sourceMappingURL=findStudioConfigPath-DqY9KOaP.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ReactCompilerConfig, c as UserViteConfig, o as TypeGenConfig, s as TypeGenResource } from "./cliConfig-
|
|
1
|
+
import { a as ReactCompilerConfig, c as UserViteConfig, o as TypeGenConfig, s as TypeGenResource } from "./cliConfig-CKGvbIpi.js";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
@@ -107,4 +107,4 @@ type CoreAppManifest = z.infer<typeof coreAppManifestSchema>;
|
|
|
107
107
|
declare const studioManifestSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
108
108
|
type StudioManifest = z.infer<typeof studioManifestSchema>;
|
|
109
109
|
export { cliConfigSchema as a, studioManifestSchema as i, StudioManifest as n, coreAppManifestSchema as r, CoreAppManifest as t };
|
|
110
|
-
//# sourceMappingURL=schemas-
|
|
110
|
+
//# sourceMappingURL=schemas-D1wUpzFC.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CliConfig } from "./cliConfig-
|
|
1
|
+
import { r as CliConfig } from "./cliConfig-CKGvbIpi.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-
|
|
28
|
+
//# sourceMappingURL=workbenchApp-BTcMIyPl.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"description": "Sanity CLI core package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
},
|
|
125
125
|
"dependencies": {
|
|
126
126
|
"@inquirer/core": "^12.1.1",
|
|
127
|
-
"@inquirer/prompts": "^8.
|
|
127
|
+
"@inquirer/prompts": "^8.8.1",
|
|
128
128
|
"@oclif/core": "^4.14.0",
|
|
129
129
|
"@sanity/client": "^8.17.0",
|
|
130
130
|
"boxen": "^8.0.1",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"obug": "^3.0.0",
|
|
140
140
|
"ora": "^9.0.0",
|
|
141
141
|
"rxjs": "^7.8.2",
|
|
142
|
-
"vite": "^8.4.
|
|
142
|
+
"vite": "^8.4.1",
|
|
143
143
|
"wrap-ansi": "^9.0.2",
|
|
144
144
|
"zod": "^4.6.7"
|
|
145
145
|
},
|
|
@@ -152,12 +152,12 @@
|
|
|
152
152
|
"@swc/cli": "^0.8.2",
|
|
153
153
|
"@swc/core": "^1.16.22",
|
|
154
154
|
"@types/jsdom": "^28.0.3",
|
|
155
|
-
"@types/node": "^22.20.
|
|
155
|
+
"@types/node": "^22.20.7",
|
|
156
156
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
157
157
|
"oxc-transform-react": "^0.158.0",
|
|
158
158
|
"oxlint": "^1.94.0",
|
|
159
159
|
"publint": "^0.3.25",
|
|
160
|
-
"sanity": "^6.
|
|
160
|
+
"sanity": "^6.26.0",
|
|
161
161
|
"typescript": "^6.0.3",
|
|
162
162
|
"vitest": "^5.1.1"
|
|
163
163
|
},
|