@sanity/workbench-cli 2.3.0 → 2.4.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.
Files changed (37) hide show
  1. package/dist/_exports/build.d.ts +54 -2
  2. package/dist/_exports/build.js +1 -0
  3. package/dist/_exports/build.js.map +1 -1
  4. package/dist/_exports/{defineApp-BRFgHrPc.d.ts → defineApp-KCHd3Vab.d.ts} +25 -25
  5. package/dist/_exports/deploy.d.ts +11 -6
  6. package/dist/_exports/dev.d.ts +1 -1
  7. package/dist/_exports/index.d.ts +1 -1
  8. package/dist/_exports/init.d.ts +2 -2
  9. package/dist/_exports/preview.d.ts +1 -1
  10. package/dist/_exports/{registry-CexFxsKR.d.ts → registry-BCLMbrla.d.ts} +10 -10
  11. package/dist/_exports/{resolveWorkbenchConfig-CDUdRIjD.d.ts → resolveWorkbenchConfig-1CV651GT.d.ts} +2 -2
  12. package/dist/_exports/{summarizeInterfaces-BQ1v1O89.d.ts → summarizeInterfaces-DoG6OunM.d.ts} +3 -3
  13. package/dist/_exports/undeploy.d.ts +2 -2
  14. package/dist/actions/build/resource-bindings.js +56 -0
  15. package/dist/actions/build/resource-bindings.js.map +1 -0
  16. package/dist/actions/build/vite/plugin.js +6 -3
  17. package/dist/actions/build/vite/plugin.js.map +1 -1
  18. package/dist/actions/build/vite/plugins/plugin-sanity-environment.js +22 -3
  19. package/dist/actions/build/vite/plugins/plugin-sanity-environment.js.map +1 -1
  20. package/dist/actions/build/vite/plugins/plugin-sanity-federation-runtime.js +16 -4
  21. package/dist/actions/build/vite/plugins/plugin-sanity-federation-runtime.js.map +1 -1
  22. package/dist/actions/build/vite/workbench-vite-plugins.js +2 -1
  23. package/dist/actions/build/vite/workbench-vite-plugins.js.map +1 -1
  24. package/dist/actions/deploy/deployConfig.js +6 -6
  25. package/dist/actions/deploy/deployConfig.js.map +1 -1
  26. package/dist/actions/deploy/deployWorkbenchApp.js +39 -19
  27. package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -1
  28. package/dist/actions/dev/startWorkbenchDevServer.js +3 -1
  29. package/dist/actions/dev/startWorkbenchDevServer.js.map +1 -1
  30. package/dist/actions/dev/toWireInterface.js +1 -1
  31. package/dist/actions/dev/toWireInterface.js.map +1 -1
  32. package/dist/actions/init/cliConfig.js +6 -6
  33. package/dist/actions/init/cliConfig.js.map +1 -1
  34. package/dist/contract.js +3 -3
  35. package/dist/contract.js.map +1 -1
  36. package/dist/services/applications.js.map +1 -1
  37. package/package.json +9 -10
@@ -1,5 +1,55 @@
1
- import { a as resolveWorkbenchApp, i as WorkbenchExposes, n as resolveWorkbenchConfig, r as ResolvedWorkbenchApp, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-CDUdRIjD.js";
1
+ import { a as resolveWorkbenchApp, i as WorkbenchExposes, n as resolveWorkbenchConfig, r as ResolvedWorkbenchApp, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-1CV651GT.js";
2
2
  import { PluginOption } from "vite";
3
+ /**
4
+ * Resource bindings ride in a dedicated module in the app's bundle rather than an
5
+ * index.html script tag, so both standalone studios and federated apps resolve
6
+ * them the same way (a federated host pulls modules, not HTML).
7
+ *
8
+ * The module is emitted at a stable, unhashed path (`sanity-resource-bindings.js`)
9
+ * at the bundle root and is statically imported first, so it is evaluated before
10
+ * any app code. At deploy time Brett replaces the `__SANITY_RESOURCE_BINDINGS__`
11
+ * token with the resolved bindings JSON. The token is invalid JSON on purpose: a
12
+ * minifier can't constant-fold `JSON.parse` of it, so the call — and the token —
13
+ * survive minification for Brett to rewrite.
14
+ *
15
+ * These constants are the single source of truth shared by the standalone studio
16
+ * build (`@sanity/cli-build`) and the federated app build here. They must stay in
17
+ * lockstep with Brett's replacement (see SDK-2413).
18
+ */
19
+ /** Rolldown chunk name used to force the bindings module into its own chunk. */
20
+ declare const RESOURCE_BINDINGS_CHUNK_NAME = "sanity-resource-bindings";
21
+ /** Stable, unhashed file name Brett looks for at the bundle root. */
22
+ declare const RESOURCE_BINDINGS_FILENAME = "sanity-resource-bindings.js";
23
+ /** Token Brett replaces with the resolved bindings JSON at deploy. */
24
+ declare const RESOURCE_BINDINGS_TOKEN = "__SANITY_RESOURCE_BINDINGS__";
25
+ /**
26
+ * Contents of the generated bindings module. The `JSON.parse` result is assigned
27
+ * to a global so the module has an observable side effect and isn't tree-shaken
28
+ * when nothing imports its export yet (the reader lands in SDK-2295). The
29
+ * try/catch keeps a local, un-deployed build (e.g. `sanity preview`) working: an
30
+ * unreplaced token throws, and we fall back to an empty array.
31
+ */
32
+ declare const RESOURCE_BINDINGS_MODULE_SOURCE = "// This file is auto-generated on 'sanity build' / 'sanity dev'\n// Modifications to this file are automatically discarded\nlet resourceBindings = []\ntry {\n resourceBindings = JSON.parse('__SANITY_RESOURCE_BINDINGS__')\n} catch {\n // Built but not deployed through Brett (e.g. local preview): keep the default.\n}\nglobalThis.__SANITY_RESOURCE_BINDINGS__ = resourceBindings\nexport {resourceBindings}\n";
33
+ /** Side-effect import placed first in each entry so the module evaluates before app code. */
34
+ declare const RESOURCE_BINDINGS_ENTRY_IMPORT = "import './sanity-resource-bindings.js'";
35
+ /**
36
+ * Rolldown `codeSplitting` group that isolates the bindings module into its own
37
+ * chunk. `minSize`/`minModuleSize` of 0 are scoped to this group (not the
38
+ * enclosing `codeSplitting` object) so they only affect the bindings module and
39
+ * never the automatic chunking of everything else. They stop Rolldown folding
40
+ * the tiny module back into its importer.
41
+ */
42
+ declare const resourceBindingsCodeSplittingGroup: {
43
+ minModuleSize: number;
44
+ minSize: number;
45
+ name: string;
46
+ test: RegExp;
47
+ };
48
+ /**
49
+ * `chunkFileNames` value for the bindings chunk (unhashed, at the bundle root),
50
+ * or `undefined` for any other chunk so the caller can apply its own default.
51
+ */
52
+ declare function resourceBindingsChunkFileName(chunkName: string): string | undefined;
3
53
  /**
4
54
  * Dep pre-bundling inputs for a workbench app's dev server.
5
55
  *
@@ -49,6 +99,8 @@ interface WorkbenchViteOptions {
49
99
  exposes?: WorkbenchExposes;
50
100
  /** App (vs studio) build — selects the discriminated federation option shape. */
51
101
  isApp?: boolean;
102
+ /** Blueprints build (via `@sanity/runtime-cli`) — emit the resource-bindings module. */
103
+ isBlueprints?: boolean;
52
104
  }
53
105
  /** Build the Vite plugins for a workbench app's module-federation remote. */
54
106
  declare function workbenchVitePlugins(options: WorkbenchViteOptions): Promise<PluginOption>;
@@ -59,5 +111,5 @@ declare function workbenchVitePlugins(options: WorkbenchViteOptions): Promise<Pl
59
111
  * its own id from the applications API.
60
112
  */
61
113
  declare function buildAppId(app: ResolvedWorkbenchApp): Promise<string>;
62
- export { type ResolvedMediaLibraryConfig, type WorkbenchExposes, buildAppId, resolveWorkbenchApp, resolveWorkbenchConfig, workbenchOptimizeDeps, workbenchVitePlugins };
114
+ export { RESOURCE_BINDINGS_CHUNK_NAME, RESOURCE_BINDINGS_ENTRY_IMPORT, RESOURCE_BINDINGS_FILENAME, RESOURCE_BINDINGS_MODULE_SOURCE, RESOURCE_BINDINGS_TOKEN, type ResolvedMediaLibraryConfig, type WorkbenchExposes, buildAppId, resolveWorkbenchApp, resolveWorkbenchConfig, resourceBindingsChunkFileName, resourceBindingsCodeSplittingGroup, workbenchOptimizeDeps, workbenchVitePlugins };
63
115
  //# sourceMappingURL=build.d.ts.map
@@ -3,6 +3,7 @@
3
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
+ export { RESOURCE_BINDINGS_CHUNK_NAME, RESOURCE_BINDINGS_ENTRY_IMPORT, RESOURCE_BINDINGS_FILENAME, RESOURCE_BINDINGS_MODULE_SOURCE, RESOURCE_BINDINGS_TOKEN, resourceBindingsChunkFileName, resourceBindingsCodeSplittingGroup } from '../actions/build/resource-bindings.js';
6
7
  export { workbenchOptimizeDeps } from '../actions/build/vite/optimize-deps.js';
7
8
  export { workbenchVitePlugins } from '../actions/build/vite/workbench-vite-plugins.js';
8
9
  export { buildAppId } from '../appId.js';
@@ -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/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"}
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 {\n RESOURCE_BINDINGS_CHUNK_NAME,\n RESOURCE_BINDINGS_ENTRY_IMPORT,\n RESOURCE_BINDINGS_FILENAME,\n RESOURCE_BINDINGS_MODULE_SOURCE,\n RESOURCE_BINDINGS_TOKEN,\n resourceBindingsChunkFileName,\n resourceBindingsCodeSplittingGroup,\n} from '../actions/build/resource-bindings.js'\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":["RESOURCE_BINDINGS_CHUNK_NAME","RESOURCE_BINDINGS_ENTRY_IMPORT","RESOURCE_BINDINGS_FILENAME","RESOURCE_BINDINGS_MODULE_SOURCE","RESOURCE_BINDINGS_TOKEN","resourceBindingsChunkFileName","resourceBindingsCodeSplittingGroup","workbenchOptimizeDeps","workbenchVitePlugins","buildAppId","resolveWorkbenchApp","resolveWorkbenchConfig"],"mappings":"AAAA,iEAAiE;AACjE,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,sDAAsD;AAEtD,SACEA,4BAA4B,EAC5BC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,uBAAuB,EACvBC,6BAA6B,EAC7BC,kCAAkC,QAC7B,wCAAuC;AAC9C,SAAQC,qBAAqB,QAAO,yCAAwC;AAC5E,SAAQC,oBAAoB,QAAO,kDAAiD;AACpF,SAAQC,UAAU,QAAO,cAAa;AACtC,SAAQC,mBAAmB,QAA8B,4BAA2B;AACpF,SAAyCC,sBAAsB,QAAO,+BAA8B"}
@@ -39,18 +39,18 @@ type TileSize = z.infer<typeof TileSizeSchema>;
39
39
  /** @public */
40
40
  type ServiceType = 'worker';
41
41
  declare const DockGroupSchema: z.ZodMiniEnum<{
42
- "dock.system": "dock.system";
43
- "dock.applications": "dock.applications";
44
- "dock.user": "dock.user";
42
+ system: "system";
43
+ applications: "applications";
44
+ user: "user";
45
45
  }>;
46
46
  /** @public */
47
47
  type DockGroup = z.output<typeof DockGroupSchema>;
48
48
  declare const PanelViewSchema: z.ZodMiniObject<{
49
49
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
50
50
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
51
- "dock.system": "dock.system";
52
- "dock.applications": "dock.applications";
53
- "dock.user": "dock.user";
51
+ system: "system";
52
+ applications: "applications";
53
+ user: "user";
54
54
  }>>;
55
55
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
56
56
  }, z.core.$strip>>;
@@ -68,9 +68,9 @@ declare function definePanelView(view: DefinePanelViewInput): PanelView;
68
68
  declare const WindowViewSchema: z.ZodMiniObject<{
69
69
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
70
70
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
71
- "dock.system": "dock.system";
72
- "dock.applications": "dock.applications";
73
- "dock.user": "dock.user";
71
+ system: "system";
72
+ applications: "applications";
73
+ user: "user";
74
74
  }>>;
75
75
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
76
76
  }, z.core.$strip>>;
@@ -119,9 +119,9 @@ declare function defineTileView(view: DefineTileViewInput): TileView;
119
119
  declare const InterfaceDeclarationSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
120
120
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
121
121
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
122
- "dock.system": "dock.system";
123
- "dock.applications": "dock.applications";
124
- "dock.user": "dock.user";
122
+ system: "system";
123
+ applications: "applications";
124
+ user: "user";
125
125
  }>>;
126
126
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
127
127
  }, z.core.$strip>>;
@@ -132,9 +132,9 @@ declare const InterfaceDeclarationSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMini
132
132
  }, z.core.$strip>, z.ZodMiniObject<{
133
133
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
134
134
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
135
- "dock.system": "dock.system";
136
- "dock.applications": "dock.applications";
137
- "dock.user": "dock.user";
135
+ system: "system";
136
+ applications: "applications";
137
+ user: "user";
138
138
  }>>;
139
139
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
140
140
  }, z.core.$strip>>;
@@ -206,9 +206,9 @@ declare const DefineAppInputSchema: z.ZodMiniObject<{
206
206
  }>>;
207
207
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
208
208
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
209
- "dock.system": "dock.system";
210
- "dock.applications": "dock.applications";
211
- "dock.user": "dock.user";
209
+ system: "system";
210
+ applications: "applications";
211
+ user: "user";
212
212
  }>>;
213
213
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
214
214
  }, z.core.$strip>>;
@@ -222,9 +222,9 @@ declare const DefineAppInputSchema: z.ZodMiniObject<{
222
222
  views: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
223
223
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
224
224
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
225
- "dock.system": "dock.system";
226
- "dock.applications": "dock.applications";
227
- "dock.user": "dock.user";
225
+ system: "system";
226
+ applications: "applications";
227
+ user: "user";
228
228
  }>>;
229
229
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
230
230
  }, z.core.$strip>>;
@@ -235,9 +235,9 @@ declare const DefineAppInputSchema: z.ZodMiniObject<{
235
235
  }, z.core.$strip>, z.ZodMiniObject<{
236
236
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
237
237
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
238
- "dock.system": "dock.system";
239
- "dock.applications": "dock.applications";
240
- "dock.user": "dock.user";
238
+ system: "system";
239
+ applications: "applications";
240
+ user: "user";
241
241
  }>>;
242
242
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
243
243
  }, z.core.$strip>>;
@@ -373,4 +373,4 @@ declare function isWorkbenchConfig(app: unknown): app is WorkbenchConfig;
373
373
  */
374
374
  declare function unstable_defineMediaLibrary(input: DefineMediaLibraryInput): WorkbenchConfig;
375
375
  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 };
376
- //# sourceMappingURL=defineApp-BRFgHrPc.d.ts.map
376
+ //# sourceMappingURL=defineApp-KCHd3Vab.d.ts.map
@@ -1,6 +1,6 @@
1
- import "./defineApp-BRFgHrPc.js";
2
- import { n as resolveWorkbenchConfig, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-CDUdRIjD.js";
3
- import { a as DeployableWorkbenchApp, i as summarizeInterfaces, n as DeployedView, o as getWorkbench, r as DeployedWebWorker, t as DeployedInterface } from "./summarizeInterfaces-BQ1v1O89.js";
1
+ import "./defineApp-KCHd3Vab.js";
2
+ import { n as resolveWorkbenchConfig, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-1CV651GT.js";
3
+ import { a as DeployableWorkbenchApp, i as summarizeInterfaces, n as DeployedView, o as getWorkbench, r as DeployedWebWorker, t as DeployedInterface } from "./summarizeInterfaces-DoG6OunM.js";
4
4
  import { AppVisibility, CliConfig, Output } from "@sanity/cli-core";
5
5
  import "node:zlib";
6
6
  /**
@@ -138,9 +138,9 @@ declare function createStudio(options: {
138
138
  }): Promise<CreatedApplication>;
139
139
  /**
140
140
  * Ship a deployment to an already-created (or `deployment.appId`) application,
141
- * then sync its mutable metadata (`title`, and `icon`/`visibility` when set)
142
- * from config. The deploy endpoint ignores these, so a redeploy patches them
143
- * here alongside the new deployment.
141
+ * then sync its mutable metadata (`title`, and `icon`/`slug`/`visibility` when
142
+ * set) from config. The deploy endpoint ignores these, so a redeploy patches
143
+ * them here alongside the new deployment.
144
144
  *
145
145
  * `onDeployed` fires the instant the deployment is live, before the metadata
146
146
  * sync — so a caller can disarm a create-time rollback that must not delete an
@@ -156,6 +156,11 @@ declare function deployWorkbenchApp(options: {
156
156
  isAutoUpdating: boolean;
157
157
  label?: string;
158
158
  onDeployed?: () => void;
159
+ /**
160
+ * The address from config. Only `createApplication` used to send it, so an
161
+ * app with a `deployment.appId` kept whatever slug it was created at.
162
+ */
163
+ slug?: string;
159
164
  sourceDir: string;
160
165
  title: string;
161
166
  version: string;
@@ -1,4 +1,4 @@
1
- import { t as DevServerManifest } from "./registry-CexFxsKR.js";
1
+ import { t as DevServerManifest } from "./registry-BCLMbrla.js";
2
2
  import { CliConfig, Output } from "@sanity/cli-core";
3
3
  import { ViteDevServer } from "vite";
4
4
  /**
@@ -1,4 +1,4 @@
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-BRFgHrPc.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-KCHd3Vab.js";
2
2
  import { AssetSourceComponentProps } from "@sanity/types";
3
3
  /**
4
4
  * The service's own declaration, surfaced to the callback.
@@ -1,10 +1,10 @@
1
1
  /** App scaffold — `entry` auto-declares the navigable app view. */
2
- declare const workbenchAppConfigTemplate = "\nimport {defineCliConfig, unstable_defineApp} from 'sanity/cli'\n\nexport default defineCliConfig({\n app: unstable_defineApp({\n title: '%title%',\n slug: '%slug%',\n organizationId: '%organizationId%',\n entry: '%entry%',\n }),\n})\n";
2
+ declare const workbenchAppConfigTemplate = "\nimport {defineApplication, defineCliConfig} from 'sanity/cli'\n\nexport default defineCliConfig({\n app: defineApplication({\n title: '%title%',\n slug: '%slug%',\n organizationId: '%organizationId%',\n entry: '%entry%',\n }),\n})\n";
3
3
  /**
4
4
  * Studio scaffold — brands with slug/title only, no `entry` (studio app views
5
5
  * aren't implemented yet).
6
6
  */
7
- declare const workbenchStudioConfigTemplate = "\nimport {defineCliConfig, unstable_defineApp} from 'sanity/cli'\n\nexport default defineCliConfig({\n api: {\n projectId: '%projectId%',\n dataset: '%dataset%'\n },\n app: unstable_defineApp({\n title: '%title%',\n slug: '%slug%',\n organizationId: '%organizationId%',\n }),\n deployment: {\n /**\n * Enable auto-updates for studios.\n * Learn more at https://www.sanity.io/docs/studio/latest-version-of-sanity#k47faf43faf56\n */\n autoUpdates: __BOOL__autoUpdates__,\n },\n})\n";
7
+ declare const workbenchStudioConfigTemplate = "\nimport {defineApplication, defineCliConfig} from 'sanity/cli'\n\nexport default defineCliConfig({\n api: {\n projectId: '%projectId%',\n dataset: '%dataset%'\n },\n app: defineApplication({\n title: '%title%',\n slug: '%slug%',\n organizationId: '%organizationId%',\n }),\n deployment: {\n /**\n * Enable auto-updates for studios.\n * Learn more at https://www.sanity.io/docs/studio/latest-version-of-sanity#k47faf43faf56\n */\n autoUpdates: __BOOL__autoUpdates__,\n },\n})\n";
8
8
  declare function toAppSlug(value: string): string | null;
9
9
  export { toAppSlug, workbenchAppConfigTemplate, workbenchStudioConfigTemplate };
10
10
  //# sourceMappingURL=init.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as DevServerManifest } from "./registry-CexFxsKR.js";
1
+ import { t as DevServerManifest } from "./registry-BCLMbrla.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. */
@@ -18,9 +18,9 @@ declare const devServerManifestSchema: z.ZodMiniObject<{
18
18
  metadata: z.ZodMiniNullable<z.ZodMiniObject<{
19
19
  dock: z.ZodMiniObject<{
20
20
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
21
- "dock.system": "dock.system";
22
- "dock.applications": "dock.applications";
23
- "dock.user": "dock.user";
21
+ system: "system";
22
+ applications: "applications";
23
+ user: "user";
24
24
  }>>;
25
25
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
26
26
  }, z.core.$strip>;
@@ -36,9 +36,9 @@ declare const devServerManifestSchema: z.ZodMiniObject<{
36
36
  metadata: z.ZodMiniNullable<z.ZodMiniObject<{
37
37
  dock: z.ZodMiniObject<{
38
38
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
39
- "dock.system": "dock.system";
40
- "dock.applications": "dock.applications";
41
- "dock.user": "dock.user";
39
+ system: "system";
40
+ applications: "applications";
41
+ user: "user";
42
42
  }>>;
43
43
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
44
44
  }, z.core.$strip>;
@@ -88,9 +88,9 @@ declare const devServerManifestSchema: z.ZodMiniObject<{
88
88
  manifest: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>, z.ZodMiniObject<{
89
89
  dock: z.ZodMiniOptional<z.ZodMiniObject<{
90
90
  group: z.ZodMiniOptional<z.ZodMiniEnum<{
91
- "dock.system": "dock.system";
92
- "dock.applications": "dock.applications";
93
- "dock.user": "dock.user";
91
+ system: "system";
92
+ applications: "applications";
93
+ user: "user";
94
94
  }>>;
95
95
  order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
96
96
  }, z.core.$strip>>;
@@ -122,4 +122,4 @@ declare const devServerManifestSchema: z.ZodMiniObject<{
122
122
  */
123
123
  type DevServerManifest = z.infer<typeof devServerManifestSchema>;
124
124
  export { DevServerManifest as t };
125
- //# sourceMappingURL=registry-CexFxsKR.d.ts.map
125
+ //# sourceMappingURL=registry-BCLMbrla.d.ts.map
@@ -1,4 +1,4 @@
1
- import { A as WorkbenchConfigValue, t as DefineAppInput } from "./defineApp-BRFgHrPc.js";
1
+ import { A as WorkbenchConfigValue, t as DefineAppInput } from "./defineApp-KCHd3Vab.js";
2
2
  import { AppVisibility, CliConfig } from "@sanity/cli-core";
3
3
  /**
4
4
  * Bundled so adding a declaration family touches this type and the artifact
@@ -59,4 +59,4 @@ interface ResolvedMediaLibraryConfig {
59
59
  */
60
60
  declare function resolveWorkbenchConfig(cliConfig: CliConfig | null | undefined): ResolvedMediaLibraryConfig | null;
61
61
  export { resolveWorkbenchApp as a, WorkbenchExposes as i, resolveWorkbenchConfig as n, ResolvedWorkbenchApp as r, ResolvedMediaLibraryConfig as t };
62
- //# sourceMappingURL=resolveWorkbenchConfig-CDUdRIjD.d.ts.map
62
+ //# sourceMappingURL=resolveWorkbenchConfig-1CV651GT.d.ts.map
@@ -1,5 +1,5 @@
1
- import { D as ViewSurface, b as ServiceType } from "./defineApp-BRFgHrPc.js";
2
- import { i as WorkbenchExposes, r as ResolvedWorkbenchApp } from "./resolveWorkbenchConfig-CDUdRIjD.js";
1
+ import { D as ViewSurface, b as ServiceType } from "./defineApp-KCHd3Vab.js";
2
+ import { i as WorkbenchExposes, r as ResolvedWorkbenchApp } from "./resolveWorkbenchConfig-1CV651GT.js";
3
3
  import { CliConfig } from "@sanity/cli-core";
4
4
  import { z } from "zod/mini";
5
5
  /**
@@ -62,4 +62,4 @@ declare function summarizeInterfaces({ views, webWorkers }: WorkbenchExposes): {
62
62
  views: DeployedView[];
63
63
  };
64
64
  export { DeployableWorkbenchApp as a, summarizeInterfaces as i, DeployedView as n, getWorkbench as o, DeployedWebWorker as r, DeployedInterface as t };
65
- //# sourceMappingURL=summarizeInterfaces-BQ1v1O89.d.ts.map
65
+ //# sourceMappingURL=summarizeInterfaces-DoG6OunM.d.ts.map
@@ -1,5 +1,5 @@
1
- import { t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-CDUdRIjD.js";
2
- import { a as DeployableWorkbenchApp, n as DeployedView, r as DeployedWebWorker } from "./summarizeInterfaces-BQ1v1O89.js";
1
+ import { t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-1CV651GT.js";
2
+ import { a as DeployableWorkbenchApp, n as DeployedView, r as DeployedWebWorker } from "./summarizeInterfaces-DoG6OunM.js";
3
3
  import "node:zlib";
4
4
  import { UndeployAdapter, UndeployApplicationTarget, UndeployConfigTarget } from "@sanity/cli-core/undeploy";
5
5
  interface ConfigSnapshot {
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Resource bindings ride in a dedicated module in the app's bundle rather than an
3
+ * index.html script tag, so both standalone studios and federated apps resolve
4
+ * them the same way (a federated host pulls modules, not HTML).
5
+ *
6
+ * The module is emitted at a stable, unhashed path (`sanity-resource-bindings.js`)
7
+ * at the bundle root and is statically imported first, so it is evaluated before
8
+ * any app code. At deploy time Brett replaces the `__SANITY_RESOURCE_BINDINGS__`
9
+ * token with the resolved bindings JSON. The token is invalid JSON on purpose: a
10
+ * minifier can't constant-fold `JSON.parse` of it, so the call — and the token —
11
+ * survive minification for Brett to rewrite.
12
+ *
13
+ * These constants are the single source of truth shared by the standalone studio
14
+ * build (`@sanity/cli-build`) and the federated app build here. They must stay in
15
+ * lockstep with Brett's replacement (see SDK-2413).
16
+ */ /** Rolldown chunk name used to force the bindings module into its own chunk. */ export const RESOURCE_BINDINGS_CHUNK_NAME = 'sanity-resource-bindings';
17
+ /** Stable, unhashed file name Brett looks for at the bundle root. */ export const RESOURCE_BINDINGS_FILENAME = `${RESOURCE_BINDINGS_CHUNK_NAME}.js`;
18
+ /** Token Brett replaces with the resolved bindings JSON at deploy. */ export const RESOURCE_BINDINGS_TOKEN = '__SANITY_RESOURCE_BINDINGS__';
19
+ /**
20
+ * Contents of the generated bindings module. The `JSON.parse` result is assigned
21
+ * to a global so the module has an observable side effect and isn't tree-shaken
22
+ * when nothing imports its export yet (the reader lands in SDK-2295). The
23
+ * try/catch keeps a local, un-deployed build (e.g. `sanity preview`) working: an
24
+ * unreplaced token throws, and we fall back to an empty array.
25
+ */ export const RESOURCE_BINDINGS_MODULE_SOURCE = `// This file is auto-generated on 'sanity build' / 'sanity dev'
26
+ // Modifications to this file are automatically discarded
27
+ let resourceBindings = []
28
+ try {
29
+ resourceBindings = JSON.parse('${RESOURCE_BINDINGS_TOKEN}')
30
+ } catch {
31
+ // Built but not deployed through Brett (e.g. local preview): keep the default.
32
+ }
33
+ globalThis.${RESOURCE_BINDINGS_TOKEN} = resourceBindings
34
+ export {resourceBindings}
35
+ `;
36
+ /** Side-effect import placed first in each entry so the module evaluates before app code. */ export const RESOURCE_BINDINGS_ENTRY_IMPORT = `import './${RESOURCE_BINDINGS_FILENAME}'`;
37
+ /**
38
+ * Rolldown `codeSplitting` group that isolates the bindings module into its own
39
+ * chunk. `minSize`/`minModuleSize` of 0 are scoped to this group (not the
40
+ * enclosing `codeSplitting` object) so they only affect the bindings module and
41
+ * never the automatic chunking of everything else. They stop Rolldown folding
42
+ * the tiny module back into its importer.
43
+ */ export const resourceBindingsCodeSplittingGroup = {
44
+ minModuleSize: 0,
45
+ minSize: 0,
46
+ name: RESOURCE_BINDINGS_CHUNK_NAME,
47
+ test: new RegExp(RESOURCE_BINDINGS_CHUNK_NAME)
48
+ };
49
+ /**
50
+ * `chunkFileNames` value for the bindings chunk (unhashed, at the bundle root),
51
+ * or `undefined` for any other chunk so the caller can apply its own default.
52
+ */ export function resourceBindingsChunkFileName(chunkName) {
53
+ return chunkName === RESOURCE_BINDINGS_CHUNK_NAME ? RESOURCE_BINDINGS_FILENAME : undefined;
54
+ }
55
+
56
+ //# sourceMappingURL=resource-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/actions/build/resource-bindings.ts"],"sourcesContent":["/**\n * Resource bindings ride in a dedicated module in the app's bundle rather than an\n * index.html script tag, so both standalone studios and federated apps resolve\n * them the same way (a federated host pulls modules, not HTML).\n *\n * The module is emitted at a stable, unhashed path (`sanity-resource-bindings.js`)\n * at the bundle root and is statically imported first, so it is evaluated before\n * any app code. At deploy time Brett replaces the `__SANITY_RESOURCE_BINDINGS__`\n * token with the resolved bindings JSON. The token is invalid JSON on purpose: a\n * minifier can't constant-fold `JSON.parse` of it, so the call — and the token —\n * survive minification for Brett to rewrite.\n *\n * These constants are the single source of truth shared by the standalone studio\n * build (`@sanity/cli-build`) and the federated app build here. They must stay in\n * lockstep with Brett's replacement (see SDK-2413).\n */\n\n/** Rolldown chunk name used to force the bindings module into its own chunk. */\nexport const RESOURCE_BINDINGS_CHUNK_NAME = 'sanity-resource-bindings'\n\n/** Stable, unhashed file name Brett looks for at the bundle root. */\nexport const RESOURCE_BINDINGS_FILENAME = `${RESOURCE_BINDINGS_CHUNK_NAME}.js`\n\n/** Token Brett replaces with the resolved bindings JSON at deploy. */\nexport const RESOURCE_BINDINGS_TOKEN = '__SANITY_RESOURCE_BINDINGS__'\n\n/**\n * Contents of the generated bindings module. The `JSON.parse` result is assigned\n * to a global so the module has an observable side effect and isn't tree-shaken\n * when nothing imports its export yet (the reader lands in SDK-2295). The\n * try/catch keeps a local, un-deployed build (e.g. `sanity preview`) working: an\n * unreplaced token throws, and we fall back to an empty array.\n */\nexport const RESOURCE_BINDINGS_MODULE_SOURCE = `// This file is auto-generated on 'sanity build' / 'sanity dev'\n// Modifications to this file are automatically discarded\nlet resourceBindings = []\ntry {\n resourceBindings = JSON.parse('${RESOURCE_BINDINGS_TOKEN}')\n} catch {\n // Built but not deployed through Brett (e.g. local preview): keep the default.\n}\nglobalThis.${RESOURCE_BINDINGS_TOKEN} = resourceBindings\nexport {resourceBindings}\n`\n\n/** Side-effect import placed first in each entry so the module evaluates before app code. */\nexport const RESOURCE_BINDINGS_ENTRY_IMPORT = `import './${RESOURCE_BINDINGS_FILENAME}'`\n\n/**\n * Rolldown `codeSplitting` group that isolates the bindings module into its own\n * chunk. `minSize`/`minModuleSize` of 0 are scoped to this group (not the\n * enclosing `codeSplitting` object) so they only affect the bindings module and\n * never the automatic chunking of everything else. They stop Rolldown folding\n * the tiny module back into its importer.\n */\nexport const resourceBindingsCodeSplittingGroup = {\n minModuleSize: 0,\n minSize: 0,\n name: RESOURCE_BINDINGS_CHUNK_NAME,\n test: new RegExp(RESOURCE_BINDINGS_CHUNK_NAME),\n}\n\n/**\n * `chunkFileNames` value for the bindings chunk (unhashed, at the bundle root),\n * or `undefined` for any other chunk so the caller can apply its own default.\n */\nexport function resourceBindingsChunkFileName(chunkName: string): string | undefined {\n return chunkName === RESOURCE_BINDINGS_CHUNK_NAME ? RESOURCE_BINDINGS_FILENAME : undefined\n}\n"],"names":["RESOURCE_BINDINGS_CHUNK_NAME","RESOURCE_BINDINGS_FILENAME","RESOURCE_BINDINGS_TOKEN","RESOURCE_BINDINGS_MODULE_SOURCE","RESOURCE_BINDINGS_ENTRY_IMPORT","resourceBindingsCodeSplittingGroup","minModuleSize","minSize","name","test","RegExp","resourceBindingsChunkFileName","chunkName","undefined"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,8EAA8E,GAC9E,OAAO,MAAMA,+BAA+B,2BAA0B;AAEtE,mEAAmE,GACnE,OAAO,MAAMC,6BAA6B,GAAGD,6BAA6B,GAAG,CAAC,CAAA;AAE9E,oEAAoE,GACpE,OAAO,MAAME,0BAA0B,+BAA8B;AAErE;;;;;;CAMC,GACD,OAAO,MAAMC,kCAAkC,CAAC;;;;iCAIf,EAAED,wBAAwB;;;;WAIhD,EAAEA,wBAAwB;;AAErC,CAAC,CAAA;AAED,2FAA2F,GAC3F,OAAO,MAAME,iCAAiC,CAAC,UAAU,EAAEH,2BAA2B,CAAC,CAAC,CAAA;AAExF;;;;;;CAMC,GACD,OAAO,MAAMI,qCAAqC;IAChDC,eAAe;IACfC,SAAS;IACTC,MAAMR;IACNS,MAAM,IAAIC,OAAOV;AACnB,EAAC;AAED;;;CAGC,GACD,OAAO,SAASW,8BAA8BC,SAAiB;IAC7D,OAAOA,cAAcZ,+BAA+BC,6BAA6BY;AACnF"}
@@ -8,7 +8,7 @@ import { sanityFederationRuntime } from './plugins/plugin-sanity-federation-runt
8
8
  /**
9
9
  * @internal
10
10
  */ export const federation = (options)=>{
11
- const { exposes, name: defaultName, pkgJson, workDir = process.cwd() } = options;
11
+ const { exposes, isBlueprints, name: defaultName, pkgJson, workDir = process.cwd() } = options;
12
12
  let name = defaultName;
13
13
  if (!name) {
14
14
  name = pkgJson?.name;
@@ -43,9 +43,11 @@ import { sanityFederationRuntime } from './plugins/plugin-sanity-federation-runt
43
43
  };
44
44
  const runtimeOptions = options.isApp ? {
45
45
  appEntry: options.appEntry,
46
- isApp: true
46
+ isApp: true,
47
+ isBlueprints
47
48
  } : {
48
49
  isApp: false,
50
+ isBlueprints,
49
51
  studioConfigPath: options.studioConfigPath
50
52
  };
51
53
  // Every federated app and studio also serves itself standalone. Whenever there's
@@ -55,7 +57,8 @@ import { sanityFederationRuntime } from './plugins/plugin-sanity-federation-runt
55
57
  return [
56
58
  sanityEnvironmentPlugin({
57
59
  clientInput,
58
- input: entryPath
60
+ input: entryPath,
61
+ isBlueprints
59
62
  }),
60
63
  sanityFederationRuntime(runtimeOptions),
61
64
  sanityExtensionArtifacts({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/actions/build/vite/plugin.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {type ModuleFederationOptions} from '@module-federation/vite'\nimport {type PackageJson} from '@sanity/cli-core'\nimport {type PluginOption} from 'vite'\n\nimport {type WorkbenchExposes} from '../../../resolveWorkbenchApp.js'\nimport {artifactExposes, workbenchArtifacts} from '../artifact.js'\nimport {FEDERATION_FILE_NAME, RUNTIME_DIR} from './constants.js'\nimport {type FederationOptions, sanityModuleFederation} from './plugins/plugin-module-federation.js'\nimport {sanityEnvironmentPlugin} from './plugins/plugin-sanity-environment.js'\nimport {sanityExtensionArtifacts} from './plugins/plugin-sanity-extension-artifacts.js'\nimport {\n type FederationRuntimeOptions,\n sanityFederationRuntime,\n} from './plugins/plugin-sanity-federation-runtime.js'\n\ninterface FederationPluginOptionsBase extends Omit<Partial<FederationOptions>, 'exposes'> {\n exposes?: WorkbenchExposes\n pkgJson?: PackageJson\n /**\n * Current working directory to read package.json from, defaults to process.cwd()\n */\n workDir?: string\n}\n\ninterface AppFederationPluginOptions extends FederationPluginOptionsBase {\n isApp: true\n\n /**\n * Relative path to the App entry from the runtime directory, e.g.\n * `../../src/App.tsx`. Omit it for a dock-only app that declares no `entry`:\n * no `./App` is exposed and the remote serves only its views.\n */\n appEntry?: string\n studioConfigPath?: never\n}\n\ninterface StudioFederationPluginOptions extends FederationPluginOptionsBase {\n /** relative path to the Studio config file from the runtime directory (e.g. `../../sanity.config.ts`). */\n studioConfigPath: string\n\n appEntry?: never\n /** @defaultValue false */\n isApp?: false\n}\n\n/**\n * Plugin options for the federation vite plugin.\n *\n * Discriminated on `isApp`:\n * - `isApp: true` → requires `appEntry`\n * - `isApp: false` (default) → requires `studioConfigPath`\n *\n * @internal\n */\ntype FederationPluginOptions = AppFederationPluginOptions | StudioFederationPluginOptions\n\n/**\n * @internal\n */\nexport const federation = (options: FederationPluginOptions): PluginOption => {\n const {exposes, name: defaultName, pkgJson, workDir = process.cwd()} = options\n\n let name = defaultName\n\n if (!name) {\n name = pkgJson?.name\n }\n\n if (!name) {\n throw new Error('\"name\" option is required but could not be inferred from package.json')\n }\n\n const generatedEntry = `./${RUNTIME_DIR}/${FEDERATION_FILE_NAME}.jsx`\n\n function resolveEntryPath(entry: string) {\n const resolvedPath = path.resolve(workDir, entry)\n\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve path for entry \"${entry}\". Please check that the file exists and the path is correct.`,\n )\n }\n\n return resolvedPath\n }\n\n const entryPath = resolveEntryPath(generatedEntry)\n\n // Each view component (`./views/<view>/<component>`) and each service loader\n // (`./services/<name>`) is exposed straight to the host, pointing at the file\n // the extension-artifacts plugin generates under RUNTIME_DIR. A service's\n // worker bundle carries no expose — the host reaches it through its loader.\n const artifacts = workbenchArtifacts(exposes ?? {})\n const artifactModuleExposes = artifactExposes(artifacts, (artifactPath) =>\n resolveEntryPath(`./${RUNTIME_DIR}/${artifactPath}`),\n )\n\n // A dock-only app (`isApp` with no `appEntry`) has no navigable full-page\n // view, so it exposes no `./App` — only its views. Studios and apps with an\n // entry expose `./App` (the generated render entry).\n const exposesApp = !options.isApp || options.appEntry !== undefined\n\n const federationExposes: NonNullable<ModuleFederationOptions['exposes']> = {\n ...(exposesApp ? {'./App': entryPath} : {}),\n ...artifactModuleExposes,\n }\n\n const runtimeOptions: FederationRuntimeOptions = options.isApp\n ? {appEntry: options.appEntry, isApp: true}\n : {isApp: false, studioConfigPath: options.studioConfigPath}\n\n // Every federated app and studio also serves itself standalone. Whenever there's\n // an `./App` to mount (never for a dock-only app), build the SPA client\n // environment from the runtime bootstrap cli-build writes.\n const clientInput = exposesApp ? path.join(workDir, '.sanity', 'runtime', 'app.js') : undefined\n\n return [\n sanityEnvironmentPlugin({clientInput, input: entryPath}),\n sanityFederationRuntime(runtimeOptions),\n sanityExtensionArtifacts({artifacts}),\n sanityModuleFederation({exposes: federationExposes, name}),\n ]\n}\n"],"names":["path","artifactExposes","workbenchArtifacts","FEDERATION_FILE_NAME","RUNTIME_DIR","sanityModuleFederation","sanityEnvironmentPlugin","sanityExtensionArtifacts","sanityFederationRuntime","federation","options","exposes","name","defaultName","pkgJson","workDir","process","cwd","Error","generatedEntry","resolveEntryPath","entry","resolvedPath","resolve","entryPath","artifacts","artifactModuleExposes","artifactPath","exposesApp","isApp","appEntry","undefined","federationExposes","runtimeOptions","studioConfigPath","clientInput","join","input"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAO5B,SAAQC,eAAe,EAAEC,kBAAkB,QAAO,iBAAgB;AAClE,SAAQC,oBAAoB,EAAEC,WAAW,QAAO,iBAAgB;AAChE,SAAgCC,sBAAsB,QAAO,wCAAuC;AACpG,SAAQC,uBAAuB,QAAO,yCAAwC;AAC9E,SAAQC,wBAAwB,QAAO,iDAAgD;AACvF,SAEEC,uBAAuB,QAClB,gDAA+C;AA2CtD;;CAEC,GACD,OAAO,MAAMC,aAAa,CAACC;IACzB,MAAM,EAACC,OAAO,EAAEC,MAAMC,WAAW,EAAEC,OAAO,EAAEC,UAAUC,QAAQC,GAAG,EAAE,EAAC,GAAGP;IAEvE,IAAIE,OAAOC;IAEX,IAAI,CAACD,MAAM;QACTA,OAAOE,SAASF;IAClB;IAEA,IAAI,CAACA,MAAM;QACT,MAAM,IAAIM,MAAM;IAClB;IAEA,MAAMC,iBAAiB,CAAC,EAAE,EAAEf,YAAY,CAAC,EAAED,qBAAqB,IAAI,CAAC;IAErE,SAASiB,iBAAiBC,KAAa;QACrC,MAAMC,eAAetB,KAAKuB,OAAO,CAACR,SAASM;QAE3C,IAAI,CAACC,cAAc;YACjB,MAAM,IAAIJ,MACR,CAAC,kCAAkC,EAAEG,MAAM,6DAA6D,CAAC;QAE7G;QAEA,OAAOC;IACT;IAEA,MAAME,YAAYJ,iBAAiBD;IAEnC,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,4EAA4E;IAC5E,MAAMM,YAAYvB,mBAAmBS,WAAW,CAAC;IACjD,MAAMe,wBAAwBzB,gBAAgBwB,WAAW,CAACE,eACxDP,iBAAiB,CAAC,EAAE,EAAEhB,YAAY,CAAC,EAAEuB,cAAc;IAGrD,0EAA0E;IAC1E,4EAA4E;IAC5E,qDAAqD;IACrD,MAAMC,aAAa,CAAClB,QAAQmB,KAAK,IAAInB,QAAQoB,QAAQ,KAAKC;IAE1D,MAAMC,oBAAqE;QACzE,GAAIJ,aAAa;YAAC,SAASJ;QAAS,IAAI,CAAC,CAAC;QAC1C,GAAGE,qBAAqB;IAC1B;IAEA,MAAMO,iBAA2CvB,QAAQmB,KAAK,GAC1D;QAACC,UAAUpB,QAAQoB,QAAQ;QAAED,OAAO;IAAI,IACxC;QAACA,OAAO;QAAOK,kBAAkBxB,QAAQwB,gBAAgB;IAAA;IAE7D,iFAAiF;IACjF,wEAAwE;IACxE,2DAA2D;IAC3D,MAAMC,cAAcP,aAAa5B,KAAKoC,IAAI,CAACrB,SAAS,WAAW,WAAW,YAAYgB;IAEtF,OAAO;QACLzB,wBAAwB;YAAC6B;YAAaE,OAAOb;QAAS;QACtDhB,wBAAwByB;QACxB1B,yBAAyB;YAACkB;QAAS;QACnCpB,uBAAuB;YAACM,SAASqB;YAAmBpB;QAAI;KACzD;AACH,EAAC"}
1
+ {"version":3,"sources":["../../../../src/actions/build/vite/plugin.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {type ModuleFederationOptions} from '@module-federation/vite'\nimport {type PackageJson} from '@sanity/cli-core'\nimport {type PluginOption} from 'vite'\n\nimport {type WorkbenchExposes} from '../../../resolveWorkbenchApp.js'\nimport {artifactExposes, workbenchArtifacts} from '../artifact.js'\nimport {FEDERATION_FILE_NAME, RUNTIME_DIR} from './constants.js'\nimport {type FederationOptions, sanityModuleFederation} from './plugins/plugin-module-federation.js'\nimport {sanityEnvironmentPlugin} from './plugins/plugin-sanity-environment.js'\nimport {sanityExtensionArtifacts} from './plugins/plugin-sanity-extension-artifacts.js'\nimport {\n type FederationRuntimeOptions,\n sanityFederationRuntime,\n} from './plugins/plugin-sanity-federation-runtime.js'\n\ninterface FederationPluginOptionsBase extends Omit<Partial<FederationOptions>, 'exposes'> {\n exposes?: WorkbenchExposes\n /** Blueprints build (via `@sanity/runtime-cli`) — emit the resource-bindings module. */\n isBlueprints?: boolean\n pkgJson?: PackageJson\n /**\n * Current working directory to read package.json from, defaults to process.cwd()\n */\n workDir?: string\n}\n\ninterface AppFederationPluginOptions extends FederationPluginOptionsBase {\n isApp: true\n\n /**\n * Relative path to the App entry from the runtime directory, e.g.\n * `../../src/App.tsx`. Omit it for a dock-only app that declares no `entry`:\n * no `./App` is exposed and the remote serves only its views.\n */\n appEntry?: string\n studioConfigPath?: never\n}\n\ninterface StudioFederationPluginOptions extends FederationPluginOptionsBase {\n /** relative path to the Studio config file from the runtime directory (e.g. `../../sanity.config.ts`). */\n studioConfigPath: string\n\n appEntry?: never\n /** @defaultValue false */\n isApp?: false\n}\n\n/**\n * Plugin options for the federation vite plugin.\n *\n * Discriminated on `isApp`:\n * - `isApp: true` → requires `appEntry`\n * - `isApp: false` (default) → requires `studioConfigPath`\n *\n * @internal\n */\ntype FederationPluginOptions = AppFederationPluginOptions | StudioFederationPluginOptions\n\n/**\n * @internal\n */\nexport const federation = (options: FederationPluginOptions): PluginOption => {\n const {exposes, isBlueprints, name: defaultName, pkgJson, workDir = process.cwd()} = options\n\n let name = defaultName\n\n if (!name) {\n name = pkgJson?.name\n }\n\n if (!name) {\n throw new Error('\"name\" option is required but could not be inferred from package.json')\n }\n\n const generatedEntry = `./${RUNTIME_DIR}/${FEDERATION_FILE_NAME}.jsx`\n\n function resolveEntryPath(entry: string) {\n const resolvedPath = path.resolve(workDir, entry)\n\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve path for entry \"${entry}\". Please check that the file exists and the path is correct.`,\n )\n }\n\n return resolvedPath\n }\n\n const entryPath = resolveEntryPath(generatedEntry)\n\n // Each view component (`./views/<view>/<component>`) and each service loader\n // (`./services/<name>`) is exposed straight to the host, pointing at the file\n // the extension-artifacts plugin generates under RUNTIME_DIR. A service's\n // worker bundle carries no expose — the host reaches it through its loader.\n const artifacts = workbenchArtifacts(exposes ?? {})\n const artifactModuleExposes = artifactExposes(artifacts, (artifactPath) =>\n resolveEntryPath(`./${RUNTIME_DIR}/${artifactPath}`),\n )\n\n // A dock-only app (`isApp` with no `appEntry`) has no navigable full-page\n // view, so it exposes no `./App` — only its views. Studios and apps with an\n // entry expose `./App` (the generated render entry).\n const exposesApp = !options.isApp || options.appEntry !== undefined\n\n const federationExposes: NonNullable<ModuleFederationOptions['exposes']> = {\n ...(exposesApp ? {'./App': entryPath} : {}),\n ...artifactModuleExposes,\n }\n\n const runtimeOptions: FederationRuntimeOptions = options.isApp\n ? {appEntry: options.appEntry, isApp: true, isBlueprints}\n : {isApp: false, isBlueprints, studioConfigPath: options.studioConfigPath}\n\n // Every federated app and studio also serves itself standalone. Whenever there's\n // an `./App` to mount (never for a dock-only app), build the SPA client\n // environment from the runtime bootstrap cli-build writes.\n const clientInput = exposesApp ? path.join(workDir, '.sanity', 'runtime', 'app.js') : undefined\n\n return [\n sanityEnvironmentPlugin({clientInput, input: entryPath, isBlueprints}),\n sanityFederationRuntime(runtimeOptions),\n sanityExtensionArtifacts({artifacts}),\n sanityModuleFederation({exposes: federationExposes, name}),\n ]\n}\n"],"names":["path","artifactExposes","workbenchArtifacts","FEDERATION_FILE_NAME","RUNTIME_DIR","sanityModuleFederation","sanityEnvironmentPlugin","sanityExtensionArtifacts","sanityFederationRuntime","federation","options","exposes","isBlueprints","name","defaultName","pkgJson","workDir","process","cwd","Error","generatedEntry","resolveEntryPath","entry","resolvedPath","resolve","entryPath","artifacts","artifactModuleExposes","artifactPath","exposesApp","isApp","appEntry","undefined","federationExposes","runtimeOptions","studioConfigPath","clientInput","join","input"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAO5B,SAAQC,eAAe,EAAEC,kBAAkB,QAAO,iBAAgB;AAClE,SAAQC,oBAAoB,EAAEC,WAAW,QAAO,iBAAgB;AAChE,SAAgCC,sBAAsB,QAAO,wCAAuC;AACpG,SAAQC,uBAAuB,QAAO,yCAAwC;AAC9E,SAAQC,wBAAwB,QAAO,iDAAgD;AACvF,SAEEC,uBAAuB,QAClB,gDAA+C;AA6CtD;;CAEC,GACD,OAAO,MAAMC,aAAa,CAACC;IACzB,MAAM,EAACC,OAAO,EAAEC,YAAY,EAAEC,MAAMC,WAAW,EAAEC,OAAO,EAAEC,UAAUC,QAAQC,GAAG,EAAE,EAAC,GAAGR;IAErF,IAAIG,OAAOC;IAEX,IAAI,CAACD,MAAM;QACTA,OAAOE,SAASF;IAClB;IAEA,IAAI,CAACA,MAAM;QACT,MAAM,IAAIM,MAAM;IAClB;IAEA,MAAMC,iBAAiB,CAAC,EAAE,EAAEhB,YAAY,CAAC,EAAED,qBAAqB,IAAI,CAAC;IAErE,SAASkB,iBAAiBC,KAAa;QACrC,MAAMC,eAAevB,KAAKwB,OAAO,CAACR,SAASM;QAE3C,IAAI,CAACC,cAAc;YACjB,MAAM,IAAIJ,MACR,CAAC,kCAAkC,EAAEG,MAAM,6DAA6D,CAAC;QAE7G;QAEA,OAAOC;IACT;IAEA,MAAME,YAAYJ,iBAAiBD;IAEnC,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,4EAA4E;IAC5E,MAAMM,YAAYxB,mBAAmBS,WAAW,CAAC;IACjD,MAAMgB,wBAAwB1B,gBAAgByB,WAAW,CAACE,eACxDP,iBAAiB,CAAC,EAAE,EAAEjB,YAAY,CAAC,EAAEwB,cAAc;IAGrD,0EAA0E;IAC1E,4EAA4E;IAC5E,qDAAqD;IACrD,MAAMC,aAAa,CAACnB,QAAQoB,KAAK,IAAIpB,QAAQqB,QAAQ,KAAKC;IAE1D,MAAMC,oBAAqE;QACzE,GAAIJ,aAAa;YAAC,SAASJ;QAAS,IAAI,CAAC,CAAC;QAC1C,GAAGE,qBAAqB;IAC1B;IAEA,MAAMO,iBAA2CxB,QAAQoB,KAAK,GAC1D;QAACC,UAAUrB,QAAQqB,QAAQ;QAAED,OAAO;QAAMlB;IAAY,IACtD;QAACkB,OAAO;QAAOlB;QAAcuB,kBAAkBzB,QAAQyB,gBAAgB;IAAA;IAE3E,iFAAiF;IACjF,wEAAwE;IACxE,2DAA2D;IAC3D,MAAMC,cAAcP,aAAa7B,KAAKqC,IAAI,CAACrB,SAAS,WAAW,WAAW,YAAYgB;IAEtF,OAAO;QACL1B,wBAAwB;YAAC8B;YAAaE,OAAOb;YAAWb;QAAY;QACpEJ,wBAAwB0B;QACxB3B,yBAAyB;YAACmB;QAAS;QACnCrB,uBAAuB;YAACM,SAASsB;YAAmBpB;QAAI;KACzD;AACH,EAAC"}
@@ -1,6 +1,23 @@
1
+ import { resourceBindingsChunkFileName, resourceBindingsCodeSplittingGroup } from '../../resource-bindings.js';
1
2
  import { FEDERATION_DIR_NAME } from '../constants.js';
3
+ // Keep the resource-bindings module in its own unhashed chunk at the bundle root
4
+ // so Brett can rewrite it at deploy. `@module-federation/vite` preserves user
5
+ // `codeSplitting` groups (clamped below its own), so this survives the federation
6
+ // build. The chunk sizing lives on the group itself (see
7
+ // `resourceBindingsCodeSplittingGroup`), so it only affects the bindings module.
8
+ const resourceBindingsOutput = {
9
+ chunkFileNames: (chunk)=>resourceBindingsChunkFileName(chunk.name) ?? 'static/[name]-[hash].js',
10
+ codeSplitting: {
11
+ groups: [
12
+ resourceBindingsCodeSplittingGroup
13
+ ]
14
+ }
15
+ };
2
16
  export function sanityEnvironmentPlugin(options) {
3
- const { clientInput, input } = options;
17
+ const { clientInput, input, isBlueprints } = options;
18
+ // Blueprints only: force the resource-bindings module into its own unhashed
19
+ // chunk so Brett can rewrite it at deploy. Off Blueprints, no such chunk.
20
+ const output = isBlueprints ? resourceBindingsOutput : undefined;
4
21
  return {
5
22
  config () {
6
23
  return {
@@ -26,7 +43,8 @@ export function sanityEnvironmentPlugin(options) {
26
43
  rolldownOptions: {
27
44
  input: {
28
45
  sanity: clientInput
29
- }
46
+ },
47
+ output
30
48
  }
31
49
  },
32
50
  consumer: 'client'
@@ -39,7 +57,8 @@ export function sanityEnvironmentPlugin(options) {
39
57
  emptyOutDir: false,
40
58
  outDir: `dist`,
41
59
  rolldownOptions: {
42
- input
60
+ input,
61
+ output
43
62
  }
44
63
  },
45
64
  consumer: 'client'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/actions/build/vite/plugins/plugin-sanity-environment.ts"],"sourcesContent":["import {type Plugin} from 'vite'\n\nimport {FEDERATION_DIR_NAME} from '../constants.js'\n\ninterface EnvironmentOptions {\n input: string\n\n /**\n * When set, also build a standalone `client` SPA environment (its own\n * `index.html` + bootstrap) alongside the federation remote, from this entry.\n * Set for every federated app and studio; omitted only for a dock-only app.\n */\n clientInput?: string\n}\n\nexport function sanityEnvironmentPlugin(options: EnvironmentOptions): Plugin {\n const {clientInput, input} = options\n\n return {\n config() {\n return {\n builder: {\n async buildApp(builder) {\n // `emptyOutDir` is false on both environments and the CLI clears\n // `dist` once up-front, so the SPA and federation outputs coexist\n // without either build wiping the other's files.\n if (clientInput) {\n await builder.build(builder.environments.client)\n }\n await builder.build(builder.environments[FEDERATION_DIR_NAME])\n },\n },\n environments: {\n ...(clientInput\n ? {\n client: {\n build: {\n assetsDir: 'static',\n copyPublicDir: false,\n emptyOutDir: false,\n outDir: `dist`,\n rolldownOptions: {input: {sanity: clientInput}},\n },\n consumer: 'client',\n },\n }\n : {}),\n [FEDERATION_DIR_NAME]: {\n build: {\n assetsDir: 'static',\n copyPublicDir: false,\n emptyOutDir: false,\n outDir: `dist`,\n rolldownOptions: {input},\n },\n consumer: 'client',\n },\n },\n }\n },\n name: 'sanity/environment',\n }\n}\n"],"names":["FEDERATION_DIR_NAME","sanityEnvironmentPlugin","options","clientInput","input","config","builder","buildApp","build","environments","client","assetsDir","copyPublicDir","emptyOutDir","outDir","rolldownOptions","sanity","consumer","name"],"mappings":"AAEA,SAAQA,mBAAmB,QAAO,kBAAiB;AAanD,OAAO,SAASC,wBAAwBC,OAA2B;IACjE,MAAM,EAACC,WAAW,EAAEC,KAAK,EAAC,GAAGF;IAE7B,OAAO;QACLG;YACE,OAAO;gBACLC,SAAS;oBACP,MAAMC,UAASD,OAAO;wBACpB,iEAAiE;wBACjE,kEAAkE;wBAClE,iDAAiD;wBACjD,IAAIH,aAAa;4BACf,MAAMG,QAAQE,KAAK,CAACF,QAAQG,YAAY,CAACC,MAAM;wBACjD;wBACA,MAAMJ,QAAQE,KAAK,CAACF,QAAQG,YAAY,CAACT,oBAAoB;oBAC/D;gBACF;gBACAS,cAAc;oBACZ,GAAIN,cACA;wBACEO,QAAQ;4BACNF,OAAO;gCACLG,WAAW;gCACXC,eAAe;gCACfC,aAAa;gCACbC,QAAQ,CAAC,IAAI,CAAC;gCACdC,iBAAiB;oCAACX,OAAO;wCAACY,QAAQb;oCAAW;gCAAC;4BAChD;4BACAc,UAAU;wBACZ;oBACF,IACA,CAAC,CAAC;oBACN,CAACjB,oBAAoB,EAAE;wBACrBQ,OAAO;4BACLG,WAAW;4BACXC,eAAe;4BACfC,aAAa;4BACbC,QAAQ,CAAC,IAAI,CAAC;4BACdC,iBAAiB;gCAACX;4BAAK;wBACzB;wBACAa,UAAU;oBACZ;gBACF;YACF;QACF;QACAC,MAAM;IACR;AACF"}
1
+ {"version":3,"sources":["../../../../../src/actions/build/vite/plugins/plugin-sanity-environment.ts"],"sourcesContent":["import {type Plugin} from 'vite'\n\nimport {\n resourceBindingsChunkFileName,\n resourceBindingsCodeSplittingGroup,\n} from '../../resource-bindings.js'\nimport {FEDERATION_DIR_NAME} from '../constants.js'\n\n// Keep the resource-bindings module in its own unhashed chunk at the bundle root\n// so Brett can rewrite it at deploy. `@module-federation/vite` preserves user\n// `codeSplitting` groups (clamped below its own), so this survives the federation\n// build. The chunk sizing lives on the group itself (see\n// `resourceBindingsCodeSplittingGroup`), so it only affects the bindings module.\nconst resourceBindingsOutput = {\n chunkFileNames: (chunk: {name: string}) =>\n resourceBindingsChunkFileName(chunk.name) ?? 'static/[name]-[hash].js',\n codeSplitting: {\n groups: [resourceBindingsCodeSplittingGroup],\n },\n}\n\ninterface EnvironmentOptions {\n input: string\n\n /**\n * When set, also build a standalone `client` SPA environment (its own\n * `index.html` + bootstrap) alongside the federation remote, from this entry.\n * Set for every federated app and studio; omitted only for a dock-only app.\n */\n clientInput?: string\n\n /** Blueprints build (via `@sanity/runtime-cli`) — emit the resource-bindings module. */\n isBlueprints?: boolean\n}\n\nexport function sanityEnvironmentPlugin(options: EnvironmentOptions): Plugin {\n const {clientInput, input, isBlueprints} = options\n\n // Blueprints only: force the resource-bindings module into its own unhashed\n // chunk so Brett can rewrite it at deploy. Off Blueprints, no such chunk.\n const output = isBlueprints ? resourceBindingsOutput : undefined\n\n return {\n config() {\n return {\n builder: {\n async buildApp(builder) {\n // `emptyOutDir` is false on both environments and the CLI clears\n // `dist` once up-front, so the SPA and federation outputs coexist\n // without either build wiping the other's files.\n if (clientInput) {\n await builder.build(builder.environments.client)\n }\n await builder.build(builder.environments[FEDERATION_DIR_NAME])\n },\n },\n environments: {\n ...(clientInput\n ? {\n client: {\n build: {\n assetsDir: 'static',\n copyPublicDir: false,\n emptyOutDir: false,\n outDir: `dist`,\n rolldownOptions: {\n input: {sanity: clientInput},\n output,\n },\n },\n consumer: 'client',\n },\n }\n : {}),\n [FEDERATION_DIR_NAME]: {\n build: {\n assetsDir: 'static',\n copyPublicDir: false,\n emptyOutDir: false,\n outDir: `dist`,\n rolldownOptions: {input, output},\n },\n consumer: 'client',\n },\n },\n }\n },\n name: 'sanity/environment',\n }\n}\n"],"names":["resourceBindingsChunkFileName","resourceBindingsCodeSplittingGroup","FEDERATION_DIR_NAME","resourceBindingsOutput","chunkFileNames","chunk","name","codeSplitting","groups","sanityEnvironmentPlugin","options","clientInput","input","isBlueprints","output","undefined","config","builder","buildApp","build","environments","client","assetsDir","copyPublicDir","emptyOutDir","outDir","rolldownOptions","sanity","consumer"],"mappings":"AAEA,SACEA,6BAA6B,EAC7BC,kCAAkC,QAC7B,6BAA4B;AACnC,SAAQC,mBAAmB,QAAO,kBAAiB;AAEnD,iFAAiF;AACjF,8EAA8E;AAC9E,kFAAkF;AAClF,yDAAyD;AACzD,iFAAiF;AACjF,MAAMC,yBAAyB;IAC7BC,gBAAgB,CAACC,QACfL,8BAA8BK,MAAMC,IAAI,KAAK;IAC/CC,eAAe;QACbC,QAAQ;YAACP;SAAmC;IAC9C;AACF;AAgBA,OAAO,SAASQ,wBAAwBC,OAA2B;IACjE,MAAM,EAACC,WAAW,EAAEC,KAAK,EAAEC,YAAY,EAAC,GAAGH;IAE3C,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAMI,SAASD,eAAeV,yBAAyBY;IAEvD,OAAO;QACLC;YACE,OAAO;gBACLC,SAAS;oBACP,MAAMC,UAASD,OAAO;wBACpB,iEAAiE;wBACjE,kEAAkE;wBAClE,iDAAiD;wBACjD,IAAIN,aAAa;4BACf,MAAMM,QAAQE,KAAK,CAACF,QAAQG,YAAY,CAACC,MAAM;wBACjD;wBACA,MAAMJ,QAAQE,KAAK,CAACF,QAAQG,YAAY,CAAClB,oBAAoB;oBAC/D;gBACF;gBACAkB,cAAc;oBACZ,GAAIT,cACA;wBACEU,QAAQ;4BACNF,OAAO;gCACLG,WAAW;gCACXC,eAAe;gCACfC,aAAa;gCACbC,QAAQ,CAAC,IAAI,CAAC;gCACdC,iBAAiB;oCACfd,OAAO;wCAACe,QAAQhB;oCAAW;oCAC3BG;gCACF;4BACF;4BACAc,UAAU;wBACZ;oBACF,IACA,CAAC,CAAC;oBACN,CAAC1B,oBAAoB,EAAE;wBACrBiB,OAAO;4BACLG,WAAW;4BACXC,eAAe;4BACfC,aAAa;4BACbC,QAAQ,CAAC,IAAI,CAAC;4BACdC,iBAAiB;gCAACd;gCAAOE;4BAAM;wBACjC;wBACAc,UAAU;oBACZ;gBACF;YACF;QACF;QACAtB,MAAM;IACR;AACF"}