react-native-prod-debugger 1.0.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.
- package/LICENSE +21 -0
- package/README.md +350 -0
- package/lib/commonjs/core/DebugBubble.js +139 -0
- package/lib/commonjs/core/DebugBubble.js.map +1 -0
- package/lib/commonjs/core/DebugOverlay.js +184 -0
- package/lib/commonjs/core/DebugOverlay.js.map +1 -0
- package/lib/commonjs/core/DebuggerProvider.js +174 -0
- package/lib/commonjs/core/DebuggerProvider.js.map +1 -0
- package/lib/commonjs/core/GestureDetector.js +83 -0
- package/lib/commonjs/core/GestureDetector.js.map +1 -0
- package/lib/commonjs/core/PluginRegistry.js +124 -0
- package/lib/commonjs/core/PluginRegistry.js.map +1 -0
- package/lib/commonjs/core/theme.js +50 -0
- package/lib/commonjs/core/theme.js.map +1 -0
- package/lib/commonjs/core/types.js +6 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/useDebugger.js +27 -0
- package/lib/commonjs/core/useDebugger.js.map +1 -0
- package/lib/commonjs/core/utils.js +239 -0
- package/lib/commonjs/core/utils.js.map +1 -0
- package/lib/commonjs/index.js +132 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js +103 -0
- package/lib/commonjs/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js +269 -0
- package/lib/commonjs/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js +363 -0
- package/lib/commonjs/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js +218 -0
- package/lib/commonjs/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/customActions/actionStore.js +46 -0
- package/lib/commonjs/plugins/customActions/actionStore.js.map +1 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js +268 -0
- package/lib/commonjs/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js +184 -0
- package/lib/commonjs/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js +381 -0
- package/lib/commonjs/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js +125 -0
- package/lib/commonjs/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js +250 -0
- package/lib/commonjs/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js +65 -0
- package/lib/commonjs/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js +709 -0
- package/lib/commonjs/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js +305 -0
- package/lib/commonjs/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js +261 -0
- package/lib/commonjs/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js +265 -0
- package/lib/commonjs/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js +50 -0
- package/lib/commonjs/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js +378 -0
- package/lib/commonjs/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js +62 -0
- package/lib/commonjs/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js +496 -0
- package/lib/commonjs/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js +44 -0
- package/lib/commonjs/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js +294 -0
- package/lib/commonjs/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js +61 -0
- package/lib/commonjs/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/module/core/DebugBubble.js +131 -0
- package/lib/module/core/DebugBubble.js.map +1 -0
- package/lib/module/core/DebugOverlay.js +176 -0
- package/lib/module/core/DebugOverlay.js.map +1 -0
- package/lib/module/core/DebuggerProvider.js +167 -0
- package/lib/module/core/DebuggerProvider.js.map +1 -0
- package/lib/module/core/GestureDetector.js +75 -0
- package/lib/module/core/GestureDetector.js.map +1 -0
- package/lib/module/core/PluginRegistry.js +116 -0
- package/lib/module/core/PluginRegistry.js.map +1 -0
- package/lib/module/core/theme.js +43 -0
- package/lib/module/core/theme.js.map +1 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/useDebugger.js +21 -0
- package/lib/module/core/useDebugger.js.map +1 -0
- package/lib/module/core/utils.js +219 -0
- package/lib/module/core/utils.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js +97 -0
- package/lib/module/plugins/console/ConsoleInterceptor.js.map +1 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js +262 -0
- package/lib/module/plugins/console/ConsoleViewerPlugin.js.map +1 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js +357 -0
- package/lib/module/plugins/crashReporter/CrashReporterPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js +211 -0
- package/lib/module/plugins/customActions/CustomActionsPlugin.js.map +1 -0
- package/lib/module/plugins/customActions/actionStore.js +38 -0
- package/lib/module/plugins/customActions/actionStore.js.map +1 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js +261 -0
- package/lib/module/plugins/deepLinkTester/DeepLinkTesterPlugin.js.map +1 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js +177 -0
- package/lib/module/plugins/deviceInfo/DeviceInfoPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js +374 -0
- package/lib/module/plugins/featureFlags/FeatureFlagsPlugin.js.map +1 -0
- package/lib/module/plugins/featureFlags/flagStore.js +117 -0
- package/lib/module/plugins/featureFlags/flagStore.js.map +1 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js +243 -0
- package/lib/module/plugins/navigationInspector/NavigationInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js +58 -0
- package/lib/module/plugins/navigationInspector/navigationStore.js.map +1 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js +703 -0
- package/lib/module/plugins/network/NetworkInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/network/NetworkInterceptor.js +299 -0
- package/lib/module/plugins/network/NetworkInterceptor.js.map +1 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js +254 -0
- package/lib/module/plugins/performance/PerformanceMonitorPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js +258 -0
- package/lib/module/plugins/remoteConfig/RemoteConfigPlugin.js.map +1 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js +43 -0
- package/lib/module/plugins/remoteConfig/remoteConfigStore.js.map +1 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js +372 -0
- package/lib/module/plugins/stateInspector/StateInspectorPlugin.js.map +1 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js +54 -0
- package/lib/module/plugins/stateInspector/stateAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js +489 -0
- package/lib/module/plugins/storageBrowser/StorageBrowserPlugin.js.map +1 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js +36 -0
- package/lib/module/plugins/storageBrowser/storageAdapterRegistry.js.map +1 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js +287 -0
- package/lib/module/plugins/timeline/TimelinePlugin.js.map +1 -0
- package/lib/module/plugins/timeline/timelineStore.js +54 -0
- package/lib/module/plugins/timeline/timelineStore.js.map +1 -0
- package/lib/typescript/core/DebugBubble.d.ts +22 -0
- package/lib/typescript/core/DebugBubble.d.ts.map +1 -0
- package/lib/typescript/core/DebugOverlay.d.ts +18 -0
- package/lib/typescript/core/DebugOverlay.d.ts.map +1 -0
- package/lib/typescript/core/DebuggerProvider.d.ts +25 -0
- package/lib/typescript/core/DebuggerProvider.d.ts.map +1 -0
- package/lib/typescript/core/GestureDetector.d.ts +20 -0
- package/lib/typescript/core/GestureDetector.d.ts.map +1 -0
- package/lib/typescript/core/PluginRegistry.d.ts +41 -0
- package/lib/typescript/core/PluginRegistry.d.ts.map +1 -0
- package/lib/typescript/core/theme.d.ts +11 -0
- package/lib/typescript/core/theme.d.ts.map +1 -0
- package/lib/typescript/core/types.d.ts +269 -0
- package/lib/typescript/core/types.d.ts.map +1 -0
- package/lib/typescript/core/useDebugger.d.ts +14 -0
- package/lib/typescript/core/useDebugger.d.ts.map +1 -0
- package/lib/typescript/core/utils.d.ts +46 -0
- package/lib/typescript/core/utils.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +23 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts +32 -0
- package/lib/typescript/plugins/console/ConsoleInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts +3 -0
- package/lib/typescript/plugins/console/ConsoleViewerPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/crashReporter/CrashReporterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/customActions/CustomActionsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts +16 -0
- package/lib/typescript/plugins/customActions/actionStore.d.ts.map +1 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deepLinkTester/DeepLinkTesterPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts +3 -0
- package/lib/typescript/plugins/deviceInfo/DeviceInfoPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts +3 -0
- package/lib/typescript/plugins/featureFlags/FeatureFlagsPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts +45 -0
- package/lib/typescript/plugins/featureFlags/flagStore.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/navigationInspector/NavigationInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts +30 -0
- package/lib/typescript/plugins/navigationInspector/navigationStore.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/network/NetworkInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts +42 -0
- package/lib/typescript/plugins/network/NetworkInterceptor.d.ts.map +1 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/performance/PerformanceMonitorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts +3 -0
- package/lib/typescript/plugins/remoteConfig/RemoteConfigPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts +20 -0
- package/lib/typescript/plugins/remoteConfig/remoteConfigStore.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts +3 -0
- package/lib/typescript/plugins/stateInspector/StateInspectorPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts +34 -0
- package/lib/typescript/plugins/stateInspector/stateAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts +3 -0
- package/lib/typescript/plugins/storageBrowser/StorageBrowserPlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts +16 -0
- package/lib/typescript/plugins/storageBrowser/storageAdapterRegistry.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts +3 -0
- package/lib/typescript/plugins/timeline/TimelinePlugin.d.ts.map +1 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts +24 -0
- package/lib/typescript/plugins/timeline/timelineStore.d.ts.map +1 -0
- package/package.json +131 -0
- package/src/core/DebugBubble.tsx +149 -0
- package/src/core/DebugOverlay.tsx +211 -0
- package/src/core/DebuggerProvider.tsx +211 -0
- package/src/core/GestureDetector.tsx +95 -0
- package/src/core/PluginRegistry.ts +118 -0
- package/src/core/theme.ts +41 -0
- package/src/core/types.ts +339 -0
- package/src/core/useDebugger.ts +24 -0
- package/src/core/utils.ts +221 -0
- package/src/index.ts +67 -0
- package/src/plugins/console/ConsoleInterceptor.ts +110 -0
- package/src/plugins/console/ConsoleViewerPlugin.tsx +241 -0
- package/src/plugins/crashReporter/CrashReporterPlugin.tsx +316 -0
- package/src/plugins/customActions/CustomActionsPlugin.tsx +199 -0
- package/src/plugins/customActions/actionStore.ts +49 -0
- package/src/plugins/deepLinkTester/DeepLinkTesterPlugin.tsx +213 -0
- package/src/plugins/deviceInfo/DeviceInfoPlugin.tsx +153 -0
- package/src/plugins/featureFlags/FeatureFlagsPlugin.tsx +338 -0
- package/src/plugins/featureFlags/flagStore.ts +118 -0
- package/src/plugins/navigationInspector/NavigationInspectorPlugin.tsx +170 -0
- package/src/plugins/navigationInspector/navigationStore.ts +70 -0
- package/src/plugins/network/NetworkInspectorPlugin.tsx +598 -0
- package/src/plugins/network/NetworkInterceptor.ts +344 -0
- package/src/plugins/performance/PerformanceMonitorPlugin.tsx +194 -0
- package/src/plugins/remoteConfig/RemoteConfigPlugin.tsx +205 -0
- package/src/plugins/remoteConfig/remoteConfigStore.ts +48 -0
- package/src/plugins/stateInspector/StateInspectorPlugin.tsx +342 -0
- package/src/plugins/stateInspector/stateAdapterRegistry.ts +66 -0
- package/src/plugins/storageBrowser/StorageBrowserPlugin.tsx +410 -0
- package/src/plugins/storageBrowser/storageAdapterRegistry.ts +47 -0
- package/src/plugins/timeline/TimelinePlugin.tsx +242 -0
- package/src/plugins/timeline/timelineStore.ts +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["darkTheme","exports","background","surface","surfaceAlt","text","textSecondary","textMuted","accent","accentLight","success","warning","error","info","border","overlay","bubbleBackground","bubbleIcon","codeBackground","codeText","headerBackground","tabActive","tabInactive","statusBarOk","statusBarWarn","statusBarError","shadow","createTheme","overrides"],"sourceRoot":"../../../src","sources":["core/theme.ts"],"mappings":";;;;;;;AAEA;AACA;AACA;AACA;AACO,MAAMA,SAAwB,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACtCE,UAAU,EAAE,SAAS;EACrBC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,SAAS;EACfC,aAAa,EAAE,SAAS;EACxBC,SAAS,EAAE,SAAS;EACpBC,MAAM,EAAE,SAAS;EACjBC,WAAW,EAAE,SAAS;EACtBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAE,qBAAqB;EAC9BC,gBAAgB,EAAE,SAAS;EAC3BC,UAAU,EAAE,SAAS;EACrBC,cAAc,EAAE,SAAS;EACzBC,QAAQ,EAAE,SAAS;EACnBC,gBAAgB,EAAE,SAAS;EAC3BC,SAAS,EAAE,SAAS;EACpBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,SAAS;EACxBC,cAAc,EAAE,SAAS;EACzBC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACO,SAASC,WAAWA,CAACC,SAAkC,EAAiB;EAC7E,IAAI,CAACA,SAAS,EAAE,OAAO5B,SAAS;EAChC,OAAO;IAAE,GAAGA,SAAS;IAAE,GAAG4B;EAAU,CAAC;AACvC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["core/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDebugger = useDebugger;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _DebuggerProvider = require("./DebuggerProvider");
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access the debugger context.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { show, hide, toggle, isVisible } = useDebugger();
|
|
15
|
+
*
|
|
16
|
+
* // Programmatically open the debugger
|
|
17
|
+
* show();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function useDebugger() {
|
|
21
|
+
const context = (0, _react.useContext)(_DebuggerProvider.DebuggerContext);
|
|
22
|
+
if (!context) {
|
|
23
|
+
throw new Error('[react-native-prod-debugger] useDebugger must be used within a <DebuggerProvider>.');
|
|
24
|
+
}
|
|
25
|
+
return context;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=useDebugger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_DebuggerProvider","useDebugger","context","useContext","DebuggerContext","Error"],"sourceRoot":"../../../src","sources":["core/useDebugger.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,WAAWA,CAAA,EAAyB;EAClD,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,iCAAe,CAAC;EAC3C,IAAI,CAACF,OAAO,EAAE;IACZ,MAAM,IAAIG,KAAK,CACb,oFACF,CAAC;EACH;EACA,OAAOH,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.copyToClipboard = copyToClipboard;
|
|
7
|
+
exports.debounce = debounce;
|
|
8
|
+
exports.extractGraphQLInfo = extractGraphQLInfo;
|
|
9
|
+
exports.formatBytes = formatBytes;
|
|
10
|
+
exports.formatDuration = formatDuration;
|
|
11
|
+
exports.formatTimeAgo = formatTimeAgo;
|
|
12
|
+
exports.formatTimestamp = formatTimestamp;
|
|
13
|
+
exports.generateId = generateId;
|
|
14
|
+
exports.getLevelColor = getLevelColor;
|
|
15
|
+
exports.getMethodColor = getMethodColor;
|
|
16
|
+
exports.getStatusColor = getStatusColor;
|
|
17
|
+
exports.safeParse = safeParse;
|
|
18
|
+
exports.safeStringify = safeStringify;
|
|
19
|
+
exports.shareText = shareText;
|
|
20
|
+
exports.toCurl = toCurl;
|
|
21
|
+
exports.truncate = truncate;
|
|
22
|
+
var _reactNative = require("react-native");
|
|
23
|
+
/** Generate a unique ID (collision-safe for debugging purposes). */
|
|
24
|
+
function generateId() {
|
|
25
|
+
return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Format bytes into a human-readable string. */
|
|
29
|
+
function formatBytes(bytes) {
|
|
30
|
+
if (bytes === undefined || bytes === null) return '—';
|
|
31
|
+
if (bytes === 0) return '0 B';
|
|
32
|
+
const units = ['B', 'KB', 'MB', 'GB'];
|
|
33
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
34
|
+
const value = bytes / Math.pow(1024, i);
|
|
35
|
+
return `${value.toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Format milliseconds into a readable duration. */
|
|
39
|
+
function formatDuration(ms) {
|
|
40
|
+
if (ms === undefined || ms === null) return '—';
|
|
41
|
+
if (ms < 1) return '<1ms';
|
|
42
|
+
if (ms < 1000) return `${Math.round(ms)}ms`;
|
|
43
|
+
if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;
|
|
44
|
+
return `${(ms / 60_000).toFixed(1)}m`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Format a UNIX timestamp into a local time string (HH:MM:SS.mmm). */
|
|
48
|
+
function formatTimestamp(ts) {
|
|
49
|
+
const d = new Date(ts);
|
|
50
|
+
const h = d.getHours().toString().padStart(2, '0');
|
|
51
|
+
const m = d.getMinutes().toString().padStart(2, '0');
|
|
52
|
+
const s = d.getSeconds().toString().padStart(2, '0');
|
|
53
|
+
const ms = d.getMilliseconds().toString().padStart(3, '0');
|
|
54
|
+
return `${h}:${m}:${s}.${ms}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Format a relative time ago (e.g., "2s ago", "5m ago"). */
|
|
58
|
+
function formatTimeAgo(ts) {
|
|
59
|
+
const diff = Date.now() - ts;
|
|
60
|
+
if (diff < 1000) return 'just now';
|
|
61
|
+
if (diff < 60_000) return `${Math.floor(diff / 1000)}s ago`;
|
|
62
|
+
if (diff < 3_600_000) return `${Math.floor(diff / 60_000)}m ago`;
|
|
63
|
+
if (diff < 86_400_000) return `${Math.floor(diff / 3_600_000)}h ago`;
|
|
64
|
+
return `${Math.floor(diff / 86_400_000)}d ago`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Truncate a string with ellipsis if it exceeds maxLength. */
|
|
68
|
+
function truncate(str, maxLength = 200) {
|
|
69
|
+
if (!str) return '';
|
|
70
|
+
if (str.length <= maxLength) return str;
|
|
71
|
+
return str.slice(0, maxLength) + '…';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Safely serialize any value to a JSON string with pretty printing. */
|
|
75
|
+
function safeStringify(value, indent = 2) {
|
|
76
|
+
try {
|
|
77
|
+
if (value === undefined) return 'undefined';
|
|
78
|
+
if (value === null) return 'null';
|
|
79
|
+
if (typeof value === 'string') return value;
|
|
80
|
+
if (typeof value === 'function') return `[Function: ${value.name || 'anonymous'}]`;
|
|
81
|
+
if (value instanceof Error) {
|
|
82
|
+
return JSON.stringify({
|
|
83
|
+
name: value.name,
|
|
84
|
+
message: value.message,
|
|
85
|
+
stack: value.stack
|
|
86
|
+
}, null, indent);
|
|
87
|
+
}
|
|
88
|
+
return JSON.stringify(value, getCircularReplacer(), indent);
|
|
89
|
+
} catch {
|
|
90
|
+
return String(value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Safely parse a JSON string, returning null on failure. */
|
|
95
|
+
function safeParse(str) {
|
|
96
|
+
try {
|
|
97
|
+
return JSON.parse(str);
|
|
98
|
+
} catch {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Copy text to the device clipboard. */
|
|
104
|
+
async function copyToClipboard(text) {
|
|
105
|
+
try {
|
|
106
|
+
if (_reactNative.Clipboard?.setString) {
|
|
107
|
+
_reactNative.Clipboard.setString(text);
|
|
108
|
+
}
|
|
109
|
+
} catch {
|
|
110
|
+
// Silently fail — clipboard may not be available
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Share text via the native share sheet. */
|
|
115
|
+
async function shareText(text, title) {
|
|
116
|
+
try {
|
|
117
|
+
await _reactNative.Share.share({
|
|
118
|
+
message: text,
|
|
119
|
+
title
|
|
120
|
+
}, _reactNative.Platform.OS === 'ios' ? {
|
|
121
|
+
subject: title
|
|
122
|
+
} : undefined);
|
|
123
|
+
} catch {
|
|
124
|
+
// Silently fail — share may be cancelled
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Get the HTTP status color based on the status code. */
|
|
129
|
+
function getStatusColor(status) {
|
|
130
|
+
if (!status) return '#6B6B80';
|
|
131
|
+
if (status < 300) return '#10B981'; // green
|
|
132
|
+
if (status < 400) return '#F59E0B'; // yellow
|
|
133
|
+
return '#EF4444'; // red
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** Get the HTTP method color. */
|
|
137
|
+
function getMethodColor(method) {
|
|
138
|
+
const colors = {
|
|
139
|
+
GET: '#3B82F6',
|
|
140
|
+
POST: '#10B981',
|
|
141
|
+
PUT: '#F59E0B',
|
|
142
|
+
PATCH: '#A78BFA',
|
|
143
|
+
DELETE: '#EF4444',
|
|
144
|
+
HEAD: '#6B6B80',
|
|
145
|
+
OPTIONS: '#6B6B80'
|
|
146
|
+
};
|
|
147
|
+
return colors[method.toUpperCase()] || '#6B6B80';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Get a console level color. */
|
|
151
|
+
function getLevelColor(level) {
|
|
152
|
+
const colors = {
|
|
153
|
+
log: '#EAEAEA',
|
|
154
|
+
info: '#3B82F6',
|
|
155
|
+
warn: '#F59E0B',
|
|
156
|
+
error: '#EF4444',
|
|
157
|
+
debug: '#A78BFA'
|
|
158
|
+
};
|
|
159
|
+
return colors[level] || '#EAEAEA';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Extract GraphQL operation name and type from request body.
|
|
164
|
+
* Returns `null` if it's not a GraphQL request.
|
|
165
|
+
*/
|
|
166
|
+
function extractGraphQLInfo(body) {
|
|
167
|
+
if (!body) return null;
|
|
168
|
+
try {
|
|
169
|
+
const parsed = JSON.parse(body);
|
|
170
|
+
const query = parsed?.query;
|
|
171
|
+
if (!query) return null;
|
|
172
|
+
|
|
173
|
+
// Extract operation type and name
|
|
174
|
+
const match = query.match(/^\s*(query|mutation|subscription)\s+(\w+)/);
|
|
175
|
+
if (match) {
|
|
176
|
+
return {
|
|
177
|
+
type: match[1],
|
|
178
|
+
operation: match[2]
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Try named operations without explicit type
|
|
183
|
+
const nameMatch = query.match(/^\s*\{\s*(\w+)/);
|
|
184
|
+
if (nameMatch) {
|
|
185
|
+
return {
|
|
186
|
+
type: 'query',
|
|
187
|
+
operation: nameMatch[1]
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
type: 'query',
|
|
192
|
+
operation: parsed.operationName || 'Unknown'
|
|
193
|
+
};
|
|
194
|
+
} catch {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Convert a network request to a cURL command string.
|
|
201
|
+
*/
|
|
202
|
+
function toCurl(request) {
|
|
203
|
+
const parts = [`curl -X ${request.method}`];
|
|
204
|
+
if (request.requestHeaders) {
|
|
205
|
+
for (const [key, value] of Object.entries(request.requestHeaders)) {
|
|
206
|
+
parts.push(`-H '${key}: ${value}'`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (request.requestBody) {
|
|
210
|
+
parts.push(`-d '${request.requestBody.replace(/'/g, "\\'")}'`);
|
|
211
|
+
}
|
|
212
|
+
parts.push(`'${request.url}'`);
|
|
213
|
+
return parts.join(' \\\n ');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** Debounce function calls. */
|
|
217
|
+
function debounce(fn, delay) {
|
|
218
|
+
let timer = null;
|
|
219
|
+
return (...args) => {
|
|
220
|
+
if (timer) clearTimeout(timer);
|
|
221
|
+
timer = setTimeout(() => fn(...args), delay);
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Circular reference replacer for JSON.stringify.
|
|
227
|
+
* Prevents "Converting circular structure to JSON" errors.
|
|
228
|
+
*/
|
|
229
|
+
function getCircularReplacer() {
|
|
230
|
+
const seen = new WeakSet();
|
|
231
|
+
return (_key, value) => {
|
|
232
|
+
if (typeof value === 'object' && value !== null) {
|
|
233
|
+
if (seen.has(value)) return '[Circular]';
|
|
234
|
+
seen.add(value);
|
|
235
|
+
}
|
|
236
|
+
return value;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","generateId","Date","now","Math","random","toString","substring","formatBytes","bytes","undefined","units","i","floor","log","value","pow","toFixed","formatDuration","ms","round","formatTimestamp","ts","d","h","getHours","padStart","m","getMinutes","s","getSeconds","getMilliseconds","formatTimeAgo","diff","truncate","str","maxLength","length","slice","safeStringify","indent","name","Error","JSON","stringify","message","stack","getCircularReplacer","String","safeParse","parse","copyToClipboard","text","Clipboard","setString","shareText","title","Share","share","Platform","OS","subject","getStatusColor","status","getMethodColor","method","colors","GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","toUpperCase","getLevelColor","level","info","warn","error","debug","extractGraphQLInfo","body","parsed","query","match","type","operation","nameMatch","operationName","toCurl","request","parts","requestHeaders","key","Object","entries","push","requestBody","replace","url","join","debounce","fn","delay","timer","args","clearTimeout","setTimeout","seen","WeakSet","_key","has","add"],"sourceRoot":"../../../src","sources":["core/utils.ts"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c,CAAC,EAAE;MACjED,KAAK,CAACK,IAAI,CAAC,OAAOH,GAAG,KAAK/E,KAAK,GAAG,CAAC;IACrC;EACF;EAEA,IAAI4E,OAAO,CAACO,WAAW,EAAE;IACvBN,KAAK,CAACK,IAAI,CAAC,OAAON,OAAO,CAACO,WAAW,CAACC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;EAChE;EAEAP,KAAK,CAACK,IAAI,CAAC,IAAIN,OAAO,CAACS,GAAG,GAAG,CAAC;EAC9B,OAAOR,KAAK,CAACS,IAAI,CAAC,SAAS,CAAC;AAC9B;;AAEA;AACO,SAASC,QAAQA,CACtBC,EAAK,EACLC,KAAa,EACqB;EAClC,IAAIC,KAA2C,GAAG,IAAI;EACtD,OAAO,CAAC,GAAGC,IAAmB,KAAK;IACjC,IAAID,KAAK,EAAEE,YAAY,CAACF,KAAK,CAAC;IAC9BA,KAAK,GAAGG,UAAU,CAAC,MAAML,EAAE,CAAC,GAAGG,IAAI,CAAC,EAAEF,KAAK,CAAC;EAC9C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,SAASzD,mBAAmBA,CAAA,EAAG;EAC7B,MAAM8D,IAAI,GAAG,IAAIC,OAAO,CAAC,CAAC;EAC1B,OAAO,CAACC,IAAY,EAAEhG,KAAc,KAAK;IACvC,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;MAC/C,IAAI8F,IAAI,CAACG,GAAG,CAACjG,KAAK,CAAC,EAAE,OAAO,YAAY;MACxC8F,IAAI,CAACI,GAAG,CAAClG,KAAK,CAAC;IACjB;IACA,OAAOA,KAAK;EACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ConsoleInterceptor", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ConsoleInterceptor.ConsoleInterceptor;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DebuggerProvider", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _DebuggerProvider.DebuggerProvider;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "NetworkInterceptor", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _NetworkInterceptor.NetworkInterceptor;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "PluginRegistry", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _PluginRegistry.PluginRegistry;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "getFlag", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _flagStore.getFlag;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "logTimelineEvent", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _timelineStore.logTimelineEvent;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "registerAction", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _actionStore.registerAction;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "registerFlag", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _flagStore.registerFlag;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "registerPlugin", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _PluginRegistry.registerPlugin;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "removeAction", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _actionStore.removeAction;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "removeStateAdapter", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _stateAdapterRegistry.removeStateAdapter;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "removeStorageAdapter", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _storageAdapterRegistry.removeStorageAdapter;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "resetFlags", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _flagStore.resetFlags;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "setNavigationRef", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _navigationStore.setNavigationRef;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "setRemoteConfigProvider", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _remoteConfigStore.setRemoteConfigProvider;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "setStateAdapter", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _stateAdapterRegistry.setStateAdapter;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "setStorageAdapter", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _storageAdapterRegistry.setStorageAdapter;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "unregisterPlugin", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _PluginRegistry.unregisterPlugin;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "useDebugger", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _useDebugger.useDebugger;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
var _DebuggerProvider = require("./core/DebuggerProvider");
|
|
121
|
+
var _useDebugger = require("./core/useDebugger");
|
|
122
|
+
var _PluginRegistry = require("./core/PluginRegistry");
|
|
123
|
+
var _NetworkInterceptor = require("./plugins/network/NetworkInterceptor");
|
|
124
|
+
var _ConsoleInterceptor = require("./plugins/console/ConsoleInterceptor");
|
|
125
|
+
var _flagStore = require("./plugins/featureFlags/flagStore");
|
|
126
|
+
var _stateAdapterRegistry = require("./plugins/stateInspector/stateAdapterRegistry");
|
|
127
|
+
var _remoteConfigStore = require("./plugins/remoteConfig/remoteConfigStore");
|
|
128
|
+
var _storageAdapterRegistry = require("./plugins/storageBrowser/storageAdapterRegistry");
|
|
129
|
+
var _navigationStore = require("./plugins/navigationInspector/navigationStore");
|
|
130
|
+
var _actionStore = require("./plugins/customActions/actionStore");
|
|
131
|
+
var _timelineStore = require("./plugins/timeline/timelineStore");
|
|
132
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_DebuggerProvider","require","_useDebugger","_PluginRegistry","_NetworkInterceptor","_ConsoleInterceptor","_flagStore","_stateAdapterRegistry","_remoteConfigStore","_storageAdapterRegistry","_navigationStore","_actionStore","_timelineStore"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AA0BA,IAAAG,mBAAA,GAAAH,OAAA;AAGA,IAAAI,mBAAA,GAAAJ,OAAA;AAGA,IAAAK,UAAA,GAAAL,OAAA;AAGA,IAAAM,qBAAA,GAAAN,OAAA;AAIA,IAAAO,kBAAA,GAAAP,OAAA;AAGA,IAAAQ,uBAAA,GAAAR,OAAA;AAMA,IAAAS,gBAAA,GAAAT,OAAA;AAGA,IAAAU,YAAA,GAAAV,OAAA;AAGA,IAAAW,cAAA,GAAAX,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ConsoleInterceptor = void 0;
|
|
7
|
+
var _utils = require("../../core/utils");
|
|
8
|
+
/**
|
|
9
|
+
* ConsoleInterceptor — Captures console.log/warn/error/info/debug calls.
|
|
10
|
+
*
|
|
11
|
+
* Wraps the global console methods and stores entries in a ring buffer.
|
|
12
|
+
* Original console behavior is preserved — messages still appear in the developer console.
|
|
13
|
+
*/
|
|
14
|
+
class ConsoleInterceptorClass {
|
|
15
|
+
entries = [];
|
|
16
|
+
listeners = new Set();
|
|
17
|
+
maxEntries = 1000;
|
|
18
|
+
isActive = false;
|
|
19
|
+
originals = {
|
|
20
|
+
log: console.log,
|
|
21
|
+
info: console.info,
|
|
22
|
+
warn: console.warn,
|
|
23
|
+
error: console.error,
|
|
24
|
+
debug: console.debug
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Start intercepting console calls. */
|
|
28
|
+
start(maxEntries = 1000) {
|
|
29
|
+
if (this.isActive) return;
|
|
30
|
+
this.maxEntries = maxEntries;
|
|
31
|
+
this.isActive = true;
|
|
32
|
+
const levels = ['log', 'info', 'warn', 'error', 'debug'];
|
|
33
|
+
for (const level of levels) {
|
|
34
|
+
this.originals[level] = console[level].bind(console);
|
|
35
|
+
console[level] = (...args) => {
|
|
36
|
+
// Preserve original behavior
|
|
37
|
+
this.originals[level](...args);
|
|
38
|
+
// Capture entry
|
|
39
|
+
this.addEntry(level, args);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Stop intercepting and restore original console. */
|
|
45
|
+
stop() {
|
|
46
|
+
if (!this.isActive) return;
|
|
47
|
+
this.isActive = false;
|
|
48
|
+
const levels = ['log', 'info', 'warn', 'error', 'debug'];
|
|
49
|
+
for (const level of levels) {
|
|
50
|
+
console[level] = this.originals[level];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Subscribe to entry changes. Returns unsubscribe function. */
|
|
55
|
+
subscribe(listener) {
|
|
56
|
+
this.listeners.add(listener);
|
|
57
|
+
listener(this.entries);
|
|
58
|
+
return () => this.listeners.delete(listener);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Get all entries. */
|
|
62
|
+
getAll() {
|
|
63
|
+
return [...this.entries];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Clear all entries. */
|
|
67
|
+
clear() {
|
|
68
|
+
this.entries = [];
|
|
69
|
+
this.notify();
|
|
70
|
+
}
|
|
71
|
+
get active() {
|
|
72
|
+
return this.isActive;
|
|
73
|
+
}
|
|
74
|
+
addEntry(level, args) {
|
|
75
|
+
const message = args.map(arg => {
|
|
76
|
+
if (typeof arg === 'string') return arg;
|
|
77
|
+
return (0, _utils.safeStringify)(arg);
|
|
78
|
+
}).join(' ');
|
|
79
|
+
const entry = {
|
|
80
|
+
id: (0, _utils.generateId)(),
|
|
81
|
+
level,
|
|
82
|
+
timestamp: Date.now(),
|
|
83
|
+
message,
|
|
84
|
+
args
|
|
85
|
+
};
|
|
86
|
+
this.entries = [entry, ...this.entries].slice(0, this.maxEntries);
|
|
87
|
+
this.notify();
|
|
88
|
+
}
|
|
89
|
+
notify() {
|
|
90
|
+
const snapshot = this.entries;
|
|
91
|
+
for (const listener of this.listeners) {
|
|
92
|
+
try {
|
|
93
|
+
listener(snapshot);
|
|
94
|
+
} catch {
|
|
95
|
+
// Silently handle errors
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Singleton console interceptor instance. */
|
|
102
|
+
const ConsoleInterceptor = exports.ConsoleInterceptor = new ConsoleInterceptorClass();
|
|
103
|
+
//# sourceMappingURL=ConsoleInterceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_utils","require","ConsoleInterceptorClass","entries","listeners","Set","maxEntries","isActive","originals","log","console","info","warn","error","debug","start","levels","level","bind","args","addEntry","stop","subscribe","listener","add","delete","getAll","clear","notify","active","message","map","arg","safeStringify","join","entry","id","generateId","timestamp","Date","now","slice","snapshot","ConsoleInterceptor","exports"],"sourceRoot":"../../../../src","sources":["plugins/console/ConsoleInterceptor.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,CAAC;EACpBC,OAAO,GAAmB,EAAE;EAC5BC,SAAS,GAAyB,IAAIC,GAAG,CAAC,CAAC;EAC3CC,UAAU,GAAW,IAAI;EACzBC,QAAQ,GAAY,KAAK;EAEzBC,SAAS,GAAuD;IACtEC,GAAG,EAAEC,OAAO,CAACD,GAAG;IAChBE,IAAI,EAAED,OAAO,CAACC,IAAI;IAClBC,IAAI,EAAEF,OAAO,CAACE,IAAI;IAClBC,KAAK,EAAEH,OAAO,CAACG,KAAK;IACpBC,KAAK,EAAEJ,OAAO,CAACI;EACjB,CAAC;;EAED;EACAC,KAAKA,CAACT,UAAkB,GAAG,IAAI,EAAQ;IACrC,IAAI,IAAI,CAACC,QAAQ,EAAE;IACnB,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,QAAQ,GAAG,IAAI;IAE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