@sanity/workbench-cli 1.2.0 → 1.4.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/_exports/build.d.ts +22 -17
- package/dist/_exports/deploy.d.ts +169 -23
- package/dist/_exports/deploy.js +4 -1
- package/dist/_exports/deploy.js.map +1 -1
- package/dist/_exports/dev.d.ts +9 -5
- package/dist/_exports/index.d.ts +19 -15
- package/dist/_exports/undeploy.d.ts +248 -0
- package/dist/_exports/undeploy.js +3 -0
- package/dist/_exports/undeploy.js.map +1 -0
- package/dist/actions/build/artifact.js +2 -2
- package/dist/actions/build/artifact.js.map +1 -1
- package/dist/actions/build/configs/artifact.js +5 -5
- package/dist/actions/build/configs/artifact.js.map +1 -1
- package/dist/actions/build/vite/plugin.js +5 -0
- package/dist/actions/build/vite/plugin.js.map +1 -1
- package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js +5 -3
- package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js.map +1 -1
- package/dist/actions/build/vite/plugins/plugin-sanity-environment.js +26 -2
- package/dist/actions/build/vite/plugins/plugin-sanity-environment.js.map +1 -1
- package/dist/actions/deploy/buildExposes.js +59 -0
- package/dist/actions/deploy/buildExposes.js.map +1 -0
- package/dist/actions/deploy/checkBuiltOutput.js +4 -3
- package/dist/actions/deploy/checkBuiltOutput.js.map +1 -1
- package/dist/actions/deploy/deployConfig.js +63 -0
- package/dist/actions/deploy/deployConfig.js.map +1 -0
- package/dist/actions/deploy/deployWorkbenchApp.js +108 -0
- package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -0
- package/dist/actions/deploy/getWorkbench.js +4 -4
- package/dist/actions/deploy/getWorkbench.js.map +1 -1
- package/dist/actions/dev/deriveInterfaces.js +43 -32
- package/dist/actions/dev/deriveInterfaces.js.map +1 -1
- package/dist/actions/dev/exposesSetId.js +8 -8
- package/dist/actions/dev/exposesSetId.js.map +1 -1
- package/dist/actions/dev/registry.js +22 -12
- package/dist/actions/dev/registry.js.map +1 -1
- package/dist/actions/dev/startDevManifestWatcher.js +2 -2
- package/dist/actions/dev/startDevManifestWatcher.js.map +1 -1
- package/dist/actions/dev/startDevServerRegistration.js +7 -7
- package/dist/actions/dev/startDevServerRegistration.js.map +1 -1
- package/dist/actions/dev/startWorkbenchDevServer.js +9 -6
- package/dist/actions/dev/startWorkbenchDevServer.js.map +1 -1
- package/dist/actions/dev/writeWorkbenchRuntime.js +4 -1
- package/dist/actions/dev/writeWorkbenchRuntime.js.map +1 -1
- package/dist/actions/undeploy/workbenchUndeployAdapter.js +150 -0
- package/dist/actions/undeploy/workbenchUndeployAdapter.js.map +1 -0
- package/dist/contract.js +16 -8
- package/dist/contract.js.map +1 -1
- package/dist/defineApp.js +25 -20
- package/dist/defineApp.js.map +1 -1
- package/dist/defineView.js.map +1 -1
- package/dist/resolveWorkbenchApp.js +4 -3
- package/dist/resolveWorkbenchApp.js.map +1 -1
- package/dist/services/apiVersion.js +5 -0
- package/dist/services/apiVersion.js.map +1 -0
- package/dist/services/applications.js +100 -0
- package/dist/services/applications.js.map +1 -0
- package/dist/services/installations.js +63 -0
- package/dist/services/installations.js.map +1 -0
- package/package.json +7 -3
- package/dist/actions/deploy/deployInstallationConfig.js +0 -91
- package/dist/actions/deploy/deployInstallationConfig.js.map +0 -1
package/dist/_exports/build.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { z } from "zod/mini";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* User-facing input for `unstable_defineApp`. Excludes the internal
|
|
7
|
-
* `applicationType`, `isSingleton`, and `
|
|
7
|
+
* `applicationType`, `isSingleton`, and `config` — validated by the
|
|
8
8
|
* schema but not part of the public surface (Sanity-owned apps set them via
|
|
9
9
|
* `@ts-expect-error`).
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
declare type DefineAppInput = Omit<
|
|
13
13
|
z.output<typeof DefineAppInputSchema>,
|
|
14
|
-
"applicationType" | "
|
|
14
|
+
"applicationType" | "config" | "isSingleton"
|
|
15
15
|
>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -31,16 +31,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
31
31
|
dashboard: "dashboard";
|
|
32
32
|
}>
|
|
33
33
|
>;
|
|
34
|
-
|
|
35
|
-
group: z.ZodMiniOptional<
|
|
36
|
-
z.ZodMiniEnum<{
|
|
37
|
-
"dock.system": "dock.system";
|
|
38
|
-
"dock.applications": "dock.applications";
|
|
39
|
-
"dock.user": "dock.user";
|
|
40
|
-
}>
|
|
41
|
-
>;
|
|
42
|
-
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
-
installationConfig: z.ZodMiniOptional<
|
|
34
|
+
config: z.ZodMiniOptional<
|
|
44
35
|
z.ZodMiniDiscriminatedUnion<
|
|
45
36
|
[
|
|
46
37
|
z.ZodMiniObject<
|
|
@@ -64,6 +55,15 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
64
55
|
"appType"
|
|
65
56
|
>
|
|
66
57
|
>;
|
|
58
|
+
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
59
|
+
group: z.ZodMiniOptional<
|
|
60
|
+
z.ZodMiniEnum<{
|
|
61
|
+
"dock.system": "dock.system";
|
|
62
|
+
"dock.applications": "dock.applications";
|
|
63
|
+
"dock.user": "dock.user";
|
|
64
|
+
}>
|
|
65
|
+
>;
|
|
66
|
+
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
67
67
|
isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
68
68
|
name: z.ZodMiniString<string>;
|
|
69
69
|
organizationId: z.ZodMiniString<string>;
|
|
@@ -74,6 +74,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
74
74
|
[
|
|
75
75
|
z.ZodMiniObject<
|
|
76
76
|
{
|
|
77
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
77
78
|
name: z.ZodMiniString<string>;
|
|
78
79
|
src: z.ZodMiniString<string>;
|
|
79
80
|
type: z.ZodMiniLiteral<"worker">;
|
|
@@ -85,6 +86,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
85
86
|
>
|
|
86
87
|
>
|
|
87
88
|
>;
|
|
89
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
88
90
|
title: z.ZodMiniString<string>;
|
|
89
91
|
views: z.ZodMiniOptional<
|
|
90
92
|
z.ZodMiniArray<
|
|
@@ -92,6 +94,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
92
94
|
[
|
|
93
95
|
z.ZodMiniObject<
|
|
94
96
|
{
|
|
97
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
95
98
|
name: z.ZodMiniString<string>;
|
|
96
99
|
src: z.ZodMiniString<string>;
|
|
97
100
|
type: z.ZodMiniLiteral<"panel">;
|
|
@@ -118,8 +121,6 @@ declare interface DefineAppResult extends DefineAppInput {
|
|
|
118
121
|
|
|
119
122
|
/** @public */
|
|
120
123
|
declare interface ResolvedWorkbenchApp {
|
|
121
|
-
/** A Sanity-owned singleton (e.g. the Media Library) — deploys its config, not an application. */
|
|
122
|
-
readonly isSingleton: boolean;
|
|
123
124
|
/** The app's unique `name` from `unstable_defineApp`. */
|
|
124
125
|
readonly name: string;
|
|
125
126
|
/** Background worker services the app declares. */
|
|
@@ -128,10 +129,14 @@ declare interface ResolvedWorkbenchApp {
|
|
|
128
129
|
readonly views: NonNullable<DefineAppInput["views"]>;
|
|
129
130
|
/** Resolved app kind — `studio` or one of the SDK app types. */
|
|
130
131
|
readonly applicationType?: string;
|
|
132
|
+
/** Deploys on its own path, separate from the interfaces. */
|
|
133
|
+
readonly config?: WorkbenchApp["config"];
|
|
131
134
|
/** SDK app-view entrypoint, when declared. */
|
|
132
135
|
readonly entry?: string;
|
|
133
|
-
/**
|
|
134
|
-
readonly
|
|
136
|
+
/** Explicit singleton flag (a Sanity-owned app); `undefined` when the app doesn't set it. */
|
|
137
|
+
readonly isSingleton?: boolean;
|
|
138
|
+
/** Hostname the application is created at on first deploy. */
|
|
139
|
+
readonly slug?: string;
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
/**
|
|
@@ -165,7 +170,7 @@ declare type WorkbenchApp = DefineAppResult &
|
|
|
165
170
|
* @internal
|
|
166
171
|
*/
|
|
167
172
|
export declare interface WorkbenchExposes {
|
|
168
|
-
|
|
173
|
+
config?: WorkbenchApp["config"];
|
|
169
174
|
services?: DefineAppInput["services"];
|
|
170
175
|
views?: DefineAppInput["views"];
|
|
171
176
|
}
|
|
@@ -2,24 +2,78 @@ import { CliConfig } from "@sanity/cli-core";
|
|
|
2
2
|
import { Output } from "@sanity/cli-core";
|
|
3
3
|
import { z } from "zod/mini";
|
|
4
4
|
|
|
5
|
+
export declare interface Application {
|
|
6
|
+
id: string;
|
|
7
|
+
organizationId: string;
|
|
8
|
+
slug: string | null;
|
|
9
|
+
title: string;
|
|
10
|
+
type: ApplicationType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare type ApplicationType = "coreApp" | "studio";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An interface as Brett stores it: the declared `type` (validated server-side,
|
|
17
|
+
* not here) and the remote-relative `moduleId` the workbench loads it by — the
|
|
18
|
+
* host prepends the app's own id.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare interface BrettInterface {
|
|
22
|
+
moduleId: string;
|
|
23
|
+
name: string;
|
|
24
|
+
title: string;
|
|
25
|
+
type: string;
|
|
26
|
+
version: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A studio workspace as Brett stores it. */
|
|
30
|
+
export declare interface BrettWorkspace {
|
|
31
|
+
dataset: string;
|
|
32
|
+
projectId: string;
|
|
33
|
+
basePath?: string;
|
|
34
|
+
icon?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
subtitle?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The interface records deploy sends: the app view (only when `exposesAppView`),
|
|
42
|
+
* every view, and every service.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildExposes(
|
|
46
|
+
exposes: WorkbenchExposes,
|
|
47
|
+
{ appName, appTitle, exposesAppView, version }: BuildExposesContext,
|
|
48
|
+
): BrettInterface[];
|
|
49
|
+
|
|
50
|
+
declare interface BuildExposesContext {
|
|
51
|
+
appName: string;
|
|
52
|
+
appTitle: string;
|
|
53
|
+
/** Whether the build exposes the app view (`./App`) — apps with an `entry`, and every studio. */
|
|
54
|
+
exposesAppView: boolean;
|
|
55
|
+
version: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
5
58
|
/**
|
|
6
59
|
* Throws unless `sourceDir` is a directory holding a federation build.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* marker that `sanity build` produced a
|
|
60
|
+
* A workbench build always emits a module-federation remote, and may
|
|
61
|
+
* additionally emit a standalone `index.html` SPA (workbench remotes). Either
|
|
62
|
+
* way `mf-manifest.json` is the reliable marker that `sanity build` produced a
|
|
63
|
+
* federation build, so that — not `index.html` — is what we check for.
|
|
10
64
|
*/
|
|
11
65
|
export declare function checkBuiltOutput(sourceDir: string): Promise<void>;
|
|
12
66
|
|
|
13
67
|
/**
|
|
14
68
|
* User-facing input for `unstable_defineApp`. Excludes the internal
|
|
15
|
-
* `applicationType`, `isSingleton`, and `
|
|
69
|
+
* `applicationType`, `isSingleton`, and `config` — validated by the
|
|
16
70
|
* schema but not part of the public surface (Sanity-owned apps set them via
|
|
17
71
|
* `@ts-expect-error`).
|
|
18
72
|
* @public
|
|
19
73
|
*/
|
|
20
74
|
declare type DefineAppInput = Omit<
|
|
21
75
|
z.output<typeof DefineAppInputSchema>,
|
|
22
|
-
"applicationType" | "
|
|
76
|
+
"applicationType" | "config" | "isSingleton"
|
|
23
77
|
>;
|
|
24
78
|
|
|
25
79
|
/**
|
|
@@ -39,16 +93,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
39
93
|
dashboard: "dashboard";
|
|
40
94
|
}>
|
|
41
95
|
>;
|
|
42
|
-
|
|
43
|
-
group: z.ZodMiniOptional<
|
|
44
|
-
z.ZodMiniEnum<{
|
|
45
|
-
"dock.system": "dock.system";
|
|
46
|
-
"dock.applications": "dock.applications";
|
|
47
|
-
"dock.user": "dock.user";
|
|
48
|
-
}>
|
|
49
|
-
>;
|
|
50
|
-
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
|
-
installationConfig: z.ZodMiniOptional<
|
|
96
|
+
config: z.ZodMiniOptional<
|
|
52
97
|
z.ZodMiniDiscriminatedUnion<
|
|
53
98
|
[
|
|
54
99
|
z.ZodMiniObject<
|
|
@@ -72,6 +117,15 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
72
117
|
"appType"
|
|
73
118
|
>
|
|
74
119
|
>;
|
|
120
|
+
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
121
|
+
group: z.ZodMiniOptional<
|
|
122
|
+
z.ZodMiniEnum<{
|
|
123
|
+
"dock.system": "dock.system";
|
|
124
|
+
"dock.applications": "dock.applications";
|
|
125
|
+
"dock.user": "dock.user";
|
|
126
|
+
}>
|
|
127
|
+
>;
|
|
128
|
+
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
75
129
|
isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
76
130
|
name: z.ZodMiniString<string>;
|
|
77
131
|
organizationId: z.ZodMiniString<string>;
|
|
@@ -82,6 +136,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
82
136
|
[
|
|
83
137
|
z.ZodMiniObject<
|
|
84
138
|
{
|
|
139
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
140
|
name: z.ZodMiniString<string>;
|
|
86
141
|
src: z.ZodMiniString<string>;
|
|
87
142
|
type: z.ZodMiniLiteral<"worker">;
|
|
@@ -93,6 +148,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
93
148
|
>
|
|
94
149
|
>
|
|
95
150
|
>;
|
|
151
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
152
|
title: z.ZodMiniString<string>;
|
|
97
153
|
views: z.ZodMiniOptional<
|
|
98
154
|
z.ZodMiniArray<
|
|
@@ -100,6 +156,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
100
156
|
[
|
|
101
157
|
z.ZodMiniObject<
|
|
102
158
|
{
|
|
159
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
103
160
|
name: z.ZodMiniString<string>;
|
|
104
161
|
src: z.ZodMiniString<string>;
|
|
105
162
|
type: z.ZodMiniLiteral<"panel">;
|
|
@@ -136,11 +193,11 @@ declare interface DeployableWorkbenchApp extends ResolvedWorkbenchApp {
|
|
|
136
193
|
*/
|
|
137
194
|
buildViewDeploymentPayload(applicationId: string): ViewDeploymentPayload;
|
|
138
195
|
/**
|
|
139
|
-
* A singleton (the Media Library) that carries an
|
|
196
|
+
* A singleton (the Media Library) that carries an config — deploy
|
|
140
197
|
* persists the config to the org's installation. Independent of the interfaces,
|
|
141
198
|
* which register regardless; non-singletons never carry a config.
|
|
142
199
|
*/
|
|
143
|
-
|
|
200
|
+
deploySingletonConfig: boolean;
|
|
144
201
|
/** Declares something to host as an application — an entry, view, or service. */
|
|
145
202
|
hasInterfaces: boolean;
|
|
146
203
|
}
|
|
@@ -151,22 +208,82 @@ declare interface DeployableWorkbenchApp extends ResolvedWorkbenchApp {
|
|
|
151
208
|
* reaches this mutating step.
|
|
152
209
|
* @internal
|
|
153
210
|
*/
|
|
154
|
-
export declare function
|
|
211
|
+
export declare function deployConfig(options: {
|
|
155
212
|
appType: string;
|
|
156
213
|
installationId: string;
|
|
214
|
+
organizationId: string;
|
|
157
215
|
output: Output;
|
|
158
216
|
sourceDir: string;
|
|
159
217
|
version: string;
|
|
160
218
|
}): Promise<void>;
|
|
161
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Deploy a workbench coreApp through Brett: redeploy when `appId` is set,
|
|
222
|
+
* otherwise create the application at `slug`. Returns the application id for the
|
|
223
|
+
* shell to report.
|
|
224
|
+
* @internal
|
|
225
|
+
*/
|
|
226
|
+
export declare function deployCoreApp(options: {
|
|
227
|
+
appId: string | undefined;
|
|
228
|
+
interfaces: readonly BrettInterface[];
|
|
229
|
+
isAutoUpdating: boolean;
|
|
230
|
+
isSingleton?: boolean;
|
|
231
|
+
organizationId: string;
|
|
232
|
+
slug: string;
|
|
233
|
+
sourceDir: string;
|
|
234
|
+
title: string;
|
|
235
|
+
version: string;
|
|
236
|
+
}): Promise<{
|
|
237
|
+
applicationId: string;
|
|
238
|
+
}>;
|
|
239
|
+
|
|
240
|
+
/** A view or service as the deploy report and `--json` output surface it. */
|
|
241
|
+
export declare interface DeployedExpose {
|
|
242
|
+
name: string;
|
|
243
|
+
src: string;
|
|
244
|
+
title: string;
|
|
245
|
+
type: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Deploy a workbench studio through Brett: redeploy when `appId` is set,
|
|
250
|
+
* otherwise create the studio at `studioHost`. Returns the application id for
|
|
251
|
+
* the shell to report; a missing `studioHost` on create is a usage error.
|
|
252
|
+
* @internal
|
|
253
|
+
*/
|
|
254
|
+
export declare function deployStudio(options: {
|
|
255
|
+
appId: string | undefined;
|
|
256
|
+
interfaces: readonly BrettInterface[];
|
|
257
|
+
isAutoUpdating: boolean;
|
|
258
|
+
organizationId: string;
|
|
259
|
+
output: Output;
|
|
260
|
+
projectId: string | undefined;
|
|
261
|
+
sourceDir: string;
|
|
262
|
+
studioHost: string | undefined;
|
|
263
|
+
title: string;
|
|
264
|
+
version: string;
|
|
265
|
+
workspaces: readonly BrettWorkspace[];
|
|
266
|
+
}): Promise<{
|
|
267
|
+
applicationId: string;
|
|
268
|
+
}>;
|
|
269
|
+
|
|
270
|
+
export declare function getApplication(
|
|
271
|
+
applicationId: string,
|
|
272
|
+
): Promise<Application | null>;
|
|
273
|
+
|
|
274
|
+
/** Where a deployed application is served on its organization's workbench. */
|
|
275
|
+
export declare function getApplicationUrl(
|
|
276
|
+
application: Pick<Application, "id" | "organizationId" | "type">,
|
|
277
|
+
): string;
|
|
278
|
+
|
|
162
279
|
export declare function getWorkbench(
|
|
163
280
|
cliConfig: CliConfig | null | undefined,
|
|
164
281
|
): DeployableWorkbenchApp | null;
|
|
165
282
|
|
|
283
|
+
export declare function getWorkbenchUrl(organizationId: string): string;
|
|
284
|
+
|
|
166
285
|
/** @public */
|
|
167
286
|
declare interface ResolvedWorkbenchApp {
|
|
168
|
-
/** A Sanity-owned singleton (e.g. the Media Library) — deploys its config, not an application. */
|
|
169
|
-
readonly isSingleton: boolean;
|
|
170
287
|
/** The app's unique `name` from `unstable_defineApp`. */
|
|
171
288
|
readonly name: string;
|
|
172
289
|
/** Background worker services the app declares. */
|
|
@@ -175,10 +292,14 @@ declare interface ResolvedWorkbenchApp {
|
|
|
175
292
|
readonly views: NonNullable<DefineAppInput["views"]>;
|
|
176
293
|
/** Resolved app kind — `studio` or one of the SDK app types. */
|
|
177
294
|
readonly applicationType?: string;
|
|
295
|
+
/** Deploys on its own path, separate from the interfaces. */
|
|
296
|
+
readonly config?: WorkbenchApp["config"];
|
|
178
297
|
/** SDK app-view entrypoint, when declared. */
|
|
179
298
|
readonly entry?: string;
|
|
180
|
-
/**
|
|
181
|
-
readonly
|
|
299
|
+
/** Explicit singleton flag (a Sanity-owned app); `undefined` when the app doesn't set it. */
|
|
300
|
+
readonly isSingleton?: boolean;
|
|
301
|
+
/** Hostname the application is created at on first deploy. */
|
|
302
|
+
readonly slug?: string;
|
|
182
303
|
}
|
|
183
304
|
|
|
184
305
|
/**
|
|
@@ -196,14 +317,28 @@ export declare function resolveInstallationId(options: {
|
|
|
196
317
|
* one of potentially many shapes.
|
|
197
318
|
* @internal
|
|
198
319
|
*/
|
|
199
|
-
export declare function
|
|
320
|
+
export declare function summarizeConfig(config: {
|
|
200
321
|
appType: string;
|
|
201
322
|
fields: {
|
|
202
323
|
name: string;
|
|
324
|
+
src: string;
|
|
203
325
|
title: string;
|
|
204
326
|
}[];
|
|
205
327
|
}): string;
|
|
206
328
|
|
|
329
|
+
/**
|
|
330
|
+
* The deploy summary of an app's exposes: the structured records (for `--json`)
|
|
331
|
+
* and one report line per non-empty group (for the human report).
|
|
332
|
+
* @internal
|
|
333
|
+
*/
|
|
334
|
+
export declare function summarizeExposes({
|
|
335
|
+
services,
|
|
336
|
+
views,
|
|
337
|
+
}: WorkbenchExposes): {
|
|
338
|
+
exposes: DeployedExpose[];
|
|
339
|
+
lines: string[];
|
|
340
|
+
};
|
|
341
|
+
|
|
207
342
|
declare type ViewDeploymentPayload = z.infer<
|
|
208
343
|
typeof viewDeploymentPayloadSchema
|
|
209
344
|
>;
|
|
@@ -251,4 +386,15 @@ declare const WORKBENCH_APP: unique symbol;
|
|
|
251
386
|
declare type WorkbenchApp = DefineAppResult &
|
|
252
387
|
z.output<typeof DefineAppInputSchema>;
|
|
253
388
|
|
|
389
|
+
/**
|
|
390
|
+
* Bundled so adding a declaration family touches this type and the artifact
|
|
391
|
+
* expanders, not every hop of build/dev plumbing in between.
|
|
392
|
+
* @internal
|
|
393
|
+
*/
|
|
394
|
+
declare interface WorkbenchExposes {
|
|
395
|
+
config?: WorkbenchApp["config"];
|
|
396
|
+
services?: DefineAppInput["services"];
|
|
397
|
+
views?: DefineAppInput["views"];
|
|
398
|
+
}
|
|
399
|
+
|
|
254
400
|
export {};
|
package/dist/_exports/deploy.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
export { buildExposes, summarizeExposes } from '../actions/deploy/buildExposes.js';
|
|
1
2
|
export { checkBuiltOutput } from '../actions/deploy/checkBuiltOutput.js';
|
|
2
|
-
export {
|
|
3
|
+
export { deployConfig, resolveInstallationId, summarizeConfig } from '../actions/deploy/deployConfig.js';
|
|
4
|
+
export { deployCoreApp, deployStudio } from '../actions/deploy/deployWorkbenchApp.js';
|
|
3
5
|
export { getWorkbench } from '../actions/deploy/getWorkbench.js';
|
|
6
|
+
export { getApplication, getApplicationUrl, getWorkbenchUrl } from '../services/applications.js';
|
|
4
7
|
|
|
5
8
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {checkBuiltOutput} from '../actions/deploy/checkBuiltOutput.js'\nexport {\n
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {\n buildExposes,\n type DeployedExpose,\n summarizeExposes,\n} from '../actions/deploy/buildExposes.js'\nexport {checkBuiltOutput} from '../actions/deploy/checkBuiltOutput.js'\nexport {\n deployConfig,\n resolveInstallationId,\n summarizeConfig,\n} from '../actions/deploy/deployConfig.js'\nexport {deployCoreApp, deployStudio} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\nexport {\n type Application,\n type BrettInterface,\n type BrettWorkspace,\n getApplication,\n getApplicationUrl,\n getWorkbenchUrl,\n} from '../services/applications.js'\n"],"names":["buildExposes","summarizeExposes","checkBuiltOutput","deployConfig","resolveInstallationId","summarizeConfig","deployCoreApp","deployStudio","getWorkbench","getApplication","getApplicationUrl","getWorkbenchUrl"],"mappings":"AAAA,SACEA,YAAY,EAEZC,gBAAgB,QACX,oCAAmC;AAC1C,SAAQC,gBAAgB,QAAO,wCAAuC;AACtE,SACEC,YAAY,EACZC,qBAAqB,EACrBC,eAAe,QACV,oCAAmC;AAC1C,SAAQC,aAAa,EAAEC,YAAY,QAAO,0CAAyC;AACnF,SAAQC,YAAY,QAAO,oCAAmC;AAC9D,SAIEC,cAAc,EACdC,iBAAiB,EACjBC,eAAe,QACV,8BAA6B"}
|
package/dist/_exports/dev.d.ts
CHANGED
|
@@ -30,9 +30,7 @@ declare type DevServerManifest = z.infer<typeof devServerManifestSchema>;
|
|
|
30
30
|
|
|
31
31
|
declare const devServerManifestSchema: z.ZodMiniObject<
|
|
32
32
|
{
|
|
33
|
-
|
|
34
|
-
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
|
-
installationConfigs: z.ZodMiniOptional<
|
|
33
|
+
configs: z.ZodMiniOptional<
|
|
36
34
|
z.ZodMiniArray<
|
|
37
35
|
z.ZodMiniObject<
|
|
38
36
|
{
|
|
@@ -48,19 +46,25 @@ declare const devServerManifestSchema: z.ZodMiniObject<
|
|
|
48
46
|
z.core.$strip
|
|
49
47
|
>
|
|
50
48
|
>;
|
|
49
|
+
id: z.ZodMiniString<string>;
|
|
51
50
|
moduleName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
|
+
version: z.ZodMiniNumber<number>;
|
|
52
52
|
},
|
|
53
53
|
z.core.$strip
|
|
54
54
|
>
|
|
55
55
|
>
|
|
56
56
|
>;
|
|
57
|
+
host: z.ZodMiniString<string>;
|
|
58
|
+
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
57
59
|
interfaces: z.ZodMiniOptional<
|
|
58
60
|
z.ZodMiniArray<
|
|
59
61
|
z.ZodMiniObject<
|
|
60
62
|
{
|
|
61
|
-
entry_point: z.ZodMiniString<string>;
|
|
62
|
-
interface_type: z.ZodMiniString<string>;
|
|
63
63
|
name: z.ZodMiniString<string>;
|
|
64
|
+
src: z.ZodMiniString<string>;
|
|
65
|
+
title: z.ZodMiniString<string>;
|
|
66
|
+
type: z.ZodMiniString<string>;
|
|
67
|
+
version: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
64
68
|
},
|
|
65
69
|
z.core.$strip
|
|
66
70
|
>
|
package/dist/_exports/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { z } from "zod/mini";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* User-facing input for `unstable_defineApp`. Excludes the internal
|
|
5
|
-
* `applicationType`, `isSingleton`, and `
|
|
5
|
+
* `applicationType`, `isSingleton`, and `config` — validated by the
|
|
6
6
|
* schema but not part of the public surface (Sanity-owned apps set them via
|
|
7
7
|
* `@ts-expect-error`).
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
10
|
export declare type DefineAppInput = Omit<
|
|
11
11
|
z.output<typeof DefineAppInputSchema>,
|
|
12
|
-
"applicationType" | "
|
|
12
|
+
"applicationType" | "config" | "isSingleton"
|
|
13
13
|
>;
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -29,16 +29,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
29
29
|
dashboard: "dashboard";
|
|
30
30
|
}>
|
|
31
31
|
>;
|
|
32
|
-
|
|
33
|
-
group: z.ZodMiniOptional<
|
|
34
|
-
z.ZodMiniEnum<{
|
|
35
|
-
"dock.system": "dock.system";
|
|
36
|
-
"dock.applications": "dock.applications";
|
|
37
|
-
"dock.user": "dock.user";
|
|
38
|
-
}>
|
|
39
|
-
>;
|
|
40
|
-
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
41
|
-
installationConfig: z.ZodMiniOptional<
|
|
32
|
+
config: z.ZodMiniOptional<
|
|
42
33
|
z.ZodMiniDiscriminatedUnion<
|
|
43
34
|
[
|
|
44
35
|
z.ZodMiniObject<
|
|
@@ -62,6 +53,15 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
62
53
|
"appType"
|
|
63
54
|
>
|
|
64
55
|
>;
|
|
56
|
+
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
57
|
+
group: z.ZodMiniOptional<
|
|
58
|
+
z.ZodMiniEnum<{
|
|
59
|
+
"dock.system": "dock.system";
|
|
60
|
+
"dock.applications": "dock.applications";
|
|
61
|
+
"dock.user": "dock.user";
|
|
62
|
+
}>
|
|
63
|
+
>;
|
|
64
|
+
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
65
65
|
isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
66
66
|
name: z.ZodMiniString<string>;
|
|
67
67
|
organizationId: z.ZodMiniString<string>;
|
|
@@ -72,6 +72,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
72
72
|
[
|
|
73
73
|
z.ZodMiniObject<
|
|
74
74
|
{
|
|
75
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
75
76
|
name: z.ZodMiniString<string>;
|
|
76
77
|
src: z.ZodMiniString<string>;
|
|
77
78
|
type: z.ZodMiniLiteral<"worker">;
|
|
@@ -83,6 +84,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
83
84
|
>
|
|
84
85
|
>
|
|
85
86
|
>;
|
|
87
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
88
|
title: z.ZodMiniString<string>;
|
|
87
89
|
views: z.ZodMiniOptional<
|
|
88
90
|
z.ZodMiniArray<
|
|
@@ -90,6 +92,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
90
92
|
[
|
|
91
93
|
z.ZodMiniObject<
|
|
92
94
|
{
|
|
95
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
96
|
name: z.ZodMiniString<string>;
|
|
94
97
|
src: z.ZodMiniString<string>;
|
|
95
98
|
type: z.ZodMiniLiteral<"panel">;
|
|
@@ -214,9 +217,10 @@ export declare interface PanelViewComponents {
|
|
|
214
217
|
* @public
|
|
215
218
|
*/
|
|
216
219
|
export declare type PanelViewProps = ViewComponentBaseProps<{
|
|
217
|
-
entry_point: string;
|
|
218
|
-
interface_type: "panel";
|
|
219
220
|
name: string;
|
|
221
|
+
src: string;
|
|
222
|
+
title: string;
|
|
223
|
+
type: "panel";
|
|
220
224
|
}>;
|
|
221
225
|
|
|
222
226
|
/** @internal */
|
|
@@ -269,7 +273,7 @@ export declare function unstable_defineApp(
|
|
|
269
273
|
): DefineAppResult;
|
|
270
274
|
|
|
271
275
|
/**
|
|
272
|
-
* Declare the Sanity Media Library as a workbench app — a singleton whose `fields` become its
|
|
276
|
+
* Declare the Sanity Media Library as a workbench app — a singleton whose `fields` become its config.
|
|
273
277
|
* @public
|
|
274
278
|
*/
|
|
275
279
|
export declare function unstable_defineMediaLibrary(
|