@sanity/workbench-cli 2.18.0 → 2.19.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/dist/_exports/_internal_worker_bus.d.ts +2 -2
- package/dist/_exports/build.d.ts +1 -1
- package/dist/_exports/{defineApp-vbUu_rBA.d.ts → defineApp-9ppP3UQR.d.ts} +2 -2
- package/dist/_exports/deploy.d.ts +23 -7
- package/dist/_exports/deploy.js +1 -0
- package/dist/_exports/deploy.js.map +1 -1
- package/dist/_exports/dev.d.ts +3 -1
- package/dist/_exports/index.d.ts +68 -3
- package/dist/_exports/preview.d.ts +3 -1
- package/dist/_exports/{registry-CbruhmxE.d.ts → registry-DZWnj09G.d.ts} +2 -2
- package/dist/_exports/{resolveWorkbenchConfig-JRi01VJM.d.ts → resolveWorkbenchConfig-_iD6fVUH.d.ts} +2 -2
- package/dist/_exports/{summarizeInterfaces-CpCUSMrz.d.ts → summarizeInterfaces-AM-QbtIA.d.ts} +3 -3
- package/dist/_exports/undeploy.d.ts +2 -2
- package/dist/actions/build/autoUpdatesLoader.js +3 -1
- package/dist/actions/build/autoUpdatesLoader.js.map +1 -1
- package/dist/actions/build/webWorkers/workerBus.js.map +1 -1
- package/dist/actions/deploy/deployWorkbenchApp.js +21 -7
- package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -1
- package/dist/actions/dev/deriveConfigs.js +1 -1
- package/dist/actions/dev/deriveConfigs.js.map +1 -1
- package/dist/actions/dev/startDevServerRegistration.js +16 -1
- package/dist/actions/dev/startDevServerRegistration.js.map +1 -1
- package/dist/actions/dev/startWorkbenchDev.js.map +1 -1
- package/dist/actions/preview/serveBuiltApplication.js +12 -1
- package/dist/actions/preview/serveBuiltApplication.js.map +1 -1
- package/dist/actions/preview/startWorkbenchPreview.js +11 -0
- package/dist/actions/preview/startWorkbenchPreview.js.map +1 -1
- package/dist/appId.js +1 -1
- package/dist/appId.js.map +1 -1
- package/dist/defineApp.js +4 -3
- package/dist/defineApp.js.map +1 -1
- package/dist/readAppIcon.js +31 -0
- package/dist/readAppIcon.js.map +1 -0
- package/dist/services/applications.js +18 -0
- package/dist/services/applications.js.map +1 -1
- package/dist/webWorker.js.map +1 -1
- package/package.json +12 -13
- package/dist/_exports/webWorker-TWUbh0uo.d.ts +0 -123
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workbench-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.1",
|
|
4
4
|
"description": "Internal implementation detail of the Sanity CLI's unstable workbench support. Not intended for direct use.",
|
|
5
5
|
"homepage": "https://github.com/sanity-io/cli",
|
|
6
6
|
"bugs": "https://github.com/sanity-io/cli/issues",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@module-federation/runtime": "2.9.3",
|
|
69
69
|
"@module-federation/vite": "1.24.0",
|
|
70
|
-
"@sanity/cli-core": "^3.
|
|
71
|
-
"@sanity/sdk": "^3.
|
|
72
|
-
"@sanity/types": "^6.
|
|
70
|
+
"@sanity/cli-core": "^3.16.0",
|
|
71
|
+
"@sanity/sdk": "^3.15.0",
|
|
72
|
+
"@sanity/types": "^6.24.0",
|
|
73
73
|
"@vitejs/plugin-react": "^6.3.0",
|
|
74
74
|
"form-data": "^4.0.6",
|
|
75
75
|
"open": "^11.0.4",
|
|
@@ -80,25 +80,24 @@
|
|
|
80
80
|
"zod": "^4.6.7"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@
|
|
83
|
+
"@repo/oxc-config": "0.0.0",
|
|
84
84
|
"@repo/package.config": "0.0.1",
|
|
85
85
|
"@repo/tsconfig": "3.70.0",
|
|
86
|
-
"@sanity/cli-test": "
|
|
87
|
-
"@sanity/eslint-config-cli": "^1.1.3",
|
|
86
|
+
"@sanity/cli-test": "26.0.0",
|
|
88
87
|
"@sanity/pkg-utils": "^12.3.4",
|
|
89
88
|
"@swc/cli": "^0.8.2",
|
|
90
89
|
"@swc/core": "^1.16.22",
|
|
91
90
|
"@types/node": "^22.20.5",
|
|
92
91
|
"@types/react": "^19.3.0",
|
|
93
92
|
"@types/semver": "^7.8.0",
|
|
94
|
-
"@vitest/coverage-istanbul": "^5.1.
|
|
95
|
-
"eslint": "^10.7.0",
|
|
93
|
+
"@vitest/coverage-istanbul": "^5.1.1",
|
|
96
94
|
"jsdom": "^29.1.1",
|
|
97
|
-
"
|
|
95
|
+
"oxlint": "^1.94.0",
|
|
96
|
+
"publint": "^0.3.25",
|
|
98
97
|
"react": "^19.3.1",
|
|
99
98
|
"react-dom": "^19.3.1",
|
|
100
99
|
"typescript": "^6.0.3",
|
|
101
|
-
"vitest": "^5.1.
|
|
100
|
+
"vitest": "^5.1.1"
|
|
102
101
|
},
|
|
103
102
|
"engines": {
|
|
104
103
|
"node": ">=22.12"
|
|
@@ -107,12 +106,12 @@
|
|
|
107
106
|
"build": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ src",
|
|
108
107
|
"build:types": "pkg-utils build --emitDeclarationOnly",
|
|
109
108
|
"check:types": "tsc --noEmit",
|
|
110
|
-
"lint": "eslint .",
|
|
111
109
|
"publint": "publint",
|
|
112
110
|
"test": "vitest run",
|
|
113
111
|
"posttest": "pnpm run lint",
|
|
114
112
|
"test:coverage": "vitest run --coverage",
|
|
115
113
|
"test:watch": "vitest",
|
|
116
|
-
"watch": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ --watch src"
|
|
114
|
+
"watch": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ --watch src",
|
|
115
|
+
"lint": "oxlint -c oxlint.config.ts"
|
|
117
116
|
}
|
|
118
117
|
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { g as WEB_WORKER_CONTRACT_VERSION, v as WebWorkerType } from "./contract-WrU3aOYd.js";
|
|
2
|
-
import { EventTopic, MessageBus, MessageBusAbortOptions, MessageBusMessage, PayloadOf, ReplyOf, StateTopic, ValueOf } from "@sanity/sdk/dashboard";
|
|
3
|
-
/**
|
|
4
|
-
* The web worker's own declaration.
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
interface WebWorkerInfo {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly type: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The message bus as a web worker sees it: the SDK's `MessageBus` without the
|
|
13
|
-
* `subscribe` forms that return observables, which would make the web worker's
|
|
14
|
-
* project install rxjs. There is no `disconnect`: Dashboard owns the connection
|
|
15
|
-
* and ends it when it stops the worker.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
interface WebWorkerBus extends Omit<MessageBus, 'subscribe'> {
|
|
19
|
-
/** Runs a responder for each event until its signal aborts. */
|
|
20
|
-
subscribe<K extends EventTopic>(type: K, handler: (message: MessageBusMessage<PayloadOf<K>, ReplyOf<K>, K>) => void, options?: MessageBusAbortOptions): void;
|
|
21
|
-
/** Runs a handler for each state value until its signal aborts. */
|
|
22
|
-
subscribe<K extends StateTopic>(type: K, handler: (value: ValueOf<K>) => void, options?: MessageBusAbortOptions): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Context every service callback receives when its worker starts. Mirrors how a
|
|
26
|
-
* view component receives its `view` — the service receives its own `service`.
|
|
27
|
-
* @deprecated Use {@link WebWorkerProps}.
|
|
28
|
-
* @public
|
|
29
|
-
*/
|
|
30
|
-
interface ServiceContext {
|
|
31
|
-
readonly bus: WebWorkerBus;
|
|
32
|
-
readonly service: WebWorkerInfo;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Props a web worker function receives when its worker starts. The default
|
|
36
|
-
* export of a web worker's `src` file runs once inside the worker.
|
|
37
|
-
*
|
|
38
|
-
* `bus` is its connection to the Dashboard message bus:
|
|
39
|
-
* `bus.emit` sends an event (such as a dock-badge update), `bus.query` reads the
|
|
40
|
-
* current value of a state topic, and `bus.subscribe` runs a handler on each
|
|
41
|
-
* new value of a state topic, or on each event of an event topic, until its
|
|
42
|
-
* `signal` aborts. A refused, unanswered or timed-out `emit` or `query` rejects
|
|
43
|
-
* with an `Error` named `MessageBusError` whose `code` says why; it is not an
|
|
44
|
-
* instance of the SDK's `MessageBusError` class. When the Dashboard's refusal
|
|
45
|
-
* says how to fix it, the error also carries `fix` and `docsUrl`. A refused
|
|
46
|
-
* `subscribe` has no error: its handler never runs, and the Dashboard reports
|
|
47
|
-
* the refusal in the browser console.
|
|
48
|
-
*
|
|
49
|
-
* An event handler answers the sender with `message.reply(value)` or refuses
|
|
50
|
-
* with `message.reject(reason)`; one that throws refuses with code
|
|
51
|
-
* `HANDLER_THREW`. For example, a worker that keeps a snapshot for its app's
|
|
52
|
-
* views, which listen with `useWorker` first and then post to it. A view's post
|
|
53
|
-
* arrives on `workers.post` as `{name, payload}`, and `workers.message` reaches
|
|
54
|
-
* only this app's views:
|
|
55
|
-
*
|
|
56
|
-
* ```ts
|
|
57
|
-
* export default ({bus}: WebWorkerProps) => {
|
|
58
|
-
* const controller = new AbortController()
|
|
59
|
-
* bus.subscribe('workers.post', (message) => message.reply(snapshot), {
|
|
60
|
-
* signal: controller.signal,
|
|
61
|
-
* })
|
|
62
|
-
* // Views that are already listening post again.
|
|
63
|
-
* bus.emit('workers.message', {type: 'welcome'})
|
|
64
|
-
* return () => controller.abort()
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* The function can return a disposer, which runs when Dashboard stops the
|
|
69
|
-
* worker. By then the bus is closed: subscriptions have ended, `emit` and
|
|
70
|
-
* `query` reject with code `ABORTED`, and `subscribe` throws that error.
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
interface WebWorkerProps {
|
|
74
|
-
readonly bus: WebWorkerBus;
|
|
75
|
-
readonly worker: WebWorkerInfo;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* A service callback. Runs once inside the worker on start; returns an optional
|
|
79
|
-
* disposer the host calls before terminating the worker.
|
|
80
|
-
* @deprecated Default-export a plain function that receives {@link WebWorkerProps} instead.
|
|
81
|
-
* @public
|
|
82
|
-
*/
|
|
83
|
-
type ServiceCallback = (context: ServiceContext) => (() => void) | void;
|
|
84
|
-
/** The callback shape each service type defines, keyed by type. */
|
|
85
|
-
interface ServiceCallbacksByType {
|
|
86
|
-
worker: ServiceCallback;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* The result of `unstable_defineService`: the author's callback, the service
|
|
90
|
-
* type, and the internal contract version the worker artifact targets.
|
|
91
|
-
* @deprecated Default-export a plain function that receives {@link WebWorkerProps} instead.
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
interface DefinedService<TType extends WebWorkerType = WebWorkerType> {
|
|
95
|
-
readonly run: ServiceCallbacksByType[TType];
|
|
96
|
-
readonly type: TType;
|
|
97
|
-
/** @internal */
|
|
98
|
-
readonly version: typeof WEB_WORKER_CONTRACT_VERSION;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Define a Sanity Dashboard background service. The first argument narrows the
|
|
102
|
-
* callback shape — `"worker"` runs the callback inside a Web Worker with the
|
|
103
|
-
* bus described on {@link WebWorkerProps}.
|
|
104
|
-
*
|
|
105
|
-
* Identity at runtime: returns the callback tagged with its type and the contract
|
|
106
|
-
* version, for the CLI build to generate a worker artifact from. Used as the
|
|
107
|
-
* default export of a service's `src` file.
|
|
108
|
-
* @deprecated Default-export a plain function that receives {@link WebWorkerProps} from the web worker's `src` file instead.
|
|
109
|
-
* @public
|
|
110
|
-
*/
|
|
111
|
-
declare function unstable_defineService<TType extends WebWorkerType>(type: TType, run: ServiceCallbacksByType[TType]): DefinedService<TType>;
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated Use `WebWorkerBus`.
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
type ServiceBus = WebWorkerBus;
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Use `WebWorkerInfo`.
|
|
119
|
-
* @public
|
|
120
|
-
*/
|
|
121
|
-
type ServiceInfo = WebWorkerInfo;
|
|
122
|
-
export { ServiceInfo as a, WebWorkerProps as c, ServiceContext as i, unstable_defineService as l, ServiceBus as n, WebWorkerBus as o, ServiceCallback as r, WebWorkerInfo as s, DefinedService as t };
|
|
123
|
-
//# sourceMappingURL=webWorker-TWUbh0uo.d.ts.map
|