react-native-debug-toolkit 3.3.4 → 3.5.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/README.md +48 -46
- package/README.zh-CN.md +48 -46
- package/android/src/main/java/com/reactnativedebugtoolkit/DebugToolkitDevConnectModule.java +0 -187
- package/bin/debug-toolkit.js +0 -16
- package/ios/DebugToolkitDevConnect.h +0 -12
- package/ios/DebugToolkitDevConnect.mm +0 -321
- package/lib/commonjs/constants/logLevels.js +19 -0
- package/lib/commonjs/constants/logLevels.js.map +1 -0
- package/lib/commonjs/core/initialize.js +36 -18
- package/lib/commonjs/core/initialize.js.map +1 -1
- package/lib/commonjs/features/console/ConsoleLogTab.js +4 -15
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/commonjs/features/console/index.js +15 -8
- package/lib/commonjs/features/console/index.js.map +1 -1
- package/lib/commonjs/features/devConnect/DevConnectTab.js +18 -470
- package/lib/commonjs/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectPreferences.js +0 -12
- package/lib/commonjs/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/commonjs/features/devConnect/devConnectUtils.js +2 -57
- package/lib/commonjs/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/commonjs/features/devConnect/index.js +1 -23
- package/lib/commonjs/features/devConnect/index.js.map +1 -1
- package/lib/commonjs/features/devConnect/nativeDevConnect.js +1 -103
- package/lib/commonjs/features/devConnect/nativeDevConnect.js.map +1 -1
- package/lib/commonjs/features/network/NetworkLogTab.js +91 -93
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -1
- package/lib/commonjs/features/network/index.js +7 -4
- package/lib/commonjs/features/network/index.js.map +1 -1
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js +1044 -0
- package/lib/commonjs/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/commonjs/features/sessionHistory/index.js +103 -0
- package/lib/commonjs/features/sessionHistory/index.js.map +1 -0
- package/lib/commonjs/features/track/index.js +4 -3
- package/lib/commonjs/features/track/index.js.map +1 -1
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/DebugView.js +3 -0
- package/lib/commonjs/ui/DebugView.js.map +1 -1
- package/lib/commonjs/ui/panel/DebugPanel.js +67 -34
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -1
- package/lib/commonjs/ui/panel/FeatureIntroCard.js +131 -0
- package/lib/commonjs/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/commonjs/ui/panel/FeatureRail.js +163 -0
- package/lib/commonjs/ui/panel/FeatureRail.js.map +1 -0
- package/lib/commonjs/ui/panel/FloatPanelView.js +169 -32
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/commonjs/ui/panel/buildFeatureSummary.js +207 -0
- package/lib/commonjs/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js +43 -0
- package/lib/commonjs/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/commonjs/ui/panel/tabPersistence.js +17 -0
- package/lib/commonjs/ui/panel/tabPersistence.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +6 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -1
- package/lib/commonjs/utils/DaemonClient.js +30 -8
- package/lib/commonjs/utils/DaemonClient.js.map +1 -1
- package/lib/commonjs/utils/SessionManager.js +132 -0
- package/lib/commonjs/utils/SessionManager.js.map +1 -0
- package/lib/commonjs/utils/StorageAdapter.js +104 -0
- package/lib/commonjs/utils/StorageAdapter.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +22 -5
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- package/lib/commonjs/utils/createDebugTab.js +21 -0
- package/lib/commonjs/utils/createDebugTab.js.map +1 -0
- package/lib/commonjs/utils/createPersistedObservableStore.js +14 -8
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/commonjs/utils/debugPreferences.js +28 -6
- package/lib/commonjs/utils/debugPreferences.js.map +1 -1
- package/lib/commonjs/utils/deviceReport.js +5 -1
- package/lib/commonjs/utils/deviceReport.js.map +1 -1
- package/lib/commonjs/utils/logRuntime.js +32 -0
- package/lib/commonjs/utils/logRuntime.js.map +1 -0
- package/lib/module/constants/logLevels.js +15 -0
- package/lib/module/constants/logLevels.js.map +1 -0
- package/lib/module/core/initialize.js +36 -18
- package/lib/module/core/initialize.js.map +1 -1
- package/lib/module/features/console/ConsoleLogTab.js +1 -12
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -1
- package/lib/module/features/console/index.js +15 -8
- package/lib/module/features/console/index.js.map +1 -1
- package/lib/module/features/devConnect/DevConnectTab.js +21 -473
- package/lib/module/features/devConnect/DevConnectTab.js.map +1 -1
- package/lib/module/features/devConnect/devConnectPreferences.js +1 -12
- package/lib/module/features/devConnect/devConnectPreferences.js.map +1 -1
- package/lib/module/features/devConnect/devConnectUtils.js +1 -53
- package/lib/module/features/devConnect/devConnectUtils.js.map +1 -1
- package/lib/module/features/devConnect/index.js +5 -9
- package/lib/module/features/devConnect/index.js.map +1 -1
- package/lib/module/features/devConnect/nativeDevConnect.js +1 -100
- package/lib/module/features/devConnect/nativeDevConnect.js.map +1 -1
- package/lib/module/features/network/NetworkLogTab.js +91 -93
- package/lib/module/features/network/NetworkLogTab.js.map +1 -1
- package/lib/module/features/network/index.js +7 -4
- package/lib/module/features/network/index.js.map +1 -1
- package/lib/module/features/sessionHistory/SessionHistoryTab.js +1039 -0
- package/lib/module/features/sessionHistory/SessionHistoryTab.js.map +1 -0
- package/lib/module/features/sessionHistory/index.js +99 -0
- package/lib/module/features/sessionHistory/index.js.map +1 -0
- package/lib/module/features/track/index.js +4 -3
- package/lib/module/features/track/index.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/DebugView.js +3 -0
- package/lib/module/ui/DebugView.js.map +1 -1
- package/lib/module/ui/panel/DebugPanel.js +67 -34
- package/lib/module/ui/panel/DebugPanel.js.map +1 -1
- package/lib/module/ui/panel/FeatureIntroCard.js +126 -0
- package/lib/module/ui/panel/FeatureIntroCard.js.map +1 -0
- package/lib/module/ui/panel/FeatureRail.js +158 -0
- package/lib/module/ui/panel/FeatureRail.js.map +1 -0
- package/lib/module/ui/panel/FloatPanelView.js +170 -33
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -1
- package/lib/module/ui/panel/buildFeatureSummary.js +203 -0
- package/lib/module/ui/panel/buildFeatureSummary.js.map +1 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js +39 -0
- package/lib/module/ui/panel/filterFeatureSnapshot.js.map +1 -0
- package/lib/module/ui/panel/tabPersistence.js +13 -0
- package/lib/module/ui/panel/tabPersistence.js.map +1 -0
- package/lib/module/ui/theme/colors.js +6 -0
- package/lib/module/ui/theme/colors.js.map +1 -1
- package/lib/module/utils/DaemonClient.js +30 -8
- package/lib/module/utils/DaemonClient.js.map +1 -1
- package/lib/module/utils/SessionManager.js +127 -0
- package/lib/module/utils/SessionManager.js.map +1 -0
- package/lib/module/utils/StorageAdapter.js +96 -0
- package/lib/module/utils/StorageAdapter.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +22 -5
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- package/lib/module/utils/createDebugTab.js +17 -0
- package/lib/module/utils/createDebugTab.js.map +1 -0
- package/lib/module/utils/createPersistedObservableStore.js +14 -8
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -1
- package/lib/module/utils/debugPreferences.js +27 -6
- package/lib/module/utils/debugPreferences.js.map +1 -1
- package/lib/module/utils/deviceReport.js +4 -1
- package/lib/module/utils/deviceReport.js.map +1 -1
- package/lib/module/utils/logRuntime.js +26 -0
- package/lib/module/utils/logRuntime.js.map +1 -0
- package/lib/typescript/src/constants/logLevels.d.ts +3 -0
- package/lib/typescript/src/constants/logLevels.d.ts.map +1 -0
- package/lib/typescript/src/core/initialize.d.ts +6 -0
- package/lib/typescript/src/core/initialize.d.ts.map +1 -1
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/console/index.d.ts +2 -1
- package/lib/typescript/src/features/console/index.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/DevConnectTab.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts +0 -2
- package/lib/typescript/src/features/devConnect/devConnectPreferences.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts +0 -20
- package/lib/typescript/src/features/devConnect/devConnectUtils.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/index.d.ts +2 -2
- package/lib/typescript/src/features/devConnect/index.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts +0 -25
- package/lib/typescript/src/features/devConnect/nativeDevConnect.d.ts.map +1 -1
- package/lib/typescript/src/features/devConnect/types.d.ts +1 -3
- package/lib/typescript/src/features/devConnect/types.d.ts.map +1 -1
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -1
- package/lib/typescript/src/features/network/index.d.ts +2 -1
- package/lib/typescript/src/features/network/index.d.ts.map +1 -1
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts +20 -0
- package/lib/typescript/src/features/sessionHistory/SessionHistoryTab.d.ts.map +1 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts +4 -0
- package/lib/typescript/src/features/sessionHistory/index.d.ts.map +1 -0
- package/lib/typescript/src/features/track/index.d.ts +2 -1
- package/lib/typescript/src/features/track/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/feature.d.ts +1 -1
- package/lib/typescript/src/types/feature.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +2 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts +4 -2
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts +3 -1
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts +11 -0
- package/lib/typescript/src/ui/panel/FeatureIntroCard.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts +16 -0
- package/lib/typescript/src/ui/panel/FeatureRail.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -1
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts +13 -0
- package/lib/typescript/src/ui/panel/buildFeatureSummary.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts +3 -0
- package/lib/typescript/src/ui/panel/filterFeatureSnapshot.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/tabPersistence.d.ts +3 -0
- package/lib/typescript/src/ui/panel/tabPersistence.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts +5 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts +7 -1
- package/lib/typescript/src/utils/DaemonClient.d.ts.map +1 -1
- package/lib/typescript/src/utils/SessionManager.d.ts +30 -0
- package/lib/typescript/src/utils/SessionManager.d.ts.map +1 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts +38 -0
- package/lib/typescript/src/utils/StorageAdapter.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +2 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- package/lib/typescript/src/utils/createDebugTab.d.ts +18 -0
- package/lib/typescript/src/utils/createDebugTab.d.ts.map +1 -0
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +4 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/debugPreferences.d.ts +1 -4
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -1
- package/lib/typescript/src/utils/deviceReport.d.ts +1 -0
- package/lib/typescript/src/utils/deviceReport.d.ts.map +1 -1
- package/lib/typescript/src/utils/logRuntime.d.ts +13 -0
- package/lib/typescript/src/utils/logRuntime.d.ts.map +1 -0
- package/package.json +10 -6
- package/src/constants/logLevels.ts +13 -0
- package/src/core/initialize.ts +61 -21
- package/src/features/console/ConsoleLogTab.tsx +1 -14
- package/src/features/console/index.ts +18 -8
- package/src/features/devConnect/DevConnectTab.tsx +17 -381
- package/src/features/devConnect/devConnectPreferences.ts +0 -15
- package/src/features/devConnect/devConnectUtils.ts +1 -81
- package/src/features/devConnect/index.ts +2 -9
- package/src/features/devConnect/nativeDevConnect.ts +1 -136
- package/src/features/devConnect/types.ts +1 -3
- package/src/features/network/NetworkLogTab.tsx +61 -71
- package/src/features/network/index.ts +12 -3
- package/src/features/sessionHistory/SessionHistoryTab.tsx +691 -0
- package/src/features/sessionHistory/index.ts +102 -0
- package/src/features/track/index.ts +10 -3
- package/src/index.ts +13 -0
- package/src/types/feature.ts +2 -1
- package/src/types/index.ts +10 -0
- package/src/ui/DebugView.tsx +6 -1
- package/src/ui/panel/DebugPanel.tsx +60 -30
- package/src/ui/panel/FeatureIntroCard.tsx +127 -0
- package/src/ui/panel/FeatureRail.tsx +165 -0
- package/src/ui/panel/FloatPanelView.tsx +176 -25
- package/src/ui/panel/buildFeatureSummary.ts +288 -0
- package/src/ui/panel/filterFeatureSnapshot.ts +51 -0
- package/src/ui/panel/tabPersistence.ts +22 -0
- package/src/ui/theme/colors.ts +7 -0
- package/src/utils/DaemonClient.ts +33 -5
- package/src/utils/SessionManager.ts +174 -0
- package/src/utils/StorageAdapter.ts +135 -0
- package/src/utils/createChannelFeature.ts +28 -6
- package/src/utils/createDebugTab.ts +32 -0
- package/src/utils/createPersistedObservableStore.ts +18 -10
- package/src/utils/debugPreferences.ts +38 -8
- package/src/utils/deviceReport.ts +5 -1
- package/src/utils/logRuntime.ts +39 -0
- package/app.plugin.js +0 -51
- package/dev-client.js +0 -3
- package/lib/commonjs/ui/panel/FeatureTabBar.js +0 -182
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/module/ui/panel/FeatureTabBar.js +0 -177
- package/lib/module/ui/panel/FeatureTabBar.js.map +0 -1
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts +0 -13
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +0 -1
- package/scripts/bundle/android.js +0 -101
- package/scripts/bundle/cli.js +0 -57
- package/scripts/bundle/doctor.js +0 -38
- package/scripts/bundle/ios.js +0 -179
- package/scripts/bundle/setup.js +0 -39
- package/scripts/debug-bundle.gradle +0 -147
- package/src/ui/panel/FeatureTabBar.tsx +0 -204
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPersistedObservableStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/createPersistedObservableStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"createPersistedObservableStore.d.ts","sourceRoot":"","sources":["../../../../src/utils/createPersistedObservableStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACrE,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EACtE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAChC,wBAAwB,CAAC,CAAC,CAAC,CA4E7B"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export declare function setPreference(key: string, value: string): Promise<void>;
|
|
2
2
|
export declare function getPreference(key: string): Promise<string | null>;
|
|
3
|
+
export declare function removePreference(key: string): Promise<void>;
|
|
3
4
|
export declare const KEYS: {
|
|
4
5
|
readonly fabPosition: "@react_native_debug_toolkit/fab_position";
|
|
5
6
|
readonly lastTab: "@react_native_debug_toolkit/last_tab";
|
|
6
|
-
readonly consoleLogs: "@react_native_debug_toolkit/console_logs";
|
|
7
|
-
readonly networkLogs: "@react_native_debug_toolkit/network_logs";
|
|
8
|
-
readonly trackLogs: "@react_native_debug_toolkit/track_logs";
|
|
9
7
|
readonly computerHost: "@react_native_debug_toolkit/computer_host";
|
|
10
|
-
readonly metroPort: "@react_native_debug_toolkit/metro_port";
|
|
11
8
|
readonly daemonPort: "@react_native_debug_toolkit/daemon_port";
|
|
12
9
|
};
|
|
13
10
|
//# sourceMappingURL=debugPreferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugPreferences.d.ts","sourceRoot":"","sources":["../../../../src/utils/debugPreferences.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debugPreferences.d.ts","sourceRoot":"","sources":["../../../../src/utils/debugPreferences.ts"],"names":[],"mappings":"AA0CA,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB7E;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BvE;AAED,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBjE;AAED,eAAO,MAAM,IAAI;;;;;CAKP,CAAC"}
|
|
@@ -20,6 +20,7 @@ export interface DebugDeviceReport {
|
|
|
20
20
|
session?: SessionInfo;
|
|
21
21
|
logs: Record<string, unknown[] | undefined>;
|
|
22
22
|
}
|
|
23
|
+
export declare function sanitizeDebugLogEntry(value: unknown, maxBodyBytes?: number): unknown;
|
|
23
24
|
export declare function createDebugDeviceReport(options?: DebugDeviceReportOptions & {
|
|
24
25
|
featureProvider?: FeatureDataProvider;
|
|
25
26
|
session?: SessionInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceReport.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;CAC7C;AAuID,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAAwB,GAAG;IAAE,eAAe,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,GACxG,iBAAiB,CAyCnB"}
|
|
1
|
+
{"version":3,"file":"deviceReport.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceReport.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAOpD,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,SAAyB,GAAG,OAAO,CAEpG;AAuID,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAAwB,GAAG;IAAE,eAAe,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAA;CAAO,GACxG,iBAAiB,CAyCnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SessionManager, type SessionManagerOptions } from './SessionManager';
|
|
2
|
+
import { type StorageAdapter } from './StorageAdapter';
|
|
3
|
+
export interface LogRuntimeContext {
|
|
4
|
+
logStorage: StorageAdapter;
|
|
5
|
+
sessionManager: SessionManager;
|
|
6
|
+
}
|
|
7
|
+
export interface LogRuntimeOptions extends SessionManagerOptions {
|
|
8
|
+
logStorage?: StorageAdapter;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLogRuntime(options?: LogRuntimeOptions): LogRuntimeContext;
|
|
11
|
+
export declare function setDefaultLogRuntime(runtime: LogRuntimeContext | null): void;
|
|
12
|
+
export declare function getDefaultLogRuntime(): LogRuntimeContext;
|
|
13
|
+
//# sourceMappingURL=logRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logRuntime.d.ts","sourceRoot":"","sources":["../../../../src/utils/logRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,cAAc,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAID,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,iBAAiB,CASnF;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAE5E;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAMxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-debug-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "A local-first React Native debug toolkit with Web Console, HTTP API, and MCP support for AI-readable app logs",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"lib",
|
|
11
11
|
"bin",
|
|
12
12
|
"node",
|
|
13
|
-
"scripts",
|
|
14
|
-
"app.plugin.js",
|
|
15
|
-
"dev-client.js",
|
|
16
13
|
"ios",
|
|
17
14
|
"android",
|
|
18
15
|
"react-native-debug-toolkit.podspec",
|
|
@@ -57,12 +54,20 @@
|
|
|
57
54
|
},
|
|
58
55
|
"peerDependencies": {
|
|
59
56
|
"@react-native-clipboard/clipboard": ">=1.0.0",
|
|
57
|
+
"@react-native-async-storage/async-storage": ">=1.0.0",
|
|
58
|
+
"react-native-mmkv": ">=2.0.0",
|
|
60
59
|
"react": ">=18.0.0",
|
|
61
60
|
"react-native": ">=0.72.0"
|
|
62
61
|
},
|
|
63
62
|
"peerDependenciesMeta": {
|
|
63
|
+
"@react-native-async-storage/async-storage": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
64
66
|
"@react-native-clipboard/clipboard": {
|
|
65
67
|
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"react-native-mmkv": {
|
|
70
|
+
"optional": true
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
"devDependencies": {
|
|
@@ -96,7 +101,6 @@
|
|
|
96
101
|
]
|
|
97
102
|
},
|
|
98
103
|
"dependencies": {
|
|
99
|
-
"@babel/runtime": "^7.29.2"
|
|
100
|
-
"xcode": "^3.0.1"
|
|
104
|
+
"@babel/runtime": "^7.29.2"
|
|
101
105
|
}
|
|
102
106
|
}
|
package/src/core/initialize.ts
CHANGED
|
@@ -12,8 +12,15 @@ import type { TrackFeatureConfig } from '../features/track';
|
|
|
12
12
|
import { createEnvironmentFeature } from '../features/environment';
|
|
13
13
|
import { createClipboardFeature } from '../features/clipboard';
|
|
14
14
|
import { createDevConnectFeature, restoreDevConnectSettingsToDaemon, nativeIsDebugBuild } from '../features/devConnect';
|
|
15
|
+
import { createSessionHistoryFeature } from '../features/sessionHistory';
|
|
15
16
|
import { daemonClient } from '../utils/DaemonClient';
|
|
16
17
|
import type { AnyDebugFeature, BuiltInFeatureName } from '../types';
|
|
18
|
+
import type { StorageAdapter } from '../utils/StorageAdapter';
|
|
19
|
+
import {
|
|
20
|
+
createLogRuntime,
|
|
21
|
+
setDefaultLogRuntime,
|
|
22
|
+
type LogRuntimeContext,
|
|
23
|
+
} from '../utils/logRuntime';
|
|
17
24
|
|
|
18
25
|
const isDebugMode = __DEV__;
|
|
19
26
|
|
|
@@ -27,25 +34,31 @@ export interface FeatureConfigs {
|
|
|
27
34
|
environment?: Parameters<typeof createEnvironmentFeature>[0];
|
|
28
35
|
clipboard?: boolean;
|
|
29
36
|
devConnect?: boolean;
|
|
37
|
+
sessionHistory?: boolean;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
export interface InitializeOptions {
|
|
33
41
|
features?: FeatureConfigs;
|
|
42
|
+
customFeatures?: AnyDebugFeature[];
|
|
34
43
|
enabled?: boolean;
|
|
44
|
+
logStorage?: StorageAdapter;
|
|
45
|
+
maxLogSessions?: number;
|
|
35
46
|
}
|
|
36
47
|
|
|
48
|
+
type EnvironmentFeatureConfig = Parameters<typeof createEnvironmentFeature>[0];
|
|
49
|
+
type BuiltInFeatureCreator = (config?: unknown, runtime?: LogRuntimeContext) => AnyDebugFeature;
|
|
50
|
+
|
|
37
51
|
/** Registry mapping feature names to creator functions */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
devConnect: createDevConnectFeature,
|
|
52
|
+
const featureRegistry: Record<BuiltInFeatureName, BuiltInFeatureCreator> = {
|
|
53
|
+
network: (config, runtime) => createNetworkFeature(config as NetworkFeatureConfig | undefined, runtime),
|
|
54
|
+
console: (config, runtime) => createConsoleLogFeature(config as ConsoleFeatureConfig | undefined, runtime),
|
|
55
|
+
zustand: (config) => createZustandLogFeature(config as ZustandFeatureConfig | undefined),
|
|
56
|
+
navigation: (config) => createNavigationLogFeature(config as NavigationFeatureConfig | undefined),
|
|
57
|
+
track: (config, runtime) => createTrackFeature(config as TrackFeatureConfig | undefined, runtime),
|
|
58
|
+
environment: (config) => createEnvironmentFeature(config as EnvironmentFeatureConfig | undefined),
|
|
59
|
+
clipboard: () => createClipboardFeature(),
|
|
60
|
+
devConnect: () => createDevConnectFeature(),
|
|
61
|
+
sessionHistory: (_config, runtime) => createSessionHistoryFeature(runtime),
|
|
49
62
|
};
|
|
50
63
|
|
|
51
64
|
const DEFAULT_FEATURES: BuiltInFeatureName[] = [
|
|
@@ -56,14 +69,17 @@ const DEFAULT_FEATURES: BuiltInFeatureName[] = [
|
|
|
56
69
|
'track',
|
|
57
70
|
'clipboard',
|
|
58
71
|
'devConnect',
|
|
72
|
+
'sessionHistory',
|
|
59
73
|
];
|
|
60
74
|
|
|
61
|
-
function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
|
|
75
|
+
function resolveFeatureConfigs(configs: FeatureConfigs, runtime: LogRuntimeContext): AnyDebugFeature[] {
|
|
62
76
|
const features: AnyDebugFeature[] = [];
|
|
63
77
|
const entries = Object.entries(configs) as [BuiltInFeatureName, unknown][];
|
|
64
78
|
|
|
65
79
|
for (const [name, config] of entries) {
|
|
66
|
-
if (config === false)
|
|
80
|
+
if (config === false) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
67
83
|
|
|
68
84
|
const creator = featureRegistry[name];
|
|
69
85
|
if (!creator) {
|
|
@@ -72,17 +88,28 @@ function resolveFeatureConfigs(configs: FeatureConfigs): AnyDebugFeature[] {
|
|
|
72
88
|
}
|
|
73
89
|
|
|
74
90
|
if (config === true || config === undefined) {
|
|
75
|
-
features.push(creator());
|
|
91
|
+
features.push(creator(undefined, runtime));
|
|
76
92
|
} else if (typeof config === 'object') {
|
|
77
|
-
features.push(creator(config as Record<string, unknown
|
|
93
|
+
features.push(creator(config as Record<string, unknown>, runtime));
|
|
78
94
|
}
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
return features;
|
|
82
98
|
}
|
|
83
99
|
|
|
84
|
-
function resolveDefaultFeatures(): AnyDebugFeature[] {
|
|
85
|
-
return DEFAULT_FEATURES.map((name) => featureRegistry[name]!());
|
|
100
|
+
function resolveDefaultFeatures(runtime: LogRuntimeContext): AnyDebugFeature[] {
|
|
101
|
+
return DEFAULT_FEATURES.map((name) => featureRegistry[name]!(undefined, runtime));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function appendCustomFeatures(
|
|
105
|
+
builtInFeatures: AnyDebugFeature[],
|
|
106
|
+
customFeatures?: AnyDebugFeature[],
|
|
107
|
+
): AnyDebugFeature[] {
|
|
108
|
+
if (!customFeatures || customFeatures.length === 0) {
|
|
109
|
+
return builtInFeatures;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return [...builtInFeatures, ...customFeatures];
|
|
86
113
|
}
|
|
87
114
|
|
|
88
115
|
/**
|
|
@@ -111,19 +138,32 @@ export async function initializeDebugToolkit(
|
|
|
111
138
|
}
|
|
112
139
|
}
|
|
113
140
|
|
|
114
|
-
const resolvedFeatures = options?.features
|
|
115
|
-
? resolveFeatureConfigs(options.features)
|
|
116
|
-
: resolveDefaultFeatures();
|
|
117
|
-
|
|
118
141
|
try {
|
|
119
142
|
DebugToolkit.setEnabled(enabled);
|
|
120
143
|
|
|
121
144
|
if (!enabled) {
|
|
145
|
+
daemonClient.clearSessionProvider();
|
|
122
146
|
DebugToolkit.reset();
|
|
123
147
|
return DebugToolkit;
|
|
124
148
|
}
|
|
125
149
|
|
|
150
|
+
const runtime = createLogRuntime({
|
|
151
|
+
logStorage: options?.logStorage,
|
|
152
|
+
maxSessions: options?.maxLogSessions,
|
|
153
|
+
});
|
|
154
|
+
setDefaultLogRuntime(runtime);
|
|
155
|
+
daemonClient.setSessionProvider(() => runtime.sessionManager.getCurrentSession());
|
|
156
|
+
|
|
157
|
+
const resolvedBuiltInFeatures = options?.features
|
|
158
|
+
? resolveFeatureConfigs(options.features, runtime)
|
|
159
|
+
: resolveDefaultFeatures(runtime);
|
|
160
|
+
const resolvedFeatures = appendCustomFeatures(
|
|
161
|
+
resolvedBuiltInFeatures,
|
|
162
|
+
options?.customFeatures,
|
|
163
|
+
);
|
|
164
|
+
|
|
126
165
|
DebugToolkit.replaceFeatures(resolvedFeatures);
|
|
166
|
+
runtime.sessionManager.initialize().catch(() => {});
|
|
127
167
|
|
|
128
168
|
daemonClient.setEndpointDetector((url) => {
|
|
129
169
|
addToBlacklist(url);
|
|
@@ -7,22 +7,9 @@ import { JsonView } from '../../ui/shared/JsonView';
|
|
|
7
7
|
import { CopyButton } from '../../ui/shared/CopyButton';
|
|
8
8
|
import { LogListScreen } from '../../ui/shared/LogListScreen';
|
|
9
9
|
import { fmt } from '../../utils/copyToComputer';
|
|
10
|
+
import { LEVEL_COLORS, LEVEL_ICONS } from '../../constants/logLevels';
|
|
10
11
|
import type { ConsoleLogEntry, DebugFeatureRenderProps } from '../../types';
|
|
11
12
|
|
|
12
|
-
const LEVEL_COLORS: Record<string, string> = {
|
|
13
|
-
log: '#8E8E93',
|
|
14
|
-
info: '#007AFF',
|
|
15
|
-
warn: '#FF9500',
|
|
16
|
-
error: '#FF3B30',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const LEVEL_ICONS: Record<string, string> = {
|
|
20
|
-
log: '●',
|
|
21
|
-
info: 'ℹ',
|
|
22
|
-
warn: '⚠',
|
|
23
|
-
error: '✕',
|
|
24
|
-
};
|
|
25
|
-
|
|
26
13
|
export const ConsoleLogTab: React.FC<DebugFeatureRenderProps<ConsoleLogEntry[]>> = React.memo(({ snapshot }) => (
|
|
27
14
|
<LogListScreen
|
|
28
15
|
data={snapshot}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConsoleLogTab } from './ConsoleLogTab';
|
|
2
2
|
import type { ConsoleLogEntry, DebugFeature } from '../../types';
|
|
3
3
|
import { createPersistedObservableStore } from '../../utils/createPersistedObservableStore';
|
|
4
|
-
import {
|
|
4
|
+
import { getDefaultLogRuntime, type LogRuntimeContext } from '../../utils/logRuntime';
|
|
5
5
|
|
|
6
6
|
const LEVELS: ConsoleLogEntry['level'][] = ['log', 'info', 'warn', 'error'];
|
|
7
7
|
|
|
@@ -13,7 +13,9 @@ const consoleCapture = (() => {
|
|
|
13
13
|
|
|
14
14
|
function stop(): void {
|
|
15
15
|
refCount = Math.max(0, refCount - 1);
|
|
16
|
-
if (refCount > 0)
|
|
16
|
+
if (refCount > 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
17
19
|
|
|
18
20
|
LEVELS.forEach((level) => {
|
|
19
21
|
const original = originalMethods[level];
|
|
@@ -78,10 +80,14 @@ export interface ConsoleFeatureConfig {
|
|
|
78
80
|
maxLogs?: number;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
export const createConsoleLogFeature = (
|
|
83
|
+
export const createConsoleLogFeature = (
|
|
84
|
+
config?: ConsoleFeatureConfig,
|
|
85
|
+
runtime: LogRuntimeContext = getDefaultLogRuntime(),
|
|
86
|
+
): DebugFeature<ConsoleLogEntry[]> => {
|
|
82
87
|
const maxLogs = config?.maxLogs ?? DEFAULT_MAX_LOGS;
|
|
83
88
|
const logStore = createPersistedObservableStore<ConsoleLogEntry>({
|
|
84
|
-
|
|
89
|
+
storage: runtime.logStorage,
|
|
90
|
+
storageKey: runtime.sessionManager.getLogStorageKey('console_logs'),
|
|
85
91
|
maxPersist: 50,
|
|
86
92
|
});
|
|
87
93
|
let initialized = false;
|
|
@@ -92,7 +98,9 @@ export const createConsoleLogFeature = (config?: ConsoleFeatureConfig): DebugFea
|
|
|
92
98
|
label: 'Console',
|
|
93
99
|
renderContent: ConsoleLogTab,
|
|
94
100
|
setup: () => {
|
|
95
|
-
if (initialized)
|
|
101
|
+
if (initialized) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
96
104
|
|
|
97
105
|
stopCapture = consoleCapture.start((entry) => {
|
|
98
106
|
logStore.push({ ...entry, id: logStore.nextId() }, maxLogs);
|
|
@@ -100,13 +108,15 @@ export const createConsoleLogFeature = (config?: ConsoleFeatureConfig): DebugFea
|
|
|
100
108
|
initialized = true;
|
|
101
109
|
},
|
|
102
110
|
getSnapshot: () => logStore.getData(),
|
|
103
|
-
clear: () => { logStore.
|
|
111
|
+
clear: () => { logStore.clearPersisted(); },
|
|
104
112
|
cleanup: () => {
|
|
105
|
-
if (!initialized)
|
|
113
|
+
if (!initialized) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
106
116
|
|
|
107
117
|
stopCapture?.();
|
|
108
118
|
stopCapture = null;
|
|
109
|
-
logStore.
|
|
119
|
+
logStore.dispose();
|
|
110
120
|
initialized = false;
|
|
111
121
|
},
|
|
112
122
|
subscribe: (listener) => logStore.subscribe(listener),
|