@sanity/cli-core 3.2.0 → 3.3.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 +5 -5
- package/dist/_exports/index.js +1 -1
- package/dist/_exports/index.js.map +1 -1
- package/dist/_exports/schemas.d.ts +1 -1
- package/dist/_exports/types.d.ts +3 -3
- package/dist/{cliConfig-DrUV6Wp6.d.ts → cliConfig-DUt8uaF6.d.ts} +28 -3
- package/dist/config/cli/cliTokenCache.js +9 -9
- package/dist/config/cli/cliTokenCache.js.map +1 -1
- package/dist/config/cli/cliUserConfig.js +31 -11
- package/dist/config/cli/cliUserConfig.js.map +1 -1
- package/dist/config/cli/types/cliConfig.js.map +1 -1
- package/dist/{findStudioConfigPath-DeBa0pMT.d.ts → findStudioConfigPath-BV4DCesQ.d.ts} +23 -5
- package/dist/{schemas-Y-KwP413.d.ts → schemas-PPIe9Jz0.d.ts} +2 -2
- package/dist/{workbenchApp-CSYpReA-.d.ts → workbenchApp-BkQHUXxH.d.ts} +2 -2
- package/package.json +1 -1
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-DUt8uaF6.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-CwJLTYDj.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as ConfigStore, o as TypeGenConfig, r as CliConfig } from "../cliConfig-
|
|
2
|
-
import { a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as
|
|
3
|
-
import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-
|
|
1
|
+
import { i as ConfigStore, o as TypeGenConfig, r as CliConfig } from "../cliConfig-DUt8uaF6.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-BV4DCesQ.js";
|
|
3
|
+
import { n as isWorkbenchApp, r as parseWorkbenchCliConfig } from "../workbenchApp-BkQHUXxH.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 ConfigStore, type TypeGenConfig, clearCliTokenCache, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliToken, getCliUserConfig, getSanityConfigDir, getSanityDataDir, getSanityEnvVar, getSanityUrl, getStudioConfig, getStudioWorkspaces, getUserConfig, getWorkspace, isStudioConfig, isWorkbenchApp, parseWorkbenchCliConfig, setCliUserConfig, tryFindStudioConfigPath };
|
|
5
|
+
export { type CliConfig, type CliTokenInfo, type ConfigStore, type TypeGenConfig, clearCliTokenCache, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliToken, getCliTokenInfo, getCliUserConfig, 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, getCliUserConfig, getUserConfig, setCliUserConfig } from '../config/cli/cliUserConfig.js';
|
|
2
|
+
export { clearCliTokenCache, getCliToken, getCliTokenInfo, getCliUserConfig, 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 getCliToken,\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} 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","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,
|
|
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} 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;AAMlE,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,12 +1,12 @@
|
|
|
1
1
|
import { i as getProjectCliClient, n as ProjectCliClientOptions, r as getGlobalCliClient, t as GlobalCliClientOptions } from "../apiClient-DXlF5ZV3.js";
|
|
2
|
-
import { i as ConfigStore, n as AppVisibility, r as CliConfig, s as UserViteConfig, t as APP_VISIBILITIES } from "../cliConfig-
|
|
2
|
+
import { i as ConfigStore, n as AppVisibility, r as CliConfig, s as UserViteConfig, t as APP_VISIBILITIES } from "../cliConfig-DUt8uaF6.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-CwJLTYDj.js";
|
|
6
6
|
import { SanityCommand, SanityCommandInterface } from "../SanityCommand.js";
|
|
7
7
|
import { t as mockBrowserEnvironment } from "../mockBrowserEnvironment-BjFQPb2W.js";
|
|
8
|
-
import { a as getStudioWorkspaces, c as findProjectRoot, d as getCliConfigUncached, f as getCliToken, g as
|
|
9
|
-
import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-
|
|
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-BV4DCesQ.js";
|
|
9
|
+
import { n as isWorkbenchApp, t as ApplicationType } from "../workbenchApp-BkQHUXxH.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-
|
|
21
|
+
import { i as studioManifestSchema, n as StudioManifest, r as coreAppManifestSchema, t as CoreAppManifest } from "../schemas-PPIe9Jz0.js";
|
|
22
22
|
import { WorkerOptions } from "node:worker_threads";
|
|
23
23
|
interface PromisifyWorkerOptions extends WorkerOptions {
|
|
24
24
|
/**
|
|
@@ -47,5 +47,5 @@ interface PromisifyWorkerOptions extends WorkerOptions {
|
|
|
47
47
|
* @internal
|
|
48
48
|
*/
|
|
49
49
|
declare function promisifyWorker<T = unknown>(filePath: URL, options?: PromisifyWorkerOptions): Promise<T>;
|
|
50
|
-
export { APP_VISIBILITIES, type AppVisibility, type ApplicationType, type CLITelemetryStore, CLI_TELEMETRY_SYMBOL, type CliConfig, type ConfigStore, type ConsentInformation, type CoreAppManifest, type GlobalCliClientOptions, NonInteractiveError, NotFoundError, type Output, type PackageJson, type ProjectCliClientOptions, ProjectRootNotFoundError, type ProjectRootResult, type ReadPackageJsonOptions, type RequireProps, SanityCommand, type SanityCommandInterface, type SanityOrgUser, type StudioManifest, type TelemetryUserProperties, type UserViteConfig, clearCliTelemetry, clearCliTokenCache, colorizeJson, coreAppManifestSchema, createStudioWorker, debug, doImport, exitCodes, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliTelemetry, getCliToken, getCliUserConfig, getGlobalCliClient, getLocalPackageDir, getLocalPackageVersion, getProjectCliClient, getSanityConfigDir, getSanityDataDir, getSanityEnvVar, getSanityUrl, getStudioConfig, getStudioWorkspaces, getTelemetryBaseInfo, getTimer, getUserConfig, getWorkspace, importModule, isCi, isInteractive, isNotFoundError, isProjectRootNotFoundError, isStaging, isStudioConfig, isWorkbenchApp, mockBrowserEnvironment, noopLogger, normalizePath, promisifyWorker, readPackageJson, reportCliTraceError, resolveLocalPackage, resolveLocalPackageFrom, resolveLocalPackagePath, safeStructuredClone, setCliTelemetry, setCliUserConfig, studioManifestSchema, studioWorkerTask, subdebug, tryFindStudioConfigPath, tsxWorkerTask };
|
|
50
|
+
export { APP_VISIBILITIES, type AppVisibility, type ApplicationType, type CLITelemetryStore, CLI_TELEMETRY_SYMBOL, type CliConfig, type CliTokenInfo, type ConfigStore, type ConsentInformation, type CoreAppManifest, type GlobalCliClientOptions, NonInteractiveError, NotFoundError, type Output, type PackageJson, type ProjectCliClientOptions, ProjectRootNotFoundError, type ProjectRootResult, type ReadPackageJsonOptions, type RequireProps, SanityCommand, type SanityCommandInterface, type SanityOrgUser, type StudioManifest, type TelemetryUserProperties, type UserViteConfig, clearCliTelemetry, clearCliTokenCache, colorizeJson, coreAppManifestSchema, createStudioWorker, debug, doImport, exitCodes, findPathForFiles, findProjectRoot, findProjectRootSync, findStudioConfigPath, getCliConfig, getCliConfigSync, getCliConfigUncached, getCliTelemetry, getCliToken, getCliTokenInfo, getCliUserConfig, getGlobalCliClient, getLocalPackageDir, getLocalPackageVersion, getProjectCliClient, getSanityConfigDir, getSanityDataDir, getSanityEnvVar, getSanityUrl, getStudioConfig, getStudioWorkspaces, getTelemetryBaseInfo, getTimer, getUserConfig, getWorkspace, importModule, isCi, isInteractive, isNotFoundError, isProjectRootNotFoundError, isStaging, isStudioConfig, isWorkbenchApp, mockBrowserEnvironment, noopLogger, normalizePath, promisifyWorker, readPackageJson, reportCliTraceError, resolveLocalPackage, resolveLocalPackageFrom, resolveLocalPackagePath, safeStructuredClone, setCliTelemetry, setCliUserConfig, studioManifestSchema, studioWorkerTask, subdebug, tryFindStudioConfigPath, tsxWorkerTask };
|
|
51
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/_exports/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// If you came here looking to add new exports, instead take a look through the `exports` in package.json and think about which of those groups your new export belongs to. You may want to consider adding a _new_ export if there is no clean conceptual fit.
|
|
4
4
|
// This is all in the name of minimizing 'barrel' export files and keeping `import`s fast. See the following for context: https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/
|
|
5
5
|
export { getGlobalCliClient, getProjectCliClient } from '../apiClient.js';
|
|
6
|
-
export { clearCliTokenCache, getCliToken, getCliUserConfig, getUserConfig, setCliUserConfig } from '../config/cli/cliUserConfig.js';
|
|
6
|
+
export { clearCliTokenCache, getCliToken, getCliTokenInfo, getCliUserConfig, getUserConfig, setCliUserConfig } from '../config/cli/cliUserConfig.js';
|
|
7
7
|
export { getCliConfig, getCliConfigUncached } from '../config/cli/getCliConfig.js';
|
|
8
8
|
export { getCliConfigSync } from '../config/cli/getCliConfigSync.js';
|
|
9
9
|
export { APP_VISIBILITIES } from '../config/cli/types/cliConfig.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["// DO NOT ADD NEW EXPORTS TO THIS FILE!\n// These are left here for backwards compatibility.\n// If you came here looking to add new exports, instead take a look through the `exports` in package.json and think about which of those groups your new export belongs to. You may want to consider adding a _new_ export if there is no clean conceptual fit.\n// This is all in the name of minimizing 'barrel' export files and keeping `import`s fast. See the following for context: https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/\nexport {\n getGlobalCliClient,\n getProjectCliClient,\n type GlobalCliClientOptions,\n type ProjectCliClientOptions,\n} from '../apiClient.js'\nexport {\n clearCliTokenCache,\n getCliToken,\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 APP_VISIBILITIES,\n type AppVisibility,\n type CliConfig,\n type ConfigStore,\n} from '../config/cli/types/cliConfig.js'\nexport {type UserViteConfig} from '../config/cli/types/userViteConfig.js'\nexport {type ApplicationType, isWorkbenchApp} 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 {type ProjectRootResult} from '../config/util/recursivelyResolveProjectRoot.js'\nexport {NonInteractiveError} from '../errors/NonInteractiveError.js'\nexport {isNotFoundError, NotFoundError} from '../errors/NotFoundError.js'\nexport {\n isProjectRootNotFoundError,\n ProjectRootNotFoundError,\n} from '../errors/ProjectRootNotFoundError.js'\nexport {exitCodes} from '../exitCodes.js'\nexport {createStudioWorker, studioWorkerTask} from '../loaders/studio/studioWorkerTask.js'\nexport {tsxWorkerTask} from '../loaders/tsx/tsxWorkerTask.js'\nexport {SanityCommand, type SanityCommandInterface} from '../SanityCommand.js'\nexport {\n clearCliTelemetry,\n CLI_TELEMETRY_SYMBOL,\n getCliTelemetry,\n reportCliTraceError,\n setCliTelemetry,\n} from '../telemetry/getCliTelemetry.js'\nexport {getTelemetryBaseInfo} from '../telemetry/getTelemetryBaseInfo.js'\nexport {noopLogger} from '../telemetry/noopTelemetry.js'\nexport {\n type CLITelemetryStore,\n type ConsentInformation,\n type TelemetryUserProperties,\n} from '../telemetry/types.js'\nexport {type Output, type RequireProps, type SanityOrgUser} from '../types.js'\nexport {doImport} from '../util/doImport.js'\nexport {mockBrowserEnvironment} from '../util/environment/mockBrowserEnvironment.js'\nexport {getLocalPackageDir, getLocalPackageVersion} from '../util/getLocalPackageVersion.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'\nexport {importModule} from '../util/importModule.js'\nexport {isCi} from '../util/isCi.js'\nexport {isInteractive} from '../util/isInteractive.js'\nexport {isStaging} from '../util/isStaging.js'\nexport {normalizePath} from '../util/normalizePath.js'\nexport {promisifyWorker} from '../util/promisifyWorker.js'\nexport {\n type PackageJson,\n readPackageJson,\n type ReadPackageJsonOptions,\n} from '../util/readPackageJson.js'\nexport {\n resolveLocalPackage,\n resolveLocalPackageFrom,\n resolveLocalPackagePath,\n} from '../util/resolveLocalPackage.js'\nexport {safeStructuredClone} from '../util/safeStructuredClone.js'\nexport {colorizeJson} from '../ux/colorizeJson.js'\nexport {getTimer} from '../ux/timer.js'\nexport {debug, subdebug} from './debug.js'\nexport {\n type CoreAppManifest,\n coreAppManifestSchema,\n type StudioManifest,\n studioManifestSchema,\n} from './schemas.js'\n"],"names":["getGlobalCliClient","getProjectCliClient","clearCliTokenCache","getCliToken","getCliUserConfig","getUserConfig","setCliUserConfig","getCliConfig","getCliConfigUncached","getCliConfigSync","APP_VISIBILITIES","isWorkbenchApp","findProjectRoot","findProjectRootSync","getStudioConfig","getStudioWorkspaces","isStudioConfig","findPathForFiles","findStudioConfigPath","tryFindStudioConfigPath","NonInteractiveError","isNotFoundError","NotFoundError","isProjectRootNotFoundError","ProjectRootNotFoundError","exitCodes","createStudioWorker","studioWorkerTask","tsxWorkerTask","SanityCommand","clearCliTelemetry","CLI_TELEMETRY_SYMBOL","getCliTelemetry","reportCliTraceError","setCliTelemetry","getTelemetryBaseInfo","noopLogger","doImport","mockBrowserEnvironment","getLocalPackageDir","getLocalPackageVersion","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace","importModule","isCi","isInteractive","isStaging","normalizePath","promisifyWorker","readPackageJson","resolveLocalPackage","resolveLocalPackageFrom","resolveLocalPackagePath","safeStructuredClone","colorizeJson","getTimer","debug","subdebug","coreAppManifestSchema","studioManifestSchema"],"mappings":"AAAA,uCAAuC;AACvC,mDAAmD;AACnD,+PAA+P;AAC/P,2LAA2L;AAC3L,SACEA,kBAAkB,EAClBC,mBAAmB,QAGd,kBAAiB;AACxB,SACEC,kBAAkB,
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["// DO NOT ADD NEW EXPORTS TO THIS FILE!\n// These are left here for backwards compatibility.\n// If you came here looking to add new exports, instead take a look through the `exports` in package.json and think about which of those groups your new export belongs to. You may want to consider adding a _new_ export if there is no clean conceptual fit.\n// This is all in the name of minimizing 'barrel' export files and keeping `import`s fast. See the following for context: https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-7/\nexport {\n getGlobalCliClient,\n getProjectCliClient,\n type GlobalCliClientOptions,\n type ProjectCliClientOptions,\n} from '../apiClient.js'\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 APP_VISIBILITIES,\n type AppVisibility,\n type CliConfig,\n type ConfigStore,\n} from '../config/cli/types/cliConfig.js'\nexport {type UserViteConfig} from '../config/cli/types/userViteConfig.js'\nexport {type ApplicationType, isWorkbenchApp} 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 {type ProjectRootResult} from '../config/util/recursivelyResolveProjectRoot.js'\nexport {NonInteractiveError} from '../errors/NonInteractiveError.js'\nexport {isNotFoundError, NotFoundError} from '../errors/NotFoundError.js'\nexport {\n isProjectRootNotFoundError,\n ProjectRootNotFoundError,\n} from '../errors/ProjectRootNotFoundError.js'\nexport {exitCodes} from '../exitCodes.js'\nexport {createStudioWorker, studioWorkerTask} from '../loaders/studio/studioWorkerTask.js'\nexport {tsxWorkerTask} from '../loaders/tsx/tsxWorkerTask.js'\nexport {SanityCommand, type SanityCommandInterface} from '../SanityCommand.js'\nexport {\n clearCliTelemetry,\n CLI_TELEMETRY_SYMBOL,\n getCliTelemetry,\n reportCliTraceError,\n setCliTelemetry,\n} from '../telemetry/getCliTelemetry.js'\nexport {getTelemetryBaseInfo} from '../telemetry/getTelemetryBaseInfo.js'\nexport {noopLogger} from '../telemetry/noopTelemetry.js'\nexport {\n type CLITelemetryStore,\n type ConsentInformation,\n type TelemetryUserProperties,\n} from '../telemetry/types.js'\nexport {type Output, type RequireProps, type SanityOrgUser} from '../types.js'\nexport {doImport} from '../util/doImport.js'\nexport {mockBrowserEnvironment} from '../util/environment/mockBrowserEnvironment.js'\nexport {getLocalPackageDir, getLocalPackageVersion} from '../util/getLocalPackageVersion.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'\nexport {importModule} from '../util/importModule.js'\nexport {isCi} from '../util/isCi.js'\nexport {isInteractive} from '../util/isInteractive.js'\nexport {isStaging} from '../util/isStaging.js'\nexport {normalizePath} from '../util/normalizePath.js'\nexport {promisifyWorker} from '../util/promisifyWorker.js'\nexport {\n type PackageJson,\n readPackageJson,\n type ReadPackageJsonOptions,\n} from '../util/readPackageJson.js'\nexport {\n resolveLocalPackage,\n resolveLocalPackageFrom,\n resolveLocalPackagePath,\n} from '../util/resolveLocalPackage.js'\nexport {safeStructuredClone} from '../util/safeStructuredClone.js'\nexport {colorizeJson} from '../ux/colorizeJson.js'\nexport {getTimer} from '../ux/timer.js'\nexport {debug, subdebug} from './debug.js'\nexport {\n type CoreAppManifest,\n coreAppManifestSchema,\n type StudioManifest,\n studioManifestSchema,\n} from './schemas.js'\n"],"names":["getGlobalCliClient","getProjectCliClient","clearCliTokenCache","getCliToken","getCliTokenInfo","getCliUserConfig","getUserConfig","setCliUserConfig","getCliConfig","getCliConfigUncached","getCliConfigSync","APP_VISIBILITIES","isWorkbenchApp","findProjectRoot","findProjectRootSync","getStudioConfig","getStudioWorkspaces","isStudioConfig","findPathForFiles","findStudioConfigPath","tryFindStudioConfigPath","NonInteractiveError","isNotFoundError","NotFoundError","isProjectRootNotFoundError","ProjectRootNotFoundError","exitCodes","createStudioWorker","studioWorkerTask","tsxWorkerTask","SanityCommand","clearCliTelemetry","CLI_TELEMETRY_SYMBOL","getCliTelemetry","reportCliTraceError","setCliTelemetry","getTelemetryBaseInfo","noopLogger","doImport","mockBrowserEnvironment","getLocalPackageDir","getLocalPackageVersion","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace","importModule","isCi","isInteractive","isStaging","normalizePath","promisifyWorker","readPackageJson","resolveLocalPackage","resolveLocalPackageFrom","resolveLocalPackagePath","safeStructuredClone","colorizeJson","getTimer","debug","subdebug","coreAppManifestSchema","studioManifestSchema"],"mappings":"AAAA,uCAAuC;AACvC,mDAAmD;AACnD,+PAA+P;AAC/P,2LAA2L;AAC3L,SACEA,kBAAkB,EAClBC,mBAAmB,QAGd,kBAAiB;AACxB,SACEC,kBAAkB,EAElBC,WAAW,EACXC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,iCAAgC;AACvC,SAAQC,YAAY,EAAEC,oBAAoB,QAAO,gCAA+B;AAChF,SAAQ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C9C,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAEEC,eAAe,QAEV,6BAA4B;AACnC,SACEC,mBAAmB,EACnBC,uBAAuB,EACvBC,uBAAuB,QAClB,iCAAgC;AACvC,SAAQC,mBAAmB,QAAO,iCAAgC;AAClE,SAAQC,YAAY,QAAO,wBAAuB;AAClD,SAAQC,QAAQ,QAAO,iBAAgB;AACvC,SAAQC,KAAK,EAAEC,QAAQ,QAAO,aAAY;AAC1C,SAEEC,qBAAqB,EAErBC,oBAAoB,QACf,eAAc"}
|
|
@@ -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-PPIe9Jz0.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, i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as UserViteConfig } from "../cliConfig-
|
|
1
|
+
import { a as ReactCompilerConfig, i as ConfigStore, o as TypeGenConfig, r as CliConfig, s as UserViteConfig } from "../cliConfig-DUt8uaF6.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-CwJLTYDj.js";
|
|
5
5
|
import { SanityCommandInterface } from "../SanityCommand.js";
|
|
6
|
-
import { t as ApplicationType } from "../workbenchApp-
|
|
6
|
+
import { t as ApplicationType } from "../workbenchApp-BkQHUXxH.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-PPIe9Jz0.js";
|
|
9
9
|
export type { ApplicationType, CLITelemetryStore, CliConfig, ConfigStore, ConsentInformation, CoreAppManifest, Output, PackageJson, ProjectRootResult, ReactCompilerConfig, ReadPackageJsonOptions, RequireProps, SanityCommandInterface, SanityOrgUser, StudioManifest, TelemetryUserProperties, TypeGenConfig, UserViteConfig };
|
|
@@ -5,6 +5,27 @@ import { ConfigEnv, InlineConfig } from "vite";
|
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
7
|
type UserViteConfig = ((config: InlineConfig, env: ConfigEnv) => InlineConfig | Promise<InlineConfig>) | InlineConfig;
|
|
8
|
+
/**
|
|
9
|
+
* An optional peer dependency's options type, or `unknown` when the peer's
|
|
10
|
+
* typings did not resolve.
|
|
11
|
+
*
|
|
12
|
+
* `babel-plugin-react-compiler` and `oxc-transform-react` are optional peer
|
|
13
|
+
* dependencies, so the type-only imports above only resolve in projects that
|
|
14
|
+
* install them. When one is missing, TypeScript degrades its import to `any`
|
|
15
|
+
* (the unresolved-module error is suppressed inside declaration files under
|
|
16
|
+
* `skipLibCheck`), and intersecting `any` into a {@link ReactCompilerConfig}
|
|
17
|
+
* branch would collapse the whole union to `any` — silently disabling type
|
|
18
|
+
* checking of the `reactCompiler` option, including for the compiler that IS
|
|
19
|
+
* installed. Mapping a missing peer's options to `unknown` (the identity
|
|
20
|
+
* under intersection) instead reduces that branch to just its `transform`
|
|
21
|
+
* discriminator, keeping the other branch fully checked.
|
|
22
|
+
*
|
|
23
|
+
* `unknown extends T` is only true when `T` degraded to `any`/`unknown`;
|
|
24
|
+
* resolved options types pass through untouched. (`0 extends 1 & T` — the
|
|
25
|
+
* usual any-detector — does not work here: an unresolved import produces the
|
|
26
|
+
* checker's error type, which that intersection propagates.)
|
|
27
|
+
*/
|
|
28
|
+
type OptionalPeerOptions<T> = unknown extends T ? unknown : T;
|
|
8
29
|
/**
|
|
9
30
|
* Configuration for React Compiler.
|
|
10
31
|
*
|
|
@@ -18,11 +39,15 @@ type UserViteConfig = ((config: InlineConfig, env: ConfigEnv) => InlineConfig |
|
|
|
18
39
|
* ({@link https://www.npmjs.com/package/oxc-transform-react | oxc-transform-react}
|
|
19
40
|
* must be installed in your project)
|
|
20
41
|
*
|
|
42
|
+
* Each branch's options are only type-checked when the corresponding package
|
|
43
|
+
* is installed; a missing package reduces its branch to just the `transform`
|
|
44
|
+
* discriminator.
|
|
45
|
+
*
|
|
21
46
|
* @public
|
|
22
47
|
*/
|
|
23
|
-
type ReactCompilerConfig = (PluginOptions & {
|
|
48
|
+
type ReactCompilerConfig = (OptionalPeerOptions<PluginOptions> & {
|
|
24
49
|
transform?: 'babel';
|
|
25
|
-
}) | (ReactCompilerOptions & {
|
|
50
|
+
}) | (OptionalPeerOptions<ReactCompilerOptions> & {
|
|
26
51
|
transform: 'oxc';
|
|
27
52
|
});
|
|
28
53
|
interface TypeGenConfig {
|
|
@@ -194,4 +219,4 @@ interface ConfigStore {
|
|
|
194
219
|
set: (key: string, value: unknown) => void;
|
|
195
220
|
}
|
|
196
221
|
export { ReactCompilerConfig as a, ConfigStore as i, AppVisibility as n, TypeGenConfig as o, CliConfig as r, UserViteConfig as s, APP_VISIBILITIES as t };
|
|
197
|
-
//# sourceMappingURL=cliConfig-
|
|
222
|
+
//# sourceMappingURL=cliConfig-DUt8uaF6.d.ts.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Module-level cache for the CLI auth token, shared between
|
|
3
|
-
* `
|
|
2
|
+
* Module-level cache for the resolved CLI auth token, shared between
|
|
3
|
+
* `getCliTokenInfo` (reads/writes) and `setCliUserConfig` (invalidates).
|
|
4
4
|
*
|
|
5
5
|
* Extracted into its own module to avoid a circular dependency
|
|
6
6
|
* between `cliUserConfig.ts` and `getCliToken.ts`.
|
|
7
|
-
*/ let
|
|
8
|
-
export function
|
|
9
|
-
return
|
|
7
|
+
*/ let cachedTokenInfo;
|
|
8
|
+
export function getCachedTokenInfo() {
|
|
9
|
+
return cachedTokenInfo;
|
|
10
10
|
}
|
|
11
|
-
export function
|
|
12
|
-
|
|
11
|
+
export function setCachedTokenInfo(tokenInfo) {
|
|
12
|
+
cachedTokenInfo = tokenInfo;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Clear the in-process token cache so the next
|
|
15
|
+
* Clear the in-process token cache so the next token resolution
|
|
16
16
|
* re-reads from disk or the environment.
|
|
17
17
|
*
|
|
18
18
|
* Called automatically by `setCliUserConfig('authToken', ...)`.
|
|
19
19
|
*
|
|
20
20
|
* @internal
|
|
21
21
|
*/ export function clearCliTokenCache() {
|
|
22
|
-
|
|
22
|
+
cachedTokenInfo = undefined;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
//# sourceMappingURL=cliTokenCache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/cli/cliTokenCache.ts"],"sourcesContent":["/**\n * Module-level cache for the CLI auth token, shared between\n * `
|
|
1
|
+
{"version":3,"sources":["../../../src/config/cli/cliTokenCache.ts"],"sourcesContent":["/**\n * Module-level cache for the resolved CLI auth token, shared between\n * `getCliTokenInfo` (reads/writes) and `setCliUserConfig` (invalidates).\n *\n * Extracted into its own module to avoid a circular dependency\n * between `cliUserConfig.ts` and `getCliToken.ts`.\n */\nexport interface CliTokenInfo {\n source: string\n token: string\n}\n\nlet cachedTokenInfo: CliTokenInfo | undefined\n\nexport function getCachedTokenInfo(): CliTokenInfo | undefined {\n return cachedTokenInfo\n}\n\nexport function setCachedTokenInfo(tokenInfo: CliTokenInfo | undefined): void {\n cachedTokenInfo = tokenInfo\n}\n\n/**\n * Clear the in-process token cache so the next token resolution\n * re-reads from disk or the environment.\n *\n * Called automatically by `setCliUserConfig('authToken', ...)`.\n *\n * @internal\n */\nexport function clearCliTokenCache(): void {\n cachedTokenInfo = undefined\n}\n"],"names":["cachedTokenInfo","getCachedTokenInfo","setCachedTokenInfo","tokenInfo","clearCliTokenCache","undefined"],"mappings":"AAAA;;;;;;CAMC,GAMD,IAAIA;AAEJ,OAAO,SAASC;IACd,OAAOD;AACT;AAEA,OAAO,SAASE,mBAAmBC,SAAmC;IACpEH,kBAAkBG;AACpB;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC;IACdJ,kBAAkBK;AACpB"}
|
|
@@ -6,7 +6,7 @@ import { getCliExecutionContext } from '../../executionContext.js';
|
|
|
6
6
|
import { getSanityConfigDir } from '../../util/getSanityConfigDir.js';
|
|
7
7
|
import { readJsonFileSync } from '../../util/readJsonFileSync.js';
|
|
8
8
|
import { writeJsonFileSync } from '../../util/writeJsonFileSync.js';
|
|
9
|
-
import { clearCliTokenCache,
|
|
9
|
+
import { clearCliTokenCache, getCachedTokenInfo, setCachedTokenInfo } from './cliTokenCache.js';
|
|
10
10
|
// Re-export so existing consumers don't break
|
|
11
11
|
export { clearCliTokenCache } from './cliTokenCache.js';
|
|
12
12
|
// Only used for testing
|
|
@@ -14,30 +14,50 @@ export const _internals = {
|
|
|
14
14
|
getCliUserConfig
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Get the CLI authentication token
|
|
17
|
+
* Get the CLI authentication token selected for the current invocation.
|
|
18
18
|
*
|
|
19
19
|
* @returns A promise that resolves to a CLI token, or undefined if no token is found
|
|
20
20
|
* @internal
|
|
21
21
|
*/ export async function getCliToken() {
|
|
22
|
+
return (await getCliTokenInfo())?.token;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the CLI authentication token and where it was resolved from.
|
|
26
|
+
*
|
|
27
|
+
* @returns A promise that resolves to the token and its source, or undefined if no token is found
|
|
28
|
+
* @internal
|
|
29
|
+
*/ export async function getCliTokenInfo() {
|
|
22
30
|
// A per-invocation execution context token (e.g. per-request from an MCP
|
|
23
31
|
// server) takes precedence and must bypass the process-wide cache entirely:
|
|
24
32
|
// reading the cache would leak another invocation's token, and writing it
|
|
25
33
|
// would leak this one's.
|
|
26
34
|
const context = getCliExecutionContext();
|
|
27
|
-
if (context)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
if (context) {
|
|
36
|
+
return context.token === undefined ? undefined : {
|
|
37
|
+
source: 'CLI execution context',
|
|
38
|
+
token: context.token
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const cachedTokenInfo = getCachedTokenInfo();
|
|
42
|
+
if (cachedTokenInfo !== undefined) {
|
|
43
|
+
return cachedTokenInfo;
|
|
31
44
|
}
|
|
32
45
|
const token = process.env.SANITY_AUTH_TOKEN;
|
|
33
46
|
if (token) {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
const tokenInfo = {
|
|
48
|
+
source: 'SANITY_AUTH_TOKEN environment variable',
|
|
49
|
+
token: token.trim()
|
|
50
|
+
};
|
|
51
|
+
setCachedTokenInfo(tokenInfo);
|
|
52
|
+
return tokenInfo;
|
|
37
53
|
}
|
|
38
54
|
const configToken = _internals.getCliUserConfig('authToken');
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
const tokenInfo = configToken === undefined ? undefined : {
|
|
56
|
+
source: getCliUserConfigPath(),
|
|
57
|
+
token: configToken
|
|
58
|
+
};
|
|
59
|
+
setCachedTokenInfo(tokenInfo);
|
|
60
|
+
return tokenInfo;
|
|
41
61
|
}
|
|
42
62
|
const cliUserConfigSchema = {
|
|
43
63
|
authToken: z.optional(z.string())
|
|
@@ -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 {clearCliTokenCache, getCachedToken, setCachedToken} 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'\n\n// Only used for testing\nexport const _internals = {\n getCliUserConfig,\n}\n\n/**\n * Get the CLI authentication token from the environment or the config file\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 // 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) return context.token\n\n const cached = getCachedToken()\n if (cached !== undefined) {\n return cached\n }\n\n const token = process.env.SANITY_AUTH_TOKEN\n if (token) {\n const trimmed = token.trim()\n setCachedToken(trimmed)\n return trimmed\n }\n\n const configToken = _internals.getCliUserConfig('authToken')\n setCachedToken(configToken)\n return configToken\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","getCachedToken","setCachedToken","_internals","getCliUserConfig","getCliToken","context","token","cached","undefined","process","env","SANITY_AUTH_TOKEN","trimmed","trim","configToken","cliUserConfigSchema","authToken","optional","string","setCliUserConfig","prop","value","assertCanAccessHostUserConfig","config","readConfig","result","safeParse","success","message","error","issues","map","path","Error","configPath","getCliUserConfigPath","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,4BAA2B;AAChE,SAAQC,kBAAkB,QAAO,mCAAkC;AACnE,SAAQC,gBAAgB,QAAO,iCAAgC;AAC/D,SAAQC,iBAAiB,QAAO,kCAAiC;AACjE,SAAQC,kBAAk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aAAa5C;QAC3B;IACF;AACF;AAEA,SAASuB;IACP,IAAI3B,0BAA0B;QAC5B,MAAM,IAAIsC,MAAM;IAClB;AACF;AAEA;;;;;;;;CAQC,GACD,SAAST;IACP,IAAI;QACF,MAAMD,SAAS1B,iBAAiBsC;QAChC,IAAI,CAACZ,UAAU,OAAOA,WAAW,YAAYuB,MAAMC,OAAO,CAACxB,SAAS;YAClE,MAAM,IAAIU,MAAM;QAClB;QACA,OAAOV;IACT,EAAE,OAAOyB,KAAc;QACrBtD,MAAM,sCAAsCsD,eAAef,QAAQe,IAAIpB,OAAO,GAAG,GAAGoB,KAAK;QACzF,OAAO,CAAC;IACV;AACF;AAEA;;;;;;;CAOC,GACD,SAASb;IACP,OAAO1B,QAAQC,GAAG,CAACuC,sBAAsB,IAAIzD,SAASI,sBAAsB;AAC9E"}
|
|
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,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,kB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,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 +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 * 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 * @public\n */\nexport type ReactCompilerConfig =\n | (BabelReactCompilerOptions & {transform?: 'babel'})\n | (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 * 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 /**\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":"
|
|
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 * 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 /**\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":"AA0DA;;;;CAIC,GACD,OAAO,MAAMA,mBAAmB;IAAC;IAAW;IAAY;CAAW,CAAS"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import { i as ConfigStore, r as CliConfig } from "./cliConfig-
|
|
1
|
+
import { i as ConfigStore, r as CliConfig } from "./cliConfig-DUt8uaF6.js";
|
|
2
2
|
import { t as ProjectRootResult } from "./recursivelyResolveProjectRoot-BE54uEP6.js";
|
|
3
3
|
import { z } from "zod/mini";
|
|
4
4
|
import { Workspace } from "sanity";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Module-level cache for the resolved CLI auth token, shared between
|
|
7
|
+
* `getCliTokenInfo` (reads/writes) and `setCliUserConfig` (invalidates).
|
|
8
|
+
*
|
|
9
|
+
* Extracted into its own module to avoid a circular dependency
|
|
10
|
+
* between `cliUserConfig.ts` and `getCliToken.ts`.
|
|
11
|
+
*/
|
|
12
|
+
interface CliTokenInfo {
|
|
13
|
+
source: string;
|
|
14
|
+
token: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Clear the in-process token cache so the next token resolution
|
|
7
18
|
* re-reads from disk or the environment.
|
|
8
19
|
*
|
|
9
20
|
* Called automatically by `setCliUserConfig('authToken', ...)`.
|
|
@@ -12,12 +23,19 @@ import { Workspace } from "sanity";
|
|
|
12
23
|
*/
|
|
13
24
|
declare function clearCliTokenCache(): void;
|
|
14
25
|
/**
|
|
15
|
-
* Get the CLI authentication token
|
|
26
|
+
* Get the CLI authentication token selected for the current invocation.
|
|
16
27
|
*
|
|
17
28
|
* @returns A promise that resolves to a CLI token, or undefined if no token is found
|
|
18
29
|
* @internal
|
|
19
30
|
*/
|
|
20
31
|
declare function getCliToken(): Promise<string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the CLI authentication token and where it was resolved from.
|
|
34
|
+
*
|
|
35
|
+
* @returns A promise that resolves to the token and its source, or undefined if no token is found
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
declare function getCliTokenInfo(): Promise<CliTokenInfo | undefined>;
|
|
21
39
|
/**
|
|
22
40
|
* Set the config value for the given property.
|
|
23
41
|
* Validates that the passed value adheres to the defined CLI config schema.
|
|
@@ -261,5 +279,5 @@ declare function findStudioConfigPath(basePath: string): Promise<string>;
|
|
|
261
279
|
* @internal
|
|
262
280
|
*/
|
|
263
281
|
declare function tryFindStudioConfigPath(basePath: string): Promise<string | undefined>;
|
|
264
|
-
export { getStudioWorkspaces as a, findProjectRoot as c, getCliConfigUncached as d, getCliToken as f,
|
|
265
|
-
//# sourceMappingURL=findStudioConfigPath-
|
|
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-BV4DCesQ.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ReactCompilerConfig, o as TypeGenConfig, s as UserViteConfig } from "./cliConfig-
|
|
1
|
+
import { a as ReactCompilerConfig, o as TypeGenConfig, s as UserViteConfig } from "./cliConfig-DUt8uaF6.js";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
@@ -97,4 +97,4 @@ type CoreAppManifest = z.infer<typeof coreAppManifestSchema>;
|
|
|
97
97
|
declare const studioManifestSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
98
98
|
type StudioManifest = z.infer<typeof studioManifestSchema>;
|
|
99
99
|
export { cliConfigSchema as a, studioManifestSchema as i, StudioManifest as n, coreAppManifestSchema as r, CoreAppManifest as t };
|
|
100
|
-
//# sourceMappingURL=schemas-
|
|
100
|
+
//# sourceMappingURL=schemas-PPIe9Jz0.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CliConfig } from "./cliConfig-
|
|
1
|
+
import { r as CliConfig } from "./cliConfig-DUt8uaF6.js";
|
|
2
2
|
/**
|
|
3
3
|
* Boolean brand check — used for config-load routing, kept exported for
|
|
4
4
|
* backward compatibility. For the typed narrowing (the app's declared fields),
|
|
@@ -19,4 +19,4 @@ type ApplicationType = (typeof APPLICATION_TYPES)[number];
|
|
|
19
19
|
*/
|
|
20
20
|
declare function parseWorkbenchCliConfig(cliConfig: unknown, projectDir: string): CliConfig;
|
|
21
21
|
export { isWorkbenchApp as n, parseWorkbenchCliConfig as r, ApplicationType as t };
|
|
22
|
-
//# sourceMappingURL=workbenchApp-
|
|
22
|
+
//# sourceMappingURL=workbenchApp-BkQHUXxH.d.ts.map
|