@sanity/cli 5.8.0 → 5.8.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.d.ts +17 -17
- package/lib/index.d.ts +232 -222
- package/lib/run.d.ts +1 -1
- package/lib/workers/getAndWriteJourneySchema.d.ts +1 -1
- package/lib/workers/getCliConfig.d.ts +1 -1
- package/lib/workers/typegenGenerate.d.ts +14 -14
- package/package.json +19 -19
package/lib/cli.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
declare interface PackageJson {
|
|
2
|
-
name: string
|
|
3
|
-
version: string
|
|
4
|
-
scripts?: Record<string, string
|
|
5
|
-
description?: string
|
|
6
|
-
author?: string
|
|
7
|
-
license?: string
|
|
8
|
-
private?: boolean
|
|
9
|
-
dependencies?: Record<string, string
|
|
10
|
-
devDependencies?: Record<string, string
|
|
11
|
-
peerDependencies?: Record<string, string
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
scripts?: Record<string, string>;
|
|
5
|
+
description?: string;
|
|
6
|
+
author?: string;
|
|
7
|
+
license?: string;
|
|
8
|
+
private?: boolean;
|
|
9
|
+
dependencies?: Record<string, string>;
|
|
10
|
+
devDependencies?: Record<string, string>;
|
|
11
|
+
peerDependencies?: Record<string, string>;
|
|
12
12
|
repository?: {
|
|
13
|
-
type: string
|
|
14
|
-
url: string
|
|
15
|
-
}
|
|
16
|
-
engines?: Record<string, string
|
|
13
|
+
type: string;
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
engines?: Record<string, string>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export declare function runCli(
|
|
@@ -21,8 +21,8 @@ export declare function runCli(
|
|
|
21
21
|
{
|
|
22
22
|
cliPkg,
|
|
23
23
|
}: {
|
|
24
|
-
cliPkg: PackageJson
|
|
24
|
+
cliPkg: PackageJson;
|
|
25
25
|
},
|
|
26
|
-
): Promise<void
|
|
26
|
+
): Promise<void>;
|
|
27
27
|
|
|
28
|
-
export {}
|
|
28
|
+
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import {Answers} from
|
|
2
|
-
import type chalk from
|
|
3
|
-
import {ChoiceCollection} from
|
|
4
|
-
import {ClientConfig} from
|
|
5
|
-
import {ConfigEnv} from
|
|
6
|
-
import {DistinctQuestion} from
|
|
7
|
-
import {InlineConfig} from
|
|
8
|
-
import {Options} from
|
|
9
|
-
import {Ora} from
|
|
10
|
-
import {PluginOptions} from
|
|
11
|
-
import {SanityClient} from
|
|
12
|
-
import {Separator} from
|
|
13
|
-
import {TelemetryLogger} from
|
|
14
|
-
import {TypeGenConfig} from
|
|
1
|
+
import { Answers } from "inquirer";
|
|
2
|
+
import type chalk from "chalk";
|
|
3
|
+
import { ChoiceCollection } from "inquirer";
|
|
4
|
+
import { ClientConfig } from "@sanity/client";
|
|
5
|
+
import { ConfigEnv } from "vite";
|
|
6
|
+
import { DistinctQuestion } from "inquirer";
|
|
7
|
+
import { InlineConfig } from "vite";
|
|
8
|
+
import { Options } from "ora";
|
|
9
|
+
import { Ora } from "ora";
|
|
10
|
+
import { PluginOptions } from "babel-plugin-react-compiler";
|
|
11
|
+
import { SanityClient } from "@sanity/client";
|
|
12
|
+
import { Separator } from "inquirer";
|
|
13
|
+
import { TelemetryLogger } from "@sanity/telemetry";
|
|
14
|
+
import { TypeGenConfig } from "@sanity/codegen";
|
|
15
15
|
|
|
16
16
|
declare interface AppConfig {
|
|
17
17
|
/**
|
|
18
18
|
* The ID of your Sanity organization
|
|
19
19
|
*/
|
|
20
|
-
organizationId: string
|
|
20
|
+
organizationId: string;
|
|
21
21
|
/**
|
|
22
22
|
* The entrypoint for your Sanity app. Defaults to './src/App'.
|
|
23
23
|
*/
|
|
24
|
-
entry?: string
|
|
24
|
+
entry?: string;
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated - Moved to `deployment.appId`
|
|
27
27
|
*/
|
|
28
|
-
id?: string
|
|
28
|
+
id?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export declare type CliApiClient = (
|
|
31
|
+
export declare type CliApiClient = (
|
|
32
|
+
options?: ClientRequirements,
|
|
33
|
+
) => SanityClient;
|
|
32
34
|
|
|
33
35
|
export declare interface CliApiConfig {
|
|
34
|
-
projectId?: string
|
|
35
|
-
dataset?: string
|
|
36
|
+
projectId?: string;
|
|
37
|
+
dataset?: string;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -46,108 +48,110 @@ export declare interface CliClientOptions extends ClientConfig {
|
|
|
46
48
|
* resolve these from the `sanity.cli.ts` configuration file. Use this option
|
|
47
49
|
* to specify the directory to look for this file.
|
|
48
50
|
*/
|
|
49
|
-
cwd?: string
|
|
51
|
+
cwd?: string;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
export declare type CliCommandAction<F = Record<string, unknown>> = (
|
|
53
55
|
args: CliCommandArguments<F>,
|
|
54
56
|
context: CliCommandContext,
|
|
55
|
-
) => Promise<unknown
|
|
57
|
+
) => Promise<unknown>;
|
|
56
58
|
|
|
57
59
|
export declare interface CliCommandArguments<F = Record<string, unknown>> {
|
|
58
|
-
groupOrCommand: string
|
|
59
|
-
argv: string[]
|
|
60
|
-
extOptions: F
|
|
61
|
-
argsWithoutOptions: string[]
|
|
62
|
-
extraArguments: string[]
|
|
60
|
+
groupOrCommand: string;
|
|
61
|
+
argv: string[];
|
|
62
|
+
extOptions: F;
|
|
63
|
+
argsWithoutOptions: string[];
|
|
64
|
+
extraArguments: string[];
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
export declare interface CliCommandContext {
|
|
66
|
-
output: CliOutputter
|
|
67
|
-
prompt: CliPrompter
|
|
68
|
-
apiClient: CliApiClient
|
|
69
|
-
cliConfigPath?: string
|
|
70
|
-
cliRoot: string
|
|
71
|
-
workDir: string
|
|
72
|
-
corePath?: string
|
|
73
|
-
chalk: typeof chalk
|
|
74
|
-
commandRunner: CliCommandRunner
|
|
75
|
-
fromInitCommand?: boolean
|
|
76
|
-
cliConfig?: CliConfig
|
|
77
|
-
cliPackageManager: CliPackageManager
|
|
78
|
-
telemetry: TelemetryLogger<TelemetryUserProperties
|
|
68
|
+
output: CliOutputter;
|
|
69
|
+
prompt: CliPrompter;
|
|
70
|
+
apiClient: CliApiClient;
|
|
71
|
+
cliConfigPath?: string;
|
|
72
|
+
cliRoot: string;
|
|
73
|
+
workDir: string;
|
|
74
|
+
corePath?: string;
|
|
75
|
+
chalk: typeof chalk;
|
|
76
|
+
commandRunner: CliCommandRunner;
|
|
77
|
+
fromInitCommand?: boolean;
|
|
78
|
+
cliConfig?: CliConfig;
|
|
79
|
+
cliPackageManager: CliPackageManager;
|
|
80
|
+
telemetry: TelemetryLogger<TelemetryUserProperties>;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
export declare interface CliCommandDefinition<F = Record<string, unknown>> {
|
|
82
|
-
name: string
|
|
83
|
-
group?: string
|
|
84
|
-
signature: string
|
|
85
|
-
description: string
|
|
86
|
-
helpText: string
|
|
87
|
-
action: CliCommandAction<F
|
|
88
|
-
hideFromHelp?: boolean
|
|
84
|
+
name: string;
|
|
85
|
+
group?: string;
|
|
86
|
+
signature: string;
|
|
87
|
+
description: string;
|
|
88
|
+
helpText: string;
|
|
89
|
+
action: CliCommandAction<F>;
|
|
90
|
+
hideFromHelp?: boolean;
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
export declare interface CliCommandGroupDefinition {
|
|
92
|
-
name: string
|
|
93
|
-
signature: string
|
|
94
|
-
isGroupRoot: boolean
|
|
95
|
-
description: string
|
|
96
|
-
hideFromHelp?: boolean
|
|
94
|
+
name: string;
|
|
95
|
+
signature: string;
|
|
96
|
+
isGroupRoot: boolean;
|
|
97
|
+
description: string;
|
|
98
|
+
hideFromHelp?: boolean;
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
export declare interface CliCommandRunner {
|
|
100
|
-
commands: Readonly<(CliCommandDefinition | CliCommandGroupDefinition)[]
|
|
101
|
-
commandGroups: Readonly<
|
|
102
|
+
commands: Readonly<(CliCommandDefinition | CliCommandGroupDefinition)[]>;
|
|
103
|
+
commandGroups: Readonly<
|
|
104
|
+
Record<string, (CliCommandDefinition | CliCommandGroupDefinition)[]>
|
|
105
|
+
>;
|
|
102
106
|
runCommand(
|
|
103
107
|
commandOrGroup: string,
|
|
104
108
|
args: CliCommandArguments,
|
|
105
109
|
options: CommandRunnerOptions,
|
|
106
|
-
): Promise<unknown
|
|
110
|
+
): Promise<unknown>;
|
|
107
111
|
resolveSubcommand(
|
|
108
112
|
group: (CliCommandDefinition | CliCommandGroupDefinition)[],
|
|
109
113
|
subCommandName: string,
|
|
110
114
|
parentGroupName: string,
|
|
111
|
-
): ResolvedCliCommand | null
|
|
115
|
+
): ResolvedCliCommand | null;
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
export declare interface CliConfig {
|
|
115
|
-
api?: CliApiConfig
|
|
119
|
+
api?: CliApiConfig;
|
|
116
120
|
project?: {
|
|
117
|
-
basePath?: string
|
|
118
|
-
}
|
|
121
|
+
basePath?: string;
|
|
122
|
+
};
|
|
119
123
|
/**
|
|
120
124
|
* Wraps the Studio in `<React.StrictMode>` root to aid flagging potential problems related to concurrent features (`startTransition`, `useTransition`, `useDeferredValue`, `Suspense`)
|
|
121
125
|
* Can also be enabled by setting `SANITY_STUDIO_REACT_STRICT_MODE="true"|"false"`.
|
|
122
126
|
* It only applies to `sanity dev` in dev mode, it's ignored in `sanity build` and in production.
|
|
123
127
|
* Defaults to `false`
|
|
124
128
|
*/
|
|
125
|
-
reactStrictMode?: boolean
|
|
129
|
+
reactStrictMode?: boolean;
|
|
126
130
|
/**
|
|
127
131
|
* The React Compiler is currently in beta, and is disabled by default.
|
|
128
132
|
* @see https://react.dev/learn/react-compiler
|
|
129
133
|
* @beta
|
|
130
134
|
*/
|
|
131
|
-
reactCompiler?: ReactCompilerConfig
|
|
135
|
+
reactCompiler?: ReactCompilerConfig;
|
|
132
136
|
server?: {
|
|
133
|
-
hostname?: string
|
|
134
|
-
port?: number
|
|
135
|
-
}
|
|
136
|
-
graphql?: GraphQLAPIConfig[]
|
|
137
|
-
vite?: UserViteConfig
|
|
137
|
+
hostname?: string;
|
|
138
|
+
port?: number;
|
|
139
|
+
};
|
|
140
|
+
graphql?: GraphQLAPIConfig[];
|
|
141
|
+
vite?: UserViteConfig;
|
|
138
142
|
/**
|
|
139
143
|
* @deprecated - Moved to deployment.autoUpdates
|
|
140
144
|
*/
|
|
141
|
-
autoUpdates?: boolean
|
|
145
|
+
autoUpdates?: boolean;
|
|
142
146
|
/**
|
|
143
147
|
* @deprecated - Replaced by deployment.appId
|
|
144
148
|
*/
|
|
145
|
-
studioHost?: string
|
|
149
|
+
studioHost?: string;
|
|
146
150
|
/**
|
|
147
151
|
* Parameter used to configure other kinds of applications.
|
|
148
152
|
* Signals to `sanity` commands that this is not a studio.
|
|
149
153
|
*/
|
|
150
|
-
app?: AppConfig
|
|
154
|
+
app?: AppConfig;
|
|
151
155
|
/**
|
|
152
156
|
* Deployment configuration
|
|
153
157
|
*/
|
|
@@ -158,13 +162,13 @@ export declare interface CliConfig {
|
|
|
158
162
|
* - Checking the output of `sanity deploy`.
|
|
159
163
|
* - Get it from your project's Studio tab in https://www.sanity.io/manage
|
|
160
164
|
*/
|
|
161
|
-
appId?: string
|
|
165
|
+
appId?: string;
|
|
162
166
|
/**
|
|
163
167
|
* Enable auto-updates for studios.
|
|
164
168
|
* {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k47faf43faf56}
|
|
165
169
|
*/
|
|
166
|
-
autoUpdates?: boolean
|
|
167
|
-
}
|
|
170
|
+
autoUpdates?: boolean;
|
|
171
|
+
};
|
|
168
172
|
/**
|
|
169
173
|
* Configuration for Sanity media libraries.
|
|
170
174
|
*/
|
|
@@ -173,8 +177,8 @@ export declare interface CliConfig {
|
|
|
173
177
|
* The path to the Media Library aspects directory. When using the CLI to manage aspects, this
|
|
174
178
|
* is the directory they will be read from and written to.
|
|
175
179
|
*/
|
|
176
|
-
aspectsPath: string
|
|
177
|
-
}
|
|
180
|
+
aspectsPath: string;
|
|
181
|
+
};
|
|
178
182
|
/**
|
|
179
183
|
* Configuration for Sanity typegen
|
|
180
184
|
*/
|
|
@@ -184,8 +188,8 @@ export declare interface CliConfig {
|
|
|
184
188
|
* When enabled, types are generated on startup and when files change.
|
|
185
189
|
* Defaults to `false`
|
|
186
190
|
*/
|
|
187
|
-
enabled?: boolean
|
|
188
|
-
}
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
};
|
|
189
193
|
/**
|
|
190
194
|
* Configuration for schema extraction (`sanity schema extract`)
|
|
191
195
|
*/
|
|
@@ -194,129 +198,132 @@ export declare interface CliConfig {
|
|
|
194
198
|
* Output path for the extracted schema file.
|
|
195
199
|
* Defaults to `schema.json` in the working directory.
|
|
196
200
|
*/
|
|
197
|
-
path?: string
|
|
201
|
+
path?: string;
|
|
198
202
|
/**
|
|
199
203
|
* When true, schema fields marked as required will be non-optional in the output.
|
|
200
204
|
* Defaults to `false`
|
|
201
205
|
*/
|
|
202
|
-
enforceRequiredFields?: boolean
|
|
206
|
+
enforceRequiredFields?: boolean;
|
|
203
207
|
/**
|
|
204
208
|
* Additional glob patterns to watch for schema changes in watch mode.
|
|
205
209
|
* These extend the default patterns:
|
|
206
210
|
* - `sanity.config.{js,jsx,ts,tsx,mjs}`
|
|
207
211
|
* - `schema*\/**\/*.{js,jsx,ts,tsx,mjs}`
|
|
208
212
|
*/
|
|
209
|
-
watchPatterns?: string[]
|
|
213
|
+
watchPatterns?: string[];
|
|
210
214
|
/**
|
|
211
215
|
* The name of the workspace to generate a schema for. Required if your Sanity project has more than one
|
|
212
216
|
* workspace.
|
|
213
217
|
*/
|
|
214
|
-
workspace?: string
|
|
215
|
-
}
|
|
218
|
+
workspace?: string;
|
|
219
|
+
};
|
|
216
220
|
}
|
|
217
221
|
|
|
218
222
|
declare type CliConfigResult =
|
|
219
223
|
| {
|
|
220
|
-
config: CliConfig
|
|
221
|
-
path: string
|
|
224
|
+
config: CliConfig;
|
|
225
|
+
path: string;
|
|
222
226
|
}
|
|
223
227
|
| {
|
|
224
|
-
config: null
|
|
225
|
-
path: string
|
|
226
|
-
}
|
|
228
|
+
config: null;
|
|
229
|
+
path: string;
|
|
230
|
+
};
|
|
227
231
|
|
|
228
232
|
declare interface ClientRequirements {
|
|
229
|
-
requireUser?: boolean
|
|
230
|
-
requireProject?: boolean
|
|
233
|
+
requireUser?: boolean;
|
|
234
|
+
requireProject?: boolean;
|
|
231
235
|
api?: {
|
|
232
|
-
projectId?: string
|
|
233
|
-
dataset?: string
|
|
234
|
-
apiHost?: string
|
|
235
|
-
apiVersion?: string
|
|
236
|
-
requestTagPrefix?: string
|
|
237
|
-
}
|
|
236
|
+
projectId?: string;
|
|
237
|
+
dataset?: string;
|
|
238
|
+
apiHost?: string;
|
|
239
|
+
apiVersion?: string;
|
|
240
|
+
requestTagPrefix?: string;
|
|
241
|
+
};
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
export declare interface CliOutputter {
|
|
241
|
-
print: (...args: unknown[]) => void
|
|
242
|
-
success: (...args: unknown[]) => void
|
|
243
|
-
warn: (...args: unknown[]) => void
|
|
244
|
-
error: (...args: unknown[]) => void
|
|
245
|
-
clear: () => void
|
|
246
|
-
spinner(options: Options | string): Ora
|
|
245
|
+
print: (...args: unknown[]) => void;
|
|
246
|
+
success: (...args: unknown[]) => void;
|
|
247
|
+
warn: (...args: unknown[]) => void;
|
|
248
|
+
error: (...args: unknown[]) => void;
|
|
249
|
+
clear: () => void;
|
|
250
|
+
spinner(options: Options | string): Ora;
|
|
247
251
|
}
|
|
248
252
|
|
|
249
253
|
/**
|
|
250
254
|
* @internal
|
|
251
255
|
*/
|
|
252
|
-
declare type CliPackageManager = typeof cliPackageManager
|
|
256
|
+
declare type CliPackageManager = typeof cliPackageManager;
|
|
253
257
|
|
|
254
258
|
/**
|
|
255
259
|
* @internal
|
|
256
260
|
*/
|
|
257
261
|
declare const cliPackageManager: {
|
|
258
|
-
getInstallCommand: typeof getInstallCommand
|
|
259
|
-
getPackageManagerChoice: typeof getPackageManagerChoice
|
|
260
|
-
installNewPackages: typeof installNewPackages
|
|
261
|
-
}
|
|
262
|
+
getInstallCommand: typeof getInstallCommand;
|
|
263
|
+
getPackageManagerChoice: typeof getPackageManagerChoice;
|
|
264
|
+
installNewPackages: typeof installNewPackages;
|
|
265
|
+
};
|
|
262
266
|
|
|
263
267
|
export declare type CliPrompter = (<T extends Answers = Answers>(
|
|
264
268
|
questions: DistinctQuestion<T>[],
|
|
265
269
|
) => Promise<T>) & {
|
|
266
|
-
Separator: typeof Separator
|
|
267
|
-
single: <T = string>(question: SinglePrompt) => Promise<T
|
|
268
|
-
}
|
|
270
|
+
Separator: typeof Separator;
|
|
271
|
+
single: <T = string>(question: SinglePrompt) => Promise<T>;
|
|
272
|
+
};
|
|
269
273
|
|
|
270
|
-
export declare type CliStubbedYarn = (
|
|
274
|
+
export declare type CliStubbedYarn = (
|
|
275
|
+
args: string[],
|
|
276
|
+
options?: CliYarnOptions,
|
|
277
|
+
) => Promise<void>;
|
|
271
278
|
|
|
272
279
|
export declare interface CliUserConfig {
|
|
273
|
-
cliLastUpdateCheck?: number
|
|
274
|
-
cliLastUpdateNag?: number
|
|
275
|
-
authToken?: string
|
|
276
|
-
authType?: string
|
|
280
|
+
cliLastUpdateCheck?: number;
|
|
281
|
+
cliLastUpdateNag?: number;
|
|
282
|
+
authToken?: string;
|
|
283
|
+
authType?: string;
|
|
277
284
|
}
|
|
278
285
|
|
|
279
286
|
export declare interface CliYarnOptions {
|
|
280
|
-
print?: CliOutputter[
|
|
281
|
-
error?: CliOutputter[
|
|
282
|
-
rootDir?: string
|
|
287
|
+
print?: CliOutputter["print"];
|
|
288
|
+
error?: CliOutputter["error"];
|
|
289
|
+
rootDir?: string;
|
|
283
290
|
}
|
|
284
291
|
|
|
285
292
|
export declare interface CommandRunnerOptions {
|
|
286
|
-
cliConfig: CliConfigResult | null
|
|
287
|
-
cliRoot: string
|
|
288
|
-
workDir: string
|
|
289
|
-
corePath: string | undefined
|
|
290
|
-
telemetry: TelemetryLogger<TelemetryUserProperties
|
|
293
|
+
cliConfig: CliConfigResult | null;
|
|
294
|
+
cliRoot: string;
|
|
295
|
+
workDir: string;
|
|
296
|
+
corePath: string | undefined;
|
|
297
|
+
telemetry: TelemetryLogger<TelemetryUserProperties>;
|
|
291
298
|
}
|
|
292
299
|
|
|
293
300
|
/**
|
|
294
301
|
* @deprecated Use `defineCliConfig` instead
|
|
295
302
|
* @beta
|
|
296
303
|
*/
|
|
297
|
-
export declare function createCliConfig(config: CliConfig): CliConfig
|
|
304
|
+
export declare function createCliConfig(config: CliConfig): CliConfig;
|
|
298
305
|
|
|
299
306
|
/** @beta */
|
|
300
|
-
export declare function defineCliConfig(config: CliConfig): CliConfig
|
|
307
|
+
export declare function defineCliConfig(config: CliConfig): CliConfig;
|
|
301
308
|
|
|
302
309
|
declare interface GetCliClient {
|
|
303
|
-
(options?: CliClientOptions): SanityClient
|
|
310
|
+
(options?: CliClientOptions): SanityClient;
|
|
304
311
|
/**
|
|
305
312
|
* @internal
|
|
306
313
|
* @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules
|
|
307
314
|
* @returns A token to use when constructing a client without a `token` explicitly defined, or undefined
|
|
308
315
|
*/
|
|
309
|
-
__internal__getToken: () => string | undefined
|
|
316
|
+
__internal__getToken: () => string | undefined;
|
|
310
317
|
}
|
|
311
318
|
|
|
312
319
|
/** @internal */
|
|
313
|
-
export declare const getCliClient: GetCliClient
|
|
320
|
+
export declare const getCliClient: GetCliClient;
|
|
314
321
|
|
|
315
322
|
declare function getInstallCommand(options: {
|
|
316
|
-
workDir: string
|
|
317
|
-
pkgNames?: string[]
|
|
318
|
-
depType?:
|
|
319
|
-
}): Promise<string
|
|
323
|
+
workDir: string;
|
|
324
|
+
pkgNames?: string[];
|
|
325
|
+
depType?: "dev" | "prod" | "peer";
|
|
326
|
+
}): Promise<string>;
|
|
320
327
|
|
|
321
328
|
/**
|
|
322
329
|
* Attempts to resolve the most optimal package manager to use to install/upgrade
|
|
@@ -343,41 +350,41 @@ declare function getPackageManagerChoice(
|
|
|
343
350
|
workDir: string,
|
|
344
351
|
options:
|
|
345
352
|
| {
|
|
346
|
-
interactive: false
|
|
353
|
+
interactive: false;
|
|
347
354
|
}
|
|
348
355
|
| {
|
|
349
|
-
interactive?: true
|
|
350
|
-
prompt: CliPrompter
|
|
356
|
+
interactive?: true;
|
|
357
|
+
prompt: CliPrompter;
|
|
351
358
|
},
|
|
352
359
|
): Promise<{
|
|
353
|
-
chosen: PackageManager
|
|
354
|
-
mostOptimal?: PackageManager
|
|
355
|
-
}
|
|
360
|
+
chosen: PackageManager;
|
|
361
|
+
mostOptimal?: PackageManager;
|
|
362
|
+
}>;
|
|
356
363
|
|
|
357
364
|
export declare interface GraphQLAPIConfig {
|
|
358
365
|
/**
|
|
359
366
|
* ID of GraphQL API. Only (currently) required when using the `--api` flag
|
|
360
367
|
* for `sanity graphql deploy`, in order to only deploy a specific API.
|
|
361
368
|
*/
|
|
362
|
-
id?: string
|
|
369
|
+
id?: string;
|
|
363
370
|
/**
|
|
364
371
|
* Name of workspace containing the schema to deploy
|
|
365
372
|
*
|
|
366
373
|
* Optional, defaults to `default` (eg the one used if no `name` is defined)
|
|
367
374
|
*/
|
|
368
|
-
workspace?: string
|
|
375
|
+
workspace?: string;
|
|
369
376
|
/**
|
|
370
377
|
* Name of source containing the schema to deploy, within the configured workspace
|
|
371
378
|
*
|
|
372
379
|
* Optional, defaults to `default` (eg the one used if no `name` is defined)
|
|
373
380
|
*/
|
|
374
|
-
source?: string
|
|
381
|
+
source?: string;
|
|
375
382
|
/**
|
|
376
383
|
* API tag for this API - allows deploying multiple different APIs to a single dataset
|
|
377
384
|
*
|
|
378
385
|
* Optional, defaults to `default`
|
|
379
386
|
*/
|
|
380
|
-
tag?: string
|
|
387
|
+
tag?: string;
|
|
381
388
|
/**
|
|
382
389
|
* Whether or not to deploy a "GraphQL Playground" to the API url - an HTML interface that allows
|
|
383
390
|
* running queries and introspecting the schema from the browser. Note that this interface is not
|
|
@@ -386,13 +393,13 @@ export declare interface GraphQLAPIConfig {
|
|
|
386
393
|
*
|
|
387
394
|
* Optional, defaults to `true`
|
|
388
395
|
*/
|
|
389
|
-
playground?: boolean
|
|
396
|
+
playground?: boolean;
|
|
390
397
|
/**
|
|
391
398
|
* Generation of API to auto-generate from schema. New APIs should use the latest (`gen3`).
|
|
392
399
|
*
|
|
393
400
|
* Optional, defaults to `gen3`
|
|
394
401
|
*/
|
|
395
|
-
generation?:
|
|
402
|
+
generation?: "gen3" | "gen2" | "gen1";
|
|
396
403
|
/**
|
|
397
404
|
* Define document interface fields (`_id`, `_type` etc) as non-nullable.
|
|
398
405
|
* If you never use a document type as an object (within other documents) in your schema types,
|
|
@@ -402,24 +409,24 @@ export declare interface GraphQLAPIConfig {
|
|
|
402
409
|
*
|
|
403
410
|
* Optional, defaults to `false`
|
|
404
411
|
*/
|
|
405
|
-
nonNullDocumentFields?: boolean
|
|
412
|
+
nonNullDocumentFields?: boolean;
|
|
406
413
|
/**
|
|
407
414
|
* Suffix to use for generated filter types.
|
|
408
415
|
*
|
|
409
416
|
* Optional, Defaults to `Filter`.
|
|
410
417
|
*
|
|
411
418
|
*/
|
|
412
|
-
filterSuffix?: string
|
|
419
|
+
filterSuffix?: string;
|
|
413
420
|
}
|
|
414
421
|
|
|
415
422
|
declare function installNewPackages(
|
|
416
423
|
options: InstallOptions,
|
|
417
|
-
context: Pick<CliCommandContext,
|
|
418
|
-
): Promise<void
|
|
424
|
+
context: Pick<CliCommandContext, "output" | "workDir">,
|
|
425
|
+
): Promise<void>;
|
|
419
426
|
|
|
420
427
|
declare interface InstallOptions {
|
|
421
|
-
packageManager: PackageManager
|
|
422
|
-
packages: string[]
|
|
428
|
+
packageManager: PackageManager;
|
|
429
|
+
packages: string[];
|
|
423
430
|
}
|
|
424
431
|
|
|
425
432
|
/**
|
|
@@ -435,118 +442,121 @@ export declare function loadEnv(
|
|
|
435
442
|
mode: string,
|
|
436
443
|
envDir: string,
|
|
437
444
|
prefixes?: string[],
|
|
438
|
-
): Record<string, string
|
|
445
|
+
): Record<string, string>;
|
|
439
446
|
|
|
440
447
|
export declare interface PackageJson {
|
|
441
|
-
name: string
|
|
442
|
-
version: string
|
|
443
|
-
scripts?: Record<string, string
|
|
444
|
-
description?: string
|
|
445
|
-
author?: string
|
|
446
|
-
license?: string
|
|
447
|
-
private?: boolean
|
|
448
|
-
dependencies?: Record<string, string
|
|
449
|
-
devDependencies?: Record<string, string
|
|
450
|
-
peerDependencies?: Record<string, string
|
|
448
|
+
name: string;
|
|
449
|
+
version: string;
|
|
450
|
+
scripts?: Record<string, string>;
|
|
451
|
+
description?: string;
|
|
452
|
+
author?: string;
|
|
453
|
+
license?: string;
|
|
454
|
+
private?: boolean;
|
|
455
|
+
dependencies?: Record<string, string>;
|
|
456
|
+
devDependencies?: Record<string, string>;
|
|
457
|
+
peerDependencies?: Record<string, string>;
|
|
451
458
|
repository?: {
|
|
452
|
-
type: string
|
|
453
|
-
url: string
|
|
454
|
-
}
|
|
455
|
-
engines?: Record<string, string
|
|
459
|
+
type: string;
|
|
460
|
+
url: string;
|
|
461
|
+
};
|
|
462
|
+
engines?: Record<string, string>;
|
|
456
463
|
}
|
|
457
464
|
|
|
458
|
-
declare type PackageManager =
|
|
465
|
+
declare type PackageManager = "npm" | "yarn" | "pnpm" | "bun" | "manual";
|
|
459
466
|
|
|
460
467
|
/**
|
|
461
468
|
* @beta
|
|
462
469
|
*/
|
|
463
|
-
export declare type ReactCompilerConfig = Partial<PluginOptions
|
|
470
|
+
export declare type ReactCompilerConfig = Partial<PluginOptions>;
|
|
464
471
|
|
|
465
472
|
export declare interface ResolvedCliCommand {
|
|
466
|
-
command: CliCommandDefinition | CliCommandGroupDefinition
|
|
467
|
-
commandName: string
|
|
468
|
-
parentName?: string
|
|
469
|
-
isGroup: boolean
|
|
470
|
-
isCommand: boolean
|
|
473
|
+
command: CliCommandDefinition | CliCommandGroupDefinition;
|
|
474
|
+
commandName: string;
|
|
475
|
+
parentName?: string;
|
|
476
|
+
isGroup: boolean;
|
|
477
|
+
isCommand: boolean;
|
|
471
478
|
}
|
|
472
479
|
|
|
473
|
-
export {SanityClient}
|
|
480
|
+
export { SanityClient };
|
|
474
481
|
|
|
475
482
|
export declare interface SanityCore {
|
|
476
|
-
requiredCliVersionRange: string
|
|
477
|
-
commands: (CliCommandDefinition | CliCommandGroupDefinition)[]
|
|
483
|
+
requiredCliVersionRange: string;
|
|
484
|
+
commands: (CliCommandDefinition | CliCommandGroupDefinition)[];
|
|
478
485
|
}
|
|
479
486
|
|
|
480
487
|
export declare interface SanityJson {
|
|
481
|
-
root?: boolean
|
|
488
|
+
root?: boolean;
|
|
482
489
|
project?: {
|
|
483
|
-
name?: string
|
|
484
|
-
basePath?: string
|
|
485
|
-
}
|
|
486
|
-
api?: CliApiConfig
|
|
490
|
+
name?: string;
|
|
491
|
+
basePath?: string;
|
|
492
|
+
};
|
|
493
|
+
api?: CliApiConfig;
|
|
487
494
|
__experimental_spaces?: {
|
|
488
|
-
name: string
|
|
489
|
-
title: string
|
|
490
|
-
default?: true
|
|
495
|
+
name: string;
|
|
496
|
+
title: string;
|
|
497
|
+
default?: true;
|
|
491
498
|
api: {
|
|
492
|
-
projectId?: string
|
|
493
|
-
dataset?: string
|
|
494
|
-
}
|
|
495
|
-
}[]
|
|
496
|
-
plugins?: string[]
|
|
499
|
+
projectId?: string;
|
|
500
|
+
dataset?: string;
|
|
501
|
+
};
|
|
502
|
+
}[];
|
|
503
|
+
plugins?: string[];
|
|
497
504
|
parts?: {
|
|
498
|
-
name?: string
|
|
499
|
-
path?: string
|
|
500
|
-
implements?: string
|
|
501
|
-
description?: string
|
|
502
|
-
}[]
|
|
505
|
+
name?: string;
|
|
506
|
+
path?: string;
|
|
507
|
+
implements?: string;
|
|
508
|
+
description?: string;
|
|
509
|
+
}[];
|
|
503
510
|
env?: {
|
|
504
|
-
production?: SanityJson
|
|
505
|
-
staging?: SanityJson
|
|
506
|
-
development?: SanityJson
|
|
507
|
-
}
|
|
511
|
+
production?: SanityJson;
|
|
512
|
+
staging?: SanityJson;
|
|
513
|
+
development?: SanityJson;
|
|
514
|
+
};
|
|
508
515
|
}
|
|
509
516
|
|
|
510
517
|
export declare interface SanityModuleInternal {
|
|
511
518
|
cliProjectCommands: {
|
|
512
|
-
requiredCliVersionRange: string
|
|
513
|
-
commands: (CliCommandDefinition | CliCommandGroupDefinition)[]
|
|
514
|
-
}
|
|
519
|
+
requiredCliVersionRange: string;
|
|
520
|
+
commands: (CliCommandDefinition | CliCommandGroupDefinition)[];
|
|
521
|
+
};
|
|
515
522
|
}
|
|
516
523
|
|
|
517
524
|
export declare type SanityUser = {
|
|
518
|
-
id: string
|
|
519
|
-
name: string
|
|
520
|
-
email: string
|
|
521
|
-
profileImage?: string
|
|
522
|
-
tosAcceptedAt?: string
|
|
523
|
-
provider:
|
|
524
|
-
}
|
|
525
|
+
id: string;
|
|
526
|
+
name: string;
|
|
527
|
+
email: string;
|
|
528
|
+
profileImage?: string;
|
|
529
|
+
tosAcceptedAt?: string;
|
|
530
|
+
provider: "google" | "github" | "sanity" | `saml-${string}`;
|
|
531
|
+
};
|
|
525
532
|
|
|
526
533
|
export declare type SinglePrompt =
|
|
527
|
-
| (Omit<DistinctQuestion,
|
|
528
|
-
type:
|
|
529
|
-
choices: ChoiceCollection
|
|
530
|
-
})
|
|
531
|
-
| (Omit<DistinctQuestion, 'name'> & {
|
|
532
|
-
type: 'confirm'
|
|
534
|
+
| (Omit<DistinctQuestion, "name"> & {
|
|
535
|
+
type: "list";
|
|
536
|
+
choices: ChoiceCollection;
|
|
533
537
|
})
|
|
534
|
-
| (Omit<DistinctQuestion,
|
|
535
|
-
type:
|
|
538
|
+
| (Omit<DistinctQuestion, "name"> & {
|
|
539
|
+
type: "confirm";
|
|
536
540
|
})
|
|
541
|
+
| (Omit<DistinctQuestion, "name"> & {
|
|
542
|
+
type: "input";
|
|
543
|
+
});
|
|
537
544
|
|
|
538
545
|
export declare interface TelemetryUserProperties {
|
|
539
|
-
runtime: string
|
|
540
|
-
runtimeVersion: string
|
|
541
|
-
cliVersion: string
|
|
542
|
-
machinePlatform: string
|
|
543
|
-
cpuArchitecture: string
|
|
544
|
-
projectId?: string
|
|
545
|
-
dataset?: string
|
|
546
|
+
runtime: string;
|
|
547
|
+
runtimeVersion: string;
|
|
548
|
+
cliVersion: string;
|
|
549
|
+
machinePlatform: string;
|
|
550
|
+
cpuArchitecture: string;
|
|
551
|
+
projectId?: string;
|
|
552
|
+
dataset?: string;
|
|
546
553
|
}
|
|
547
554
|
|
|
548
555
|
export declare type UserViteConfig =
|
|
549
556
|
| InlineConfig
|
|
550
|
-
| ((
|
|
557
|
+
| ((
|
|
558
|
+
config: InlineConfig,
|
|
559
|
+
env: ConfigEnv,
|
|
560
|
+
) => InlineConfig | Promise<InlineConfig>);
|
|
551
561
|
|
|
552
|
-
export {}
|
|
562
|
+
export {};
|
package/lib/run.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {TypegenWorkerChannel as TypegenWorkerChannel_2} from
|
|
2
|
-
import {WorkerChannel} from
|
|
1
|
+
import { TypegenWorkerChannel as TypegenWorkerChannel_2 } from "@sanity/codegen";
|
|
2
|
+
import { WorkerChannel } from "@sanity/worker-channels";
|
|
3
3
|
|
|
4
4
|
export declare interface TypegenGenerateTypesWorkerData {
|
|
5
|
-
workDir: string
|
|
6
|
-
schemaPath: string
|
|
7
|
-
searchPath: string | string[]
|
|
8
|
-
overloadClientMethods?: boolean
|
|
5
|
+
workDir: string;
|
|
6
|
+
schemaPath: string;
|
|
7
|
+
searchPath: string | string[];
|
|
8
|
+
overloadClientMethods?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export declare type TypegenWorkerChannel = WorkerChannel.Definition<
|
|
12
12
|
{
|
|
13
|
-
loadedSchema: WorkerChannel.Event
|
|
13
|
+
loadedSchema: WorkerChannel.Event;
|
|
14
14
|
typegenStarted: WorkerChannel.Event<{
|
|
15
|
-
expectedFileCount: number
|
|
16
|
-
}
|
|
15
|
+
expectedFileCount: number;
|
|
16
|
+
}>;
|
|
17
17
|
typegenComplete: WorkerChannel.Event<{
|
|
18
|
-
code: string
|
|
19
|
-
}
|
|
20
|
-
} & TypegenWorkerChannel_2[
|
|
21
|
-
|
|
18
|
+
code: string;
|
|
19
|
+
}>;
|
|
20
|
+
} & TypegenWorkerChannel_2["__definition"]
|
|
21
|
+
>;
|
|
22
22
|
|
|
23
|
-
export {}
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,35 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1-next.1+a2c187ff7a",
|
|
4
4
|
"description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
6
|
+
"cli",
|
|
7
7
|
"cms",
|
|
8
|
+
"content",
|
|
8
9
|
"headless",
|
|
9
10
|
"realtime",
|
|
10
|
-
"
|
|
11
|
-
"cli",
|
|
11
|
+
"sanity",
|
|
12
12
|
"tool"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://www.sanity.io/",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/sanity-io/sanity/issues"
|
|
17
17
|
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Sanity.io <hello@sanity.io>",
|
|
18
20
|
"repository": {
|
|
19
21
|
"type": "git",
|
|
20
22
|
"url": "git+https://github.com/sanity-io/sanity.git",
|
|
21
23
|
"directory": "packages/@sanity/cli"
|
|
22
24
|
},
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"author": "Sanity.io <hello@sanity.io>",
|
|
25
|
-
"sideEffects": false,
|
|
26
|
-
"type": "commonjs",
|
|
27
|
-
"exports": {
|
|
28
|
-
".": "./lib/index.js",
|
|
29
|
-
"./package.json": "./package.json"
|
|
30
|
-
},
|
|
31
|
-
"main": "./lib/index.js",
|
|
32
|
-
"types": "./lib/index.d.ts",
|
|
33
25
|
"bin": {
|
|
34
26
|
"sanity": "./bin/sanity"
|
|
35
27
|
},
|
|
@@ -39,6 +31,14 @@
|
|
|
39
31
|
"lib",
|
|
40
32
|
"templates"
|
|
41
33
|
],
|
|
34
|
+
"type": "commonjs",
|
|
35
|
+
"sideEffects": false,
|
|
36
|
+
"main": "./lib/index.js",
|
|
37
|
+
"types": "./lib/index.d.ts",
|
|
38
|
+
"exports": {
|
|
39
|
+
".": "./lib/index.js",
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/parser": "^7.28.6",
|
|
44
44
|
"@babel/traverse": "^7.28.6",
|
|
@@ -112,11 +112,11 @@
|
|
|
112
112
|
"vitest": "^4.0.18",
|
|
113
113
|
"which": "^2.0.2",
|
|
114
114
|
"xdg-basedir": "^4.0.0",
|
|
115
|
-
"@repo/eslint-config": "5.8.
|
|
116
|
-
"@repo/package.config": "5.8.
|
|
117
|
-
"@
|
|
118
|
-
"@repo/
|
|
119
|
-
"@
|
|
115
|
+
"@repo/eslint-config": "5.8.1-next.1+a2c187ff7a",
|
|
116
|
+
"@repo/package.config": "5.8.1-next.1+a2c187ff7a",
|
|
117
|
+
"@repo/test-config": "5.8.1-next.1+a2c187ff7a",
|
|
118
|
+
"@repo/tsconfig": "5.8.1-next.1+a2c187ff7a",
|
|
119
|
+
"@sanity/types": "5.8.0"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"babel-plugin-react-compiler": "*"
|