@widy/sdk 1.0.13 → 1.0.14
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,12 +1,12 @@
|
|
|
1
1
|
import { WebSocketServer } from "ws";
|
|
2
2
|
export function rsBuildHotReloadPlugin({ port = 4777, delay = 400, entryFilePath, }) {
|
|
3
3
|
const isWatch = process.argv.includes("--watch");
|
|
4
|
-
const ws = new WebSocketServer({ port });
|
|
5
4
|
return {
|
|
6
5
|
name: "hot-reload-widget",
|
|
7
6
|
setup(api) {
|
|
8
7
|
if (!isWatch)
|
|
9
8
|
return;
|
|
9
|
+
const ws = new WebSocketServer({ port });
|
|
10
10
|
api.transform({}, ({ code, resourcePath }) => {
|
|
11
11
|
if (resourcePath === entryFilePath) {
|
|
12
12
|
const hotReloadSnippet = `
|
package/dist/types.d.ts
CHANGED
|
@@ -374,7 +374,7 @@ export type WidgetScopes = WidgetQuery | WidgetSubscription | WidgetMutation;
|
|
|
374
374
|
export interface IWidgetRequest<T = unknown> {
|
|
375
375
|
id: string;
|
|
376
376
|
scope: WidgetScopes;
|
|
377
|
-
|
|
377
|
+
arg?: T;
|
|
378
378
|
}
|
|
379
379
|
export interface IWidgetResponse<T = unknown> {
|
|
380
380
|
id: string;
|