@sanity/cli-core 2.3.0 → 2.5.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 +13 -1
- package/dist/_exports/config.d.ts +13 -1
- package/dist/_exports/index.d.ts +35 -8
- package/dist/_exports/index.js +1 -0
- package/dist/_exports/index.js.map +1 -1
- package/dist/_exports/package-manager.d.ts +1 -2
- package/dist/_exports/schemas.d.ts +8 -0
- package/dist/_exports/tasks.d.ts +6 -6
- package/dist/_exports/types.d.ts +14 -1
- package/dist/_exports/undeploy.d.ts +74 -0
- package/dist/_exports/undeploy.js +13 -0
- package/dist/_exports/undeploy.js.map +1 -0
- package/dist/_exports/util.d.ts +5 -0
- package/dist/_exports/util.js +1 -0
- package/dist/_exports/util.js.map +1 -1
- package/dist/_exports/ux.d.ts +1 -2
- package/dist/config/cli/schemas.js +3 -1
- package/dist/config/cli/schemas.js.map +1 -1
- package/dist/config/cli/types/cliConfig.js +7 -5
- package/dist/config/cli/types/cliConfig.js.map +1 -1
- package/dist/loaders/studio/studioWorkerLifecycle.js +85 -0
- package/dist/loaders/studio/studioWorkerLifecycle.js.map +1 -0
- package/dist/loaders/studio/studioWorkerLoader.worker.js +86 -54
- package/dist/loaders/studio/studioWorkerLoader.worker.js.map +1 -1
- package/dist/loaders/studio/studioWorkerTask.js +17 -1
- package/dist/loaders/studio/studioWorkerTask.js.map +1 -1
- package/dist/manifest.js +1 -0
- package/dist/manifest.js.map +1 -1
- package/dist/util/getCoreAppUrl.js +6 -0
- package/dist/util/getCoreAppUrl.js.map +1 -0
- package/dist/util/promisifyWorker.js +21 -6
- package/dist/util/promisifyWorker.js.map +1 -1
- package/package.json +17 -13
package/dist/SanityCommand.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ import { Interfaces } from "@oclif/core";
|
|
|
7
7
|
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
8
8
|
import { SanityClient } from "sanity";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Dashboard visibility an application can declare. Mirrors Brett's canonical
|
|
12
|
+
* `VISIBILITIES` — the source of truth lives in the application service.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
declare const APP_VISIBILITIES: readonly ["default", "unlisted", "disabled"];
|
|
16
|
+
|
|
17
|
+
/** @public */
|
|
18
|
+
declare type AppVisibility = (typeof APP_VISIBILITIES)[number];
|
|
19
|
+
|
|
10
20
|
declare type Args<T extends typeof Command> = Interfaces.InferredArgs<
|
|
11
21
|
T["args"]
|
|
12
22
|
>;
|
|
@@ -39,6 +49,8 @@ declare interface CliConfig {
|
|
|
39
49
|
priority?: number;
|
|
40
50
|
/** The title of the custom app, as it is seen in Dashboard UI */
|
|
41
51
|
title?: string;
|
|
52
|
+
/** Dashboard visibility of the application. Defaults to `default`. */
|
|
53
|
+
visibility?: AppVisibility;
|
|
42
54
|
};
|
|
43
55
|
/** @deprecated Use deployment.autoUpdates */
|
|
44
56
|
autoUpdates?: boolean;
|
|
@@ -81,7 +93,7 @@ declare interface CliConfig {
|
|
|
81
93
|
basePath?: string;
|
|
82
94
|
};
|
|
83
95
|
/** Configuration options for React Compiler */
|
|
84
|
-
reactCompiler?: PluginOptions;
|
|
96
|
+
reactCompiler?: boolean | PluginOptions;
|
|
85
97
|
/** 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. */
|
|
86
98
|
reactStrictMode?: boolean;
|
|
87
99
|
/**
|
|
@@ -4,6 +4,16 @@ import { PluginOptions } from "babel-plugin-react-compiler";
|
|
|
4
4
|
import { Workspace } from "sanity";
|
|
5
5
|
import { z } from "zod/mini";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Dashboard visibility an application can declare. Mirrors Brett's canonical
|
|
9
|
+
* `VISIBILITIES` — the source of truth lives in the application service.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
declare const APP_VISIBILITIES: readonly ["default", "unlisted", "disabled"];
|
|
13
|
+
|
|
14
|
+
/** @public */
|
|
15
|
+
declare type AppVisibility = (typeof APP_VISIBILITIES)[number];
|
|
16
|
+
|
|
7
17
|
/**
|
|
8
18
|
* Clear the in-process token cache so the next `getCliToken()` call
|
|
9
19
|
* re-reads from disk or the environment.
|
|
@@ -42,6 +52,8 @@ export declare interface CliConfig {
|
|
|
42
52
|
priority?: number;
|
|
43
53
|
/** The title of the custom app, as it is seen in Dashboard UI */
|
|
44
54
|
title?: string;
|
|
55
|
+
/** Dashboard visibility of the application. Defaults to `default`. */
|
|
56
|
+
visibility?: AppVisibility;
|
|
45
57
|
};
|
|
46
58
|
/** @deprecated Use deployment.autoUpdates */
|
|
47
59
|
autoUpdates?: boolean;
|
|
@@ -84,7 +96,7 @@ export declare interface CliConfig {
|
|
|
84
96
|
basePath?: string;
|
|
85
97
|
};
|
|
86
98
|
/** Configuration options for React Compiler */
|
|
87
|
-
reactCompiler?: PluginOptions;
|
|
99
|
+
reactCompiler?: boolean | PluginOptions;
|
|
88
100
|
/** 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. */
|
|
89
101
|
reactStrictMode?: boolean;
|
|
90
102
|
/**
|
package/dist/_exports/index.d.ts
CHANGED
|
@@ -11,10 +11,21 @@ import { SanityClient } from "@sanity/client";
|
|
|
11
11
|
import { SanityClient as SanityClient_2 } from "sanity";
|
|
12
12
|
import { URL as URL_2 } from "node:url";
|
|
13
13
|
import { Worker as Worker_2 } from "node:worker_threads";
|
|
14
|
-
import { WorkerOptions
|
|
14
|
+
import { WorkerOptions } from "node:worker_threads";
|
|
15
15
|
import { Workspace } from "sanity";
|
|
16
16
|
import { z } from "zod/mini";
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Dashboard visibility an application can declare. Mirrors Brett's canonical
|
|
20
|
+
* `VISIBILITIES` — the source of truth lives in the application service.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare const APP_VISIBILITIES: readonly [
|
|
24
|
+
"default",
|
|
25
|
+
"unlisted",
|
|
26
|
+
"disabled",
|
|
27
|
+
];
|
|
28
|
+
|
|
18
29
|
declare const APPLICATION_TYPES: readonly [
|
|
19
30
|
"coreApp",
|
|
20
31
|
"studio",
|
|
@@ -26,6 +37,9 @@ declare const APPLICATION_TYPES: readonly [
|
|
|
26
37
|
/** The resolved kind of a workbench app — `studio` or one of the SDK app types. */
|
|
27
38
|
export declare type ApplicationType = (typeof APPLICATION_TYPES)[number];
|
|
28
39
|
|
|
40
|
+
/** @public */
|
|
41
|
+
export declare type AppVisibility = (typeof APP_VISIBILITIES)[number];
|
|
42
|
+
|
|
29
43
|
declare type Args<T extends typeof Command> = Interfaces.InferredArgs<
|
|
30
44
|
T["args"]
|
|
31
45
|
>;
|
|
@@ -81,6 +95,8 @@ export declare interface CliConfig {
|
|
|
81
95
|
priority?: number;
|
|
82
96
|
/** The title of the custom app, as it is seen in Dashboard UI */
|
|
83
97
|
title?: string;
|
|
98
|
+
/** Dashboard visibility of the application. Defaults to `default`. */
|
|
99
|
+
visibility?: AppVisibility;
|
|
84
100
|
};
|
|
85
101
|
/** @deprecated Use deployment.autoUpdates */
|
|
86
102
|
autoUpdates?: boolean;
|
|
@@ -123,7 +139,7 @@ export declare interface CliConfig {
|
|
|
123
139
|
basePath?: string;
|
|
124
140
|
};
|
|
125
141
|
/** Configuration options for React Compiler */
|
|
126
|
-
reactCompiler?: PluginOptions;
|
|
142
|
+
reactCompiler?: boolean | PluginOptions;
|
|
127
143
|
/** 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. */
|
|
128
144
|
reactStrictMode?: boolean;
|
|
129
145
|
/**
|
|
@@ -251,6 +267,7 @@ export declare const coreAppManifestSchema: z.ZodMiniObject<
|
|
|
251
267
|
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
252
268
|
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
253
269
|
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
270
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
254
271
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
255
272
|
version: z.ZodMiniString<string>;
|
|
256
273
|
},
|
|
@@ -992,7 +1009,8 @@ export declare interface ProjectRootResult {
|
|
|
992
1009
|
* Creates a Node.js Worker from the given file path and options, and wraps it
|
|
993
1010
|
* in a Promise that resolves with the first message the worker sends, and
|
|
994
1011
|
* rejects on error, message deserialization failure, or non-zero exit code.
|
|
995
|
-
*
|
|
1012
|
+
* By default, the worker is terminated after a message or error is received.
|
|
1013
|
+
* Callers can instead unref it and allow natural process teardown.
|
|
996
1014
|
*
|
|
997
1015
|
* @param filePath - URL to the worker file
|
|
998
1016
|
* @param options - Options to pass to the Worker constructor
|
|
@@ -1005,8 +1023,17 @@ export declare function promisifyWorker<T = unknown>(
|
|
|
1005
1023
|
options?: PromisifyWorkerOptions,
|
|
1006
1024
|
): Promise<T>;
|
|
1007
1025
|
|
|
1008
|
-
declare interface PromisifyWorkerOptions extends
|
|
1009
|
-
/**
|
|
1026
|
+
declare interface PromisifyWorkerOptions extends WorkerOptions {
|
|
1027
|
+
/**
|
|
1028
|
+
* Whether to forcibly terminate the worker after settling. Disable this for
|
|
1029
|
+
* workers that host native addons (e.g. rolldown via Vite 8) whose threads
|
|
1030
|
+
* must tear down with the process: terminating such a worker while native
|
|
1031
|
+
* threads are live can abort the whole process with a silent SIGABRT. A
|
|
1032
|
+
* disabled worker is unrefed and may continue running until the process
|
|
1033
|
+
* exits, including after a timeout.
|
|
1034
|
+
*/
|
|
1035
|
+
terminateOnSettle?: boolean;
|
|
1036
|
+
/** Optional timeout in milliseconds. If the worker does not respond within this time, the promise is rejected. */
|
|
1010
1037
|
timeout?: number;
|
|
1011
1038
|
}
|
|
1012
1039
|
|
|
@@ -1492,11 +1519,11 @@ export declare function studioWorkerTask<T = unknown>(
|
|
|
1492
1519
|
* @internal
|
|
1493
1520
|
*/
|
|
1494
1521
|
declare interface StudioWorkerTaskOptions extends RequireProps<
|
|
1495
|
-
|
|
1522
|
+
WorkerOptions,
|
|
1496
1523
|
"name"
|
|
1497
1524
|
> {
|
|
1498
1525
|
studioRootPath: string;
|
|
1499
|
-
/** Optional timeout in milliseconds. If the worker does not respond within this time,
|
|
1526
|
+
/** Optional timeout in milliseconds. If the worker does not respond within this time, the promise is rejected. */
|
|
1500
1527
|
timeout?: number;
|
|
1501
1528
|
}
|
|
1502
1529
|
|
|
@@ -1607,7 +1634,7 @@ export declare function tsxWorkerTask<T = unknown>(
|
|
|
1607
1634
|
* @internal
|
|
1608
1635
|
*/
|
|
1609
1636
|
declare interface TsxWorkerTaskOptions extends RequireProps<
|
|
1610
|
-
|
|
1637
|
+
WorkerOptions,
|
|
1611
1638
|
"name"
|
|
1612
1639
|
> {
|
|
1613
1640
|
rootPath: string;
|
package/dist/_exports/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { getGlobalCliClient, getProjectCliClient } from '../apiClient.js';
|
|
|
6
6
|
export { clearCliTokenCache, getCliToken, 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
|
+
export { APP_VISIBILITIES } from '../config/cli/types/cliConfig.js';
|
|
9
10
|
export { isWorkbenchApp } from '../config/cli/workbenchApp.js';
|
|
10
11
|
export { findProjectRoot } from '../config/findProjectRoot.js';
|
|
11
12
|
export { findProjectRootSync } from '../config/findProjectRootSync.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 {type CliConfig
|
|
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,EAClBC,WAAW,EACXC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,QACX,iCAAgC;AACvC,SAAQC,YAAY,EAAEC,oBAAoB,QAAO,gCAA+B;AAChF,SAAQC,gBAAgB,QAAO,oCAAmC;AAClE,SACEC,gBAAgB,QAIX,mCAAkC;AAEzC,SAA8BC,cAAc,QAAO,gCAA+B;AAClF,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;AAEpG,SAAQC,mBAAmB,QAAO,mCAAkC;AACpE,SAAQC,eAAe,EAAEC,aAAa,QAAO,6BAA4B;AACzE,SACEC,0BAA0B,EAC1BC,wBAAwB,QACnB,wCAAuC;AAC9C,SAAQC,SAAS,QAAO,kBAAiB;AACzC,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,wCAAuC;AAC1F,SAAQC,aAAa,QAAO,kCAAiC;AAC7D,SAAQC,aAAa,QAAoC,sBAAqB;AAC9E,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,EACfC,mBAAmB,EACnBC,eAAe,QACV,kCAAiC;AACxC,SAAQC,oBAAoB,QAAO,uCAAsC;AACzE,SAAQC,UAAU,QAAO,gCAA+B;AAOxD,SAAQC,QAAQ,QAAO,sBAAqB;AAC5C,SAAQC,sBAAsB,QAAO,gDAA+C;AACpF,SAAQC,kBAAkB,EAAEC,sBAAsB,QAAO,oCAAmC;AAC5F,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,gCAA+B;AAClF,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,IAAI,QAAO,kBAAiB;AACpC,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,SAAS,QAAO,uBAAsB;AAC9C,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"}
|
|
@@ -49,8 +49,7 @@ export declare function getLocalPackageVersion(
|
|
|
49
49
|
* the detected package manager.
|
|
50
50
|
*/
|
|
51
51
|
export declare function getRunningPackageManager():
|
|
52
|
-
|
|
|
53
|
-
| undefined;
|
|
52
|
+
DetectedPackageManager | undefined;
|
|
54
53
|
|
|
55
54
|
/**
|
|
56
55
|
* Extract the yarn major version from a `npm_config_user_agent` string.
|
|
@@ -27,6 +27,13 @@ export declare const cliConfigSchema: z.ZodMiniObject<
|
|
|
27
27
|
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
28
|
organizationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
29
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
+
visibility: z.ZodMiniOptional<
|
|
31
|
+
z.ZodMiniEnum<{
|
|
32
|
+
default: "default";
|
|
33
|
+
unlisted: "unlisted";
|
|
34
|
+
disabled: "disabled";
|
|
35
|
+
}>
|
|
36
|
+
>;
|
|
30
37
|
},
|
|
31
38
|
z.core.$strip
|
|
32
39
|
>
|
|
@@ -187,6 +194,7 @@ export declare const coreAppManifestSchema: z.ZodMiniObject<
|
|
|
187
194
|
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
188
195
|
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
189
196
|
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
197
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
190
198
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
191
199
|
version: z.ZodMiniString<string>;
|
|
192
200
|
},
|
package/dist/_exports/tasks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URL as URL_2 } from "node:url";
|
|
2
|
-
import { Worker
|
|
3
|
-
import { WorkerOptions
|
|
2
|
+
import { Worker } from "node:worker_threads";
|
|
3
|
+
import { WorkerOptions } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new worker for a studio worker task.
|
|
@@ -33,7 +33,7 @@ import { WorkerOptions as WorkerOptions_2 } from "node:worker_threads";
|
|
|
33
33
|
export declare function createStudioWorker(
|
|
34
34
|
filePath: URL,
|
|
35
35
|
options: StudioWorkerTaskOptions,
|
|
36
|
-
):
|
|
36
|
+
): Worker;
|
|
37
37
|
|
|
38
38
|
declare type RequireProps<T, K extends keyof T> = Omit<T, K> &
|
|
39
39
|
Required<Pick<T, K>>;
|
|
@@ -77,11 +77,11 @@ export declare function studioWorkerTask<T = unknown>(
|
|
|
77
77
|
* @internal
|
|
78
78
|
*/
|
|
79
79
|
declare interface StudioWorkerTaskOptions extends RequireProps<
|
|
80
|
-
|
|
80
|
+
WorkerOptions,
|
|
81
81
|
"name"
|
|
82
82
|
> {
|
|
83
83
|
studioRootPath: string;
|
|
84
|
-
/** Optional timeout in milliseconds. If the worker does not respond within this time,
|
|
84
|
+
/** Optional timeout in milliseconds. If the worker does not respond within this time, the promise is rejected. */
|
|
85
85
|
timeout?: number;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -111,7 +111,7 @@ export declare function tsxWorkerTask<T = unknown>(
|
|
|
111
111
|
* @internal
|
|
112
112
|
*/
|
|
113
113
|
declare interface TsxWorkerTaskOptions extends RequireProps<
|
|
114
|
-
|
|
114
|
+
WorkerOptions,
|
|
115
115
|
"name"
|
|
116
116
|
> {
|
|
117
117
|
rootPath: string;
|
package/dist/_exports/types.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ import { InlineConfig } from "vite";
|
|
|
4
4
|
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
5
5
|
import { z } from "zod/mini";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Dashboard visibility an application can declare. Mirrors Brett's canonical
|
|
9
|
+
* `VISIBILITIES` — the source of truth lives in the application service.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
declare const APP_VISIBILITIES: readonly ["default", "unlisted", "disabled"];
|
|
13
|
+
|
|
7
14
|
declare const APPLICATION_TYPES: readonly [
|
|
8
15
|
"coreApp",
|
|
9
16
|
"studio",
|
|
@@ -15,6 +22,9 @@ declare const APPLICATION_TYPES: readonly [
|
|
|
15
22
|
/** The resolved kind of a workbench app — `studio` or one of the SDK app types. */
|
|
16
23
|
export declare type ApplicationType = (typeof APPLICATION_TYPES)[number];
|
|
17
24
|
|
|
25
|
+
/** @public */
|
|
26
|
+
declare type AppVisibility = (typeof APP_VISIBILITIES)[number];
|
|
27
|
+
|
|
18
28
|
/**
|
|
19
29
|
* @public
|
|
20
30
|
*/
|
|
@@ -43,6 +53,8 @@ export declare interface CliConfig {
|
|
|
43
53
|
priority?: number;
|
|
44
54
|
/** The title of the custom app, as it is seen in Dashboard UI */
|
|
45
55
|
title?: string;
|
|
56
|
+
/** Dashboard visibility of the application. Defaults to `default`. */
|
|
57
|
+
visibility?: AppVisibility;
|
|
46
58
|
};
|
|
47
59
|
/** @deprecated Use deployment.autoUpdates */
|
|
48
60
|
autoUpdates?: boolean;
|
|
@@ -85,7 +97,7 @@ export declare interface CliConfig {
|
|
|
85
97
|
basePath?: string;
|
|
86
98
|
};
|
|
87
99
|
/** Configuration options for React Compiler */
|
|
88
|
-
reactCompiler?: PluginOptions;
|
|
100
|
+
reactCompiler?: boolean | PluginOptions;
|
|
89
101
|
/** 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. */
|
|
90
102
|
reactStrictMode?: boolean;
|
|
91
103
|
/**
|
|
@@ -211,6 +223,7 @@ declare const coreAppManifestSchema: z.ZodMiniObject<
|
|
|
211
223
|
group: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
212
224
|
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
213
225
|
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
226
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
214
227
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
215
228
|
version: z.ZodMiniString<string>;
|
|
216
229
|
},
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parts of an undeploy that differ per application backend. The shared
|
|
3
|
+
* sequence — mode selection, target reporting, confirmation, error handling —
|
|
4
|
+
* lives in the host CLI's runner; adapters only resolve and delete.
|
|
5
|
+
*/
|
|
6
|
+
export declare interface UndeployAdapter<
|
|
7
|
+
TTarget extends UndeployTarget = UndeployTarget,
|
|
8
|
+
> {
|
|
9
|
+
/** Resolves what an undeploy would delete; read-only. */
|
|
10
|
+
resolveTarget(): Promise<UndeployTargetResolution<TTarget>>;
|
|
11
|
+
type: "coreApp" | "studio";
|
|
12
|
+
/** Deletes the target — the only mutating step, never run on a dry run. */
|
|
13
|
+
undeploy(target: TTarget): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** An undeploy that deletes the application, along with all its deployments. */
|
|
17
|
+
export declare interface UndeployApplicationTarget extends UndeployTargetDetails {
|
|
18
|
+
deletes: "application";
|
|
19
|
+
id: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** An undeploy that deletes an installation's deployed config; the installation stays installed. */
|
|
23
|
+
export declare interface UndeployConfigTarget extends UndeployTargetDetails {
|
|
24
|
+
deletes: "config";
|
|
25
|
+
id: null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* What an undeploy deletes, resolved once and read by every report — the
|
|
30
|
+
* dry-run plan, the `--json` payloads, and the real run's confirmation prompt —
|
|
31
|
+
* so the human and machine outputs can't drift. Adapters may extend the
|
|
32
|
+
* variants with backend-specific fields; they serialize into `--json` as-is,
|
|
33
|
+
* except the report-only `summary`.
|
|
34
|
+
*/
|
|
35
|
+
export declare type UndeployTarget =
|
|
36
|
+
UndeployApplicationTarget | UndeployConfigTarget;
|
|
37
|
+
|
|
38
|
+
declare interface UndeployTargetDetails {
|
|
39
|
+
/** Details of the deployment currently being served; `null` when none is live. */
|
|
40
|
+
activeDeployment: {
|
|
41
|
+
deployedAt: string;
|
|
42
|
+
deployedBy: string;
|
|
43
|
+
} | null;
|
|
44
|
+
/** Hostname the application is served from; freed for anyone to claim after undeploy. */
|
|
45
|
+
appHost: string | null;
|
|
46
|
+
createdAt: string | null;
|
|
47
|
+
organizationId: string | null;
|
|
48
|
+
projectId: string | null;
|
|
49
|
+
title: string | null;
|
|
50
|
+
type: "coreApp" | "studio";
|
|
51
|
+
/** Where the deployed studio/app is currently reachable. */
|
|
52
|
+
url: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Adapter-authored report lines about what gets deleted (interfaces, config
|
|
55
|
+
* snapshots, …), rendered under the target details. Built from the same data
|
|
56
|
+
* the adapter puts on its target, so the report can't drift from the payload.
|
|
57
|
+
*/
|
|
58
|
+
summary?: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare type UndeployTargetResolution<
|
|
62
|
+
TTarget extends UndeployTarget = UndeployTarget,
|
|
63
|
+
> =
|
|
64
|
+
| {
|
|
65
|
+
message: string;
|
|
66
|
+
solution?: string;
|
|
67
|
+
type: "none";
|
|
68
|
+
}
|
|
69
|
+
| {
|
|
70
|
+
target: TTarget;
|
|
71
|
+
type: "found";
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an undeploy deletes, resolved once and read by every report — the
|
|
3
|
+
* dry-run plan, the `--json` payloads, and the real run's confirmation prompt —
|
|
4
|
+
* so the human and machine outputs can't drift. Adapters may extend the
|
|
5
|
+
* variants with backend-specific fields; they serialize into `--json` as-is,
|
|
6
|
+
* except the report-only `summary`.
|
|
7
|
+
*/ /**
|
|
8
|
+
* The parts of an undeploy that differ per application backend. The shared
|
|
9
|
+
* sequence — mode selection, target reporting, confirmation, error handling —
|
|
10
|
+
* lives in the host CLI's runner; adapters only resolve and delete.
|
|
11
|
+
*/ export { };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=undeploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/undeploy.ts"],"sourcesContent":["/**\n * What an undeploy deletes, resolved once and read by every report — the\n * dry-run plan, the `--json` payloads, and the real run's confirmation prompt —\n * so the human and machine outputs can't drift. Adapters may extend the\n * variants with backend-specific fields; they serialize into `--json` as-is,\n * except the report-only `summary`.\n */\nexport type UndeployTarget = UndeployApplicationTarget | UndeployConfigTarget\n\n/** An undeploy that deletes the application, along with all its deployments. */\nexport interface UndeployApplicationTarget extends UndeployTargetDetails {\n deletes: 'application'\n id: string\n}\n\n/** An undeploy that deletes an installation's deployed config; the installation stays installed. */\nexport interface UndeployConfigTarget extends UndeployTargetDetails {\n deletes: 'config'\n id: null\n}\n\ninterface UndeployTargetDetails {\n /** Details of the deployment currently being served; `null` when none is live. */\n activeDeployment: {deployedAt: string; deployedBy: string} | null\n /** Hostname the application is served from; freed for anyone to claim after undeploy. */\n appHost: string | null\n createdAt: string | null\n organizationId: string | null\n projectId: string | null\n title: string | null\n type: 'coreApp' | 'studio'\n /** Where the deployed studio/app is currently reachable. */\n url: string | null\n\n /**\n * Adapter-authored report lines about what gets deleted (interfaces, config\n * snapshots, …), rendered under the target details. Built from the same data\n * the adapter puts on its target, so the report can't drift from the payload.\n */\n summary?: string[]\n}\n\nexport type UndeployTargetResolution<TTarget extends UndeployTarget = UndeployTarget> =\n | {message: string; solution?: string; type: 'none'}\n | {target: TTarget; type: 'found'}\n\n/**\n * The parts of an undeploy that differ per application backend. The shared\n * sequence — mode selection, target reporting, confirmation, error handling —\n * lives in the host CLI's runner; adapters only resolve and delete.\n */\nexport interface UndeployAdapter<TTarget extends UndeployTarget = UndeployTarget> {\n /** Resolves what an undeploy would delete; read-only. */\n resolveTarget(): Promise<UndeployTargetResolution<TTarget>>\n type: 'coreApp' | 'studio'\n /** Deletes the target — the only mutating step, never run on a dry run. */\n undeploy(target: TTarget): Promise<void>\n}\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAwCD;;;;CAIC,GACD,WAMC"}
|
package/dist/_exports/util.d.ts
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function doImport(source: string): Promise<any>;
|
|
8
8
|
|
|
9
|
+
export declare function getCoreAppUrl(
|
|
10
|
+
organizationId: string,
|
|
11
|
+
appId: string,
|
|
12
|
+
): string;
|
|
13
|
+
|
|
9
14
|
/**
|
|
10
15
|
* Returns the base Sanity configuration directory for the current user.
|
|
11
16
|
* For persistent user settings (auth tokens, preferences, etc.).
|
package/dist/_exports/util.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Pure in-memory and zero dep utilities
|
|
2
2
|
//
|
|
3
3
|
export { doImport } from '../util/doImport.js';
|
|
4
|
+
export { getCoreAppUrl } from '../util/getCoreAppUrl.js';
|
|
4
5
|
export { getSanityConfigDir, getSanityDataDir } from '../util/getSanityConfigDir.js';
|
|
5
6
|
export { getSanityEnvVar } from '../util/getSanityEnvVar.js';
|
|
6
7
|
export { getSanityUrl } from '../util/getSanityUrl.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/util.ts"],"sourcesContent":["// Pure in-memory and zero dep utilities\n//\nexport {doImport} from '../util/doImport.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 {isTrueish} from '../util/isTrueish.js'\nexport {normalizePath} from '../util/normalizePath.js'\nexport {safeStructuredClone} from '../util/safeStructuredClone.js'\n"],"names":["doImport","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace","importModule","isCi","isInteractive","isStaging","isTrueish","normalizePath","safeStructuredClone"],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,SAAQA,QAAQ,QAAO,sBAAqB;AAC5C,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,gCAA+B;AAClF,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,IAAI,QAAO,kBAAiB;AACpC,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,SAAS,QAAO,uBAAsB;AAC9C,SAAQC,SAAS,QAAO,uBAAsB;AAC9C,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,mBAAmB,QAAO,iCAAgC"}
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/util.ts"],"sourcesContent":["// Pure in-memory and zero dep utilities\n//\nexport {doImport} from '../util/doImport.js'\nexport {getCoreAppUrl} from '../util/getCoreAppUrl.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 {isTrueish} from '../util/isTrueish.js'\nexport {normalizePath} from '../util/normalizePath.js'\nexport {safeStructuredClone} from '../util/safeStructuredClone.js'\n"],"names":["doImport","getCoreAppUrl","getSanityConfigDir","getSanityDataDir","getSanityEnvVar","getSanityUrl","getWorkspace","importModule","isCi","isInteractive","isStaging","isTrueish","normalizePath","safeStructuredClone"],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,SAAQA,QAAQ,QAAO,sBAAqB;AAC5C,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,kBAAkB,EAAEC,gBAAgB,QAAO,gCAA+B;AAClF,SAAQC,eAAe,QAAO,6BAA4B;AAC1D,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,YAAY,QAAO,0BAAyB;AACpD,SAAQC,IAAI,QAAO,kBAAiB;AACpC,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,SAAS,QAAO,uBAAsB;AAC9C,SAAQC,SAAS,QAAO,uBAAsB;AAC9C,SAAQC,aAAa,QAAO,2BAA0B;AACtD,SAAQC,mBAAmB,QAAO,iCAAgC"}
|
package/dist/_exports/ux.d.ts
CHANGED
|
@@ -24,8 +24,7 @@ export declare const checkbox: typeof inquirer.checkbox;
|
|
|
24
24
|
|
|
25
25
|
export declare function colorizeJson(input: unknown): string;
|
|
26
26
|
|
|
27
|
-
declare const
|
|
28
|
-
export { confirm_2 as confirm };
|
|
27
|
+
export declare const confirm: typeof inquirer.confirm;
|
|
29
28
|
|
|
30
29
|
export { CustomBorderStyle };
|
|
31
30
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod/mini';
|
|
2
|
+
import { APP_VISIBILITIES } from './types/cliConfig.js';
|
|
2
3
|
/**
|
|
3
4
|
* @public
|
|
4
5
|
*/ export const cliConfigSchema = z.object({
|
|
@@ -11,7 +12,8 @@ import { z } from 'zod/mini';
|
|
|
11
12
|
icon: z.optional(z.string()),
|
|
12
13
|
id: z.optional(z.string()),
|
|
13
14
|
organizationId: z.optional(z.string()),
|
|
14
|
-
title: z.optional(z.string())
|
|
15
|
+
title: z.optional(z.string()),
|
|
16
|
+
visibility: z.optional(z.enum(APP_VISIBILITIES))
|
|
15
17
|
})),
|
|
16
18
|
autoUpdates: z.optional(z.boolean()),
|
|
17
19
|
deployment: z.optional(z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {z} from 'zod/mini'\n\nimport {type CliConfig, type TypeGenConfig} from './types/cliConfig'\nimport {type UserViteConfig} from './types/userViteConfig'\n\n/**\n * @public\n */\nexport const cliConfigSchema = z.object({\n api: z.optional(\n z.object({\n dataset: z.optional(z.string()),\n projectId: z.optional(z.string()),\n }),\n ),\n\n app: z.optional(\n z.object({\n entry: z.optional(z.string()),\n icon: z.optional(z.string()),\n id: z.optional(z.string()),\n organizationId: z.optional(z.string()),\n title: z.optional(z.string()),\n }),\n ),\n\n autoUpdates: z.optional(z.boolean()),\n\n deployment: z.optional(\n z.object({\n appId: z.optional(z.string()),\n autoUpdates: z.optional(z.boolean()),\n }),\n ),\n\n graphql: z.optional(\n z.array(\n z.object({\n filterSuffix: z.optional(z.string()),\n generation: z.optional(z.enum(['gen1', 'gen2', 'gen3'])),\n id: z.optional(z.string()),\n nonNullDocumentFields: z.optional(z.boolean()),\n playground: z.optional(z.boolean()),\n source: z.optional(z.string()),\n tag: z.optional(z.string()),\n workspace: z.optional(z.string()),\n }),\n ),\n ),\n\n mediaLibrary: z.optional(\n z.object({\n aspectsPath: z.optional(z.string()),\n }),\n ),\n\n project: z.optional(\n z.object({\n basePath: z.optional(z.string()),\n }),\n ),\n\n reactCompiler: z.optional(z.custom<ReactCompilerConfig>()),\n\n reactStrictMode: z.optional(z.boolean()),\n\n schemaExtraction: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n enforceRequiredFields: z.optional(z.boolean()),\n path: z.optional(z.string()),\n watchPatterns: z.optional(z.array(z.string())),\n workspace: z.optional(z.string()),\n }),\n ),\n\n server: z.optional(\n z.object({\n hostname: z.optional(z.string()),\n port: z.optional(z.number()),\n }),\n ),\n\n studioHost: z.optional(z.string()),\n\n unstable_bundledDev: z.optional(z.boolean()),\n\n vite: z.optional(z.custom<UserViteConfig>()),\n\n typegen: z.optional(z.custom<Partial<TypeGenConfig> & {enabled?: boolean}>()),\n}) satisfies z.core.$ZodType<CliConfig>\n"],"names":["z","cliConfigSchema","object","api","optional","dataset","string","projectId","app","entry","icon","id","organizationId","title","autoUpdates","boolean","deployment","appId","graphql","array","filterSuffix","generation","
|
|
1
|
+
{"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {z} from 'zod/mini'\n\nimport {APP_VISIBILITIES, type CliConfig, type TypeGenConfig} from './types/cliConfig.js'\nimport {type UserViteConfig} from './types/userViteConfig'\n\n/**\n * @public\n */\nexport const cliConfigSchema = z.object({\n api: z.optional(\n z.object({\n dataset: z.optional(z.string()),\n projectId: z.optional(z.string()),\n }),\n ),\n\n app: z.optional(\n z.object({\n entry: z.optional(z.string()),\n icon: z.optional(z.string()),\n id: z.optional(z.string()),\n organizationId: z.optional(z.string()),\n title: z.optional(z.string()),\n visibility: z.optional(z.enum(APP_VISIBILITIES)),\n }),\n ),\n\n autoUpdates: z.optional(z.boolean()),\n\n deployment: z.optional(\n z.object({\n appId: z.optional(z.string()),\n autoUpdates: z.optional(z.boolean()),\n }),\n ),\n\n graphql: z.optional(\n z.array(\n z.object({\n filterSuffix: z.optional(z.string()),\n generation: z.optional(z.enum(['gen1', 'gen2', 'gen3'])),\n id: z.optional(z.string()),\n nonNullDocumentFields: z.optional(z.boolean()),\n playground: z.optional(z.boolean()),\n source: z.optional(z.string()),\n tag: z.optional(z.string()),\n workspace: z.optional(z.string()),\n }),\n ),\n ),\n\n mediaLibrary: z.optional(\n z.object({\n aspectsPath: z.optional(z.string()),\n }),\n ),\n\n project: z.optional(\n z.object({\n basePath: z.optional(z.string()),\n }),\n ),\n\n reactCompiler: z.optional(z.custom<ReactCompilerConfig>()),\n\n reactStrictMode: z.optional(z.boolean()),\n\n schemaExtraction: z.optional(\n z.object({\n enabled: z.optional(z.boolean()),\n enforceRequiredFields: z.optional(z.boolean()),\n path: z.optional(z.string()),\n watchPatterns: z.optional(z.array(z.string())),\n workspace: z.optional(z.string()),\n }),\n ),\n\n server: z.optional(\n z.object({\n hostname: z.optional(z.string()),\n port: z.optional(z.number()),\n }),\n ),\n\n studioHost: z.optional(z.string()),\n\n unstable_bundledDev: z.optional(z.boolean()),\n\n vite: z.optional(z.custom<UserViteConfig>()),\n\n typegen: z.optional(z.custom<Partial<TypeGenConfig> & {enabled?: boolean}>()),\n}) satisfies z.core.$ZodType<CliConfig>\n"],"names":["z","APP_VISIBILITIES","cliConfigSchema","object","api","optional","dataset","string","projectId","app","entry","icon","id","organizationId","title","visibility","enum","autoUpdates","boolean","deployment","appId","graphql","array","filterSuffix","generation","nonNullDocumentFields","playground","source","tag","workspace","mediaLibrary","aspectsPath","project","basePath","reactCompiler","custom","reactStrictMode","schemaExtraction","enabled","enforceRequiredFields","path","watchPatterns","server","hostname","port","number","studioHost","unstable_bundledDev","vite","typegen"],"mappings":"AACA,SAAQA,CAAC,QAAO,WAAU;AAE1B,SAAQC,gBAAgB,QAA2C,uBAAsB;AAGzF;;CAEC,GACD,OAAO,MAAMC,kBAAkBF,EAAEG,MAAM,CAAC;IACtCC,KAAKJ,EAAEK,QAAQ,CACbL,EAAEG,MAAM,CAAC;QACPG,SAASN,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC5BC,WAAWR,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAChC;IAGFE,KAAKT,EAAEK,QAAQ,CACbL,EAAEG,MAAM,CAAC;QACPO,OAAOV,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC1BI,MAAMX,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACzBK,IAAIZ,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACvBM,gBAAgBb,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACnCO,OAAOd,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC1BQ,YAAYf,EAAEK,QAAQ,CAACL,EAAEgB,IAAI,CAACf;IAChC;IAGFgB,aAAajB,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;IAEjCC,YAAYnB,EAAEK,QAAQ,CACpBL,EAAEG,MAAM,CAAC;QACPiB,OAAOpB,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC1BU,aAAajB,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;IACnC;IAGFG,SAASrB,EAAEK,QAAQ,CACjBL,EAAEsB,KAAK,CACLtB,EAAEG,MAAM,CAAC;QACPoB,cAAcvB,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACjCiB,YAAYxB,EAAEK,QAAQ,CAACL,EAAEgB,IAAI,CAAC;YAAC;YAAQ;YAAQ;SAAO;QACtDJ,IAAIZ,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACvBkB,uBAAuBzB,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAC3CQ,YAAY1B,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAChCS,QAAQ3B,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC3BqB,KAAK5B,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACxBsB,WAAW7B,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAChC;IAIJuB,cAAc9B,EAAEK,QAAQ,CACtBL,EAAEG,MAAM,CAAC;QACP4B,aAAa/B,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAClC;IAGFyB,SAAShC,EAAEK,QAAQ,CACjBL,EAAEG,MAAM,CAAC;QACP8B,UAAUjC,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAC/B;IAGF2B,eAAelC,EAAEK,QAAQ,CAACL,EAAEmC,MAAM;IAElCC,iBAAiBpC,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;IAErCmB,kBAAkBrC,EAAEK,QAAQ,CAC1BL,EAAEG,MAAM,CAAC;QACPmC,SAAStC,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAC7BqB,uBAAuBvC,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;QAC3CsB,MAAMxC,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QACzBkC,eAAezC,EAAEK,QAAQ,CAACL,EAAEsB,KAAK,CAACtB,EAAEO,MAAM;QAC1CsB,WAAW7B,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAChC;IAGFmC,QAAQ1C,EAAEK,QAAQ,CAChBL,EAAEG,MAAM,CAAC;QACPwC,UAAU3C,EAAEK,QAAQ,CAACL,EAAEO,MAAM;QAC7BqC,MAAM5C,EAAEK,QAAQ,CAACL,EAAE6C,MAAM;IAC3B;IAGFC,YAAY9C,EAAEK,QAAQ,CAACL,EAAEO,MAAM;IAE/BwC,qBAAqB/C,EAAEK,QAAQ,CAACL,EAAEkB,OAAO;IAEzC8B,MAAMhD,EAAEK,QAAQ,CAACL,EAAEmC,MAAM;IAEzBc,SAASjD,EAAEK,QAAQ,CAACL,EAAEmC,MAAM;AAC9B,GAAuC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* arbitrary keys without schema validation.
|
|
5
|
-
*
|
|
2
|
+
* Dashboard visibility an application can declare. Mirrors Brett's canonical
|
|
3
|
+
* `VISIBILITIES` — the source of truth lives in the application service.
|
|
6
4
|
* @public
|
|
7
|
-
*/ export
|
|
5
|
+
*/ export const APP_VISIBILITIES = [
|
|
6
|
+
'default',
|
|
7
|
+
'unlisted',
|
|
8
|
+
'disabled'
|
|
9
|
+
];
|
|
8
10
|
|
|
9
11
|
//# sourceMappingURL=cliConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/config/cli/types/cliConfig.ts"],"sourcesContent":["import {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\n\nimport {type UserViteConfig} from './userViteConfig'\n\nexport interface TypeGenConfig {\n formatGeneratedCode: boolean\n generates: string\n overloadClientMethods: boolean\n path: string | string[]\n schema: string\n}\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 /** Dock group the app renders in. Defaults to `dock.applications`. */\n group?: 'dock.applications' | 'dock.system' | 'dock.user'\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 /** Sort position within the dock group, ascending. Defaults to `100`. */\n priority?: number\n /** The title of the custom app, as it is seen in Dashboard UI */\n title?: string\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 /** Configuration options for React Compiler */\n reactCompiler?: 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":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/config/cli/types/cliConfig.ts"],"sourcesContent":["import {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\n\nimport {type UserViteConfig} from './userViteConfig'\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 /** Dock group the app renders in. Defaults to `dock.applications`. */\n group?: 'dock.applications' | 'dock.system' | 'dock.user'\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 /** Sort position within the dock group, ascending. Defaults to `100`. */\n priority?: number\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 /** Configuration options for React Compiler */\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":"AAYA;;;;CAIC,GACD,OAAO,MAAMA,mBAAmB;IAAC;IAAW;IAAY;CAAW,CAAS"}
|