react-native-debug-toolkit 2.1.0 → 2.2.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 +54 -92
- package/README.zh-CN.md +50 -88
- package/lib/commonjs/core/DebugToolkit.js +33 -11
- package/lib/commonjs/core/DebugToolkit.js.map +1 -1
- package/lib/commonjs/core/DebugToolkitProvider.js +18 -12
- package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -1
- package/lib/commonjs/{initialize.js → core/initialize.js} +17 -17
- package/lib/commonjs/core/initialize.js.map +1 -0
- package/lib/commonjs/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/commonjs/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/commonjs/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/commonjs/features/clipboard/index.js.map +1 -0
- package/lib/commonjs/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/commonjs/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/commonjs/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/commonjs/features/console/index.js.map +1 -0
- package/lib/commonjs/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/commonjs/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/commonjs/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- package/lib/commonjs/features/environment/index.js.map +1 -0
- package/lib/commonjs/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/commonjs/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/commonjs/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
- package/lib/commonjs/features/navigation/index.js.map +1 -0
- package/lib/commonjs/{hooks → features/navigation}/useNavigationLogger.js +3 -3
- package/lib/commonjs/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/commonjs/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/commonjs/features/network/NetworkLogTab.js.map +1 -0
- package/lib/commonjs/features/{NetworkFeature.js → network/index.js} +20 -31
- package/lib/commonjs/features/network/index.js.map +1 -0
- package/lib/commonjs/features/network/networkInterceptor.js +261 -0
- package/lib/commonjs/features/network/networkInterceptor.js.map +1 -0
- package/lib/commonjs/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- package/lib/commonjs/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/commonjs/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +8 -8
- package/lib/commonjs/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/commonjs/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/commonjs/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/commonjs/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/commonjs/features/track/TrackLogTab.js.map +1 -0
- package/lib/commonjs/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/commonjs/features/track/index.js.map +1 -0
- package/lib/commonjs/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/commonjs/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/commonjs/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/commonjs/features/zustand/index.js.map +1 -0
- package/lib/commonjs/index.js +21 -21
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/environment.js +2 -0
- package/lib/commonjs/types/environment.js.map +1 -0
- package/lib/commonjs/types/feature.js +6 -0
- package/lib/commonjs/types/feature.js.map +1 -0
- package/lib/commonjs/types/index.js +0 -4
- package/lib/commonjs/types/logs.js +2 -0
- package/lib/commonjs/types/logs.js.map +1 -0
- package/lib/commonjs/types/navigation.js +2 -0
- package/lib/commonjs/types/navigation.js.map +1 -0
- package/lib/commonjs/types/thirdPartyLibs.js +2 -0
- package/lib/commonjs/types/thirdPartyLibs.js.map +1 -0
- package/lib/commonjs/{components → ui}/DebugView.js +2 -2
- package/lib/commonjs/ui/DebugView.js.map +1 -0
- package/lib/commonjs/{components → ui/floating}/FloatIcon.js +65 -12
- package/lib/commonjs/ui/floating/FloatIcon.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/commonjs/ui/panel/DebugPanel.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/commonjs/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/commonjs/{components → ui/panel}/FloatPanelView.js +36 -12
- package/lib/commonjs/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/commonjs/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/commonjs/ui/shared/CopyButton.js.map +1 -0
- package/lib/commonjs/ui/shared/JsonView.js.map +1 -0
- package/lib/commonjs/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/commonjs/ui/shared/LogListScreen.js.map +1 -0
- package/lib/commonjs/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/commonjs/{utils → ui/theme}/colors.js +0 -5
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/layout.js.map +1 -0
- package/lib/commonjs/utils/createChannelFeature.js +18 -4
- package/lib/commonjs/utils/createChannelFeature.js.map +1 -1
- package/lib/commonjs/utils/createObservableStore.js +5 -0
- package/lib/commonjs/utils/createObservableStore.js.map +1 -1
- package/lib/commonjs/utils/createPersistedObservableStore.js +71 -0
- package/lib/commonjs/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/commonjs/utils/debugPreferences.js +52 -0
- package/lib/commonjs/utils/debugPreferences.js.map +1 -0
- package/lib/module/core/DebugToolkit.js +33 -11
- package/lib/module/core/DebugToolkit.js.map +1 -1
- package/lib/module/core/DebugToolkitProvider.js +18 -12
- package/lib/module/core/DebugToolkitProvider.js.map +1 -1
- package/lib/module/{initialize.js → core/initialize.js} +10 -10
- package/lib/module/core/initialize.js.map +1 -0
- package/lib/module/{components → features/clipboard}/ClipboardTab.js +2 -2
- package/lib/module/features/clipboard/ClipboardTab.js.map +1 -0
- package/lib/module/features/{ClipboardFeature.js → clipboard/index.js} +3 -3
- package/lib/module/features/clipboard/index.js.map +1 -0
- package/lib/module/{components → features/console}/ConsoleLogTab.js +9 -9
- package/lib/module/features/console/ConsoleLogTab.js.map +1 -0
- package/lib/module/features/{ConsoleLogFeature.js → console/index.js} +10 -7
- package/lib/module/features/console/index.js.map +1 -0
- package/lib/module/{components → features/environment}/EnvironmentTab.js +3 -3
- package/lib/module/features/environment/EnvironmentTab.js.map +1 -0
- package/lib/module/features/{EnvironmentFeature.js → environment/index.js} +18 -13
- package/lib/module/features/environment/index.js.map +1 -0
- package/lib/module/{components → features/navigation}/NavigationLogTab.js +4 -3
- package/lib/module/features/navigation/NavigationLogTab.js.map +1 -0
- package/lib/module/features/{NavigationLogFeature.js → navigation/index.js} +4 -4
- package/lib/module/features/navigation/index.js.map +1 -0
- package/lib/module/{hooks → features/navigation}/useNavigationLogger.js +2 -2
- package/lib/module/features/navigation/useNavigationLogger.js.map +1 -0
- package/lib/module/{components → features/network}/NetworkLogTab.js +8 -7
- package/lib/module/features/network/NetworkLogTab.js.map +1 -0
- package/lib/module/features/{NetworkFeature.js → network/index.js} +20 -31
- package/lib/module/features/network/index.js.map +1 -0
- package/lib/module/features/network/networkInterceptor.js +256 -0
- package/lib/module/features/network/networkInterceptor.js.map +1 -0
- package/lib/module/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.js +3 -2
- package/lib/module/features/thirdPartyLibs/ThirdPartyLibsTab.js.map +1 -0
- package/lib/module/features/{ThirdPartyLibsFeature.js → thirdPartyLibs/index.js} +4 -4
- package/lib/module/features/thirdPartyLibs/index.js.map +1 -0
- package/lib/module/{native/NativeDebugLibs.js → features/thirdPartyLibs/nativeDebugLibs.js} +1 -1
- package/lib/module/features/thirdPartyLibs/nativeDebugLibs.js.map +1 -0
- package/lib/module/{components → features/track}/TrackLogTab.js +8 -8
- package/lib/module/features/track/TrackLogTab.js.map +1 -0
- package/lib/module/features/{TrackFeature.js → track/index.js} +10 -5
- package/lib/module/features/track/index.js.map +1 -0
- package/lib/module/{components → features/zustand}/ZustandLogTab.js +8 -8
- package/lib/module/features/zustand/ZustandLogTab.js.map +1 -0
- package/lib/module/features/{ZustandLogFeature.js → zustand/index.js} +4 -4
- package/lib/module/features/zustand/index.js.map +1 -0
- package/lib/module/index.js +11 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/environment.js +2 -0
- package/lib/module/types/environment.js.map +1 -0
- package/lib/module/types/feature.js +4 -0
- package/lib/module/types/feature.js.map +1 -0
- package/lib/module/types/index.js +0 -2
- package/lib/module/types/logs.js +2 -0
- package/lib/module/types/logs.js.map +1 -0
- package/lib/module/types/navigation.js +2 -0
- package/lib/module/types/navigation.js.map +1 -0
- package/lib/module/types/thirdPartyLibs.js +2 -0
- package/lib/module/types/thirdPartyLibs.js.map +1 -0
- package/lib/module/{components → ui}/DebugView.js +2 -2
- package/lib/module/ui/DebugView.js.map +1 -0
- package/lib/module/{components → ui/floating}/FloatIcon.js +66 -13
- package/lib/module/ui/floating/FloatIcon.js.map +1 -0
- package/lib/module/{components → ui/panel}/DebugPanel.js +4 -4
- package/lib/module/ui/panel/DebugPanel.js.map +1 -0
- package/lib/module/{components → ui/panel}/FeatureTabBar.js +1 -1
- package/lib/module/ui/panel/FeatureTabBar.js.map +1 -0
- package/lib/module/{components → ui/panel}/FloatPanelView.js +36 -12
- package/lib/module/ui/panel/FloatPanelView.js.map +1 -0
- package/lib/module/{components → ui}/shared/CollapsibleSection.js +1 -1
- package/lib/module/ui/shared/CollapsibleSection.js.map +1 -0
- package/lib/module/{components → ui}/shared/CopyButton.js +1 -1
- package/lib/module/ui/shared/CopyButton.js.map +1 -0
- package/lib/module/ui/shared/JsonView.js.map +1 -0
- package/lib/module/{components → ui}/shared/LogListScreen.js +2 -2
- package/lib/module/ui/shared/LogListScreen.js.map +1 -0
- package/lib/module/ui/shared/useSlideDetailAnimation.js.map +1 -0
- package/lib/module/{utils → ui/theme}/colors.js +0 -5
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/layout.js.map +1 -0
- package/lib/module/utils/createChannelFeature.js +18 -4
- package/lib/module/utils/createChannelFeature.js.map +1 -1
- package/lib/module/utils/createObservableStore.js +5 -0
- package/lib/module/utils/createObservableStore.js.map +1 -1
- package/lib/module/utils/createPersistedObservableStore.js +67 -0
- package/lib/module/utils/createPersistedObservableStore.js.map +1 -0
- package/lib/module/utils/debugPreferences.js +46 -0
- package/lib/module/utils/debugPreferences.js.map +1 -0
- package/lib/typescript/src/core/DebugToolkit.d.ts +7 -3
- package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -1
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts +2 -2
- package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -1
- package/lib/typescript/src/{initialize.d.ts → core/initialize.d.ts} +7 -7
- package/lib/typescript/src/core/initialize.d.ts.map +1 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts +4 -0
- package/lib/typescript/src/features/clipboard/ClipboardTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ClipboardFeature.d.ts → clipboard/index.d.ts} +3 -3
- package/lib/typescript/src/features/clipboard/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/console}/ConsoleLogTab.d.ts +2 -2
- package/lib/typescript/src/features/console/ConsoleLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ConsoleLogFeature.d.ts → console/index.d.ts} +3 -3
- package/lib/typescript/src/features/console/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/environment}/EnvironmentTab.d.ts +1 -1
- package/lib/typescript/src/features/environment/EnvironmentTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{EnvironmentFeature.d.ts → environment/index.d.ts} +2 -2
- package/lib/typescript/src/features/environment/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/navigation}/NavigationLogTab.d.ts +2 -2
- package/lib/typescript/src/features/navigation/NavigationLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{NavigationLogFeature.d.ts → navigation/index.d.ts} +3 -3
- package/lib/typescript/src/features/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/{hooks → features/navigation}/useNavigationLogger.d.ts +1 -1
- package/lib/typescript/src/features/navigation/useNavigationLogger.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/network}/NetworkLogTab.d.ts +2 -2
- package/lib/typescript/src/features/network/NetworkLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/network/index.d.ts +15 -0
- package/lib/typescript/src/features/network/index.d.ts.map +1 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts +19 -0
- package/lib/typescript/src/features/network/networkInterceptor.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.d.ts +2 -2
- package/lib/typescript/src/features/thirdPartyLibs/ThirdPartyLibsTab.d.ts.map +1 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts +3 -0
- package/lib/typescript/src/features/thirdPartyLibs/index.d.ts.map +1 -0
- package/lib/typescript/src/{native/NativeDebugLibs.d.ts → features/thirdPartyLibs/nativeDebugLibs.d.ts} +1 -1
- package/lib/typescript/src/features/thirdPartyLibs/nativeDebugLibs.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/track}/TrackLogTab.d.ts +2 -2
- package/lib/typescript/src/features/track/TrackLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{TrackFeature.d.ts → track/index.d.ts} +3 -3
- package/lib/typescript/src/features/track/index.d.ts.map +1 -0
- package/lib/typescript/src/{components → features/zustand}/ZustandLogTab.d.ts +2 -2
- package/lib/typescript/src/features/zustand/ZustandLogTab.d.ts.map +1 -0
- package/lib/typescript/src/features/{ZustandLogFeature.d.ts → zustand/index.d.ts} +3 -3
- package/lib/typescript/src/features/zustand/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +19 -19
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/environment.d.ts +11 -0
- package/lib/typescript/src/types/environment.d.ts.map +1 -0
- package/lib/typescript/src/types/feature.d.ts +23 -0
- package/lib/typescript/src/types/feature.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +5 -108
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/logs.d.ts +51 -0
- package/lib/typescript/src/types/logs.d.ts.map +1 -0
- package/lib/typescript/src/types/navigation.d.ts +8 -0
- package/lib/typescript/src/types/navigation.d.ts.map +1 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts +13 -0
- package/lib/typescript/src/types/thirdPartyLibs.d.ts.map +1 -0
- package/lib/typescript/src/{components → ui}/DebugView.d.ts +1 -1
- package/lib/typescript/src/ui/DebugView.d.ts.map +1 -0
- package/lib/typescript/src/ui/floating/FloatIcon.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/DebugPanel.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FeatureTabBar.d.ts.map +1 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts +12 -0
- package/lib/typescript/src/ui/panel/FloatPanelView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CollapsibleSection.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/CopyButton.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/JsonView.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/LogListScreen.d.ts.map +1 -0
- package/lib/typescript/src/ui/shared/useSlideDetailAnimation.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/src/ui/theme/layout.d.ts.map +1 -0
- package/lib/typescript/src/utils/createChannelFeature.d.ts +12 -3
- package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -1
- package/lib/typescript/src/utils/createObservableStore.d.ts +1 -0
- package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -1
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts +15 -0
- package/lib/typescript/src/utils/createPersistedObservableStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts +10 -0
- package/lib/typescript/src/utils/debugPreferences.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/DebugToolkit.tsx +37 -11
- package/src/core/DebugToolkitProvider.tsx +20 -13
- package/src/{initialize.ts → core/initialize.ts} +16 -16
- package/src/{components → features/clipboard}/ClipboardTab.tsx +4 -4
- package/src/features/{ClipboardFeature.ts → clipboard/index.ts} +4 -4
- package/src/{components → features/console}/ConsoleLogTab.tsx +10 -10
- package/src/features/{ConsoleLogFeature.ts → console/index.ts} +11 -8
- package/src/{components → features/environment}/EnvironmentTab.tsx +5 -5
- package/src/features/{EnvironmentFeature.ts → environment/index.ts} +23 -13
- package/src/{components → features/navigation}/NavigationLogTab.tsx +6 -5
- package/src/features/{NavigationLogFeature.ts → navigation/index.ts} +5 -5
- package/src/{hooks → features/navigation}/useNavigationLogger.ts +3 -3
- package/src/{components → features/network}/NetworkLogTab.tsx +10 -9
- package/src/features/{NetworkFeature.ts → network/index.ts} +26 -39
- package/src/features/network/networkInterceptor.ts +311 -0
- package/src/{components → features/thirdPartyLibs}/ThirdPartyLibsTab.tsx +5 -4
- package/src/features/{ThirdPartyLibsFeature.ts → thirdPartyLibs/index.ts} +5 -5
- package/src/{components → features/track}/TrackLogTab.tsx +9 -9
- package/src/features/{TrackFeature.ts → track/index.ts} +13 -6
- package/src/{components → features/zustand}/ZustandLogTab.tsx +10 -10
- package/src/features/{ZustandLogFeature.ts → zustand/index.ts} +5 -5
- package/src/index.ts +19 -19
- package/src/types/environment.ts +11 -0
- package/src/types/feature.ts +32 -0
- package/src/types/index.ts +29 -127
- package/src/types/logs.ts +54 -0
- package/src/types/navigation.ts +5 -0
- package/src/types/thirdPartyLibs.ts +13 -0
- package/src/{components → ui}/DebugView.tsx +3 -3
- package/src/{components → ui/floating}/FloatIcon.tsx +60 -29
- package/src/{components → ui/panel}/DebugPanel.tsx +4 -4
- package/src/{components → ui/panel}/FeatureTabBar.tsx +1 -1
- package/src/{components → ui/panel}/FloatPanelView.tsx +38 -13
- package/src/{components → ui}/shared/CollapsibleSection.tsx +1 -1
- package/src/{components → ui}/shared/CopyButton.tsx +1 -1
- package/src/{components → ui}/shared/LogListScreen.tsx +2 -2
- package/src/{utils → ui/theme}/colors.ts +0 -5
- package/src/utils/createChannelFeature.ts +32 -7
- package/src/utils/createObservableStore.ts +6 -0
- package/src/utils/createPersistedObservableStore.ts +76 -0
- package/src/utils/debugPreferences.ts +48 -0
- package/lib/commonjs/components/ClipboardTab.js.map +0 -1
- package/lib/commonjs/components/ConsoleLogTab.js.map +0 -1
- package/lib/commonjs/components/DebugPanel.js.map +0 -1
- package/lib/commonjs/components/DebugView.js.map +0 -1
- package/lib/commonjs/components/EnvironmentTab.js.map +0 -1
- package/lib/commonjs/components/FeatureTabBar.js.map +0 -1
- package/lib/commonjs/components/FloatIcon.js.map +0 -1
- package/lib/commonjs/components/FloatPanelView.js.map +0 -1
- package/lib/commonjs/components/NavigationLogTab.js.map +0 -1
- package/lib/commonjs/components/NetworkLogTab.js.map +0 -1
- package/lib/commonjs/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/commonjs/components/TrackLogTab.js.map +0 -1
- package/lib/commonjs/components/ZustandLogTab.js.map +0 -1
- package/lib/commonjs/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/commonjs/components/shared/CopyButton.js.map +0 -1
- package/lib/commonjs/components/shared/JsonView.js.map +0 -1
- package/lib/commonjs/components/shared/LogListScreen.js.map +0 -1
- package/lib/commonjs/features/ClipboardFeature.js.map +0 -1
- package/lib/commonjs/features/ConsoleLogFeature.js.map +0 -1
- package/lib/commonjs/features/EnvironmentFeature.js.map +0 -1
- package/lib/commonjs/features/NavigationLogFeature.js.map +0 -1
- package/lib/commonjs/features/NetworkFeature.js.map +0 -1
- package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/commonjs/features/TrackFeature.js.map +0 -1
- package/lib/commonjs/features/ZustandLogFeature.js.map +0 -1
- package/lib/commonjs/hooks/useNavigationLogger.js.map +0 -1
- package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/commonjs/initialize.js.map +0 -1
- package/lib/commonjs/interceptors/networkInterceptor.js +0 -466
- package/lib/commonjs/interceptors/networkInterceptor.js.map +0 -1
- package/lib/commonjs/native/NativeDebugLibs.js.map +0 -1
- package/lib/commonjs/utils/colors.js.map +0 -1
- package/lib/commonjs/utils/layout.js.map +0 -1
- package/lib/module/components/ClipboardTab.js.map +0 -1
- package/lib/module/components/ConsoleLogTab.js.map +0 -1
- package/lib/module/components/DebugPanel.js.map +0 -1
- package/lib/module/components/DebugView.js.map +0 -1
- package/lib/module/components/EnvironmentTab.js.map +0 -1
- package/lib/module/components/FeatureTabBar.js.map +0 -1
- package/lib/module/components/FloatIcon.js.map +0 -1
- package/lib/module/components/FloatPanelView.js.map +0 -1
- package/lib/module/components/NavigationLogTab.js.map +0 -1
- package/lib/module/components/NetworkLogTab.js.map +0 -1
- package/lib/module/components/ThirdPartyLibsTab.js.map +0 -1
- package/lib/module/components/TrackLogTab.js.map +0 -1
- package/lib/module/components/ZustandLogTab.js.map +0 -1
- package/lib/module/components/shared/CollapsibleSection.js.map +0 -1
- package/lib/module/components/shared/CopyButton.js.map +0 -1
- package/lib/module/components/shared/JsonView.js.map +0 -1
- package/lib/module/components/shared/LogListScreen.js.map +0 -1
- package/lib/module/features/ClipboardFeature.js.map +0 -1
- package/lib/module/features/ConsoleLogFeature.js.map +0 -1
- package/lib/module/features/EnvironmentFeature.js.map +0 -1
- package/lib/module/features/NavigationLogFeature.js.map +0 -1
- package/lib/module/features/NetworkFeature.js.map +0 -1
- package/lib/module/features/ThirdPartyLibsFeature.js.map +0 -1
- package/lib/module/features/TrackFeature.js.map +0 -1
- package/lib/module/features/ZustandLogFeature.js.map +0 -1
- package/lib/module/hooks/useNavigationLogger.js.map +0 -1
- package/lib/module/hooks/useSlideDetailAnimation.js.map +0 -1
- package/lib/module/initialize.js.map +0 -1
- package/lib/module/interceptors/networkInterceptor.js +0 -460
- package/lib/module/interceptors/networkInterceptor.js.map +0 -1
- package/lib/module/native/NativeDebugLibs.js.map +0 -1
- package/lib/module/utils/colors.js.map +0 -1
- package/lib/module/utils/layout.js.map +0 -1
- package/lib/typescript/src/components/ClipboardTab.d.ts +0 -4
- package/lib/typescript/src/components/ClipboardTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/DebugPanel.d.ts.map +0 -1
- package/lib/typescript/src/components/DebugView.d.ts.map +0 -1
- package/lib/typescript/src/components/EnvironmentTab.d.ts.map +0 -1
- package/lib/typescript/src/components/FeatureTabBar.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatIcon.d.ts.map +0 -1
- package/lib/typescript/src/components/FloatPanelView.d.ts +0 -9
- package/lib/typescript/src/components/FloatPanelView.d.ts.map +0 -1
- package/lib/typescript/src/components/NavigationLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/NetworkLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +0 -1
- package/lib/typescript/src/components/TrackLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/ZustandLogTab.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/CopyButton.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/JsonView.d.ts.map +0 -1
- package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +0 -1
- package/lib/typescript/src/features/ClipboardFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/NetworkFeature.d.ts +0 -15
- package/lib/typescript/src/features/NetworkFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +0 -3
- package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/TrackFeature.d.ts.map +0 -1
- package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +0 -1
- package/lib/typescript/src/initialize.d.ts.map +0 -1
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts +0 -18
- package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +0 -1
- package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +0 -1
- package/lib/typescript/src/utils/colors.d.ts.map +0 -1
- package/lib/typescript/src/utils/layout.d.ts.map +0 -1
- package/src/interceptors/networkInterceptor.ts +0 -646
- /package/lib/commonjs/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/commonjs/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/commonjs/{utils → ui/theme}/layout.js +0 -0
- /package/lib/module/{components → ui}/shared/JsonView.js +0 -0
- /package/lib/module/{hooks → ui/shared}/useSlideDetailAnimation.js +0 -0
- /package/lib/module/{utils → ui/theme}/layout.js +0 -0
- /package/lib/typescript/src/{components → ui/floating}/FloatIcon.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/DebugPanel.d.ts +0 -0
- /package/lib/typescript/src/{components → ui/panel}/FeatureTabBar.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CollapsibleSection.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/CopyButton.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/JsonView.d.ts +0 -0
- /package/lib/typescript/src/{components → ui}/shared/LogListScreen.d.ts +0 -0
- /package/lib/typescript/src/{hooks → ui/shared}/useSlideDetailAnimation.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/colors.d.ts +0 -0
- /package/lib/typescript/src/{utils → ui/theme}/layout.d.ts +0 -0
- /package/src/{native/NativeDebugLibs.ts → features/thirdPartyLibs/nativeDebugLibs.ts} +0 -0
- /package/src/{components → ui}/shared/JsonView.tsx +0 -0
- /package/src/{hooks → ui/shared}/useSlideDetailAnimation.ts +0 -0
- /package/src/{utils → ui/theme}/layout.ts +0 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import type { NetworkLogEntry } from '../../types';
|
|
2
|
+
import { urlRewriter } from '../../utils/urlRewriterRegistry';
|
|
3
|
+
|
|
4
|
+
type NetworkLogPayload = Omit<NetworkLogEntry, 'id'>;
|
|
5
|
+
|
|
6
|
+
// Intercepts fetch requests and optionally axios via interceptors.
|
|
7
|
+
// Axios response data is captured directly through interceptor callbacks,
|
|
8
|
+
// avoiding the unreliable XHR response interception in React Native.
|
|
9
|
+
|
|
10
|
+
// ─── Minimal axios interface (no hard dependency) ──────
|
|
11
|
+
|
|
12
|
+
export interface AxiosInstanceLike {
|
|
13
|
+
interceptors: {
|
|
14
|
+
request: {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
use(onFulfilled?: (config: any) => any, onRejected?: (error: any) => any): number;
|
|
17
|
+
eject(id: number): void;
|
|
18
|
+
};
|
|
19
|
+
response: {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
use(onFulfilled?: (response: any) => any, onRejected?: (error: any) => any): number;
|
|
22
|
+
eject(id: number): void;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// ─── Shared helpers ────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
function rewriteUrl(url: string): string {
|
|
30
|
+
const rewriter = urlRewriter.get();
|
|
31
|
+
if (!rewriter) {
|
|
32
|
+
return url;
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
return rewriter(url);
|
|
36
|
+
} catch {
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function headersToObject(
|
|
42
|
+
headers: Record<string, string> | Headers | undefined,
|
|
43
|
+
): Record<string, string> {
|
|
44
|
+
const result: Record<string, string> = {};
|
|
45
|
+
if (!headers) {
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
if (typeof (headers as Headers).forEach === 'function') {
|
|
49
|
+
(headers as Headers).forEach((value: string, key: string) => {
|
|
50
|
+
result[key] = value;
|
|
51
|
+
});
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
Object.keys(headers).forEach((key) => {
|
|
55
|
+
result[key] = (headers as Record<string, string>)[key]!;
|
|
56
|
+
});
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getRequestSnapshot(
|
|
61
|
+
input: unknown,
|
|
62
|
+
init?: RequestInit,
|
|
63
|
+
): NetworkLogEntry['request'] {
|
|
64
|
+
const request = input instanceof Request ? input : null;
|
|
65
|
+
return {
|
|
66
|
+
url: typeof input === 'string' ? input : request?.url ?? String(input),
|
|
67
|
+
method: (init?.method || request?.method || 'GET').toUpperCase(),
|
|
68
|
+
headers: init?.headers
|
|
69
|
+
? headersToObject(init.headers as Record<string, string> | Headers)
|
|
70
|
+
: request?.headers
|
|
71
|
+
? headersToObject(request.headers)
|
|
72
|
+
: undefined,
|
|
73
|
+
body: init?.body,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function parseResponseBody(response: Response): Promise<unknown> {
|
|
78
|
+
const raw = await response.clone().text();
|
|
79
|
+
if (!raw) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
return JSON.parse(raw);
|
|
84
|
+
} catch {
|
|
85
|
+
return raw;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function normalizeAxiosHeaders(
|
|
90
|
+
headers: unknown,
|
|
91
|
+
): Record<string, string> | undefined {
|
|
92
|
+
if (!headers || typeof headers !== 'object') {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
// AxiosHeaders instance
|
|
96
|
+
if (typeof (headers as Record<string, unknown>).forEach === 'function') {
|
|
97
|
+
const result: Record<string, string> = {};
|
|
98
|
+
(headers as { forEach(fn: (value: string, key: string) => void): void }).forEach(
|
|
99
|
+
(value, key) => {
|
|
100
|
+
result[key] = value;
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
104
|
+
}
|
|
105
|
+
// Plain object
|
|
106
|
+
const result: Record<string, string> = {};
|
|
107
|
+
const obj = headers as Record<string, unknown>;
|
|
108
|
+
for (const key of Object.keys(obj)) {
|
|
109
|
+
const val = obj[key];
|
|
110
|
+
if (typeof val === 'string') {
|
|
111
|
+
result[key] = val;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function buildFullUrl(config: {
|
|
118
|
+
baseURL?: string;
|
|
119
|
+
url?: string;
|
|
120
|
+
}): string {
|
|
121
|
+
const base = config.baseURL ?? '';
|
|
122
|
+
const url = config.url ?? '';
|
|
123
|
+
if (!base || url.startsWith('http')) {
|
|
124
|
+
return url;
|
|
125
|
+
}
|
|
126
|
+
return base.replace(/\/$/, '') + '/' + url.replace(/^\//, '');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ─── Fetch interceptor ─────────────────────────────────
|
|
130
|
+
|
|
131
|
+
let originalFetch: typeof globalThis.fetch | null = null;
|
|
132
|
+
let fetchRefCount = 0;
|
|
133
|
+
|
|
134
|
+
function stopFetch(): void {
|
|
135
|
+
fetchRefCount = Math.max(0, fetchRefCount - 1);
|
|
136
|
+
if (fetchRefCount === 0 && originalFetch) {
|
|
137
|
+
globalThis.fetch = originalFetch;
|
|
138
|
+
originalFetch = null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function startFetch(emit: (entry: NetworkLogPayload) => void): () => void {
|
|
143
|
+
fetchRefCount += 1;
|
|
144
|
+
if (originalFetch) {
|
|
145
|
+
return () => {
|
|
146
|
+
stopFetch();
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
originalFetch = globalThis.fetch;
|
|
151
|
+
|
|
152
|
+
globalThis.fetch = async function interceptedFetch(
|
|
153
|
+
input: Parameters<typeof fetch>[0],
|
|
154
|
+
init?: Parameters<typeof fetch>[1],
|
|
155
|
+
) {
|
|
156
|
+
const startTime = Date.now();
|
|
157
|
+
|
|
158
|
+
let rewrittenInput: typeof input = input;
|
|
159
|
+
if (urlRewriter.get()) {
|
|
160
|
+
if (typeof input === 'string') {
|
|
161
|
+
rewrittenInput = rewriteUrl(input);
|
|
162
|
+
} else if (input instanceof Request) {
|
|
163
|
+
rewrittenInput = new Request(rewriteUrl(input.url), input as RequestInit);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const request = getRequestSnapshot(rewrittenInput, init);
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
const response = await originalFetch!.call(globalThis, rewrittenInput, init);
|
|
171
|
+
const duration = Date.now() - startTime;
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
const data = await parseResponseBody(response);
|
|
175
|
+
emit({
|
|
176
|
+
timestamp: startTime,
|
|
177
|
+
duration,
|
|
178
|
+
request,
|
|
179
|
+
response: { status: response.status, statusText: response.statusText, data },
|
|
180
|
+
});
|
|
181
|
+
} catch {
|
|
182
|
+
emit({
|
|
183
|
+
timestamp: startTime,
|
|
184
|
+
duration,
|
|
185
|
+
request,
|
|
186
|
+
response: { status: response.status, statusText: response.statusText },
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return response;
|
|
191
|
+
} catch (error) {
|
|
192
|
+
emit({
|
|
193
|
+
timestamp: startTime,
|
|
194
|
+
duration: Date.now() - startTime,
|
|
195
|
+
request,
|
|
196
|
+
error: error instanceof Error ? error.message : String(error),
|
|
197
|
+
});
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
return () => {
|
|
203
|
+
stopFetch();
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ─── Axios interceptor ─────────────────────────────────
|
|
208
|
+
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
210
|
+
const pendingAxiosRequests = new WeakMap<any, { startTime: number; timestamp: number }>();
|
|
211
|
+
|
|
212
|
+
export function startAxios(
|
|
213
|
+
axiosInstance: AxiosInstanceLike,
|
|
214
|
+
emit: (entry: NetworkLogPayload) => void,
|
|
215
|
+
): () => void {
|
|
216
|
+
const requestInterceptorId = axiosInstance.interceptors.request.use(
|
|
217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
+
(config: any) => {
|
|
219
|
+
const now = Date.now();
|
|
220
|
+
pendingAxiosRequests.set(config, { startTime: now, timestamp: now });
|
|
221
|
+
|
|
222
|
+
if (urlRewriter.get() && config.url) {
|
|
223
|
+
const fullUrl = buildFullUrl(config);
|
|
224
|
+
const rewritten = rewriteUrl(fullUrl);
|
|
225
|
+
if (rewritten !== fullUrl) {
|
|
226
|
+
config.url = rewritten;
|
|
227
|
+
if (config.baseURL) {
|
|
228
|
+
config.baseURL = undefined;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return config;
|
|
234
|
+
},
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
const responseInterceptorId = axiosInstance.interceptors.response.use(
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
239
|
+
(response: any) => {
|
|
240
|
+
const config = response.config;
|
|
241
|
+
const pending = config ? pendingAxiosRequests.get(config) : undefined;
|
|
242
|
+
const startTime = pending?.timestamp ?? Date.now();
|
|
243
|
+
|
|
244
|
+
emit({
|
|
245
|
+
timestamp: startTime,
|
|
246
|
+
duration: Date.now() - startTime,
|
|
247
|
+
request: {
|
|
248
|
+
url: buildFullUrl(config),
|
|
249
|
+
method: (config?.method ?? 'GET').toUpperCase(),
|
|
250
|
+
headers: normalizeAxiosHeaders(config?.headers),
|
|
251
|
+
body: config?.data,
|
|
252
|
+
},
|
|
253
|
+
response: {
|
|
254
|
+
status: response.status,
|
|
255
|
+
statusText: response.statusText,
|
|
256
|
+
headers: normalizeAxiosHeaders(response.headers),
|
|
257
|
+
data: response.data,
|
|
258
|
+
success: response.status >= 200 && response.status < 300,
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
return response;
|
|
263
|
+
},
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
265
|
+
(error: any) => {
|
|
266
|
+
const config = error.config;
|
|
267
|
+
const pending = config ? pendingAxiosRequests.get(config) : undefined;
|
|
268
|
+
const startTime = pending?.timestamp ?? Date.now();
|
|
269
|
+
|
|
270
|
+
if (config) {
|
|
271
|
+
emit({
|
|
272
|
+
timestamp: startTime,
|
|
273
|
+
duration: Date.now() - startTime,
|
|
274
|
+
request: {
|
|
275
|
+
url: buildFullUrl(config),
|
|
276
|
+
method: (config.method ?? 'GET').toUpperCase(),
|
|
277
|
+
headers: normalizeAxiosHeaders(config.headers),
|
|
278
|
+
body: config.data,
|
|
279
|
+
},
|
|
280
|
+
response: error.response
|
|
281
|
+
? {
|
|
282
|
+
status: error.response.status,
|
|
283
|
+
statusText: error.response.statusText,
|
|
284
|
+
headers: normalizeAxiosHeaders(error.response.headers),
|
|
285
|
+
data: error.response.data,
|
|
286
|
+
success: false,
|
|
287
|
+
}
|
|
288
|
+
: undefined,
|
|
289
|
+
error: error.message ?? String(error),
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return Promise.reject(error);
|
|
294
|
+
},
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
return () => {
|
|
298
|
+
axiosInstance.interceptors.request.eject(requestInterceptorId);
|
|
299
|
+
axiosInstance.interceptors.response.eject(responseInterceptorId);
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// ─── Cleanup ───────────────────────────────────────────
|
|
304
|
+
|
|
305
|
+
export function resetInterceptors(): void {
|
|
306
|
+
if (originalFetch) {
|
|
307
|
+
globalThis.fetch = originalFetch;
|
|
308
|
+
originalFetch = null;
|
|
309
|
+
}
|
|
310
|
+
fetchRefCount = 0;
|
|
311
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
3
|
-
import { Colors } from '
|
|
4
|
-
import type { DebugFeatureRenderProps, ThirdPartyLib, ThirdPartyLibAction } from '
|
|
3
|
+
import { Colors } from '../../ui/theme/colors';
|
|
4
|
+
import type { DebugFeatureRenderProps, ThirdPartyLib, ThirdPartyLibAction } from '../../types';
|
|
5
5
|
|
|
6
|
-
export const ThirdPartyLibsTab: React.FC<DebugFeatureRenderProps<ThirdPartyLib>> = ({
|
|
7
|
-
|
|
6
|
+
export const ThirdPartyLibsTab: React.FC<DebugFeatureRenderProps<ThirdPartyLib[]>> = ({
|
|
7
|
+
snapshot,
|
|
8
8
|
}) => {
|
|
9
|
+
const data = snapshot;
|
|
9
10
|
if (data.length === 0) {
|
|
10
11
|
return (
|
|
11
12
|
<View style={styles.container}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
|
-
import { ThirdPartyLibsTab } from '
|
|
3
|
-
import { NativeDebugLibs } from '
|
|
4
|
-
import type { DebugFeature, ThirdPartyLib } from '
|
|
2
|
+
import { ThirdPartyLibsTab } from './ThirdPartyLibsTab';
|
|
3
|
+
import { NativeDebugLibs } from './nativeDebugLibs';
|
|
4
|
+
import type { DebugFeature, ThirdPartyLib } from '../../types';
|
|
5
5
|
|
|
6
6
|
const availableLibs: ThirdPartyLib[] = [
|
|
7
7
|
{
|
|
@@ -32,11 +32,11 @@ function getPlatformLibs(): ThirdPartyLib[] {
|
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export const createThirdPartyLibsFeature = (): DebugFeature<ThirdPartyLib> => ({
|
|
35
|
+
export const createThirdPartyLibsFeature = (): DebugFeature<ThirdPartyLib[]> => ({
|
|
36
36
|
name: 'thirdPartyLibs',
|
|
37
37
|
label: 'Debug Libraries',
|
|
38
38
|
renderContent: ThirdPartyLibsTab,
|
|
39
39
|
setup: () => {},
|
|
40
|
-
|
|
40
|
+
getSnapshot: () => getPlatformLibs(),
|
|
41
41
|
cleanup: () => {},
|
|
42
42
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
3
|
-
import { Colors } from '
|
|
4
|
-
import { safeStringify } from '
|
|
5
|
-
import { CollapsibleSection } from '
|
|
6
|
-
import { JsonView } from '
|
|
7
|
-
import { CopyButton } from '
|
|
8
|
-
import { LogListScreen } from '
|
|
9
|
-
import type { DebugFeatureRenderProps, TrackLogEntry } from '
|
|
3
|
+
import { Colors } from '../../ui/theme/colors';
|
|
4
|
+
import { safeStringify } from '../../utils/safeStringify';
|
|
5
|
+
import { CollapsibleSection } from '../../ui/shared/CollapsibleSection';
|
|
6
|
+
import { JsonView } from '../../ui/shared/JsonView';
|
|
7
|
+
import { CopyButton } from '../../ui/shared/CopyButton';
|
|
8
|
+
import { LogListScreen } from '../../ui/shared/LogListScreen';
|
|
9
|
+
import type { DebugFeatureRenderProps, TrackLogEntry } from '../../types';
|
|
10
10
|
|
|
11
|
-
export const TrackLogTab: React.FC<DebugFeatureRenderProps<TrackLogEntry>> = React.memo(({
|
|
11
|
+
export const TrackLogTab: React.FC<DebugFeatureRenderProps<TrackLogEntry[]>> = React.memo(({ snapshot }) => (
|
|
12
12
|
<LogListScreen
|
|
13
|
-
data={
|
|
13
|
+
data={snapshot}
|
|
14
14
|
emptyText="No track events"
|
|
15
15
|
renderRow={(item) => (
|
|
16
16
|
<View style={s.cardRow}>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TrackLogTab } from '
|
|
2
|
-
import type { DebugFeature, TrackLogEntry } from '
|
|
3
|
-
import { createEventChannel } from '
|
|
4
|
-
import { createChannelFeature } from '
|
|
1
|
+
import { TrackLogTab } from './TrackLogTab';
|
|
2
|
+
import type { DebugFeature, TrackLogEntry } from '../../types';
|
|
3
|
+
import { createEventChannel } from '../../utils/createEventChannel';
|
|
4
|
+
import { createChannelFeature } from '../../utils/createChannelFeature';
|
|
5
|
+
import { KEYS } from '../../utils/debugPreferences';
|
|
5
6
|
|
|
6
7
|
export interface TrackEventData {
|
|
7
8
|
eventName: string;
|
|
@@ -21,11 +22,17 @@ export interface TrackFeatureConfig {
|
|
|
21
22
|
maxLogs?: number;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export const createTrackFeature = (config?: TrackFeatureConfig): DebugFeature<TrackLogEntry> =>
|
|
25
|
+
export const createTrackFeature = (config?: TrackFeatureConfig): DebugFeature<TrackLogEntry[]> =>
|
|
25
26
|
createChannelFeature(
|
|
26
27
|
() => trackChannel,
|
|
27
28
|
(payload, id) => ({ ...payload, id }),
|
|
28
|
-
{
|
|
29
|
+
{
|
|
30
|
+
name: 'track',
|
|
31
|
+
label: 'Track',
|
|
32
|
+
renderContent: TrackLogTab,
|
|
33
|
+
maxLogs: config?.maxLogs,
|
|
34
|
+
persist: { storageKey: KEYS.trackLogs, maxPersist: 50 },
|
|
35
|
+
},
|
|
29
36
|
);
|
|
30
37
|
|
|
31
38
|
/** Reset module-level state for testing */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
3
|
-
import { Colors } from '
|
|
4
|
-
import { safeStringify } from '
|
|
5
|
-
import { CollapsibleSection } from '
|
|
6
|
-
import { JsonView } from '
|
|
7
|
-
import { CopyButton } from '
|
|
8
|
-
import { LogListScreen } from '
|
|
9
|
-
import type { DebugFeatureRenderProps, ZustandLogEntry } from '
|
|
3
|
+
import { Colors } from '../../ui/theme/colors';
|
|
4
|
+
import { safeStringify } from '../../utils/safeStringify';
|
|
5
|
+
import { CollapsibleSection } from '../../ui/shared/CollapsibleSection';
|
|
6
|
+
import { JsonView } from '../../ui/shared/JsonView';
|
|
7
|
+
import { CopyButton } from '../../ui/shared/CopyButton';
|
|
8
|
+
import { LogListScreen } from '../../ui/shared/LogListScreen';
|
|
9
|
+
import type { DebugFeatureRenderProps, ZustandLogEntry } from '../../types';
|
|
10
10
|
|
|
11
11
|
const getActionColor = (action: string): string => {
|
|
12
12
|
if (action.includes('add') || action.includes('create')) return '#34C759';
|
|
@@ -34,11 +34,11 @@ function findChanges(prev: unknown, next: unknown): string[] {
|
|
|
34
34
|
return changed;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export const ZustandLogTab: React.FC<DebugFeatureRenderProps<ZustandLogEntry>> = React.memo(({
|
|
38
|
-
|
|
37
|
+
export const ZustandLogTab: React.FC<DebugFeatureRenderProps<ZustandLogEntry[]>> = React.memo(({
|
|
38
|
+
snapshot,
|
|
39
39
|
}) => (
|
|
40
40
|
<LogListScreen
|
|
41
|
-
data={
|
|
41
|
+
data={snapshot}
|
|
42
42
|
emptyText="No Zustand state changes"
|
|
43
43
|
renderRow={(item) => (
|
|
44
44
|
<View style={s.cardRow}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ZustandLogTab } from '
|
|
2
|
-
import type { DebugFeature, ZustandLogEntry } from '
|
|
3
|
-
import { createEventChannel } from '
|
|
4
|
-
import { createChannelFeature } from '
|
|
1
|
+
import { ZustandLogTab } from './ZustandLogTab';
|
|
2
|
+
import type { DebugFeature, ZustandLogEntry } from '../../types';
|
|
3
|
+
import { createEventChannel } from '../../utils/createEventChannel';
|
|
4
|
+
import { createChannelFeature } from '../../utils/createChannelFeature';
|
|
5
5
|
|
|
6
6
|
type ZustandLogPayload = Omit<ZustandLogEntry, 'id'>;
|
|
7
7
|
|
|
@@ -88,7 +88,7 @@ export interface ZustandFeatureConfig {
|
|
|
88
88
|
maxLogs?: number;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry> =>
|
|
91
|
+
export const createZustandLogFeature = (config?: ZustandFeatureConfig): DebugFeature<ZustandLogEntry[]> =>
|
|
92
92
|
createChannelFeature(
|
|
93
93
|
() => zustandChannel,
|
|
94
94
|
(payload, id) => ({ ...payload, id }),
|
package/src/index.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
// Core
|
|
2
2
|
export { DebugToolkit } from './core/DebugToolkit';
|
|
3
3
|
export { DebugToolkitProvider, useDebugToolkit } from './core/DebugToolkitProvider';
|
|
4
|
-
export { DebugView } from './
|
|
5
|
-
export type { DebugViewProps } from './
|
|
6
|
-
export { initializeDebugToolkit } from './initialize';
|
|
7
|
-
export type { InitializeOptions, FeatureConfigs } from './initialize';
|
|
4
|
+
export { DebugView } from './ui/DebugView';
|
|
5
|
+
export type { DebugViewProps } from './ui/DebugView';
|
|
6
|
+
export { initializeDebugToolkit } from './core/initialize';
|
|
7
|
+
export type { InitializeOptions, FeatureConfigs } from './core/initialize';
|
|
8
8
|
|
|
9
9
|
// Feature factories
|
|
10
|
-
export { createNetworkFeature } from './features/
|
|
11
|
-
export type { NetworkFeatureConfig, AxiosInstanceLike } from './features/
|
|
12
|
-
export { createConsoleLogFeature } from './features/
|
|
13
|
-
export type { ConsoleFeatureConfig } from './features/
|
|
14
|
-
export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/
|
|
15
|
-
export type { ZustandFeatureConfig } from './features/
|
|
16
|
-
export { createNavigationLogFeature, addNavigationLog } from './features/
|
|
17
|
-
export type { NavigationFeatureConfig } from './features/
|
|
18
|
-
export { createTrackFeature, addTrackLog } from './features/
|
|
19
|
-
export type { TrackFeatureConfig, TrackEventData } from './features/
|
|
20
|
-
export { createEnvironmentFeature } from './features/
|
|
21
|
-
export type { EnvironmentFeatureAPI } from './features/
|
|
22
|
-
export { createClipboardFeature } from './features/
|
|
10
|
+
export { createNetworkFeature } from './features/network';
|
|
11
|
+
export type { NetworkFeatureConfig, AxiosInstanceLike } from './features/network';
|
|
12
|
+
export { createConsoleLogFeature } from './features/console';
|
|
13
|
+
export type { ConsoleFeatureConfig } from './features/console';
|
|
14
|
+
export { createZustandLogFeature, zustandLogMiddleware, addZustandLog } from './features/zustand';
|
|
15
|
+
export type { ZustandFeatureConfig } from './features/zustand';
|
|
16
|
+
export { createNavigationLogFeature, addNavigationLog } from './features/navigation';
|
|
17
|
+
export type { NavigationFeatureConfig } from './features/navigation';
|
|
18
|
+
export { createTrackFeature, addTrackLog } from './features/track';
|
|
19
|
+
export type { TrackFeatureConfig, TrackEventData } from './features/track';
|
|
20
|
+
export { createEnvironmentFeature } from './features/environment';
|
|
21
|
+
export type { EnvironmentFeatureAPI } from './features/environment';
|
|
22
|
+
export { createClipboardFeature } from './features/clipboard';
|
|
23
23
|
|
|
24
24
|
// Hooks
|
|
25
|
-
export { useNavigationLogger } from './
|
|
25
|
+
export { useNavigationLogger } from './features/navigation/useNavigationLogger';
|
|
26
26
|
|
|
27
27
|
// Utilities
|
|
28
28
|
export { safeStringify } from './utils/safeStringify';
|
|
@@ -45,4 +45,4 @@ export type {
|
|
|
45
45
|
} from './types';
|
|
46
46
|
|
|
47
47
|
// Default export for convenience
|
|
48
|
-
export { initializeDebugToolkit as default } from './initialize';
|
|
48
|
+
export { initializeDebugToolkit as default } from './core/initialize';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
export type DebugFeatureListener = () => void;
|
|
4
|
+
|
|
5
|
+
export type BuiltInFeatureName =
|
|
6
|
+
| 'network'
|
|
7
|
+
| 'console'
|
|
8
|
+
| 'zustand'
|
|
9
|
+
| 'navigation'
|
|
10
|
+
| 'track'
|
|
11
|
+
| 'environment'
|
|
12
|
+
| 'clipboard';
|
|
13
|
+
|
|
14
|
+
export interface DebugFeatureRenderProps<TSnapshot = unknown> {
|
|
15
|
+
snapshot: TSnapshot;
|
|
16
|
+
feature: DebugFeature<TSnapshot>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
export type AnyDebugFeature = DebugFeature<any>;
|
|
21
|
+
|
|
22
|
+
export interface DebugFeature<TSnapshot = unknown> {
|
|
23
|
+
name: string;
|
|
24
|
+
label: string;
|
|
25
|
+
setup: () => void;
|
|
26
|
+
getSnapshot: () => TSnapshot;
|
|
27
|
+
clear?: () => void;
|
|
28
|
+
cleanup: () => void;
|
|
29
|
+
subscribe?: (listener: DebugFeatureListener) => () => void;
|
|
30
|
+
renderContent?: ComponentType<DebugFeatureRenderProps<TSnapshot>>;
|
|
31
|
+
badge?: () => { label: string; color: string } | null;
|
|
32
|
+
}
|