@sanity/workbench-cli 2.20.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/_exports/build.d.ts +3 -2
  2. package/dist/_exports/build.js.map +1 -1
  3. package/dist/_exports/defineApp-COehpvlC.d.ts +376 -0
  4. package/dist/_exports/deploy.d.ts +18 -41
  5. package/dist/_exports/deploy.js +2 -0
  6. package/dist/_exports/deploy.js.map +1 -1
  7. package/dist/_exports/{summarizeInterfaces-BKIMEFzw.d.ts → deploySummary-DU7_Vcyq.d.ts} +30 -4
  8. package/dist/_exports/dev.d.ts +1 -1
  9. package/dist/_exports/index.d.ts +22 -4
  10. package/dist/_exports/index.js +2 -1
  11. package/dist/_exports/index.js.map +1 -1
  12. package/dist/_exports/preview.d.ts +1 -1
  13. package/dist/_exports/{registry-BI8kZVpy.d.ts → registry-Da2PAcT1.d.ts} +11 -7
  14. package/dist/_exports/{resolveWorkbenchConfig-Eex64aAA.d.ts → resolveWorkbenchApp-Bn0tsSDM.d.ts} +5 -20
  15. package/dist/_exports/resolveWorkbenchConfig-DkrkqN9H.d.ts +10 -0
  16. package/dist/_exports/undeploy.d.ts +6 -6
  17. package/dist/_exports/undeploy.js +1 -0
  18. package/dist/_exports/undeploy.js.map +1 -1
  19. package/dist/actions/build/artifact.js +20 -1
  20. package/dist/actions/build/artifact.js.map +1 -1
  21. package/dist/actions/build/configs/artifact.js +10 -50
  22. package/dist/actions/build/configs/artifact.js.map +1 -1
  23. package/dist/actions/build/dashboardConfig/artifact.js +25 -0
  24. package/dist/actions/build/dashboardConfig/artifact.js.map +1 -0
  25. package/dist/actions/build/hotConfigListeners.js +34 -0
  26. package/dist/actions/build/hotConfigListeners.js.map +1 -0
  27. package/dist/actions/build/vite/optimize-deps.js +2 -1
  28. package/dist/actions/build/vite/optimize-deps.js.map +1 -1
  29. package/dist/actions/build/vite/plugins/plugin-sanity-extension-artifacts.js +3 -1
  30. package/dist/actions/build/vite/plugins/plugin-sanity-extension-artifacts.js.map +1 -1
  31. package/dist/actions/deploy/deployConfig.js +9 -7
  32. package/dist/actions/deploy/deployConfig.js.map +1 -1
  33. package/dist/actions/deploy/deployPayload.js.map +1 -1
  34. package/dist/actions/deploy/deploySummary.js +24 -5
  35. package/dist/actions/deploy/deploySummary.js.map +1 -1
  36. package/dist/actions/deploy/uploadDashboardConfig.js +34 -0
  37. package/dist/actions/deploy/uploadDashboardConfig.js.map +1 -0
  38. package/dist/actions/dev/deriveConfigs.js +17 -13
  39. package/dist/actions/dev/deriveConfigs.js.map +1 -1
  40. package/dist/actions/dev/registry.js +34 -20
  41. package/dist/actions/dev/registry.js.map +1 -1
  42. package/dist/actions/dev/startDevServerRegistration.js +9 -5
  43. package/dist/actions/dev/startDevServerRegistration.js.map +1 -1
  44. package/dist/actions/dev/startWorkbenchDev.js +2 -2
  45. package/dist/actions/dev/startWorkbenchDev.js.map +1 -1
  46. package/dist/actions/preview/startWorkbenchPreview.js +39 -11
  47. package/dist/actions/preview/startWorkbenchPreview.js.map +1 -1
  48. package/dist/actions/undeploy/workbenchUndeployAdapter.js +50 -3
  49. package/dist/actions/undeploy/workbenchUndeployAdapter.js.map +1 -1
  50. package/dist/contract.js +14 -0
  51. package/dist/contract.js.map +1 -1
  52. package/dist/dashboardConfig.js +5 -0
  53. package/dist/dashboardConfig.js.map +1 -0
  54. package/dist/defineApp.js +25 -2
  55. package/dist/defineApp.js.map +1 -1
  56. package/dist/deriveInterfaces.js +2 -2
  57. package/dist/deriveInterfaces.js.map +1 -1
  58. package/dist/resolveWorkbenchApp.js +3 -2
  59. package/dist/resolveWorkbenchApp.js.map +1 -1
  60. package/dist/resolveWorkbenchConfig.js +11 -16
  61. package/dist/resolveWorkbenchConfig.js.map +1 -1
  62. package/dist/services/applications.js +1 -1
  63. package/dist/services/applications.js.map +1 -1
  64. package/dist/services/dashboard-configs.js +54 -0
  65. package/dist/services/dashboard-configs.js.map +1 -0
  66. package/package.json +8 -8
  67. package/dist/_exports/contract-BeAds4Yi.d.ts +0 -191
  68. package/dist/_exports/defineApp-DSXAAr3V.d.ts +0 -177
@@ -1,177 +0,0 @@
1
- import { z } from "zod/mini";
2
- /**
3
- * Runtime-validation schema for `defineApplication`.
4
- * @internal
5
- */
6
- declare const DefineAppInputSchema: z.ZodMiniObject<{
7
- applicationType: z.ZodMiniOptional<z.ZodMiniEnum<{
8
- coreApp: "coreApp";
9
- studio: "studio";
10
- canvas: "canvas";
11
- dashboard: "dashboard";
12
- }>>;
13
- dock: z.ZodMiniOptional<z.ZodMiniObject<{
14
- group: z.ZodMiniOptional<z.ZodMiniEnum<{
15
- system: "system";
16
- applications: "applications";
17
- }>>;
18
- order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
19
- }, z.core.$strip>>;
20
- entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
21
- icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
22
- isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
23
- name: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
- organizationId: z.ZodMiniString<string>;
25
- slug: z.ZodMiniString<string>;
26
- title: z.ZodMiniString<string>;
27
- views: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
28
- dock: z.ZodMiniOptional<z.ZodMiniObject<{
29
- group: z.ZodMiniOptional<z.ZodMiniEnum<{
30
- system: "system";
31
- applications: "applications";
32
- }>>;
33
- order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
34
- }, z.core.$strip>>;
35
- icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
36
- title: z.ZodMiniString<string>;
37
- name: z.ZodMiniString<string>;
38
- src: z.ZodMiniString<string>;
39
- surface: z.ZodMiniLiteral<"window">;
40
- }, z.core.$strip>, z.ZodMiniObject<{
41
- dock: z.ZodMiniOptional<z.ZodMiniObject<{
42
- order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
43
- }, z.core.$strip>>;
44
- icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
45
- title: z.ZodMiniString<string>;
46
- name: z.ZodMiniString<string>;
47
- src: z.ZodMiniString<string>;
48
- surface: z.ZodMiniLiteral<"panel">;
49
- }, z.core.$strip>, z.ZodMiniObject<{
50
- title: z.ZodMiniString<string>;
51
- name: z.ZodMiniString<string>;
52
- src: z.ZodMiniString<string>;
53
- surface: z.ZodMiniLiteral<"asset_source">;
54
- }, z.core.$strip>, z.ZodMiniObject<{
55
- order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
56
- size: z.ZodMiniEnum<{
57
- small: "small";
58
- large: "large";
59
- banner: "banner";
60
- }>;
61
- title: z.ZodMiniString<string>;
62
- name: z.ZodMiniString<string>;
63
- src: z.ZodMiniString<string>;
64
- surface: z.ZodMiniLiteral<"tile">;
65
- }, z.core.$strip>], "surface">>>;
66
- visibility: z.ZodMiniOptional<z.ZodMiniEnum<{
67
- default: "default";
68
- unlisted: "unlisted";
69
- disabled: "disabled";
70
- }>>;
71
- webWorkers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
72
- title: z.ZodMiniString<string>;
73
- name: z.ZodMiniString<string>;
74
- src: z.ZodMiniString<string>;
75
- type: z.ZodMiniLiteral<"worker">;
76
- }, z.core.$strip>], "type">>>;
77
- }, z.core.$strip>;
78
- /**
79
- * User-facing input for `defineApplication`. Excludes the internal
80
- * `applicationType` and `isSingleton`.
81
- * @public
82
- */
83
- type DefineAppInput = Omit<z.output<typeof DefineAppInputSchema>, 'applicationType' | 'isSingleton'>;
84
- /**
85
- * Nominal brand the CLI discriminates on to enable the workbench build/deploy
86
- * codepath. Registered via `Symbol.for` so the marker survives module-realm
87
- * boundaries — `@sanity/cli-core` re-derives the same global symbol with
88
- * `Symbol.for` rather than importing it, so it stays internal to this module.
89
- */
90
- declare const WORKBENCH_APP: unique symbol;
91
- /**
92
- * The branded result of `defineApplication`. Carries the same fields as the
93
- * input plus the internal brand — users only ever see `DefineAppInput`.
94
- * @public
95
- */
96
- type DefineAppResult = { [K in keyof DefineAppInput]: Exclude<DefineAppInput[K], undefined>; } & {
97
- readonly [WORKBENCH_APP]: true;
98
- };
99
- /**
100
- * A branded app as the CLI reads it — the full schema shape, including the
101
- * internal fields `DefineAppInput` omits. Schema-derived so the narrowing
102
- * can't drift from what the schema validates.
103
- * @public
104
- */
105
- type WorkbenchApp = DefineAppResult & z.output<typeof DefineAppInputSchema>;
106
- /**
107
- * Whether `app` is a branded `defineApplication(...)` result — the sole
108
- * workbench opt-in.
109
- * @public
110
- */
111
- declare function isWorkbenchApp(app: unknown): app is WorkbenchApp;
112
- /**
113
- * Declare a Sanity Dashboard application. Identity at runtime — returns the same
114
- * object reference, tagged with the Dashboard brand. Field validation (the
115
- * `slug` pattern etc.) runs at build time in the CLI via `DefineAppInputSchema`;
116
- * this helper stays a thin, pure identity wrapper.
117
- * @public
118
- */
119
- declare function defineApplication(input: DefineAppInput): DefineAppResult;
120
- /**
121
- * One custom field a media library exposes. `src` default-exports a `defineField(...)` schema type.
122
- * @public
123
- */
124
- interface MediaLibraryField {
125
- /** Unique within the media library. */
126
- name: string;
127
- src: string;
128
- title: string;
129
- /** Readable outside the owning organization. */
130
- public?: boolean;
131
- }
132
- /**
133
- * Sanity-owned singleton, so authors don't name or title the app — only `organizationId` is required.
134
- * @public
135
- */
136
- interface DefineMediaLibraryInput {
137
- /** Organization that owns the media library — the CLI runs and deploys against it. */
138
- organizationId: string;
139
- fields?: MediaLibraryField[];
140
- }
141
- /**
142
- * Nominal brand the CLI discriminates a config on. A config is *not* an app: it
143
- * carries no `slug`/`title`/application identity, only a target `appType`, its
144
- * owning `organizationId`, and its `fields`. Registered via `Symbol.for` so the
145
- * marker survives module-realm boundaries — `@sanity/cli-core` re-derives the
146
- * same global symbol rather than importing it.
147
- */
148
- declare const WORKBENCH_CONFIG: unique symbol;
149
- /**
150
- * A branded workbench config as the CLI reads it: bound to its target app by
151
- * `appType`, not carrying its own app identity. The deploy/undeploy/build paths
152
- * discriminate it via {@link isWorkbenchConfig}.
153
- * @public
154
- */
155
- interface WorkbenchConfig {
156
- appType: 'media-library';
157
- fields: MediaLibraryField[];
158
- organizationId: string;
159
- readonly [WORKBENCH_CONFIG]: true;
160
- }
161
- /**
162
- * Whether `app` is a branded `unstable_defineMediaLibrary(...)` config — a
163
- * config-carrier rather than an app. Configs live in `cliConfig.app` alongside
164
- * apps but resolve through `resolveWorkbenchConfig`, not `resolveWorkbenchApp`.
165
- * @public
166
- */
167
- declare function isWorkbenchConfig(app: unknown): app is WorkbenchConfig;
168
- /**
169
- * Declare the Sanity Media Library config. The Media Library is a Sanity-owned
170
- * singleton, so this is not an app — it carries no slug or title, only the
171
- * target `appType`, its owning organization, and the `fields` it contributes to
172
- * the installation's config.
173
- * @public
174
- */
175
- declare function unstable_defineMediaLibrary(input: DefineMediaLibraryInput): WorkbenchConfig;
176
- export { WorkbenchApp as a, isWorkbenchApp as c, MediaLibraryField as i, isWorkbenchConfig as l, DefineAppResult as n, WorkbenchConfig as o, DefineMediaLibraryInput as r, defineApplication as s, DefineAppInput as t, unstable_defineMediaLibrary as u };
177
- //# sourceMappingURL=defineApp-DSXAAr3V.d.ts.map