@buoy-gg/core 7.0.40 → 7.0.41
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/README.md +10 -0
- package/bin/buoy.js +25 -31
- package/lib/commonjs/browserRegister.js +48 -0
- package/lib/commonjs/browserRegister.server.js +10 -0
- package/lib/commonjs/floatingMenu/AppHost.web.js +71 -59
- package/lib/commonjs/floatingMenu/BrowserToolRuntime.js +150 -0
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +10 -1111
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.shared.js +1114 -0
- package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +28 -1028
- package/lib/commonjs/floatingMenu/FloatingDevTools.js +7 -2
- package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +54 -40
- package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +8 -2
- package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +10 -0
- package/lib/commonjs/floatingMenu/autoExternalSync.js +9 -0
- package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +86 -12
- package/lib/commonjs/floatingMenu/dial/DialIcon.js +4 -2
- package/lib/commonjs/floatingMenu/settingsBus.js +6 -17
- package/lib/commonjs/floatingMenu/useDesktopSyncStatus.web.js +14 -0
- package/lib/commonjs/index.web.js +92 -1
- package/lib/commonjs/reactDevtoolsTypes.js +1 -0
- package/lib/commonjs/utils/autoDiscoverPresets.web.js +5 -178
- package/lib/commonjs/utils/createWebTool.js +20 -0
- package/lib/commonjs/utils/createWebTools.js +30 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/browserRegister.js +44 -0
- package/lib/module/browserRegister.server.js +6 -0
- package/lib/module/floatingMenu/AppHost.web.js +71 -59
- package/lib/module/floatingMenu/BrowserToolRuntime.js +146 -0
- package/lib/module/floatingMenu/DevToolsSettingsModal.js +1 -1113
- package/lib/module/floatingMenu/DevToolsSettingsModal.shared.js +1110 -0
- package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +32 -1043
- package/lib/module/floatingMenu/FloatingDevTools.js +7 -2
- package/lib/module/floatingMenu/FloatingDevTools.web.js +55 -42
- package/lib/module/floatingMenu/MinimizedToolsStack.web.js +8 -2
- package/lib/module/floatingMenu/autoDiscoverPresets.js +10 -0
- package/lib/module/floatingMenu/autoExternalSync.js +9 -0
- package/lib/module/floatingMenu/dial/DialDevTools.web.js +87 -14
- package/lib/module/floatingMenu/dial/DialIcon.js +4 -2
- package/lib/module/floatingMenu/settingsBus.js +1 -17
- package/lib/module/floatingMenu/useDesktopSyncStatus.web.js +10 -0
- package/lib/module/index.web.js +8 -1
- package/lib/module/reactDevtoolsTypes.js +1 -0
- package/lib/module/utils/autoDiscoverPresets.web.js +5 -180
- package/lib/module/utils/createWebTool.js +17 -0
- package/lib/module/utils/createWebTools.js +25 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/commonjs/browserRegister.d.ts +5 -0
- package/lib/typescript/commonjs/browserRegister.d.ts.map +1 -0
- package/lib/typescript/commonjs/browserRegister.server.d.ts +5 -0
- package/lib/typescript/commonjs/browserRegister.server.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts +3 -3
- package/lib/typescript/commonjs/floatingMenu/AppHost.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts +14 -0
- package/lib/typescript/commonjs/floatingMenu/BrowserToolRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
- package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +12 -6
- package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +1 -9
- package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +1 -1
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
- package/lib/typescript/commonjs/floatingMenu/useDesktopSyncStatus.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.web.d.ts +6 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts +8 -0
- package/lib/typescript/commonjs/reactDevtoolsTypes.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts +3 -40
- package/lib/typescript/commonjs/utils/autoDiscoverPresets.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/createWebTool.d.ts +6 -0
- package/lib/typescript/commonjs/utils/createWebTool.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/createWebTools.d.ts +4 -0
- package/lib/typescript/commonjs/utils/createWebTools.d.ts.map +1 -0
- package/lib/typescript/commonjs/version.d.ts +1 -1
- package/lib/typescript/module/browserRegister.d.ts +5 -0
- package/lib/typescript/module/browserRegister.d.ts.map +1 -0
- package/lib/typescript/module/browserRegister.server.d.ts +5 -0
- package/lib/typescript/module/browserRegister.server.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/AppHost.web.d.ts +3 -3
- package/lib/typescript/module/floatingMenu/AppHost.web.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts +14 -0
- package/lib/typescript/module/floatingMenu/BrowserToolRuntime.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +2 -67
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts +71 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.shared.d.ts.map +1 -0
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts +3 -16
- package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +12 -6
- package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +1 -1
- package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts +1 -9
- package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +1 -1
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts +3 -0
- package/lib/typescript/module/floatingMenu/useDesktopSyncStatus.web.d.ts.map +1 -0
- package/lib/typescript/module/index.web.d.ts +6 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/reactDevtoolsTypes.d.ts +8 -0
- package/lib/typescript/module/reactDevtoolsTypes.d.ts.map +1 -0
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts +3 -40
- package/lib/typescript/module/utils/autoDiscoverPresets.web.d.ts.map +1 -1
- package/lib/typescript/module/utils/createWebTool.d.ts +6 -0
- package/lib/typescript/module/utils/createWebTool.d.ts.map +1 -0
- package/lib/typescript/module/utils/createWebTools.d.ts +4 -0
- package/lib/typescript/module/utils/createWebTools.d.ts.map +1 -0
- package/lib/typescript/module/version.d.ts +1 -1
- package/lib/web/chunks/chunk-5NZOQR6Q.mjs +2 -0
- package/lib/web/chunks/chunk-CGDSLLZF.mjs +2 -0
- package/lib/web/chunks/chunk-DCJDUSNR.mjs +2 -0
- package/lib/web/chunks/chunk-IDSHFS6G.mjs +2 -0
- package/lib/web/chunks/chunk-JOAMJGCS.mjs +2 -0
- package/lib/web/chunks/chunk-KYKZ2N52.mjs +2 -0
- package/lib/web/chunks/chunk-NGM7JGGS.mjs +2 -0
- package/lib/web/chunks/chunk-QZDVCMCT.mjs +2 -0
- package/lib/web/chunks/chunk-R7RGRTY5.mjs +2 -0
- package/lib/web/chunks/chunk-Z3XWDDIO.mjs +2 -0
- package/lib/web/chunks/chunk-ZTGQ6TTY.mjs +2 -0
- package/lib/web/index.mjs +11 -0
- package/lib/web/register-server.mjs +2 -0
- package/lib/web/register.mjs +2 -0
- package/lib/web/toolkit.mjs +2 -0
- package/package.json +50 -12
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
4
|
+
import { LicenseManager, useLicense } from '@buoy-gg/license';
|
|
5
|
+
import { registerToolAdapters } from '@buoy-gg/shared-ui';
|
|
6
|
+
import { externalSyncOptions, shouldMountExternalSync } from "./externalSyncGate.js";
|
|
7
|
+
import { useDeviceIdentity } from "./deviceIdentity.js";
|
|
8
|
+
import { appSyncAdapter } from "./sync/appSyncAdapter.js";
|
|
9
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const roots = ['ConsoleRoot', 'RouteTracker', 'ReactQueryTracker', 'ReduxAutoInstrument', 'PerfMonitorRoot', 'AutomationResumer', 'ImagesRoot'];
|
|
11
|
+
const overlays = ['DebugBordersStandaloneOverlay', 'HighlightUpdatesOverlay', 'ImageOverlayStandalone', 'PerfMonitorOverlay', 'JsTopHudOverlay', 'ImpersonateOverlay', 'ScenariosOverlay'];
|
|
12
|
+
export function BrowserToolRuntime(props) {
|
|
13
|
+
const modules = useMemo(() => Object.fromEntries(Object.entries(props.modules).map(([id, module]) => [id.replace(/^@buoy-gg\//, '').replace(/\/web$/, ''), module])), [props.modules]);
|
|
14
|
+
const query = modules['react-query'];
|
|
15
|
+
return query?.useReactQuerySyncAdapter ? /*#__PURE__*/_jsx(QueryRuntime, {
|
|
16
|
+
...props,
|
|
17
|
+
modules: modules,
|
|
18
|
+
query: query
|
|
19
|
+
}) : /*#__PURE__*/_jsx(ToolRuntime, {
|
|
20
|
+
...props,
|
|
21
|
+
modules: modules
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function QueryRuntime(props) {
|
|
25
|
+
const adapter = props.query.useReactQuerySyncAdapter();
|
|
26
|
+
return /*#__PURE__*/_jsx(ToolRuntime, {
|
|
27
|
+
...props,
|
|
28
|
+
queryAdapter: adapter
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function ToolRuntime({
|
|
32
|
+
modules,
|
|
33
|
+
apps,
|
|
34
|
+
requiredEnvVars,
|
|
35
|
+
externalSync,
|
|
36
|
+
headless,
|
|
37
|
+
sentryGetClient,
|
|
38
|
+
queryAdapter
|
|
39
|
+
}) {
|
|
40
|
+
const {
|
|
41
|
+
isPro,
|
|
42
|
+
tier
|
|
43
|
+
} = useLicense();
|
|
44
|
+
const adapters = useMemo(() => {
|
|
45
|
+
const result = {
|
|
46
|
+
app: appSyncAdapter
|
|
47
|
+
};
|
|
48
|
+
for (const [id, module] of Object.entries(modules)) {
|
|
49
|
+
for (const [name, adapter] of Object.entries(module)) {
|
|
50
|
+
if (name.endsWith('SyncAdapter') && adapter && typeof adapter === 'object') result[id] = adapter;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (queryAdapter) result.query = queryAdapter;
|
|
54
|
+
if (modules.env?.createEnvSyncAdapter) result.env = modules.env.createEnvSyncAdapter(requiredEnvVars ?? []);
|
|
55
|
+
for (const app of apps ?? []) if (app.sync) result[`custom:${app.id}`] = app.sync;
|
|
56
|
+
return result;
|
|
57
|
+
}, [modules, apps, requiredEnvVars, queryAdapter]);
|
|
58
|
+
const ref = useRef(adapters);
|
|
59
|
+
ref.current = adapters;
|
|
60
|
+
useEffect(() => registerToolAdapters(() => ref.current), []);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const cleanups = [];
|
|
63
|
+
const start = fn => {
|
|
64
|
+
const stop = fn?.();
|
|
65
|
+
if (typeof stop === 'function') cleanups.push(stop);
|
|
66
|
+
};
|
|
67
|
+
start(modules.network?.startNetworkCapture);
|
|
68
|
+
start(modules.storage?.startBrowserStorageCapture);
|
|
69
|
+
start(modules.assets?.startBrowserAssetCapture);
|
|
70
|
+
if (modules.storage?.storageSyncAdapter?.subscribe) start(() => modules.storage.storageSyncAdapter.subscribe(() => {}));
|
|
71
|
+
if (modules['focus-inspector']?.focusInspectorSyncAdapter?.subscribe) start(() => modules['focus-inspector'].focusInspectorSyncAdapter.subscribe(() => {}));
|
|
72
|
+
return () => {
|
|
73
|
+
for (const stop of cleanups.reverse()) stop();
|
|
74
|
+
};
|
|
75
|
+
}, [modules]);
|
|
76
|
+
const sync = modules['external-sync'];
|
|
77
|
+
const dev = typeof __DEV__ !== 'undefined' ? __DEV__ : process.env.NODE_ENV !== 'production';
|
|
78
|
+
const connect = shouldMountExternalSync({
|
|
79
|
+
isDevelopment: dev,
|
|
80
|
+
isLicensed: isPro,
|
|
81
|
+
externalSync,
|
|
82
|
+
isAvailable: Boolean(sync)
|
|
83
|
+
});
|
|
84
|
+
const SentryRoot = modules.sentry?.SentryRoot;
|
|
85
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
86
|
+
children: [Object.entries(modules).flatMap(([id, module]) => roots.map(name => {
|
|
87
|
+
const Root = module[name];
|
|
88
|
+
return Root ? /*#__PURE__*/_jsx(Root, {}, `${id}:${name}`) : null;
|
|
89
|
+
})), SentryRoot && /*#__PURE__*/_jsx(SentryRoot, {
|
|
90
|
+
getClient: sentryGetClient
|
|
91
|
+
}), Object.entries(modules).flatMap(([id, module]) => overlays.map(name => {
|
|
92
|
+
const Overlay = module[name];
|
|
93
|
+
// Simulation indicators remain visible when a remote driver changes app state.
|
|
94
|
+
return Overlay && (!headless || name === 'ScenariosOverlay' || name === 'ImpersonateOverlay') ? /*#__PURE__*/_jsx(Overlay, {}, `${id}:${name}`) : null;
|
|
95
|
+
})), connect && /*#__PURE__*/_jsx(BrowserExternalSync, {
|
|
96
|
+
module: sync,
|
|
97
|
+
tools: adapters,
|
|
98
|
+
options: externalSyncOptions(externalSync),
|
|
99
|
+
isPro: isPro,
|
|
100
|
+
tier: tier
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function BrowserExternalSync({
|
|
105
|
+
module,
|
|
106
|
+
tools,
|
|
107
|
+
options,
|
|
108
|
+
isPro,
|
|
109
|
+
tier
|
|
110
|
+
}) {
|
|
111
|
+
const identity = useDeviceIdentity(options, {
|
|
112
|
+
appName: typeof document === 'undefined' ? null : document.title || location.hostname,
|
|
113
|
+
hardwareName: 'Browser',
|
|
114
|
+
platform: 'web'
|
|
115
|
+
});
|
|
116
|
+
const {
|
|
117
|
+
socket
|
|
118
|
+
} = module.useExternalSyncSocket({
|
|
119
|
+
deviceName: identity?.deviceName ?? 'Buoy Browser',
|
|
120
|
+
socketURL: options?.socketURL ?? module.getDefaultSocketURL(),
|
|
121
|
+
persistentDeviceId: identity?.deviceId ?? null,
|
|
122
|
+
platform: 'web',
|
|
123
|
+
enableLogs: options?.enableLogs
|
|
124
|
+
});
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (!socket) return;
|
|
127
|
+
const emit = () => {
|
|
128
|
+
if (socket.connected && LicenseManager.hasAccountAccess()) socket.emit('device-license', {
|
|
129
|
+
isPro: isPro ? '1' : '0',
|
|
130
|
+
tier
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
emit();
|
|
134
|
+
socket.on('connect', emit);
|
|
135
|
+
return () => {
|
|
136
|
+
socket.off('connect', emit);
|
|
137
|
+
};
|
|
138
|
+
}, [socket, isPro, tier]);
|
|
139
|
+
module.useExternalSync({
|
|
140
|
+
tools,
|
|
141
|
+
socket,
|
|
142
|
+
deviceId: identity?.deviceId ?? null,
|
|
143
|
+
enableLogs: options?.enableLogs
|
|
144
|
+
});
|
|
145
|
+
return null;
|
|
146
|
+
}
|