@sanity/workbench-cli 2.1.0 → 2.2.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/README.md +1 -1
- package/dist/_exports/build.d.ts +4 -4
- package/dist/_exports/build.js +2 -1
- package/dist/_exports/build.js.map +1 -1
- package/dist/_exports/defineApp-DldjQwq6.d.ts +375 -0
- package/dist/_exports/deploy.d.ts +10 -9
- package/dist/_exports/deploy.js +1 -0
- package/dist/_exports/deploy.js.map +1 -1
- package/dist/_exports/dev.d.ts +1 -1
- package/dist/_exports/index.d.ts +23 -16
- package/dist/_exports/index.js +2 -1
- package/dist/_exports/index.js.map +1 -1
- package/dist/_exports/preview.d.ts +1 -1
- package/dist/_exports/{registry-DI7hnTof.d.ts → registry-HE_dEHFa.d.ts} +38 -15
- package/dist/_exports/resolveWorkbenchConfig-6iznHbED.d.ts +60 -0
- package/dist/_exports/{summarizeInterfaces-DLsq6P43.d.ts → summarizeInterfaces-CjkeWwkY.d.ts} +20 -17
- package/dist/_exports/undeploy.d.ts +12 -9
- package/dist/actions/build/artifact.js +1 -1
- package/dist/actions/build/artifact.js.map +1 -1
- package/dist/actions/build/views/artifact.js +1 -1
- package/dist/actions/build/views/artifact.js.map +1 -1
- package/dist/actions/build/vite/optimize-deps.js +3 -3
- package/dist/actions/build/vite/optimize-deps.js.map +1 -1
- package/dist/actions/build/vite/plugins/plugin-module-federation.js +1 -2
- package/dist/actions/build/vite/plugins/plugin-module-federation.js.map +1 -1
- package/dist/actions/build/vite/plugins/plugin-sanity-federation-runtime.js +1 -1
- package/dist/actions/build/vite/plugins/plugin-sanity-federation-runtime.js.map +1 -1
- package/dist/actions/build/vite/workbench-vite-plugins.js +1 -1
- package/dist/actions/build/vite/workbench-vite-plugins.js.map +1 -1
- package/dist/actions/deploy/deployPayload.js +0 -3
- package/dist/actions/deploy/deployPayload.js.map +1 -1
- package/dist/actions/deploy/deployWorkbenchApp.js +46 -4
- package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -1
- package/dist/actions/deploy/getWorkbench.js +4 -5
- package/dist/actions/deploy/getWorkbench.js.map +1 -1
- package/dist/actions/deploy/summarizeInterfaces.js +14 -10
- package/dist/actions/deploy/summarizeInterfaces.js.map +1 -1
- package/dist/actions/deploy/viewDeployment.js +17 -5
- package/dist/actions/deploy/viewDeployment.js.map +1 -1
- package/dist/actions/dev/deriveConfigs.js +9 -6
- package/dist/actions/dev/deriveConfigs.js.map +1 -1
- package/dist/actions/dev/exposesSetId.js +2 -2
- package/dist/actions/dev/exposesSetId.js.map +1 -1
- package/dist/actions/dev/registry.js +31 -25
- package/dist/actions/dev/registry.js.map +1 -1
- package/dist/actions/dev/startDevManifestWatcher.js.map +1 -1
- package/dist/actions/dev/startDevServerRegistration.js +35 -60
- package/dist/actions/dev/startDevServerRegistration.js.map +1 -1
- package/dist/actions/dev/startWorkbenchDevServer.js +3 -3
- package/dist/actions/dev/startWorkbenchDevServer.js.map +1 -1
- package/dist/actions/preview/serveBuiltApplication.js +1 -1
- package/dist/actions/preview/serveBuiltApplication.js.map +1 -1
- package/dist/actions/preview/startWorkbenchPreview.js +1 -1
- package/dist/actions/preview/startWorkbenchPreview.js.map +1 -1
- package/dist/actions/undeploy/workbenchUndeployAdapter.js +24 -33
- package/dist/actions/undeploy/workbenchUndeployAdapter.js.map +1 -1
- package/dist/appId.js +13 -9
- package/dist/appId.js.map +1 -1
- package/dist/applicationReference.js +12 -0
- package/dist/applicationReference.js.map +1 -0
- package/dist/contract.js +69 -31
- package/dist/contract.js.map +1 -1
- package/dist/defineApp.js +52 -59
- package/dist/defineApp.js.map +1 -1
- package/dist/defineView.js +3 -3
- package/dist/defineView.js.map +1 -1
- package/dist/deriveInterfaces.js +45 -19
- package/dist/deriveInterfaces.js.map +1 -1
- package/dist/resolveWorkbenchApp.js +13 -9
- package/dist/resolveWorkbenchApp.js.map +1 -1
- package/dist/resolveWorkbenchConfig.js +30 -0
- package/dist/resolveWorkbenchConfig.js.map +1 -0
- package/dist/services/applications.js +7 -1
- package/dist/services/applications.js.map +1 -1
- package/package.json +2 -2
- package/dist/_exports/contract-DyG11fQ7.d.ts +0 -45
- package/dist/_exports/defineApp-DSvQx8rf.d.ts +0 -151
- package/dist/_exports/resolveWorkbenchApp-Be9eU8mu.d.ts +0 -41
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Internal implementation detail of the [Sanity CLI](https://github.com/sanity-io/
|
|
|
4
4
|
It backs the CLI's **unstable** workbench support and is not meant to be installed
|
|
5
5
|
or imported directly — its API can change or be removed without notice.
|
|
6
6
|
|
|
7
|
-
Workbench is opt-in per project via `
|
|
7
|
+
Workbench is opt-in per project via `defineApplication` in `sanity.cli.ts`; use it
|
|
8
8
|
through the `sanity` CLI, not this package.
|
|
9
9
|
|
|
10
10
|
Maintainers: see `ARCHITECTURE.md` (not published) for how this package fits together.
|
package/dist/_exports/build.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as resolveWorkbenchApp, i as WorkbenchExposes, n as resolveWorkbenchConfig, r as ResolvedWorkbenchApp, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-6iznHbED.js";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
3
|
/**
|
|
4
4
|
* Dep pre-bundling inputs for a workbench app's dev server.
|
|
5
5
|
*
|
|
6
6
|
* Vite's dep scanner crawls from the app's HTML entry, which reaches only the
|
|
7
7
|
* app's `entry` (or a studio's config) — never the federation `exposes` (dock
|
|
8
|
-
* views,
|
|
8
|
+
* views, web workers, media-library config fields), which the host loads
|
|
9
9
|
* dynamically at runtime. So a dep imported only by an exposed module (e.g.
|
|
10
10
|
* `sanity/workbench` in a service or view) escapes the startup scan; Vite
|
|
11
11
|
* discovers it on first request, re-optimizes, and full-page reloads — which
|
|
@@ -21,7 +21,7 @@ import { PluginOption } from "vite";
|
|
|
21
21
|
*
|
|
22
22
|
* @param cwd - Project root; `entries` are returned relative to it.
|
|
23
23
|
* @param appSources - Absolute paths to the app's `entry` and/or studio config.
|
|
24
|
-
* @param exposes - The app's declared views/
|
|
24
|
+
* @param exposes - The app's declared views/web workers/config.
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
27
|
declare function workbenchOptimizeDeps(options: {
|
|
@@ -59,5 +59,5 @@ declare function workbenchVitePlugins(options: WorkbenchViteOptions): Promise<Pl
|
|
|
59
59
|
* its own id from the applications API.
|
|
60
60
|
*/
|
|
61
61
|
declare function buildAppId(app: ResolvedWorkbenchApp): Promise<string>;
|
|
62
|
-
export { type WorkbenchExposes, buildAppId, resolveWorkbenchApp, workbenchOptimizeDeps, workbenchVitePlugins };
|
|
62
|
+
export { type ResolvedMediaLibraryConfig, type WorkbenchExposes, buildAppId, resolveWorkbenchApp, resolveWorkbenchConfig, workbenchOptimizeDeps, workbenchVitePlugins };
|
|
63
63
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/_exports/build.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Node-only build entry: the module-federation Vite plugins that
|
|
2
2
|
// `@sanity/cli-build`'s `getViteConfig` swaps in for a workbench app, plus the
|
|
3
|
-
// resolver the build reads declared views/
|
|
3
|
+
// resolver the build reads declared views/web workers from. The build needs no
|
|
4
4
|
// deploy-time guards, so it takes the bare `resolveWorkbenchApp` — the guarded
|
|
5
5
|
// view (`getWorkbench`) is the deploy entry's export.
|
|
6
6
|
export { workbenchOptimizeDeps } from '../actions/build/vite/optimize-deps.js';
|
|
7
7
|
export { workbenchVitePlugins } from '../actions/build/vite/workbench-vite-plugins.js';
|
|
8
8
|
export { buildAppId } from '../appId.js';
|
|
9
9
|
export { resolveWorkbenchApp } from '../resolveWorkbenchApp.js';
|
|
10
|
+
export { resolveWorkbenchConfig } from '../resolveWorkbenchConfig.js';
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=build.js.map
|
|
@@ -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/
|
|
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/web workers 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 {workbenchOptimizeDeps} from '../actions/build/vite/optimize-deps.js'\nexport {workbenchVitePlugins} from '../actions/build/vite/workbench-vite-plugins.js'\nexport {buildAppId} from '../appId.js'\nexport {resolveWorkbenchApp, type WorkbenchExposes} from '../resolveWorkbenchApp.js'\nexport {type ResolvedMediaLibraryConfig, resolveWorkbenchConfig} from '../resolveWorkbenchConfig.js'\n"],"names":["workbenchOptimizeDeps","workbenchVitePlugins","buildAppId","resolveWorkbenchApp","resolveWorkbenchConfig"],"mappings":"AAAA,iEAAiE;AACjE,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,sDAAsD;AAEtD,SAAQA,qBAAqB,QAAO,yCAAwC;AAC5E,SAAQC,oBAAoB,QAAO,kDAAiD;AACpF,SAAQC,UAAU,QAAO,cAAa;AACtC,SAAQC,mBAAmB,QAA8B,4BAA2B;AACpF,SAAyCC,sBAAsB,QAAO,+BAA8B"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { z } from "zod/mini";
|
|
2
|
+
/** @internal */
|
|
3
|
+
declare const VIEW_CONTRACT_VERSION = 1;
|
|
4
|
+
/** @internal */
|
|
5
|
+
declare const SERVICE_CONTRACT_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* A view component. The return is opaque so the runtime helpers carry no React
|
|
8
|
+
* dependency — the generated artifact renders it with the app's own React.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
type ViewComponent<TProps> = (props: TProps) => unknown;
|
|
12
|
+
/** @public */
|
|
13
|
+
interface ViewComponentBaseProps<TView> {
|
|
14
|
+
view: TView;
|
|
15
|
+
}
|
|
16
|
+
/** Component slots per view surface; windows load outside the component artifact path. @internal */
|
|
17
|
+
declare const VIEW_COMPONENTS: {
|
|
18
|
+
readonly app: readonly [];
|
|
19
|
+
readonly asset_source: readonly ["asset_source"];
|
|
20
|
+
readonly panel: readonly ["title", "panel"];
|
|
21
|
+
readonly tile: readonly ["tile"];
|
|
22
|
+
};
|
|
23
|
+
/** @public */
|
|
24
|
+
type ViewSurface = keyof typeof VIEW_COMPONENTS;
|
|
25
|
+
/**
|
|
26
|
+
* A tile's footprint family — the shape it occupies on the dashboard. Modelled
|
|
27
|
+
* on iOS WidgetKit families, not a linear scale: `banner` is full-width and
|
|
28
|
+
* shallow, which a `small`→`large` magnitude can't express. The host maps a
|
|
29
|
+
* family to a layout slot; the component reads it to render per footprint.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
declare const TileSizeSchema: z.ZodMiniEnum<{
|
|
33
|
+
small: "small";
|
|
34
|
+
large: "large";
|
|
35
|
+
banner: "banner";
|
|
36
|
+
}>;
|
|
37
|
+
/** @public */
|
|
38
|
+
type TileSize = z.infer<typeof TileSizeSchema>;
|
|
39
|
+
/** @public */
|
|
40
|
+
type ServiceType = 'worker';
|
|
41
|
+
declare const DockGroupSchema: z.ZodMiniEnum<{
|
|
42
|
+
"dock.system": "dock.system";
|
|
43
|
+
"dock.applications": "dock.applications";
|
|
44
|
+
"dock.user": "dock.user";
|
|
45
|
+
}>;
|
|
46
|
+
/** @public */
|
|
47
|
+
type DockGroup = z.output<typeof DockGroupSchema>;
|
|
48
|
+
declare const PanelViewSchema: z.ZodMiniObject<{
|
|
49
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
50
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
51
|
+
"dock.system": "dock.system";
|
|
52
|
+
"dock.applications": "dock.applications";
|
|
53
|
+
"dock.user": "dock.user";
|
|
54
|
+
}>>;
|
|
55
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
title: z.ZodMiniString<string>;
|
|
58
|
+
name: z.ZodMiniString<string>;
|
|
59
|
+
src: z.ZodMiniString<string>;
|
|
60
|
+
surface: z.ZodMiniLiteral<"panel">;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/** @public */
|
|
63
|
+
type PanelView = z.output<typeof PanelViewSchema>;
|
|
64
|
+
/** @public */
|
|
65
|
+
type DefinePanelViewInput = Omit<PanelView, 'surface'>;
|
|
66
|
+
/** @public */
|
|
67
|
+
declare function definePanelView(view: DefinePanelViewInput): PanelView;
|
|
68
|
+
declare const WindowViewSchema: z.ZodMiniObject<{
|
|
69
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
70
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
71
|
+
"dock.system": "dock.system";
|
|
72
|
+
"dock.applications": "dock.applications";
|
|
73
|
+
"dock.user": "dock.user";
|
|
74
|
+
}>>;
|
|
75
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
title: z.ZodMiniString<string>;
|
|
78
|
+
name: z.ZodMiniString<string>;
|
|
79
|
+
src: z.ZodMiniString<string>;
|
|
80
|
+
surface: z.ZodMiniLiteral<"app">;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
/** @public */
|
|
83
|
+
type WindowView = z.output<typeof WindowViewSchema>;
|
|
84
|
+
/** @public */
|
|
85
|
+
type DefineWindowViewInput = Omit<WindowView, 'surface'>;
|
|
86
|
+
/** @public */
|
|
87
|
+
declare function defineWindowView(view: DefineWindowViewInput): WindowView;
|
|
88
|
+
declare const AssetSourceViewSchema: z.ZodMiniObject<{
|
|
89
|
+
title: z.ZodMiniString<string>;
|
|
90
|
+
name: z.ZodMiniString<string>;
|
|
91
|
+
src: z.ZodMiniString<string>;
|
|
92
|
+
surface: z.ZodMiniLiteral<"asset_source">;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/** @public */
|
|
95
|
+
type AssetSourceView = z.output<typeof AssetSourceViewSchema>;
|
|
96
|
+
/** @public */
|
|
97
|
+
type DefineAssetSourceViewInput = Omit<AssetSourceView, 'surface'>;
|
|
98
|
+
/** @public */
|
|
99
|
+
declare function defineAssetSourceView(view: DefineAssetSourceViewInput): AssetSourceView;
|
|
100
|
+
declare const TileViewSchema: z.ZodMiniObject<{
|
|
101
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
102
|
+
size: z.ZodMiniEnum<{
|
|
103
|
+
small: "small";
|
|
104
|
+
large: "large";
|
|
105
|
+
banner: "banner";
|
|
106
|
+
}>;
|
|
107
|
+
title: z.ZodMiniString<string>;
|
|
108
|
+
name: z.ZodMiniString<string>;
|
|
109
|
+
src: z.ZodMiniString<string>;
|
|
110
|
+
surface: z.ZodMiniLiteral<"tile">;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
/** @public */
|
|
113
|
+
type TileView = z.output<typeof TileViewSchema>;
|
|
114
|
+
/** @public */
|
|
115
|
+
type DefineTileViewInput = Omit<TileView, 'surface'>;
|
|
116
|
+
/** @public */
|
|
117
|
+
declare function defineTileView(view: DefineTileViewInput): TileView;
|
|
118
|
+
/** @internal */
|
|
119
|
+
declare const InterfaceDeclarationSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
120
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
121
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
122
|
+
"dock.system": "dock.system";
|
|
123
|
+
"dock.applications": "dock.applications";
|
|
124
|
+
"dock.user": "dock.user";
|
|
125
|
+
}>>;
|
|
126
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
title: z.ZodMiniString<string>;
|
|
129
|
+
name: z.ZodMiniString<string>;
|
|
130
|
+
src: z.ZodMiniString<string>;
|
|
131
|
+
surface: z.ZodMiniLiteral<"app">;
|
|
132
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
133
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
134
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
135
|
+
"dock.system": "dock.system";
|
|
136
|
+
"dock.applications": "dock.applications";
|
|
137
|
+
"dock.user": "dock.user";
|
|
138
|
+
}>>;
|
|
139
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
title: z.ZodMiniString<string>;
|
|
142
|
+
name: z.ZodMiniString<string>;
|
|
143
|
+
src: z.ZodMiniString<string>;
|
|
144
|
+
surface: z.ZodMiniLiteral<"panel">;
|
|
145
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
146
|
+
title: z.ZodMiniString<string>;
|
|
147
|
+
name: z.ZodMiniString<string>;
|
|
148
|
+
src: z.ZodMiniString<string>;
|
|
149
|
+
surface: z.ZodMiniLiteral<"asset_source">;
|
|
150
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
151
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
152
|
+
size: z.ZodMiniEnum<{
|
|
153
|
+
small: "small";
|
|
154
|
+
large: "large";
|
|
155
|
+
banner: "banner";
|
|
156
|
+
}>;
|
|
157
|
+
title: z.ZodMiniString<string>;
|
|
158
|
+
name: z.ZodMiniString<string>;
|
|
159
|
+
src: z.ZodMiniString<string>;
|
|
160
|
+
surface: z.ZodMiniLiteral<"tile">;
|
|
161
|
+
}, z.core.$strip>], "surface">;
|
|
162
|
+
/** @public */
|
|
163
|
+
type ViewDeclaration = z.output<typeof InterfaceDeclarationSchema>;
|
|
164
|
+
declare const WebWorkerSchema: z.ZodMiniObject<{
|
|
165
|
+
title: z.ZodMiniString<string>;
|
|
166
|
+
name: z.ZodMiniString<string>;
|
|
167
|
+
src: z.ZodMiniString<string>;
|
|
168
|
+
type: z.ZodMiniLiteral<"worker">;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
/** @public */
|
|
171
|
+
type WebWorker = z.output<typeof WebWorkerSchema>;
|
|
172
|
+
/** @public */
|
|
173
|
+
type DefineWebWorkerInput = Omit<WebWorker, 'type'>;
|
|
174
|
+
/** @public */
|
|
175
|
+
declare function defineWebWorker(webWorker: DefineWebWorkerInput): WebWorker;
|
|
176
|
+
/**
|
|
177
|
+
* A workbench config's built value, keyed by `appType`; deploys as a versioned
|
|
178
|
+
* snapshot, not an interface.
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
declare const ConfigSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
182
|
+
appType: z.ZodMiniLiteral<"media-library">;
|
|
183
|
+
fields: z.ZodMiniArray<z.ZodMiniObject<{
|
|
184
|
+
public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
185
|
+
title: z.ZodMiniString<string>;
|
|
186
|
+
name: z.ZodMiniString<string>;
|
|
187
|
+
src: z.ZodMiniString<string>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
}, z.core.$strip>], "appType">;
|
|
190
|
+
/**
|
|
191
|
+
* The `{appType, fields}` config value the build expands into a federation
|
|
192
|
+
* remote and the deploy summarizes.
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
type WorkbenchConfigValue = z.output<typeof ConfigSchema>;
|
|
196
|
+
/**
|
|
197
|
+
* Runtime-validation schema for `defineApplication`.
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
200
|
+
declare const DefineAppInputSchema: z.ZodMiniObject<{
|
|
201
|
+
applicationType: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
202
|
+
coreApp: "coreApp";
|
|
203
|
+
studio: "studio";
|
|
204
|
+
canvas: "canvas";
|
|
205
|
+
dashboard: "dashboard";
|
|
206
|
+
}>>;
|
|
207
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
208
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
209
|
+
"dock.system": "dock.system";
|
|
210
|
+
"dock.applications": "dock.applications";
|
|
211
|
+
"dock.user": "dock.user";
|
|
212
|
+
}>>;
|
|
213
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
216
|
+
icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
217
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
218
|
+
organizationId: z.ZodMiniString<string>;
|
|
219
|
+
slug: z.ZodMiniString<string>;
|
|
220
|
+
title: z.ZodMiniString<string>;
|
|
221
|
+
views: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
222
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
223
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
224
|
+
"dock.system": "dock.system";
|
|
225
|
+
"dock.applications": "dock.applications";
|
|
226
|
+
"dock.user": "dock.user";
|
|
227
|
+
}>>;
|
|
228
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
title: z.ZodMiniString<string>;
|
|
231
|
+
name: z.ZodMiniString<string>;
|
|
232
|
+
src: z.ZodMiniString<string>;
|
|
233
|
+
surface: z.ZodMiniLiteral<"app">;
|
|
234
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
235
|
+
dock: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
236
|
+
group: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
237
|
+
"dock.system": "dock.system";
|
|
238
|
+
"dock.applications": "dock.applications";
|
|
239
|
+
"dock.user": "dock.user";
|
|
240
|
+
}>>;
|
|
241
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
242
|
+
}, z.core.$strip>>;
|
|
243
|
+
title: z.ZodMiniString<string>;
|
|
244
|
+
name: z.ZodMiniString<string>;
|
|
245
|
+
src: z.ZodMiniString<string>;
|
|
246
|
+
surface: z.ZodMiniLiteral<"panel">;
|
|
247
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
248
|
+
title: z.ZodMiniString<string>;
|
|
249
|
+
name: z.ZodMiniString<string>;
|
|
250
|
+
src: z.ZodMiniString<string>;
|
|
251
|
+
surface: z.ZodMiniLiteral<"asset_source">;
|
|
252
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
253
|
+
order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
254
|
+
size: z.ZodMiniEnum<{
|
|
255
|
+
small: "small";
|
|
256
|
+
large: "large";
|
|
257
|
+
banner: "banner";
|
|
258
|
+
}>;
|
|
259
|
+
title: z.ZodMiniString<string>;
|
|
260
|
+
name: z.ZodMiniString<string>;
|
|
261
|
+
src: z.ZodMiniString<string>;
|
|
262
|
+
surface: z.ZodMiniLiteral<"tile">;
|
|
263
|
+
}, z.core.$strip>], "surface">>>;
|
|
264
|
+
visibility: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
265
|
+
default: "default";
|
|
266
|
+
unlisted: "unlisted";
|
|
267
|
+
disabled: "disabled";
|
|
268
|
+
}>>;
|
|
269
|
+
webWorkers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
270
|
+
title: z.ZodMiniString<string>;
|
|
271
|
+
name: z.ZodMiniString<string>;
|
|
272
|
+
src: z.ZodMiniString<string>;
|
|
273
|
+
type: z.ZodMiniLiteral<"worker">;
|
|
274
|
+
}, z.core.$strip>], "type">>>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
/**
|
|
277
|
+
* User-facing input for `defineApplication`. Excludes the internal
|
|
278
|
+
* `applicationType`.
|
|
279
|
+
* @public
|
|
280
|
+
*/
|
|
281
|
+
type DefineAppInput = Omit<z.output<typeof DefineAppInputSchema>, 'applicationType'>;
|
|
282
|
+
/**
|
|
283
|
+
* Nominal brand the CLI discriminates on to enable the workbench build/deploy
|
|
284
|
+
* codepath. Registered via `Symbol.for` so the marker survives module-realm
|
|
285
|
+
* boundaries — `@sanity/cli-core` re-derives the same global symbol with
|
|
286
|
+
* `Symbol.for` rather than importing it, so it stays internal to this module.
|
|
287
|
+
*/
|
|
288
|
+
declare const WORKBENCH_APP: unique symbol;
|
|
289
|
+
/**
|
|
290
|
+
* The branded result of `defineApplication`. Carries the same fields as the
|
|
291
|
+
* input plus the internal brand — users only ever see `DefineAppInput`.
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
type DefineAppResult = DefineAppInput & {
|
|
295
|
+
readonly [WORKBENCH_APP]: true;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* A branded app as the CLI reads it — the full schema shape, including the
|
|
299
|
+
* internal fields `DefineAppInput` omits. Schema-derived so the narrowing
|
|
300
|
+
* can't drift from what the schema validates.
|
|
301
|
+
* @public
|
|
302
|
+
*/
|
|
303
|
+
type WorkbenchApp = DefineAppResult & z.output<typeof DefineAppInputSchema>;
|
|
304
|
+
/**
|
|
305
|
+
* Whether `app` is a branded `defineApplication(...)` result — the sole
|
|
306
|
+
* workbench opt-in.
|
|
307
|
+
* @public
|
|
308
|
+
*/
|
|
309
|
+
declare function isWorkbenchApp(app: unknown): app is WorkbenchApp;
|
|
310
|
+
/**
|
|
311
|
+
* Declare a Sanity Workbench application. Identity at runtime — returns the same
|
|
312
|
+
* object reference, tagged with the workbench brand. Field validation (the
|
|
313
|
+
* `slug` pattern etc.) runs at build time in the CLI via `DefineAppInputSchema`;
|
|
314
|
+
* this helper stays a thin, pure identity wrapper.
|
|
315
|
+
* @public
|
|
316
|
+
*/
|
|
317
|
+
declare function defineApplication(input: DefineAppInput): DefineAppResult;
|
|
318
|
+
/**
|
|
319
|
+
* One custom field a media library exposes. `src` default-exports a `defineField(...)` schema type.
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
interface MediaLibraryField {
|
|
323
|
+
/** Unique within the media library. */
|
|
324
|
+
name: string;
|
|
325
|
+
src: string;
|
|
326
|
+
title: string;
|
|
327
|
+
/** Readable outside the owning organization. */
|
|
328
|
+
public?: boolean;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Sanity-owned singleton, so authors don't name or title the app — only `organizationId` is required.
|
|
332
|
+
* @public
|
|
333
|
+
*/
|
|
334
|
+
interface DefineMediaLibraryInput {
|
|
335
|
+
/** Organization that owns the media library — the CLI runs and deploys against it. */
|
|
336
|
+
organizationId: string;
|
|
337
|
+
fields?: MediaLibraryField[];
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Nominal brand the CLI discriminates a config on. A config is *not* an app: it
|
|
341
|
+
* carries no `slug`/`title`/application identity, only a target `appType`, its
|
|
342
|
+
* owning `organizationId`, and its `fields`. Registered via `Symbol.for` so the
|
|
343
|
+
* marker survives module-realm boundaries — `@sanity/cli-core` re-derives the
|
|
344
|
+
* same global symbol rather than importing it.
|
|
345
|
+
*/
|
|
346
|
+
declare const WORKBENCH_CONFIG: unique symbol;
|
|
347
|
+
/**
|
|
348
|
+
* A branded workbench config as the CLI reads it: bound to its target app by
|
|
349
|
+
* `appType`, not carrying its own app identity. The deploy/undeploy/build paths
|
|
350
|
+
* discriminate it via {@link isWorkbenchConfig}.
|
|
351
|
+
* @public
|
|
352
|
+
*/
|
|
353
|
+
interface WorkbenchConfig {
|
|
354
|
+
appType: 'media-library';
|
|
355
|
+
fields: MediaLibraryField[];
|
|
356
|
+
organizationId: string;
|
|
357
|
+
readonly [WORKBENCH_CONFIG]: true;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Whether `app` is a branded `unstable_defineMediaLibrary(...)` config — a
|
|
361
|
+
* config-carrier rather than an app. Configs live in `cliConfig.app` alongside
|
|
362
|
+
* apps but resolve through `resolveWorkbenchConfig`, not `resolveWorkbenchApp`.
|
|
363
|
+
* @public
|
|
364
|
+
*/
|
|
365
|
+
declare function isWorkbenchConfig(app: unknown): app is WorkbenchConfig;
|
|
366
|
+
/**
|
|
367
|
+
* Declare the Sanity Media Library config. The Media Library is a Sanity-owned
|
|
368
|
+
* singleton, so this is not an app — it carries no slug or title, only the
|
|
369
|
+
* target `appType`, its owning organization, and the `fields` it contributes to
|
|
370
|
+
* the installation's config.
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
declare function unstable_defineMediaLibrary(input: DefineMediaLibraryInput): WorkbenchConfig;
|
|
374
|
+
export { WorkbenchConfigValue as A, VIEW_CONTRACT_VERSION as C, ViewSurface as D, ViewDeclaration as E, defineWindowView as F, definePanelView as M, defineTileView as N, WebWorker as O, defineWebWorker as P, TileView as S, ViewComponentBaseProps as T, DockGroup as _, WorkbenchApp as a, ServiceType as b, isWorkbenchApp as c, AssetSourceView as d, DefineAssetSourceViewInput as f, DefineWindowViewInput as g, DefineWebWorkerInput as h, MediaLibraryField as i, defineAssetSourceView as j, WindowView as k, isWorkbenchConfig as l, DefineTileViewInput as m, DefineAppResult as n, WorkbenchConfig as o, DefinePanelViewInput as p, DefineMediaLibraryInput as r, defineApplication as s, DefineAppInput as t, unstable_defineMediaLibrary as u, PanelView as v, ViewComponent as w, TileSize as x, SERVICE_CONTRACT_VERSION as y };
|
|
375
|
+
//# sourceMappingURL=defineApp-DldjQwq6.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
1
|
+
import "./defineApp-DldjQwq6.js";
|
|
2
|
+
import { n as resolveWorkbenchConfig, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-6iznHbED.js";
|
|
3
|
+
import { a as DeployableWorkbenchApp, i as summarizeInterfaces, n as DeployedView, o as getWorkbench, r as DeployedWebWorker, t as DeployedInterface } from "./summarizeInterfaces-CjkeWwkY.js";
|
|
3
4
|
import { AppVisibility, CliConfig, Output } from "@sanity/cli-core";
|
|
4
5
|
import "node:zlib";
|
|
5
6
|
/**
|
|
@@ -52,9 +53,8 @@ interface WorkbenchDeployPayload {
|
|
|
52
53
|
title: string;
|
|
53
54
|
/** Media-library config summary. */
|
|
54
55
|
config?: string;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
views?: DeployedInterface[];
|
|
56
|
+
services?: DeployedWebWorker[];
|
|
57
|
+
views?: DeployedView[];
|
|
58
58
|
visibility?: string;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -64,8 +64,8 @@ interface WorkbenchDeployPayload {
|
|
|
64
64
|
declare function toWorkbenchPayload(workbench: DeployableWorkbenchApp | null, { config, interfaces, title }: {
|
|
65
65
|
config?: string;
|
|
66
66
|
interfaces: {
|
|
67
|
-
services:
|
|
68
|
-
views:
|
|
67
|
+
services: DeployedWebWorker[];
|
|
68
|
+
views: DeployedView[];
|
|
69
69
|
} | null;
|
|
70
70
|
title: string;
|
|
71
71
|
}): Partial<WorkbenchDeployPayload>;
|
|
@@ -117,7 +117,7 @@ interface CreatedApplication {
|
|
|
117
117
|
* @internal
|
|
118
118
|
*/
|
|
119
119
|
declare function createCoreApp(options: {
|
|
120
|
-
|
|
120
|
+
name?: string;
|
|
121
121
|
organizationId: string;
|
|
122
122
|
slug: string;
|
|
123
123
|
title: string;
|
|
@@ -128,6 +128,7 @@ declare function createCoreApp(options: {
|
|
|
128
128
|
* @internal
|
|
129
129
|
*/
|
|
130
130
|
declare function createStudio(options: {
|
|
131
|
+
name?: string;
|
|
131
132
|
organizationId: string;
|
|
132
133
|
projectId: string | undefined;
|
|
133
134
|
slug: string;
|
|
@@ -160,5 +161,5 @@ declare function deployWorkbenchApp(options: {
|
|
|
160
161
|
visibility?: AppVisibility;
|
|
161
162
|
workspaces?: readonly BrettWorkspace[];
|
|
162
163
|
}): Promise<void>;
|
|
163
|
-
export { type Application, type BrettAccess, type BrettWorkspace, type CreatedApplication, type DeployedInterface, type WorkbenchDeployPayload, checkBuiltOutput, createCoreApp, createStudio, deployConfig, deployWorkbenchApp, getApplication, getApplicationUrl, getWorkbench, getWorkbenchUrl, listApplications, resolveInstallationId, summarizeConfig, summarizeInterfaces, toWorkbenchPayload };
|
|
164
|
+
export { type Application, type BrettAccess, type BrettWorkspace, type CreatedApplication, type DeployedInterface, type DeployedView, type DeployedWebWorker, type ResolvedMediaLibraryConfig, type WorkbenchDeployPayload, checkBuiltOutput, createCoreApp, createStudio, deployConfig, deployWorkbenchApp, getApplication, getApplicationUrl, getWorkbench, getWorkbenchUrl, listApplications, resolveInstallationId, resolveWorkbenchConfig, summarizeConfig, summarizeInterfaces, toWorkbenchPayload };
|
|
164
165
|
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/_exports/deploy.js
CHANGED
|
@@ -4,6 +4,7 @@ export { toWorkbenchPayload } from '../actions/deploy/deployPayload.js';
|
|
|
4
4
|
export { createCoreApp, createStudio, deployWorkbenchApp } from '../actions/deploy/deployWorkbenchApp.js';
|
|
5
5
|
export { getWorkbench } from '../actions/deploy/getWorkbench.js';
|
|
6
6
|
export { summarizeInterfaces } from '../actions/deploy/summarizeInterfaces.js';
|
|
7
|
+
export { resolveWorkbenchConfig } from '../resolveWorkbenchConfig.js';
|
|
7
8
|
export { getApplication, getApplicationUrl, getWorkbenchUrl, listApplications } from '../services/applications.js';
|
|
8
9
|
|
|
9
10
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {checkBuiltOutput} from '../actions/deploy/checkBuiltOutput.js'\nexport {\n deployConfig,\n resolveInstallationId,\n summarizeConfig,\n} from '../actions/deploy/deployConfig.js'\nexport {toWorkbenchPayload, type WorkbenchDeployPayload} from '../actions/deploy/deployPayload.js'\nexport {\n createCoreApp,\n type CreatedApplication,\n createStudio,\n deployWorkbenchApp,\n} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\nexport {type DeployedInterface
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/deploy.ts"],"sourcesContent":["export {checkBuiltOutput} from '../actions/deploy/checkBuiltOutput.js'\nexport {\n deployConfig,\n resolveInstallationId,\n summarizeConfig,\n} from '../actions/deploy/deployConfig.js'\nexport {toWorkbenchPayload, type WorkbenchDeployPayload} from '../actions/deploy/deployPayload.js'\nexport {\n createCoreApp,\n type CreatedApplication,\n createStudio,\n deployWorkbenchApp,\n} from '../actions/deploy/deployWorkbenchApp.js'\nexport {getWorkbench} from '../actions/deploy/getWorkbench.js'\nexport {\n type DeployedInterface,\n type DeployedView,\n type DeployedWebWorker,\n summarizeInterfaces,\n} from '../actions/deploy/summarizeInterfaces.js'\nexport {type ResolvedMediaLibraryConfig, resolveWorkbenchConfig} from '../resolveWorkbenchConfig.js'\nexport {\n type Application,\n type BrettAccess,\n type BrettWorkspace,\n getApplication,\n getApplicationUrl,\n getWorkbenchUrl,\n listApplications,\n} from '../services/applications.js'\n"],"names":["checkBuiltOutput","deployConfig","resolveInstallationId","summarizeConfig","toWorkbenchPayload","createCoreApp","createStudio","deployWorkbenchApp","getWorkbench","summarizeInterfaces","resolveWorkbenchConfig","getApplication","getApplicationUrl","getWorkbenchUrl","listApplications"],"mappings":"AAAA,SAAQA,gBAAgB,QAAO,wCAAuC;AACtE,SACEC,YAAY,EACZC,qBAAqB,EACrBC,eAAe,QACV,oCAAmC;AAC1C,SAAQC,kBAAkB,QAAoC,qCAAoC;AAClG,SACEC,aAAa,EAEbC,YAAY,EACZC,kBAAkB,QACb,0CAAyC;AAChD,SAAQC,YAAY,QAAO,oCAAmC;AAC9D,SAIEC,mBAAmB,QACd,2CAA0C;AACjD,SAAyCC,sBAAsB,QAAO,+BAA8B;AACpG,SAIEC,cAAc,EACdC,iBAAiB,EACjBC,eAAe,EACfC,gBAAgB,QACX,8BAA6B"}
|
package/dist/_exports/dev.d.ts
CHANGED
package/dist/_exports/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as VIEW_CONTRACT_VERSION, i as TileSize, n as SERVICE_CONTRACT_VERSION, o as ViewComponent, r as ServiceType, s as ViewComponentBaseProps, t as InterfaceType } from "./contract-DyG11fQ7.js";
|
|
1
|
+
import { C as VIEW_CONTRACT_VERSION, D as ViewSurface, E as ViewDeclaration, F as defineWindowView, M as definePanelView, N as defineTileView, O as WebWorker, P as defineWebWorker, S as TileView, T as ViewComponentBaseProps, _ as DockGroup, a as WorkbenchApp, b as ServiceType, c as isWorkbenchApp, d as AssetSourceView, f as DefineAssetSourceViewInput, g as DefineWindowViewInput, h as DefineWebWorkerInput, i as MediaLibraryField, j as defineAssetSourceView, k as WindowView, l as isWorkbenchConfig, m as DefineTileViewInput, n as DefineAppResult, o as WorkbenchConfig, p as DefinePanelViewInput, r as DefineMediaLibraryInput, s as defineApplication, t as DefineAppInput, u as unstable_defineMediaLibrary, v as PanelView, w as ViewComponent, x as TileSize, y as SERVICE_CONTRACT_VERSION } from "./defineApp-DldjQwq6.js";
|
|
3
2
|
import { AssetSourceComponentProps } from "@sanity/types";
|
|
4
3
|
/**
|
|
5
4
|
* The service's own declaration, surfaced to the callback.
|
|
@@ -49,6 +48,13 @@ interface DefinedService<TType extends ServiceType = ServiceType> {
|
|
|
49
48
|
* @public
|
|
50
49
|
*/
|
|
51
50
|
declare function unstable_defineService<TType extends ServiceType>(type: TType, run: ServiceCallbacksByType[TType]): DefinedService<TType>;
|
|
51
|
+
/** @public */
|
|
52
|
+
type WindowViewProps = ViewComponentBaseProps<{
|
|
53
|
+
name: string;
|
|
54
|
+
src: string;
|
|
55
|
+
surface: 'app';
|
|
56
|
+
title: string;
|
|
57
|
+
}>;
|
|
52
58
|
/**
|
|
53
59
|
* Props a panel component receives: its interface record, minus the
|
|
54
60
|
* service-assigned `id`/`deployment_id` a local dev server can't provide. Mirrors
|
|
@@ -59,8 +65,8 @@ declare function unstable_defineService<TType extends ServiceType>(type: TType,
|
|
|
59
65
|
type PanelViewProps = ViewComponentBaseProps<{
|
|
60
66
|
name: string;
|
|
61
67
|
src: string;
|
|
68
|
+
surface: 'panel';
|
|
62
69
|
title: string;
|
|
63
|
-
type: 'panel';
|
|
64
70
|
}>;
|
|
65
71
|
/**
|
|
66
72
|
* The component slots a `panel` view exposes — each its own module-federation
|
|
@@ -93,18 +99,18 @@ interface AssetSourceViewComponents {
|
|
|
93
99
|
*/
|
|
94
100
|
type AssetSourceComponent = keyof AssetSourceViewComponents;
|
|
95
101
|
/**
|
|
96
|
-
* Props a tile component receives: its own interface record
|
|
97
|
-
*
|
|
102
|
+
* Props a tile component receives: its own interface record plus its footprint
|
|
103
|
+
* `size`, so it can render per family. Mirrors the
|
|
98
104
|
* `tile` record the dashboard host renders from; drift is guarded by the stamped
|
|
99
|
-
* contract version. Placement `
|
|
105
|
+
* contract version. Placement `order` is host-only metadata, not surfaced here.
|
|
100
106
|
* @public
|
|
101
107
|
*/
|
|
102
108
|
type TileViewProps = ViewComponentBaseProps<{
|
|
103
109
|
name: string;
|
|
104
110
|
size: TileSize;
|
|
105
111
|
src: string;
|
|
112
|
+
surface: 'tile';
|
|
106
113
|
title: string;
|
|
107
|
-
type: 'tile';
|
|
108
114
|
}>;
|
|
109
115
|
/**
|
|
110
116
|
* The component slot a `tile` view exposes — a single island, typed with the
|
|
@@ -120,22 +126,23 @@ interface TileViewComponents {
|
|
|
120
126
|
*/
|
|
121
127
|
type TileComponent = keyof TileViewComponents;
|
|
122
128
|
/**
|
|
123
|
-
* The components each
|
|
129
|
+
* The components each view surface exposes.
|
|
124
130
|
* @public
|
|
125
131
|
*/
|
|
126
|
-
interface
|
|
132
|
+
interface ViewComponentsBySurface {
|
|
133
|
+
app: ViewComponent<WindowViewProps>;
|
|
127
134
|
asset_source: AssetSourceViewComponents;
|
|
128
135
|
panel: PanelViewComponents;
|
|
129
136
|
tile: TileViewComponents;
|
|
130
137
|
}
|
|
131
138
|
/**
|
|
132
|
-
* The result of `unstable_defineView`: the author's component(s), the view
|
|
139
|
+
* The result of `unstable_defineView`: the author's component(s), the view surface,
|
|
133
140
|
* and the internal contract version the build artifact targets.
|
|
134
141
|
* @public
|
|
135
142
|
*/
|
|
136
|
-
interface DefinedView<
|
|
137
|
-
readonly components:
|
|
138
|
-
readonly
|
|
143
|
+
interface DefinedView<TSurface extends ViewSurface = ViewSurface> {
|
|
144
|
+
readonly components: ViewComponentsBySurface[TSurface];
|
|
145
|
+
readonly surface: TSurface;
|
|
139
146
|
/** @internal */
|
|
140
147
|
readonly version: typeof VIEW_CONTRACT_VERSION;
|
|
141
148
|
}
|
|
@@ -144,11 +151,11 @@ interface DefinedView<TType extends InterfaceType = InterfaceType> {
|
|
|
144
151
|
* and the props each component receives — `"panel"` yields a `{title, panel}`
|
|
145
152
|
* record whose components are typed with the panel props.
|
|
146
153
|
*
|
|
147
|
-
* Returns the component(s) tagged with their
|
|
154
|
+
* Returns the component(s) tagged with their surface and contract version, for
|
|
148
155
|
* the CLI build to generate render artifacts from. Used as the default export of
|
|
149
156
|
* a view's `src` file.
|
|
150
157
|
* @public
|
|
151
158
|
*/
|
|
152
|
-
declare function unstable_defineView<
|
|
153
|
-
export { type AssetSourceComponent, type AssetSourceViewComponents, type DefineAppInput, type DefineAppResult, type DefineMediaLibraryInput, type DefinedService, type DefinedView, type DockGroup, type
|
|
159
|
+
declare function unstable_defineView<TSurface extends ViewSurface>(surface: TSurface, components: ViewComponentsBySurface[TSurface]): DefinedView<TSurface>;
|
|
160
|
+
export { type AssetSourceComponent, type AssetSourceView, type AssetSourceViewComponents, type DefineAppInput, type DefineAppResult, type DefineAssetSourceViewInput, type DefineMediaLibraryInput, type DefinePanelViewInput, type DefineTileViewInput, type DefineWebWorkerInput, type DefineWindowViewInput, type DefinedService, type DefinedView, type DockGroup, type MediaLibraryField, type PanelComponent, type PanelView, type PanelViewComponents, type PanelViewProps, type ServiceCallback, type ServiceContext, type ServiceInfo, type ServiceType, type TileComponent, type TileSize, type TileView, type TileViewComponents, type TileViewProps, type ViewComponentsBySurface, type ViewDeclaration, type ViewSurface, type WebWorker, type WindowView, type WindowViewProps, type WorkbenchApp, type WorkbenchConfig, defineApplication, defineAssetSourceView, definePanelView, defineTileView, defineWebWorker, defineWindowView, isWorkbenchApp, isWorkbenchConfig, unstable_defineMediaLibrary, unstable_defineService, unstable_defineView };
|
|
154
161
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/_exports/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { defineAssetSourceView, definePanelView, defineTileView, defineWebWorker, defineWindowView } from '../contract.js';
|
|
2
|
+
export { defineApplication, isWorkbenchApp, isWorkbenchConfig, unstable_defineMediaLibrary } from '../defineApp.js';
|
|
2
3
|
export { unstable_defineService } from '../defineService.js';
|
|
3
4
|
export { unstable_defineView } from '../defineView.js';
|
|
4
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export type {\n AssetSourceView,\n DefineAssetSourceViewInput,\n DefinePanelViewInput,\n DefineTileViewInput,\n DefineWebWorkerInput,\n DefineWindowViewInput,\n DockGroup,\n PanelView,\n ServiceType,\n TileSize,\n TileView,\n ViewDeclaration,\n ViewSurface,\n WebWorker,\n WindowView,\n} from '../contract.js'\nexport {\n defineAssetSourceView,\n definePanelView,\n defineTileView,\n defineWebWorker,\n defineWindowView,\n} from '../contract.js'\nexport {\n defineApplication,\n isWorkbenchApp,\n isWorkbenchConfig,\n unstable_defineMediaLibrary,\n} from '../defineApp.js'\nexport type {\n DefineAppInput,\n DefineAppResult,\n DefineMediaLibraryInput,\n MediaLibraryField,\n WorkbenchApp,\n WorkbenchConfig,\n} from '../defineApp.js'\nexport {unstable_defineService} from '../defineService.js'\nexport type {\n DefinedService,\n ServiceCallback,\n ServiceContext,\n ServiceInfo,\n} from '../defineService.js'\nexport {unstable_defineView} from '../defineView.js'\nexport type {\n AssetSourceComponent,\n AssetSourceViewComponents,\n DefinedView,\n PanelComponent,\n PanelViewComponents,\n PanelViewProps,\n TileComponent,\n TileViewComponents,\n TileViewProps,\n ViewComponentsBySurface,\n WindowViewProps,\n} from '../defineView.js'\n"],"names":["defineAssetSourceView","definePanelView","defineTileView","defineWebWorker","defineWindowView","defineApplication","isWorkbenchApp","isWorkbenchConfig","unstable_defineMediaLibrary","unstable_defineService","unstable_defineView"],"mappings":"AAiBA,SACEA,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,gBAAgB,QACX,iBAAgB;AACvB,SACEC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBC,2BAA2B,QACtB,kBAAiB;AASxB,SAAQC,sBAAsB,QAAO,sBAAqB;AAO1D,SAAQC,mBAAmB,QAAO,mBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as DevServerManifest } from "./registry-
|
|
1
|
+
import { t as DevServerManifest } from "./registry-HE_dEHFa.js";
|
|
2
2
|
import { CliConfig, Output } from "@sanity/cli-core";
|
|
3
3
|
interface StartWorkbenchPreviewOptions {
|
|
4
4
|
/** Directory for the workbench Vite server's dependency cache. */
|