@sanity/workbench-cli 1.1.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_exports/build.d.ts +81 -8
- package/dist/_exports/build.js.map +1 -1
- package/dist/_exports/deploy.d.ts +287 -12
- package/dist/_exports/deploy.js +4 -3
- package/dist/_exports/deploy.js.map +1 -1
- package/dist/_exports/dev.d.ts +25 -0
- package/dist/_exports/index.d.ts +85 -31
- package/dist/_exports/index.js +1 -11
- package/dist/_exports/index.js.map +1 -1
- package/dist/actions/build/artifact.js +8 -7
- package/dist/actions/build/artifact.js.map +1 -1
- package/dist/actions/build/configs/artifact.js +45 -0
- package/dist/actions/build/configs/artifact.js.map +1 -0
- package/dist/actions/build/vite/plugin.js +6 -14
- package/dist/actions/build/vite/plugin.js.map +1 -1
- package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js +24 -0
- package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js.map +1 -0
- package/dist/actions/build/vite/workbench-vite-plugins.js +8 -4
- package/dist/actions/build/vite/workbench-vite-plugins.js.map +1 -1
- package/dist/actions/deploy/apiVersion.js +5 -0
- package/dist/actions/deploy/apiVersion.js.map +1 -0
- package/dist/actions/deploy/buildExposes.js +56 -0
- package/dist/actions/deploy/buildExposes.js.map +1 -0
- package/dist/actions/deploy/checkBuiltOutput.js +25 -0
- package/dist/actions/deploy/checkBuiltOutput.js.map +1 -0
- package/dist/actions/deploy/deployConfig.js +90 -0
- package/dist/actions/deploy/deployConfig.js.map +1 -0
- package/dist/actions/deploy/deployWorkbenchApp.js +185 -0
- package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -0
- package/dist/actions/deploy/getWorkbench.js +14 -25
- package/dist/actions/deploy/getWorkbench.js.map +1 -1
- package/dist/actions/deploy/viewDeployment.js +32 -0
- package/dist/actions/deploy/viewDeployment.js.map +1 -0
- package/dist/actions/dev/deriveInterfaces.js +63 -6
- package/dist/actions/dev/deriveInterfaces.js.map +1 -1
- package/dist/actions/dev/exposesSetId.js +69 -0
- package/dist/actions/dev/exposesSetId.js.map +1 -0
- package/dist/actions/dev/registry.js +27 -1
- package/dist/actions/dev/registry.js.map +1 -1
- package/dist/actions/dev/startDevManifestWatcher.js +2 -1
- package/dist/actions/dev/startDevManifestWatcher.js.map +1 -1
- package/dist/actions/dev/startDevServerRegistration.js +26 -11
- package/dist/actions/dev/startDevServerRegistration.js.map +1 -1
- package/dist/actions/dev/startWorkbenchDevServer.js +23 -5
- 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/contract.js +43 -40
- package/dist/contract.js.map +1 -1
- package/dist/defineApp.js +60 -1
- package/dist/defineApp.js.map +1 -1
- package/dist/resolveWorkbenchApp.js +5 -1
- package/dist/resolveWorkbenchApp.js.map +1 -1
- package/package.json +7 -4
- package/dist/actions/dev/interfaceSetId.js +0 -51
- package/dist/actions/dev/interfaceSetId.js.map +0 -1
package/dist/_exports/build.d.ts
CHANGED
|
@@ -4,13 +4,14 @@ import { z } from "zod/mini";
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* User-facing input for `unstable_defineApp`. Excludes the internal
|
|
7
|
-
* `applicationType`
|
|
8
|
-
* the public surface (Sanity-owned apps set
|
|
7
|
+
* `applicationType`, `isSingleton`, and `config` — validated by the
|
|
8
|
+
* schema but not part of the public surface (Sanity-owned apps set them via
|
|
9
|
+
* `@ts-expect-error`).
|
|
9
10
|
* @public
|
|
10
11
|
*/
|
|
11
12
|
declare type DefineAppInput = Omit<
|
|
12
13
|
z.output<typeof DefineAppInputSchema>,
|
|
13
|
-
"applicationType"
|
|
14
|
+
"applicationType" | "config" | "isSingleton"
|
|
14
15
|
>;
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -23,13 +24,37 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
23
24
|
{
|
|
24
25
|
applicationType: z.ZodMiniOptional<
|
|
25
26
|
z.ZodMiniEnum<{
|
|
27
|
+
"media-library": "media-library";
|
|
26
28
|
coreApp: "coreApp";
|
|
27
29
|
studio: "studio";
|
|
28
30
|
canvas: "canvas";
|
|
29
31
|
dashboard: "dashboard";
|
|
30
|
-
"media-library": "media-library";
|
|
31
32
|
}>
|
|
32
33
|
>;
|
|
34
|
+
config: z.ZodMiniOptional<
|
|
35
|
+
z.ZodMiniDiscriminatedUnion<
|
|
36
|
+
[
|
|
37
|
+
z.ZodMiniObject<
|
|
38
|
+
{
|
|
39
|
+
appType: z.ZodMiniLiteral<"media-library">;
|
|
40
|
+
fields: z.ZodMiniArray<
|
|
41
|
+
z.ZodMiniObject<
|
|
42
|
+
{
|
|
43
|
+
public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
44
|
+
title: z.ZodMiniString<string>;
|
|
45
|
+
name: z.ZodMiniString<string>;
|
|
46
|
+
src: z.ZodMiniString<string>;
|
|
47
|
+
},
|
|
48
|
+
z.core.$strip
|
|
49
|
+
>
|
|
50
|
+
>;
|
|
51
|
+
},
|
|
52
|
+
z.core.$strip
|
|
53
|
+
>,
|
|
54
|
+
],
|
|
55
|
+
"appType"
|
|
56
|
+
>
|
|
57
|
+
>;
|
|
33
58
|
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
34
59
|
group: z.ZodMiniOptional<
|
|
35
60
|
z.ZodMiniEnum<{
|
|
@@ -39,6 +64,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
39
64
|
}>
|
|
40
65
|
>;
|
|
41
66
|
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
67
|
+
isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
42
68
|
name: z.ZodMiniString<string>;
|
|
43
69
|
organizationId: z.ZodMiniString<string>;
|
|
44
70
|
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
@@ -48,6 +74,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
48
74
|
[
|
|
49
75
|
z.ZodMiniObject<
|
|
50
76
|
{
|
|
77
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
78
|
name: z.ZodMiniString<string>;
|
|
52
79
|
src: z.ZodMiniString<string>;
|
|
53
80
|
type: z.ZodMiniLiteral<"worker">;
|
|
@@ -59,6 +86,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
59
86
|
>
|
|
60
87
|
>
|
|
61
88
|
>;
|
|
89
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
62
90
|
title: z.ZodMiniString<string>;
|
|
63
91
|
views: z.ZodMiniOptional<
|
|
64
92
|
z.ZodMiniArray<
|
|
@@ -66,6 +94,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
66
94
|
[
|
|
67
95
|
z.ZodMiniObject<
|
|
68
96
|
{
|
|
97
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
69
98
|
name: z.ZodMiniString<string>;
|
|
70
99
|
src: z.ZodMiniString<string>;
|
|
71
100
|
type: z.ZodMiniLiteral<"panel">;
|
|
@@ -81,16 +110,33 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
81
110
|
z.core.$strip
|
|
82
111
|
>;
|
|
83
112
|
|
|
113
|
+
/**
|
|
114
|
+
* The branded result of `unstable_defineApp`. Carries the same fields as the
|
|
115
|
+
* input plus the internal brand — users only ever see `DefineAppInput`.
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
declare interface DefineAppResult extends DefineAppInput {
|
|
119
|
+
readonly [WORKBENCH_APP]: true;
|
|
120
|
+
}
|
|
121
|
+
|
|
84
122
|
/** @public */
|
|
85
123
|
declare interface ResolvedWorkbenchApp {
|
|
124
|
+
/** The app's unique `name` from `unstable_defineApp`. */
|
|
125
|
+
readonly name: string;
|
|
86
126
|
/** Background worker services the app declares. */
|
|
87
127
|
readonly services: NonNullable<DefineAppInput["services"]>;
|
|
88
128
|
/** Dock panel views the app declares. */
|
|
89
129
|
readonly views: NonNullable<DefineAppInput["views"]>;
|
|
90
130
|
/** Resolved app kind — `studio` or one of the SDK app types. */
|
|
91
131
|
readonly applicationType?: string;
|
|
132
|
+
/** Deploys on its own path, separate from the interfaces. */
|
|
133
|
+
readonly config?: WorkbenchApp["config"];
|
|
92
134
|
/** SDK app-view entrypoint, when declared. */
|
|
93
135
|
readonly entry?: string;
|
|
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;
|
|
94
140
|
}
|
|
95
141
|
|
|
96
142
|
/**
|
|
@@ -101,6 +147,34 @@ export declare function resolveWorkbenchApp(
|
|
|
101
147
|
cliConfig: CliConfig | null | undefined,
|
|
102
148
|
): ResolvedWorkbenchApp | null;
|
|
103
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Nominal brand the CLI discriminates on to enable the workbench build/deploy
|
|
152
|
+
* codepath. Registered via `Symbol.for` so the marker survives module-realm
|
|
153
|
+
* boundaries — `@sanity/cli-core` re-derives the same global symbol with
|
|
154
|
+
* `Symbol.for` rather than importing it, so it stays internal to this module.
|
|
155
|
+
*/
|
|
156
|
+
declare const WORKBENCH_APP: unique symbol;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* A branded app as the CLI reads it — the full schema shape, including the
|
|
160
|
+
* internal fields `DefineAppInput` omits. Schema-derived so the narrowing
|
|
161
|
+
* can't drift from what the schema validates.
|
|
162
|
+
* @public
|
|
163
|
+
*/
|
|
164
|
+
declare type WorkbenchApp = DefineAppResult &
|
|
165
|
+
z.output<typeof DefineAppInputSchema>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Bundled so adding a declaration family touches this type and the artifact
|
|
169
|
+
* expanders, not every hop of build/dev plumbing in between.
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
export declare interface WorkbenchExposes {
|
|
173
|
+
config?: WorkbenchApp["config"];
|
|
174
|
+
services?: DefineAppInput["services"];
|
|
175
|
+
views?: DefineAppInput["views"];
|
|
176
|
+
}
|
|
177
|
+
|
|
104
178
|
declare interface WorkbenchViteOptions {
|
|
105
179
|
/** Project root — read for the federation remote name, and the plugin workDir. */
|
|
106
180
|
cwd: string;
|
|
@@ -113,12 +187,11 @@ declare interface WorkbenchViteOptions {
|
|
|
113
187
|
relativeConfigLocation: string | null;
|
|
114
188
|
relativeEntry: string | null;
|
|
115
189
|
};
|
|
190
|
+
/** The app's bus identity, stamped into its modules for `@sanity/runtime`. */
|
|
191
|
+
appId?: string;
|
|
192
|
+
exposes?: WorkbenchExposes;
|
|
116
193
|
/** App (vs studio) build — selects the discriminated federation option shape. */
|
|
117
194
|
isApp?: boolean;
|
|
118
|
-
/** Declared background services. */
|
|
119
|
-
services?: DefineAppInput["services"];
|
|
120
|
-
/** Declared dock views. */
|
|
121
|
-
views?: DefineAppInput["views"];
|
|
122
195
|
}
|
|
123
196
|
|
|
124
197
|
/** Build the Vite plugins for a workbench app's module-federation remote. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/build.ts"],"sourcesContent":["// Node-only build entry: the module-federation Vite plugins that\n// `@sanity/cli-build`'s `getViteConfig` swaps in for a workbench app, plus the\n// resolver the build reads declared views/services from. The build needs no\n// deploy-time guards, so it takes the bare `resolveWorkbenchApp` — the guarded\n// view (`getWorkbench`) is the deploy entry's export.\n\nexport {workbenchVitePlugins} from '../actions/build/vite/workbench-vite-plugins.js'\nexport {resolveWorkbenchApp} from '../resolveWorkbenchApp.js'\n"],"names":["workbenchVitePlugins","resolveWorkbenchApp"],"mappings":"AAAA,iEAAiE;AACjE,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,sDAAsD;AAEtD,SAAQA,oBAAoB,QAAO,kDAAiD;AACpF,SAAQC,mBAAmB,
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/build.ts"],"sourcesContent":["// Node-only build entry: the module-federation Vite plugins that\n// `@sanity/cli-build`'s `getViteConfig` swaps in for a workbench app, plus the\n// resolver the build reads declared views/services from. The build needs no\n// deploy-time guards, so it takes the bare `resolveWorkbenchApp` — the guarded\n// view (`getWorkbench`) is the deploy entry's export.\n\nexport {workbenchVitePlugins} from '../actions/build/vite/workbench-vite-plugins.js'\nexport {resolveWorkbenchApp, type WorkbenchExposes} from '../resolveWorkbenchApp.js'\n"],"names":["workbenchVitePlugins","resolveWorkbenchApp"],"mappings":"AAAA,iEAAiE;AACjE,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,sDAAsD;AAEtD,SAAQA,oBAAoB,QAAO,kDAAiD;AACpF,SAAQC,mBAAmB,QAA8B,4BAA2B"}
|
|
@@ -1,15 +1,78 @@
|
|
|
1
1
|
import { CliConfig } from "@sanity/cli-core";
|
|
2
|
+
import { Output } from "@sanity/cli-core";
|
|
2
3
|
import { z } from "zod/mini";
|
|
3
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
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Throws unless `sourceDir` is a directory holding a federation build.
|
|
60
|
+
* Workbench builds emit a module-federation remote instead of a static SPA,
|
|
61
|
+
* so the usual `index.html` contract doesn't apply — `mf-manifest.json` is the
|
|
62
|
+
* marker that `sanity build` produced a federation build.
|
|
63
|
+
*/
|
|
64
|
+
export declare function checkBuiltOutput(sourceDir: string): Promise<void>;
|
|
65
|
+
|
|
4
66
|
/**
|
|
5
67
|
* User-facing input for `unstable_defineApp`. Excludes the internal
|
|
6
|
-
* `applicationType`
|
|
7
|
-
* the public surface (Sanity-owned apps set
|
|
68
|
+
* `applicationType`, `isSingleton`, and `config` — validated by the
|
|
69
|
+
* schema but not part of the public surface (Sanity-owned apps set them via
|
|
70
|
+
* `@ts-expect-error`).
|
|
8
71
|
* @public
|
|
9
72
|
*/
|
|
10
73
|
declare type DefineAppInput = Omit<
|
|
11
74
|
z.output<typeof DefineAppInputSchema>,
|
|
12
|
-
"applicationType"
|
|
75
|
+
"applicationType" | "config" | "isSingleton"
|
|
13
76
|
>;
|
|
14
77
|
|
|
15
78
|
/**
|
|
@@ -22,13 +85,37 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
22
85
|
{
|
|
23
86
|
applicationType: z.ZodMiniOptional<
|
|
24
87
|
z.ZodMiniEnum<{
|
|
88
|
+
"media-library": "media-library";
|
|
25
89
|
coreApp: "coreApp";
|
|
26
90
|
studio: "studio";
|
|
27
91
|
canvas: "canvas";
|
|
28
92
|
dashboard: "dashboard";
|
|
29
|
-
"media-library": "media-library";
|
|
30
93
|
}>
|
|
31
94
|
>;
|
|
95
|
+
config: z.ZodMiniOptional<
|
|
96
|
+
z.ZodMiniDiscriminatedUnion<
|
|
97
|
+
[
|
|
98
|
+
z.ZodMiniObject<
|
|
99
|
+
{
|
|
100
|
+
appType: z.ZodMiniLiteral<"media-library">;
|
|
101
|
+
fields: z.ZodMiniArray<
|
|
102
|
+
z.ZodMiniObject<
|
|
103
|
+
{
|
|
104
|
+
public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
105
|
+
title: z.ZodMiniString<string>;
|
|
106
|
+
name: z.ZodMiniString<string>;
|
|
107
|
+
src: z.ZodMiniString<string>;
|
|
108
|
+
},
|
|
109
|
+
z.core.$strip
|
|
110
|
+
>
|
|
111
|
+
>;
|
|
112
|
+
},
|
|
113
|
+
z.core.$strip
|
|
114
|
+
>,
|
|
115
|
+
],
|
|
116
|
+
"appType"
|
|
117
|
+
>
|
|
118
|
+
>;
|
|
32
119
|
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
33
120
|
group: z.ZodMiniOptional<
|
|
34
121
|
z.ZodMiniEnum<{
|
|
@@ -38,6 +125,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
38
125
|
}>
|
|
39
126
|
>;
|
|
40
127
|
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
128
|
+
isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
41
129
|
name: z.ZodMiniString<string>;
|
|
42
130
|
organizationId: z.ZodMiniString<string>;
|
|
43
131
|
priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
@@ -47,6 +135,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
47
135
|
[
|
|
48
136
|
z.ZodMiniObject<
|
|
49
137
|
{
|
|
138
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
139
|
name: z.ZodMiniString<string>;
|
|
51
140
|
src: z.ZodMiniString<string>;
|
|
52
141
|
type: z.ZodMiniLiteral<"worker">;
|
|
@@ -58,6 +147,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
58
147
|
>
|
|
59
148
|
>
|
|
60
149
|
>;
|
|
150
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
61
151
|
title: z.ZodMiniString<string>;
|
|
62
152
|
views: z.ZodMiniOptional<
|
|
63
153
|
z.ZodMiniArray<
|
|
@@ -65,6 +155,7 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
65
155
|
[
|
|
66
156
|
z.ZodMiniObject<
|
|
67
157
|
{
|
|
158
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
68
159
|
name: z.ZodMiniString<string>;
|
|
69
160
|
src: z.ZodMiniString<string>;
|
|
70
161
|
type: z.ZodMiniLiteral<"panel">;
|
|
@@ -80,36 +171,220 @@ declare const DefineAppInputSchema: z.ZodMiniObject<
|
|
|
80
171
|
z.core.$strip
|
|
81
172
|
>;
|
|
82
173
|
|
|
174
|
+
/**
|
|
175
|
+
* The branded result of `unstable_defineApp`. Carries the same fields as the
|
|
176
|
+
* input plus the internal brand — users only ever see `DefineAppInput`.
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
declare interface DefineAppResult extends DefineAppInput {
|
|
180
|
+
readonly [WORKBENCH_APP]: true;
|
|
181
|
+
}
|
|
182
|
+
|
|
83
183
|
declare interface DeployableWorkbenchApp extends ResolvedWorkbenchApp {
|
|
84
184
|
/**
|
|
85
|
-
* Throws when the app
|
|
86
|
-
*
|
|
87
|
-
* load, so deploy gates on this before any prompts or API calls.
|
|
185
|
+
* Throws when the app exposes nothing (no entry, view, service, or config) —
|
|
186
|
+
* the remote would have nothing to load. Gated before any prompt or API call.
|
|
88
187
|
*/
|
|
89
188
|
assertDeployable(): void;
|
|
90
189
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
|
|
94
|
-
|
|
190
|
+
* Validates the app's declared views into the application-service payload.
|
|
191
|
+
* Throws when a view declaration is malformed.
|
|
192
|
+
*/
|
|
193
|
+
buildViewDeploymentPayload(applicationId: string): ViewDeploymentPayload;
|
|
194
|
+
/**
|
|
195
|
+
* A singleton (the Media Library) that carries an config — deploy
|
|
196
|
+
* persists the config to the org's installation. Independent of the interfaces,
|
|
197
|
+
* which register regardless; non-singletons never carry a config.
|
|
95
198
|
*/
|
|
96
|
-
|
|
199
|
+
deploySingletonConfig: boolean;
|
|
200
|
+
/** Declares something to host as an application — an entry, view, or service. */
|
|
201
|
+
hasInterfaces: boolean;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Upload the built module-federation remote to the installation as its config
|
|
206
|
+
* snapshot. `installationId` is resolved by the caller so `--dry-run` never
|
|
207
|
+
* reaches this mutating step.
|
|
208
|
+
* @internal
|
|
209
|
+
*/
|
|
210
|
+
export declare function deployConfig(options: {
|
|
211
|
+
appType: string;
|
|
212
|
+
installationId: string;
|
|
213
|
+
output: Output;
|
|
214
|
+
sourceDir: string;
|
|
215
|
+
version: string;
|
|
216
|
+
}): Promise<void>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Deploy a workbench coreApp through Brett: redeploy when `appId` is set,
|
|
220
|
+
* otherwise create the application at `slug`. Returns the application id for the
|
|
221
|
+
* shell to report.
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
export declare function deployCoreApp(options: {
|
|
225
|
+
appId: string | undefined;
|
|
226
|
+
interfaces: readonly BrettInterface[];
|
|
227
|
+
isAutoUpdating: boolean;
|
|
228
|
+
isSingleton?: boolean;
|
|
229
|
+
organizationId: string;
|
|
230
|
+
slug: string;
|
|
231
|
+
sourceDir: string;
|
|
232
|
+
title: string;
|
|
233
|
+
version: string;
|
|
234
|
+
}): Promise<{
|
|
235
|
+
applicationId: string;
|
|
236
|
+
}>;
|
|
237
|
+
|
|
238
|
+
/** A view or service as the deploy report and `--json` output surface it. */
|
|
239
|
+
export declare interface DeployedExpose {
|
|
240
|
+
name: string;
|
|
241
|
+
src: string;
|
|
242
|
+
title: string;
|
|
243
|
+
type: string;
|
|
97
244
|
}
|
|
98
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Deploy a workbench studio through Brett: redeploy when `appId` is set,
|
|
248
|
+
* otherwise create the studio at `studioHost`. Returns the application id for
|
|
249
|
+
* the shell to report; a missing `studioHost` on create is a usage error.
|
|
250
|
+
* @internal
|
|
251
|
+
*/
|
|
252
|
+
export declare function deployStudio(options: {
|
|
253
|
+
appId: string | undefined;
|
|
254
|
+
interfaces: readonly BrettInterface[];
|
|
255
|
+
isAutoUpdating: boolean;
|
|
256
|
+
organizationId: string;
|
|
257
|
+
output: Output;
|
|
258
|
+
projectId: string | undefined;
|
|
259
|
+
sourceDir: string;
|
|
260
|
+
studioHost: string | undefined;
|
|
261
|
+
title: string;
|
|
262
|
+
version: string;
|
|
263
|
+
workspaces: readonly BrettWorkspace[];
|
|
264
|
+
}): Promise<{
|
|
265
|
+
applicationId: string;
|
|
266
|
+
}>;
|
|
267
|
+
|
|
268
|
+
export declare function getApplication(
|
|
269
|
+
applicationId: string,
|
|
270
|
+
): Promise<Application | null>;
|
|
271
|
+
|
|
99
272
|
export declare function getWorkbench(
|
|
100
273
|
cliConfig: CliConfig | null | undefined,
|
|
101
274
|
): DeployableWorkbenchApp | null;
|
|
102
275
|
|
|
103
276
|
/** @public */
|
|
104
277
|
declare interface ResolvedWorkbenchApp {
|
|
278
|
+
/** The app's unique `name` from `unstable_defineApp`. */
|
|
279
|
+
readonly name: string;
|
|
105
280
|
/** Background worker services the app declares. */
|
|
106
281
|
readonly services: NonNullable<DefineAppInput["services"]>;
|
|
107
282
|
/** Dock panel views the app declares. */
|
|
108
283
|
readonly views: NonNullable<DefineAppInput["views"]>;
|
|
109
284
|
/** Resolved app kind — `studio` or one of the SDK app types. */
|
|
110
285
|
readonly applicationType?: string;
|
|
286
|
+
/** Deploys on its own path, separate from the interfaces. */
|
|
287
|
+
readonly config?: WorkbenchApp["config"];
|
|
111
288
|
/** SDK app-view entrypoint, when declared. */
|
|
112
289
|
readonly entry?: string;
|
|
290
|
+
/** Explicit singleton flag (a Sanity-owned app); `undefined` when the app doesn't set it. */
|
|
291
|
+
readonly isSingleton?: boolean;
|
|
292
|
+
/** Hostname the application is created at on first deploy. */
|
|
293
|
+
readonly slug?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The org's active installation for an app type, or `undefined` when none is
|
|
298
|
+
* installed. Read-only, so `--dry-run` can report deployability.
|
|
299
|
+
* @internal
|
|
300
|
+
*/
|
|
301
|
+
export declare function resolveInstallationId(options: {
|
|
302
|
+
appType: string;
|
|
303
|
+
organizationId: string;
|
|
304
|
+
}): Promise<string | undefined>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* A report heading and item list for a config; a media library's `fields` are
|
|
308
|
+
* one of potentially many shapes.
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
export declare function summarizeConfig(config: {
|
|
312
|
+
appType: string;
|
|
313
|
+
fields: {
|
|
314
|
+
name: string;
|
|
315
|
+
title: string;
|
|
316
|
+
}[];
|
|
317
|
+
}): string;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The deploy summary of an app's exposes: the structured records (for `--json`)
|
|
321
|
+
* and one report line per non-empty group (for the human report).
|
|
322
|
+
* @internal
|
|
323
|
+
*/
|
|
324
|
+
export declare function summarizeExposes({
|
|
325
|
+
services,
|
|
326
|
+
views,
|
|
327
|
+
}: WorkbenchExposes): {
|
|
328
|
+
exposes: DeployedExpose[];
|
|
329
|
+
lines: string[];
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
declare type ViewDeploymentPayload = z.infer<
|
|
333
|
+
typeof viewDeploymentPayloadSchema
|
|
334
|
+
>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Payload registering an app's views with the application service on deploy.
|
|
338
|
+
*
|
|
339
|
+
* Phase 1 stub: the service that stores views does not exist yet, so the
|
|
340
|
+
* payload is validated and logged only — never sent. Builds the contract the
|
|
341
|
+
* application-service endpoint will accept.
|
|
342
|
+
*/
|
|
343
|
+
declare const viewDeploymentPayloadSchema: z.ZodMiniObject<
|
|
344
|
+
{
|
|
345
|
+
applicationId: z.ZodMiniString<string>;
|
|
346
|
+
views: z.ZodMiniArray<
|
|
347
|
+
z.ZodMiniObject<
|
|
348
|
+
{
|
|
349
|
+
name: z.ZodMiniString<string>;
|
|
350
|
+
src: z.ZodMiniString<string>;
|
|
351
|
+
type: z.ZodMiniEnum<{
|
|
352
|
+
panel: "panel";
|
|
353
|
+
}>;
|
|
354
|
+
},
|
|
355
|
+
z.core.$loose
|
|
356
|
+
>
|
|
357
|
+
>;
|
|
358
|
+
},
|
|
359
|
+
z.core.$strip
|
|
360
|
+
>;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Nominal brand the CLI discriminates on to enable the workbench build/deploy
|
|
364
|
+
* codepath. Registered via `Symbol.for` so the marker survives module-realm
|
|
365
|
+
* boundaries — `@sanity/cli-core` re-derives the same global symbol with
|
|
366
|
+
* `Symbol.for` rather than importing it, so it stays internal to this module.
|
|
367
|
+
*/
|
|
368
|
+
declare const WORKBENCH_APP: unique symbol;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* A branded app as the CLI reads it — the full schema shape, including the
|
|
372
|
+
* internal fields `DefineAppInput` omits. Schema-derived so the narrowing
|
|
373
|
+
* can't drift from what the schema validates.
|
|
374
|
+
* @public
|
|
375
|
+
*/
|
|
376
|
+
declare type WorkbenchApp = DefineAppResult &
|
|
377
|
+
z.output<typeof DefineAppInputSchema>;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Bundled so adding a declaration family touches this type and the artifact
|
|
381
|
+
* expanders, not every hop of build/dev plumbing in between.
|
|
382
|
+
* @internal
|
|
383
|
+
*/
|
|
384
|
+
declare interface WorkbenchExposes {
|
|
385
|
+
config?: WorkbenchApp["config"];
|
|
386
|
+
services?: DefineAppInput["services"];
|
|
387
|
+
views?: DefineAppInput["views"];
|
|
113
388
|
}
|
|
114
389
|
|
|
115
390
|
export {};
|
package/dist/_exports/deploy.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { buildExposes, summarizeExposes } from '../actions/deploy/buildExposes.js';
|
|
2
|
+
export { checkBuiltOutput } from '../actions/deploy/checkBuiltOutput.js';
|
|
3
|
+
export { deployConfig, resolveInstallationId, summarizeConfig } from '../actions/deploy/deployConfig.js';
|
|
4
|
+
export { deployCoreApp, deployStudio, getApplication } from '../actions/deploy/deployWorkbenchApp.js';
|
|
4
5
|
export { getWorkbench } from '../actions/deploy/getWorkbench.js';
|
|
5
6
|
|
|
6
7
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {\n type BrettInterface,\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 {\n type Application,\n type BrettWorkspace,\n deployCoreApp,\n deployStudio,\n getApplication,\n} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\n"],"names":["buildExposes","summarizeExposes","checkBuiltOutput","deployConfig","resolveInstallationId","summarizeConfig","deployCoreApp","deployStudio","getApplication","getWorkbench"],"mappings":"AAAA,SAEEA,YAAY,EAEZC,gBAAgB,QACX,oCAAmC;AAC1C,SAAQC,gBAAgB,QAAO,wCAAuC;AACtE,SACEC,YAAY,EACZC,qBAAqB,EACrBC,eAAe,QACV,oCAAmC;AAC1C,SAGEC,aAAa,EACbC,YAAY,EACZC,cAAc,QACT,0CAAyC;AAChD,SAAQC,YAAY,QAAO,oCAAmC"}
|
package/dist/_exports/dev.d.ts
CHANGED
|
@@ -30,6 +30,30 @@ declare type DevServerManifest = z.infer<typeof devServerManifestSchema>;
|
|
|
30
30
|
|
|
31
31
|
declare const devServerManifestSchema: z.ZodMiniObject<
|
|
32
32
|
{
|
|
33
|
+
configs: z.ZodMiniOptional<
|
|
34
|
+
z.ZodMiniArray<
|
|
35
|
+
z.ZodMiniObject<
|
|
36
|
+
{
|
|
37
|
+
appType: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
38
|
+
fields: z.ZodMiniArray<
|
|
39
|
+
z.ZodMiniObject<
|
|
40
|
+
{
|
|
41
|
+
name: z.ZodMiniString<string>;
|
|
42
|
+
public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
43
|
+
src: z.ZodMiniString<string>;
|
|
44
|
+
title: z.ZodMiniString<string>;
|
|
45
|
+
},
|
|
46
|
+
z.core.$strip
|
|
47
|
+
>
|
|
48
|
+
>;
|
|
49
|
+
id: z.ZodMiniString<string>;
|
|
50
|
+
moduleName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
|
+
version: z.ZodMiniNumber<number>;
|
|
52
|
+
},
|
|
53
|
+
z.core.$strip
|
|
54
|
+
>
|
|
55
|
+
>
|
|
56
|
+
>;
|
|
33
57
|
host: z.ZodMiniString<string>;
|
|
34
58
|
id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
35
59
|
interfaces: z.ZodMiniOptional<
|
|
@@ -39,6 +63,7 @@ declare const devServerManifestSchema: z.ZodMiniObject<
|
|
|
39
63
|
entry_point: z.ZodMiniString<string>;
|
|
40
64
|
interface_type: z.ZodMiniString<string>;
|
|
41
65
|
name: z.ZodMiniString<string>;
|
|
66
|
+
version: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
42
67
|
},
|
|
43
68
|
z.core.$strip
|
|
44
69
|
>
|