@sanity/cli-core 0.0.2-alpha.2 → 0.1.0-alpha.10

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.
Files changed (160) hide show
  1. package/dist/SanityCommand.js +34 -3
  2. package/dist/SanityCommand.js.map +1 -1
  3. package/dist/_exports/tree.d.ts +47 -0
  4. package/dist/_exports/tree.js +3 -0
  5. package/dist/_exports/tree.js.map +1 -0
  6. package/dist/_exports/ux.d.ts +40 -0
  7. package/dist/_exports/ux.js +6 -0
  8. package/dist/_exports/ux.js.map +1 -0
  9. package/dist/config/cli/getCliConfig.worker.js +2 -1
  10. package/dist/config/cli/getCliConfig.worker.js.map +1 -1
  11. package/dist/config/cli/schemas.js +5 -2
  12. package/dist/config/cli/schemas.js.map +1 -1
  13. package/dist/config/cli/types/cliConfig.js.map +1 -1
  14. package/dist/config/findProjectRoot.js +2 -2
  15. package/dist/config/findProjectRoot.js.map +1 -1
  16. package/dist/config/studio/getStudioConfig.js +0 -3
  17. package/dist/config/studio/getStudioConfig.js.map +1 -1
  18. package/dist/config/studio/getStudioWorkspaces.js +50 -0
  19. package/dist/config/studio/getStudioWorkspaces.js.map +1 -0
  20. package/dist/config/studio/isStudioConfig.js +19 -0
  21. package/dist/config/studio/isStudioConfig.js.map +1 -0
  22. package/dist/config/studio/readStudioConfig.js +13 -9
  23. package/dist/config/studio/readStudioConfig.js.map +1 -1
  24. package/dist/config/studio/readStudioConfig.worker.js +4 -30
  25. package/dist/config/studio/readStudioConfig.worker.js.map +1 -1
  26. package/dist/config/util/findStudioConfigPath.js +24 -3
  27. package/dist/config/util/findStudioConfigPath.js.map +1 -1
  28. package/dist/config/util/recursivelyResolveProjectRoot.js.map +1 -1
  29. package/dist/index.d.ts +6027 -36
  30. package/dist/index.js +14 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/loaders/studio/studioWorkerLoader.worker.js +10 -24
  33. package/dist/loaders/studio/studioWorkerLoader.worker.js.map +1 -1
  34. package/dist/loaders/studio/studioWorkerTask.js +41 -11
  35. package/dist/loaders/studio/studioWorkerTask.js.map +1 -1
  36. package/dist/loaders/tsx/tsxWorkerTask.js +3 -0
  37. package/dist/loaders/tsx/tsxWorkerTask.js.map +1 -1
  38. package/dist/services/apiClient.js +18 -17
  39. package/dist/services/apiClient.js.map +1 -1
  40. package/dist/telemetry/cleanupOldTelemetryFiles.js +30 -0
  41. package/dist/telemetry/cleanupOldTelemetryFiles.js.map +1 -0
  42. package/dist/telemetry/createTelemetryStore.js +95 -0
  43. package/dist/telemetry/createTelemetryStore.js.map +1 -0
  44. package/dist/telemetry/createTraceId.js +10 -0
  45. package/dist/telemetry/createTraceId.js.map +1 -0
  46. package/dist/telemetry/findTelemetryFiles.js +36 -0
  47. package/dist/telemetry/findTelemetryFiles.js.map +1 -0
  48. package/dist/telemetry/flushTelemetryFiles.js +107 -0
  49. package/dist/telemetry/flushTelemetryFiles.js.map +1 -0
  50. package/dist/telemetry/generateTelemetryFilePath.js +30 -0
  51. package/dist/telemetry/generateTelemetryFilePath.js.map +1 -0
  52. package/dist/telemetry/getTelemetryBaseInfo.js +33 -0
  53. package/dist/telemetry/getTelemetryBaseInfo.js.map +1 -0
  54. package/dist/telemetry/logger.js +54 -0
  55. package/dist/telemetry/logger.js.map +1 -0
  56. package/dist/telemetry/telemetryStoreDebug.js +7 -0
  57. package/dist/telemetry/telemetryStoreDebug.js.map +1 -0
  58. package/dist/telemetry/trace.js +150 -0
  59. package/dist/telemetry/trace.js.map +1 -0
  60. package/dist/telemetry/types.js +5 -0
  61. package/dist/telemetry/types.js.map +1 -0
  62. package/dist/types.js +2 -0
  63. package/dist/types.js.map +1 -1
  64. package/dist/util/doImport.js +16 -0
  65. package/dist/util/doImport.js.map +1 -0
  66. package/dist/util/environment/getStudioEnvironmentVariables.js +2 -1
  67. package/dist/util/environment/getStudioEnvironmentVariables.js.map +1 -1
  68. package/dist/util/getCliTelemetry.js +36 -0
  69. package/dist/util/getCliTelemetry.js.map +1 -0
  70. package/dist/util/isStaging.js +10 -0
  71. package/dist/util/isStaging.js.map +1 -0
  72. package/dist/util/normalizePath.js +12 -0
  73. package/dist/util/normalizePath.js.map +1 -0
  74. package/dist/util/parseStringFlag.js +19 -0
  75. package/dist/util/parseStringFlag.js.map +1 -0
  76. package/dist/util/readNDJSON.js +18 -0
  77. package/dist/util/readNDJSON.js.map +1 -0
  78. package/dist/util/resolveLocalPackage.js +34 -0
  79. package/dist/util/resolveLocalPackage.js.map +1 -0
  80. package/dist/util/tree.js +108 -0
  81. package/dist/util/tree.js.map +1 -0
  82. package/dist/util/waitForAsync.js +5 -0
  83. package/dist/util/waitForAsync.js.map +1 -0
  84. package/dist/ux/boxen.js +3 -0
  85. package/dist/ux/boxen.js.map +1 -0
  86. package/dist/ux/colorizeJson.js +6 -6
  87. package/dist/ux/colorizeJson.js.map +1 -1
  88. package/dist/ux/prompts.js +3 -0
  89. package/dist/ux/prompts.js.map +1 -0
  90. package/dist/ux/spinner.js +1 -1
  91. package/dist/ux/spinner.js.map +1 -1
  92. package/package.json +53 -28
  93. package/dist/SanityCommand.d.ts +0 -56
  94. package/dist/config/__tests__/cliToken.test.js +0 -74
  95. package/dist/config/__tests__/cliToken.test.js.map +0 -1
  96. package/dist/config/__tests__/cliUserConfig.test.js +0 -131
  97. package/dist/config/__tests__/cliUserConfig.test.js.map +0 -1
  98. package/dist/config/__tests__/findProjectRoot.test.js +0 -159
  99. package/dist/config/__tests__/findProjectRoot.test.js.map +0 -1
  100. package/dist/config/__tests__/findProjectRootSync.test.js +0 -112
  101. package/dist/config/__tests__/findProjectRootSync.test.js.map +0 -1
  102. package/dist/config/__tests__/getCliConfigSync.test.js +0 -31
  103. package/dist/config/__tests__/getCliConfigSync.test.js.map +0 -1
  104. package/dist/config/cli/getCliConfig.d.ts +0 -16
  105. package/dist/config/cli/getCliConfig.worker.d.ts +0 -1
  106. package/dist/config/cli/getCliConfigSync.d.ts +0 -12
  107. package/dist/config/cli/schemas.d.ts +0 -255
  108. package/dist/config/cli/types/cliConfig.d.ts +0 -74
  109. package/dist/config/cli/types/userViteConfig.d.ts +0 -5
  110. package/dist/config/findProjectRoot.d.ts +0 -14
  111. package/dist/config/findProjectRootSync.d.ts +0 -27
  112. package/dist/config/studio/getStudioConfig.d.ts +0 -14
  113. package/dist/config/studio/readStudioConfig.d.ts +0 -190
  114. package/dist/config/studio/readStudioConfig.worker.d.ts +0 -1
  115. package/dist/config/util/configPathsSync.d.ts +0 -17
  116. package/dist/config/util/findAppConfigPath.d.ts +0 -8
  117. package/dist/config/util/findConfigsPaths.d.ts +0 -16
  118. package/dist/config/util/findStudioConfigPath.d.ts +0 -9
  119. package/dist/config/util/isSanityV2StudioRoot.d.ts +0 -8
  120. package/dist/config/util/recursivelyResolveProjectRoot.d.ts +0 -27
  121. package/dist/debug.d.ts +0 -15
  122. package/dist/loaders/studio/studioWorkerLoader.worker.d.ts +0 -1
  123. package/dist/loaders/studio/studioWorkerTask.d.ts +0 -40
  124. package/dist/loaders/tsx/tsxWorkerLoader.worker.d.ts +0 -1
  125. package/dist/loaders/tsx/tsxWorkerTask.d.ts +0 -28
  126. package/dist/services/apiClient.d.ts +0 -53
  127. package/dist/services/cliUserConfig.d.ts +0 -57
  128. package/dist/services/getCliToken.d.ts +0 -7
  129. package/dist/types.d.ts +0 -7
  130. package/dist/util/NotFoundError.d.ts +0 -20
  131. package/dist/util/__tests__/createExpiringConfig.test.js +0 -400
  132. package/dist/util/__tests__/createExpiringConfig.test.js.map +0 -1
  133. package/dist/util/createExpiringConfig.d.ts +0 -37
  134. package/dist/util/environment/getStudioEnvironmentVariables.d.ts +0 -12
  135. package/dist/util/environment/mockBrowserEnvironment.d.ts +0 -17
  136. package/dist/util/environment/setupBrowserStubs.d.ts +0 -10
  137. package/dist/util/environment/stubs.d.ts +0 -254
  138. package/dist/util/fileExists.d.ts +0 -9
  139. package/dist/util/generateHelpUrl.d.ts +0 -8
  140. package/dist/util/getEmptyAuth.d.ts +0 -5
  141. package/dist/util/getSanityEnvVar.d.ts +0 -19
  142. package/dist/util/getSanityUrl.d.ts +0 -5
  143. package/dist/util/getUserConfig.d.ts +0 -2
  144. package/dist/util/isCi.d.ts +0 -1
  145. package/dist/util/isHttpError.d.ts +0 -29
  146. package/dist/util/isHttpError.js +0 -18
  147. package/dist/util/isHttpError.js.map +0 -1
  148. package/dist/util/isInteractive.d.ts +0 -1
  149. package/dist/util/isRecord.d.ts +0 -8
  150. package/dist/util/isTrueish.d.ts +0 -1
  151. package/dist/util/readJsonFile.d.ts +0 -14
  152. package/dist/util/safeStructuredClone.d.ts +0 -8
  153. package/dist/util/tryGetDefaultExport.d.ts +0 -5
  154. package/dist/util/writeJsonFile.d.ts +0 -9
  155. package/dist/ux/colorizeJson.d.ts +0 -1
  156. package/dist/ux/formatObject.d.ts +0 -1
  157. package/dist/ux/logSymbols.d.ts +0 -1
  158. package/dist/ux/printKeyValue.d.ts +0 -1
  159. package/dist/ux/spinner.d.ts +0 -1
  160. package/dist/ux/timer.d.ts +0 -12
@@ -1,255 +0,0 @@
1
- import { z } from 'zod';
2
- import { type UserViteConfig } from './types/userViteConfig';
3
- /**
4
- * @public
5
- */
6
- export declare const cliConfigSchema: z.ZodObject<{
7
- api: z.ZodOptional<z.ZodObject<{
8
- dataset: z.ZodOptional<z.ZodString>;
9
- projectId: z.ZodOptional<z.ZodString>;
10
- }, "strip", z.ZodTypeAny, {
11
- dataset?: string | undefined;
12
- projectId?: string | undefined;
13
- }, {
14
- dataset?: string | undefined;
15
- projectId?: string | undefined;
16
- }>>;
17
- app: z.ZodOptional<z.ZodObject<{
18
- entry: z.ZodOptional<z.ZodString>;
19
- id: z.ZodOptional<z.ZodString>;
20
- organizationId: z.ZodOptional<z.ZodString>;
21
- }, "strip", z.ZodTypeAny, {
22
- entry?: string | undefined;
23
- id?: string | undefined;
24
- organizationId?: string | undefined;
25
- }, {
26
- entry?: string | undefined;
27
- id?: string | undefined;
28
- organizationId?: string | undefined;
29
- }>>;
30
- autoUpdates: z.ZodOptional<z.ZodBoolean>;
31
- deployment: z.ZodOptional<z.ZodObject<{
32
- appId: z.ZodOptional<z.ZodString>;
33
- autoUpdates: z.ZodOptional<z.ZodBoolean>;
34
- }, "strip", z.ZodTypeAny, {
35
- autoUpdates?: boolean | undefined;
36
- appId?: string | undefined;
37
- }, {
38
- autoUpdates?: boolean | undefined;
39
- appId?: string | undefined;
40
- }>>;
41
- graphql: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
- filterSuffix: z.ZodOptional<z.ZodString>;
43
- generation: z.ZodOptional<z.ZodEnum<["gen1", "gen2", "gen3"]>>;
44
- id: z.ZodOptional<z.ZodString>;
45
- nonNullDocumentFields: z.ZodOptional<z.ZodBoolean>;
46
- playground: z.ZodOptional<z.ZodBoolean>;
47
- source: z.ZodOptional<z.ZodString>;
48
- tag: z.ZodOptional<z.ZodString>;
49
- workspace: z.ZodOptional<z.ZodString>;
50
- }, "strip", z.ZodTypeAny, {
51
- id?: string | undefined;
52
- filterSuffix?: string | undefined;
53
- generation?: "gen1" | "gen2" | "gen3" | undefined;
54
- nonNullDocumentFields?: boolean | undefined;
55
- playground?: boolean | undefined;
56
- source?: string | undefined;
57
- tag?: string | undefined;
58
- workspace?: string | undefined;
59
- }, {
60
- id?: string | undefined;
61
- filterSuffix?: string | undefined;
62
- generation?: "gen1" | "gen2" | "gen3" | undefined;
63
- nonNullDocumentFields?: boolean | undefined;
64
- playground?: boolean | undefined;
65
- source?: string | undefined;
66
- tag?: string | undefined;
67
- workspace?: string | undefined;
68
- }>, "many">>;
69
- mediaLibrary: z.ZodOptional<z.ZodObject<{
70
- aspectsPath: z.ZodOptional<z.ZodString>;
71
- }, "strip", z.ZodTypeAny, {
72
- aspectsPath?: string | undefined;
73
- }, {
74
- aspectsPath?: string | undefined;
75
- }>>;
76
- project: z.ZodOptional<z.ZodObject<{
77
- basePath: z.ZodOptional<z.ZodString>;
78
- }, "strip", z.ZodTypeAny, {
79
- basePath?: string | undefined;
80
- }, {
81
- basePath?: string | undefined;
82
- }>>;
83
- reactCompiler: z.ZodOptional<z.ZodType<Partial<{
84
- environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
85
- logger: import("babel-plugin-react-compiler").Logger | null;
86
- gating: import("babel-plugin-react-compiler").ExternalFunction | null;
87
- dynamicGating: {
88
- source: string;
89
- } | null;
90
- panicThreshold: unknown;
91
- noEmit: boolean;
92
- compilationMode: unknown;
93
- eslintSuppressionRules: Array<string> | null | undefined;
94
- flowSuppressions: boolean;
95
- ignoreUseNoForget: boolean;
96
- customOptOutDirectives: string[] | null;
97
- sources: Array<string> | ((filename: string) => boolean) | null;
98
- enableReanimatedCheck: boolean;
99
- target: "17" | "18" | "19" | {
100
- kind: "donotuse_meta_internal";
101
- runtimeModule: string;
102
- };
103
- }>, z.ZodTypeDef, Partial<{
104
- environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
105
- logger: import("babel-plugin-react-compiler").Logger | null;
106
- gating: import("babel-plugin-react-compiler").ExternalFunction | null;
107
- dynamicGating: {
108
- source: string;
109
- } | null;
110
- panicThreshold: unknown;
111
- noEmit: boolean;
112
- compilationMode: unknown;
113
- eslintSuppressionRules: Array<string> | null | undefined;
114
- flowSuppressions: boolean;
115
- ignoreUseNoForget: boolean;
116
- customOptOutDirectives: string[] | null;
117
- sources: Array<string> | ((filename: string) => boolean) | null;
118
- enableReanimatedCheck: boolean;
119
- target: "17" | "18" | "19" | {
120
- kind: "donotuse_meta_internal";
121
- runtimeModule: string;
122
- };
123
- }>>>;
124
- reactStrictMode: z.ZodOptional<z.ZodBoolean>;
125
- server: z.ZodOptional<z.ZodObject<{
126
- hostname: z.ZodOptional<z.ZodString>;
127
- port: z.ZodOptional<z.ZodNumber>;
128
- }, "strip", z.ZodTypeAny, {
129
- hostname?: string | undefined;
130
- port?: number | undefined;
131
- }, {
132
- hostname?: string | undefined;
133
- port?: number | undefined;
134
- }>>;
135
- studioHost: z.ZodOptional<z.ZodString>;
136
- vite: z.ZodOptional<z.ZodType<UserViteConfig, z.ZodTypeDef, UserViteConfig>>;
137
- }, "strip", z.ZodTypeAny, {
138
- api?: {
139
- dataset?: string | undefined;
140
- projectId?: string | undefined;
141
- } | undefined;
142
- app?: {
143
- entry?: string | undefined;
144
- id?: string | undefined;
145
- organizationId?: string | undefined;
146
- } | undefined;
147
- autoUpdates?: boolean | undefined;
148
- deployment?: {
149
- autoUpdates?: boolean | undefined;
150
- appId?: string | undefined;
151
- } | undefined;
152
- graphql?: {
153
- id?: string | undefined;
154
- filterSuffix?: string | undefined;
155
- generation?: "gen1" | "gen2" | "gen3" | undefined;
156
- nonNullDocumentFields?: boolean | undefined;
157
- playground?: boolean | undefined;
158
- source?: string | undefined;
159
- tag?: string | undefined;
160
- workspace?: string | undefined;
161
- }[] | undefined;
162
- mediaLibrary?: {
163
- aspectsPath?: string | undefined;
164
- } | undefined;
165
- project?: {
166
- basePath?: string | undefined;
167
- } | undefined;
168
- reactCompiler?: Partial<{
169
- environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
170
- logger: import("babel-plugin-react-compiler").Logger | null;
171
- gating: import("babel-plugin-react-compiler").ExternalFunction | null;
172
- dynamicGating: {
173
- source: string;
174
- } | null;
175
- panicThreshold: unknown;
176
- noEmit: boolean;
177
- compilationMode: unknown;
178
- eslintSuppressionRules: Array<string> | null | undefined;
179
- flowSuppressions: boolean;
180
- ignoreUseNoForget: boolean;
181
- customOptOutDirectives: string[] | null;
182
- sources: Array<string> | ((filename: string) => boolean) | null;
183
- enableReanimatedCheck: boolean;
184
- target: "17" | "18" | "19" | {
185
- kind: "donotuse_meta_internal";
186
- runtimeModule: string;
187
- };
188
- }> | undefined;
189
- reactStrictMode?: boolean | undefined;
190
- server?: {
191
- hostname?: string | undefined;
192
- port?: number | undefined;
193
- } | undefined;
194
- studioHost?: string | undefined;
195
- vite?: UserViteConfig | undefined;
196
- }, {
197
- api?: {
198
- dataset?: string | undefined;
199
- projectId?: string | undefined;
200
- } | undefined;
201
- app?: {
202
- entry?: string | undefined;
203
- id?: string | undefined;
204
- organizationId?: string | undefined;
205
- } | undefined;
206
- autoUpdates?: boolean | undefined;
207
- deployment?: {
208
- autoUpdates?: boolean | undefined;
209
- appId?: string | undefined;
210
- } | undefined;
211
- graphql?: {
212
- id?: string | undefined;
213
- filterSuffix?: string | undefined;
214
- generation?: "gen1" | "gen2" | "gen3" | undefined;
215
- nonNullDocumentFields?: boolean | undefined;
216
- playground?: boolean | undefined;
217
- source?: string | undefined;
218
- tag?: string | undefined;
219
- workspace?: string | undefined;
220
- }[] | undefined;
221
- mediaLibrary?: {
222
- aspectsPath?: string | undefined;
223
- } | undefined;
224
- project?: {
225
- basePath?: string | undefined;
226
- } | undefined;
227
- reactCompiler?: Partial<{
228
- environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
229
- logger: import("babel-plugin-react-compiler").Logger | null;
230
- gating: import("babel-plugin-react-compiler").ExternalFunction | null;
231
- dynamicGating: {
232
- source: string;
233
- } | null;
234
- panicThreshold: unknown;
235
- noEmit: boolean;
236
- compilationMode: unknown;
237
- eslintSuppressionRules: Array<string> | null | undefined;
238
- flowSuppressions: boolean;
239
- ignoreUseNoForget: boolean;
240
- customOptOutDirectives: string[] | null;
241
- sources: Array<string> | ((filename: string) => boolean) | null;
242
- enableReanimatedCheck: boolean;
243
- target: "17" | "18" | "19" | {
244
- kind: "donotuse_meta_internal";
245
- runtimeModule: string;
246
- };
247
- }> | undefined;
248
- reactStrictMode?: boolean | undefined;
249
- server?: {
250
- hostname?: string | undefined;
251
- port?: number | undefined;
252
- } | undefined;
253
- studioHost?: string | undefined;
254
- vite?: UserViteConfig | undefined;
255
- }>;
@@ -1,74 +0,0 @@
1
- import { type PluginOptions as ReactCompilerConfig } from 'babel-plugin-react-compiler';
2
- import { type UserViteConfig } from './userViteConfig';
3
- /**
4
- * @public
5
- */
6
- export interface CliConfig {
7
- /** The project ID and dataset the Sanity CLI should use to run its commands */
8
- api?: {
9
- dataset?: string;
10
- projectId?: string;
11
- };
12
- /** Configuration for custom Sanity apps built with the App SDK */
13
- app?: {
14
- /** The entrypoint for your custom app. By default, `src/App.tsx` */
15
- entry?: string;
16
- /** @deprecated Use deployment.appId */
17
- id?: string;
18
- /** The ID for the Sanity organization that manages this application */
19
- organizationId?: string;
20
- };
21
- /** @deprecated Use deployment.autoUpdates */
22
- autoUpdates?: boolean;
23
- /** Options for custom app and Studio deployments */
24
- deployment?: {
25
- /**
26
- * The ID for your custom app or Studio. Generated when deploying your app or Studio for the first time.
27
- * Get your app ID by either:
28
- * 1. Checking the output of `sanity deploy`, or
29
- * 2. Checking your project’s Studio tab at https://sanity.io/manage
30
- *
31
- * @remarks This is required for all custom app deployments, and for Studios opting in to fine grained version control.
32
- * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k0896ed4574b7}
33
- */
34
- appId?: string;
35
- /**
36
- * Enable automatic updates for your Studio or custom app’s Sanity dependencies.
37
- * {@link https://www.sanity.io/docs/studio/latest-version-of-sanity}
38
- */
39
- autoUpdates?: boolean;
40
- };
41
- /** Define the GraphQL APIs that the CLI can deploy and interact with */
42
- graphql?: Array<{
43
- filterSuffix?: string;
44
- generation?: 'gen1' | 'gen2' | 'gen3';
45
- id?: string;
46
- nonNullDocumentFields?: boolean;
47
- playground?: boolean;
48
- source?: string;
49
- tag?: string;
50
- workspace?: string;
51
- }>;
52
- /** Configuration for the Media Library */
53
- mediaLibrary?: {
54
- /** 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. */
55
- aspectsPath?: string;
56
- };
57
- /** 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. */
58
- project?: {
59
- basePath?: string;
60
- };
61
- /** Configuration options for React Compiler */
62
- reactCompiler?: ReactCompilerConfig;
63
- /** 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 false. */
64
- reactStrictMode?: boolean;
65
- /** Defines the hostname and port that the development server should run on. hostname defaults to localhost, and port to 3333. */
66
- server?: {
67
- hostname?: string;
68
- port?: number;
69
- };
70
- /** @deprecated Use deployment.appId */
71
- studioHost?: string;
72
- /** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */
73
- vite?: UserViteConfig;
74
- }
@@ -1,5 +0,0 @@
1
- import { type ConfigEnv, type InlineConfig } from 'vite';
2
- /**
3
- * @public
4
- */
5
- export type UserViteConfig = ((config: InlineConfig, env: ConfigEnv) => InlineConfig | Promise<InlineConfig>) | InlineConfig;
@@ -1,14 +0,0 @@
1
- import { type ProjectRootResult } from './util/recursivelyResolveProjectRoot.js';
2
- /**
3
- * Resolve project root directory and type.
4
- *
5
- * Project root is:
6
- * - `studio` - A pre-blueprints Sanity studio root (containing `sanity.config.(ts|js)`)
7
- * - `app` - A Sanity app root (containing `sanity.cli.(ts|js)`)
8
- *
9
- * If a Sanity Studio v2/v1 root is found (containing `sanity.json` with `root: true`),
10
- * an error is thrown, as v2/v1 is no longer supported.
11
- *
12
- * @internal
13
- */
14
- export declare function findProjectRoot(cwd: string): Promise<ProjectRootResult>;
@@ -1,27 +0,0 @@
1
- import { ProjectRootResult } from './util/recursivelyResolveProjectRoot.js';
2
- /**
3
- * Generic recursive search function for project configuration files (synchronous version).
4
- *
5
- * @param basePath - The base path to start searching from
6
- * @param findConfigFn - Function that looks for config files in a given directory
7
- * @param projectType - The type of project ('app' | 'studio')
8
- * @param iterations - Current iteration count, passed internally to prevent infinite recursion
9
- * @returns An object if config is found, false otherwise
10
- * @internal
11
- */
12
- export declare function recursivelyResolveProjectRootSync(basePath: string, findConfigFn: (path: string) => string | undefined, projectType: 'app' | 'studio', iterations?: number): false | ProjectRootResult;
13
- /**
14
- * Resolve project root directory and type synchronously.
15
- *
16
- * Project root is:
17
- * - `studio` - A pre-blueprints Sanity studio root (containing `sanity.config.(ts|js)`)
18
- * - `app` - A Sanity app root (containing `sanity.cli.(ts|js)`)
19
- *
20
- * If a Sanity Studio v2/v1 root is found (containing `sanity.json` with `root: true`),
21
- * an error is thrown, as v2/v1 is no longer supported.
22
- *
23
- * @param cwd - Current working directory to start searching from
24
- * @returns Project root result
25
- * @internal
26
- */
27
- export declare function findProjectRootSync(cwd: string): ProjectRootResult;
@@ -1,14 +0,0 @@
1
- import { type RawStudioConfig, type ResolvedStudioConfig } from './readStudioConfig.js';
2
- /**
3
- * Get the studio config for a project, given the root path.
4
- *
5
- * @param rootPath - The root path for the project
6
- * @returns The studio config (some properties may be missing)
7
- * @internal
8
- */
9
- export declare function getStudioConfig(rootPath: string, options: {
10
- resolvePlugins: true;
11
- }): Promise<ResolvedStudioConfig>;
12
- export declare function getStudioConfig(rootPath: string, options: {
13
- resolvePlugins: false;
14
- }): Promise<RawStudioConfig>;
@@ -1,190 +0,0 @@
1
- import { z } from 'zod';
2
- declare const rawConfigSchema: z.ZodUnion<[z.ZodArray<z.ZodObject<{
3
- basePath: z.ZodString;
4
- dataset: z.ZodString;
5
- name: z.ZodString;
6
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
7
- projectId: z.ZodString;
8
- schema: z.ZodObject<{
9
- _original: z.ZodObject<{
10
- name: z.ZodOptional<z.ZodString>;
11
- types: z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">;
12
- }, "strip", z.ZodTypeAny, {
13
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
14
- name?: string | undefined;
15
- }, {
16
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
17
- name?: string | undefined;
18
- }>;
19
- }, "strip", z.ZodTypeAny, {
20
- _original: {
21
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
22
- name?: string | undefined;
23
- };
24
- }, {
25
- _original: {
26
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
27
- name?: string | undefined;
28
- };
29
- }>;
30
- title: z.ZodString;
31
- }, "strip", z.ZodTypeAny, {
32
- name: string;
33
- dataset: string;
34
- projectId: string;
35
- basePath: string;
36
- schema: {
37
- _original: {
38
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
39
- name?: string | undefined;
40
- };
41
- };
42
- title: string;
43
- plugins?: unknown[] | undefined;
44
- }, {
45
- name: string;
46
- dataset: string;
47
- projectId: string;
48
- basePath: string;
49
- schema: {
50
- _original: {
51
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
52
- name?: string | undefined;
53
- };
54
- };
55
- title: string;
56
- plugins?: unknown[] | undefined;
57
- }>, "many">, z.ZodObject<{
58
- basePath: z.ZodOptional<z.ZodString>;
59
- dataset: z.ZodString;
60
- name: z.ZodOptional<z.ZodString>;
61
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
62
- projectId: z.ZodString;
63
- schema: z.ZodOptional<z.ZodObject<{
64
- name: z.ZodOptional<z.ZodString>;
65
- types: z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">;
66
- }, "strip", z.ZodTypeAny, {
67
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
68
- name?: string | undefined;
69
- }, {
70
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
71
- name?: string | undefined;
72
- }>>;
73
- title: z.ZodOptional<z.ZodString>;
74
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
75
- basePath: z.ZodOptional<z.ZodString>;
76
- dataset: z.ZodString;
77
- name: z.ZodOptional<z.ZodString>;
78
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
79
- projectId: z.ZodString;
80
- schema: z.ZodOptional<z.ZodObject<{
81
- name: z.ZodOptional<z.ZodString>;
82
- types: z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">;
83
- }, "strip", z.ZodTypeAny, {
84
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
85
- name?: string | undefined;
86
- }, {
87
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
88
- name?: string | undefined;
89
- }>>;
90
- title: z.ZodOptional<z.ZodString>;
91
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
92
- basePath: z.ZodOptional<z.ZodString>;
93
- dataset: z.ZodString;
94
- name: z.ZodOptional<z.ZodString>;
95
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
96
- projectId: z.ZodString;
97
- schema: z.ZodOptional<z.ZodObject<{
98
- name: z.ZodOptional<z.ZodString>;
99
- types: z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">;
100
- }, "strip", z.ZodTypeAny, {
101
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
102
- name?: string | undefined;
103
- }, {
104
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
105
- name?: string | undefined;
106
- }>>;
107
- title: z.ZodOptional<z.ZodString>;
108
- }, z.ZodTypeAny, "passthrough">>]>;
109
- declare const resolvedConfigSchema: z.ZodArray<z.ZodObject<{
110
- basePath: z.ZodString;
111
- dataset: z.ZodString;
112
- name: z.ZodString;
113
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
114
- projectId: z.ZodString;
115
- schema: z.ZodObject<{
116
- _original: z.ZodObject<{
117
- name: z.ZodOptional<z.ZodString>;
118
- types: z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">;
119
- }, "strip", z.ZodTypeAny, {
120
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
121
- name?: string | undefined;
122
- }, {
123
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
124
- name?: string | undefined;
125
- }>;
126
- }, "strip", z.ZodTypeAny, {
127
- _original: {
128
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
129
- name?: string | undefined;
130
- };
131
- }, {
132
- _original: {
133
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
134
- name?: string | undefined;
135
- };
136
- }>;
137
- title: z.ZodString;
138
- }, "strip", z.ZodTypeAny, {
139
- name: string;
140
- dataset: string;
141
- projectId: string;
142
- basePath: string;
143
- schema: {
144
- _original: {
145
- types: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[];
146
- name?: string | undefined;
147
- };
148
- };
149
- title: string;
150
- plugins?: unknown[] | undefined;
151
- }, {
152
- name: string;
153
- dataset: string;
154
- projectId: string;
155
- basePath: string;
156
- schema: {
157
- _original: {
158
- types: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[];
159
- name?: string | undefined;
160
- };
161
- };
162
- title: string;
163
- plugins?: unknown[] | undefined;
164
- }>, "many">;
165
- export type RawStudioConfig = z.infer<typeof rawConfigSchema>;
166
- export type ResolvedStudioConfig = z.infer<typeof resolvedConfigSchema>;
167
- export interface ReadStudioConfigOptions {
168
- /**
169
- * Whether or not to resolve the plugins defined in the config.
170
- *
171
- * In some cases, you need this in order to have the full picture of what the studio
172
- * would "see". As an example, plugins can define schema types that are not explicitly
173
- * defined in the users' schema types. In order to get the full picture, you need to
174
- * resolve the plugins, which is an asyncronous operation.
175
- *
176
- * In other cases, it might be enough to only do a shallow pass. As an example, if you
177
- * only need to know about the defined workspace, or the user-defined schema types,
178
- * this can be set to `false` - which should resolve faster (and potentially "safer")
179
- * in terms of not triggering all kinds of browser behavior that may or may not be
180
- * loaded as the plugins are resolved.
181
- */
182
- resolvePlugins: boolean;
183
- }
184
- export declare function readStudioConfig(configPath: string, options: {
185
- resolvePlugins: true;
186
- }): Promise<ResolvedStudioConfig>;
187
- export declare function readStudioConfig(configPath: string, options: {
188
- resolvePlugins: false;
189
- }): Promise<RawStudioConfig>;
190
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- /**
2
- * Resolves to a string containing the found config path, or `undefined` if not found.
3
- * Throws if Sanity v2 studio root is found.
4
- *
5
- * @param basePath - The base path to start searching from
6
- * @returns A string containing the found config path, or `undefined` if not found
7
- * @internal
8
- */
9
- export declare function findStudioConfigPathSync(basePath: string): string | undefined;
10
- /**
11
- * Resolves to a string containing the found config path, or `undefined` if not found.
12
- *
13
- * @param basePath - The base path to start searching from
14
- * @returns A string containing the found config path, or `undefined` if not found
15
- * @internal
16
- */
17
- export declare function findAppConfigPathSync(basePath: string): string | undefined;
@@ -1,8 +0,0 @@
1
- /**
2
- * Resolves to a string containing the found config path, or `undefined` if not found.
3
- *
4
- * @param basePath - The base path to start searching from
5
- * @returns A promise that resolves to a string containing the found config path, or `undefined` if not found
6
- * @internal
7
- */
8
- export declare function findAppConfigPath(basePath: string): Promise<string | undefined>;
@@ -1,16 +0,0 @@
1
- /**
2
- * @internal
3
- */
4
- interface PathResult {
5
- exists: boolean;
6
- path: string;
7
- }
8
- /**
9
- * Finds the path for a given set of files.
10
- *
11
- * @param basePath - The base path to search for files.
12
- * @param files - The files to search for.
13
- * @internal
14
- */
15
- export declare function findPathForFiles(basePath: string, files: string[]): Promise<PathResult[]>;
16
- export {};
@@ -1,9 +0,0 @@
1
- /**
2
- * Resolves to a string containing the found config path, or `false` if not found.
3
- * Throws if Sanity v2 studio root is found.
4
- *
5
- * @param basePath - The base path to start searching from
6
- * @returns A promise that resolves to a string containing the found config path, or `undefined` if not found
7
- * @internal
8
- */
9
- export declare function findStudioConfigPath(basePath: string): Promise<string | undefined>;
@@ -1,8 +0,0 @@
1
- /**
2
- * Checks for a `sanity.json` file with `"root": true` in the given directory.
3
- *
4
- * @param basePath - The base path to look for a `sanity.json` in
5
- * @returns Resolves to true if a `sanity.json` with `"root": true` is found, false otherwise
6
- * @internal
7
- */
8
- export declare function isSanityV2StudioRoot(basePath: string): Promise<boolean>;