@sanity/workbench-cli 2.0.0 → 2.0.2

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.
@@ -1,203 +1,20 @@
1
- import { CliConfig } from "@sanity/cli-core";
2
- import { Output } from "@sanity/cli-core";
1
+ import { t as DevServerManifest } from "./registry-DI7hnTof.js";
2
+ import { CliConfig, Output } from "@sanity/cli-core";
3
3
  import { ViteDevServer } from "vite";
4
- import { z } from "zod/mini";
5
-
6
4
  /**
7
5
  * Minimal shape the supervisor needs back from a started app/studio dev server.
8
6
  * The not-started arm is reserved for expected early exits the server already
9
7
  * reported (e.g. a missing organization id) — a failure to *boot* still throws.
10
8
  */
11
- declare type AppServerResult =
12
- | {
13
- close: () => Promise<void>;
14
- server: ViteDevServer;
15
- started: true;
16
- }
17
- | {
18
- reason: string;
19
- started: false;
20
- };
21
-
22
- /**
23
- * A manifest describing a running dev server process (studio or app).
24
- * Stored as `~/.sanity/dev-servers/<pid>.json`.
25
- *
26
- * The workbench singleton is tracked separately via the lock file — see
27
- * `acquireWorkbenchLock` and `readWorkbenchLock` below.
28
- */
29
- declare type DevServerManifest = z.infer<typeof devServerManifestSchema>;
30
-
31
- declare const devServerManifestSchema: z.ZodMiniObject<
32
- {
33
- configs: z.ZodMiniOptional<
34
- z.ZodMiniArray<
35
- z.ZodMiniObject<
36
- {
37
- appType: z.ZodMiniOptional<z.ZodMiniString<string>>;
38
- fields: z.ZodMiniArray<
39
- z.ZodMiniObject<
40
- {
41
- name: z.ZodMiniString<string>;
42
- public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
43
- src: z.ZodMiniString<string>;
44
- title: z.ZodMiniString<string>;
45
- },
46
- z.core.$strip
47
- >
48
- >;
49
- id: z.ZodMiniString<string>;
50
- moduleName: z.ZodMiniOptional<z.ZodMiniString<string>>;
51
- version: z.ZodMiniString<string>;
52
- },
53
- z.core.$strip
54
- >
55
- >
56
- >;
57
- host: z.ZodMiniString<string>;
58
- id: z.ZodMiniOptional<z.ZodMiniString<string>>;
59
- interfaces: z.ZodMiniOptional<
60
- z.ZodMiniArray<
61
- z.ZodMiniDiscriminatedUnion<
62
- [
63
- z.ZodMiniObject<
64
- {
65
- metadata: z.ZodMiniNullable<
66
- z.ZodMiniObject<
67
- {
68
- group: z.ZodMiniOptional<z.ZodMiniString<string>>;
69
- priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
70
- },
71
- z.core.$strip
72
- >
73
- >;
74
- type: z.ZodMiniLiteral<"app">;
75
- id: z.ZodMiniString<string>;
76
- moduleId: z.ZodMiniString<string>;
77
- name: z.ZodMiniString<string>;
78
- src: z.ZodMiniString<string>;
79
- title: z.ZodMiniString<string>;
80
- version: z.ZodMiniOptional<z.ZodMiniString<string>>;
81
- },
82
- z.core.$strip
83
- >,
84
- z.ZodMiniObject<
85
- {
86
- metadata: z.ZodMiniNull;
87
- type: z.ZodMiniLiteral<"panel">;
88
- id: z.ZodMiniString<string>;
89
- moduleId: z.ZodMiniString<string>;
90
- name: z.ZodMiniString<string>;
91
- src: z.ZodMiniString<string>;
92
- title: z.ZodMiniString<string>;
93
- version: z.ZodMiniOptional<z.ZodMiniString<string>>;
94
- },
95
- z.core.$strip
96
- >,
97
- z.ZodMiniObject<
98
- {
99
- metadata: z.ZodMiniNull;
100
- type: z.ZodMiniLiteral<"asset_source">;
101
- id: z.ZodMiniString<string>;
102
- moduleId: z.ZodMiniString<string>;
103
- name: z.ZodMiniString<string>;
104
- src: z.ZodMiniString<string>;
105
- title: z.ZodMiniString<string>;
106
- version: z.ZodMiniOptional<z.ZodMiniString<string>>;
107
- },
108
- z.core.$strip
109
- >,
110
- z.ZodMiniObject<
111
- {
112
- metadata: z.ZodMiniObject<
113
- {
114
- priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
115
- size: z.ZodMiniEnum<{
116
- small: "small";
117
- large: "large";
118
- banner: "banner";
119
- }>;
120
- },
121
- z.core.$strip
122
- >;
123
- type: z.ZodMiniLiteral<"tile">;
124
- id: z.ZodMiniString<string>;
125
- moduleId: z.ZodMiniString<string>;
126
- name: z.ZodMiniString<string>;
127
- src: z.ZodMiniString<string>;
128
- title: z.ZodMiniString<string>;
129
- version: z.ZodMiniOptional<z.ZodMiniString<string>>;
130
- },
131
- z.core.$strip
132
- >,
133
- z.ZodMiniObject<
134
- {
135
- metadata: z.ZodMiniNull;
136
- type: z.ZodMiniLiteral<"worker">;
137
- id: z.ZodMiniString<string>;
138
- moduleId: z.ZodMiniString<string>;
139
- name: z.ZodMiniString<string>;
140
- src: z.ZodMiniString<string>;
141
- title: z.ZodMiniString<string>;
142
- version: z.ZodMiniOptional<z.ZodMiniString<string>>;
143
- },
144
- z.core.$strip
145
- >,
146
- ],
147
- "type"
148
- >
149
- >
150
- >;
151
- manifest: z.ZodMiniOptional<
152
- z.ZodMiniUnion<
153
- readonly [
154
- z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>,
155
- z.ZodMiniObject<
156
- {
157
- group: z.ZodMiniOptional<z.ZodMiniString<string>>;
158
- icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
159
- priority: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
160
- slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
161
- title: z.ZodMiniOptional<z.ZodMiniString<string>>;
162
- version: z.ZodMiniString<string>;
163
- },
164
- z.core.$strip
165
- >,
166
- ]
167
- >
168
- >;
169
- manifestUpdatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
170
- pid: z.ZodMiniNumber<number>;
171
- port: z.ZodMiniNumber<number>;
172
- projectId: z.ZodMiniOptional<z.ZodMiniString<string>>;
173
- startedAt: z.ZodMiniString<string>;
174
- type: z.ZodMiniEnum<{
175
- coreApp: "coreApp";
176
- studio: "studio";
177
- }>;
178
- version: z.ZodMiniLiteral<1>;
179
- workDir: z.ZodMiniString<string>;
180
- },
181
- z.core.$strip
182
- >;
183
-
184
- /**
185
- * Orchestrate the dev servers a workbench project needs: a singleton workbench
186
- * Vite server plus the app/studio dev server it renders, wired to the dev-server
187
- * registry so view/service edits re-sync live.
188
- *
189
- * A running workbench claims the configured port, so the app server binds the
190
- * next one. If the workbench can't start (package or port unavailable), the app
191
- * server falls back to the configured port and announces its own URL, exactly as
192
- * a plain `sanity dev` would.
193
- */
194
- export declare function startWorkbenchDev(
195
- options: StartWorkbenchDevOptions,
196
- ): Promise<{
9
+ type AppServerResult = {
197
10
  close: () => Promise<void>;
198
- }>;
199
-
200
- export declare interface StartWorkbenchDevOptions {
11
+ server: ViteDevServer;
12
+ started: true;
13
+ } | {
14
+ reason: string;
15
+ started: false;
16
+ };
17
+ interface StartWorkbenchDevOptions {
201
18
  /** Directory for the workbench Vite server's dependency cache. */
202
19
  cacheDir: string;
203
20
  /** CLI-domain `app.id`/`deployment.appId` deprecation check, run before registering. */
@@ -207,7 +24,7 @@ export declare interface StartWorkbenchDevOptions {
207
24
  extractManifest: (params: {
208
25
  configPath: string;
209
26
  workDir: string;
210
- }) => Promise<DevServerManifest["manifest"]>;
27
+ }) => Promise<DevServerManifest['manifest']>;
211
28
  httpHost: string | undefined;
212
29
  httpPort: number;
213
30
  isApp: boolean;
@@ -221,5 +38,18 @@ export declare interface StartWorkbenchDevOptions {
221
38
  }) => Promise<AppServerResult>;
222
39
  workDir: string;
223
40
  }
224
-
225
- export {};
41
+ /**
42
+ * Orchestrate the dev servers a workbench project needs: a singleton workbench
43
+ * Vite server plus the app/studio dev server it renders, wired to the dev-server
44
+ * registry so view/service edits re-sync live.
45
+ *
46
+ * A running workbench claims the configured port, so the app server binds the
47
+ * next one. If the workbench can't start (package or port unavailable), the app
48
+ * server falls back to the configured port and announces its own URL, exactly as
49
+ * a plain `sanity dev` would.
50
+ */
51
+ declare function startWorkbenchDev(options: StartWorkbenchDevOptions): Promise<{
52
+ close: () => Promise<void>;
53
+ }>;
54
+ export { type StartWorkbenchDevOptions, startWorkbenchDev };
55
+ //# sourceMappingURL=dev.d.ts.map