react-native-debug-toolkit 0.6.4 → 2.1.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.
Files changed (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -211
  3. package/README.zh-CN.md +150 -171
  4. package/lib/commonjs/components/ClipboardTab.js +91 -0
  5. package/lib/commonjs/components/ClipboardTab.js.map +1 -0
  6. package/lib/commonjs/components/ConsoleLogTab.js +162 -0
  7. package/lib/commonjs/components/ConsoleLogTab.js.map +1 -0
  8. package/lib/commonjs/components/DebugPanel.js +230 -0
  9. package/lib/commonjs/components/DebugPanel.js.map +1 -0
  10. package/lib/commonjs/components/DebugView.js +66 -0
  11. package/lib/commonjs/components/DebugView.js.map +1 -0
  12. package/lib/commonjs/components/EnvironmentTab.js +287 -0
  13. package/lib/commonjs/components/EnvironmentTab.js.map +1 -0
  14. package/lib/commonjs/components/FeatureTabBar.js +182 -0
  15. package/lib/commonjs/components/FeatureTabBar.js.map +1 -0
  16. package/lib/commonjs/components/FloatIcon.js +187 -0
  17. package/lib/commonjs/components/FloatIcon.js.map +1 -0
  18. package/lib/commonjs/components/FloatPanelView.js +214 -0
  19. package/lib/commonjs/components/FloatPanelView.js.map +1 -0
  20. package/lib/commonjs/components/NavigationLogTab.js +131 -0
  21. package/lib/commonjs/components/NavigationLogTab.js.map +1 -0
  22. package/lib/commonjs/components/NetworkLogTab.js +404 -0
  23. package/lib/commonjs/components/NetworkLogTab.js.map +1 -0
  24. package/lib/commonjs/components/ThirdPartyLibsTab.js +97 -0
  25. package/lib/commonjs/components/ThirdPartyLibsTab.js.map +1 -0
  26. package/lib/commonjs/components/TrackLogTab.js +230 -0
  27. package/lib/commonjs/components/TrackLogTab.js.map +1 -0
  28. package/lib/commonjs/components/ZustandLogTab.js +311 -0
  29. package/lib/commonjs/components/ZustandLogTab.js.map +1 -0
  30. package/lib/commonjs/components/shared/CollapsibleSection.js +84 -0
  31. package/lib/commonjs/components/shared/CollapsibleSection.js.map +1 -0
  32. package/lib/commonjs/components/shared/CopyButton.js +64 -0
  33. package/lib/commonjs/components/shared/CopyButton.js.map +1 -0
  34. package/lib/commonjs/components/shared/JsonView.js +157 -0
  35. package/lib/commonjs/components/shared/JsonView.js.map +1 -0
  36. package/lib/commonjs/components/shared/LogListScreen.js +174 -0
  37. package/lib/commonjs/components/shared/LogListScreen.js.map +1 -0
  38. package/lib/commonjs/core/DebugToolkit.js +122 -0
  39. package/lib/commonjs/core/DebugToolkit.js.map +1 -0
  40. package/lib/commonjs/core/DebugToolkitProvider.js +66 -0
  41. package/lib/commonjs/core/DebugToolkitProvider.js.map +1 -0
  42. package/lib/commonjs/features/ClipboardFeature.js +21 -0
  43. package/lib/commonjs/features/ClipboardFeature.js.map +1 -0
  44. package/lib/commonjs/features/ConsoleLogFeature.js +115 -0
  45. package/lib/commonjs/features/ConsoleLogFeature.js.map +1 -0
  46. package/lib/commonjs/features/EnvironmentFeature.js +160 -0
  47. package/lib/commonjs/features/EnvironmentFeature.js.map +1 -0
  48. package/lib/commonjs/features/NavigationLogFeature.js +39 -0
  49. package/lib/commonjs/features/NavigationLogFeature.js.map +1 -0
  50. package/lib/commonjs/features/NetworkFeature.js +107 -0
  51. package/lib/commonjs/features/NetworkFeature.js.map +1 -0
  52. package/lib/commonjs/features/ThirdPartyLibsFeature.js +51 -0
  53. package/lib/commonjs/features/ThirdPartyLibsFeature.js.map +1 -0
  54. package/lib/commonjs/features/TrackFeature.js +34 -0
  55. package/lib/commonjs/features/TrackFeature.js.map +1 -0
  56. package/lib/commonjs/features/ZustandLogFeature.js +59 -0
  57. package/lib/commonjs/features/ZustandLogFeature.js.map +1 -0
  58. package/lib/commonjs/hooks/useNavigationLogger.js +78 -0
  59. package/lib/commonjs/hooks/useNavigationLogger.js.map +1 -0
  60. package/lib/commonjs/hooks/useSlideDetailAnimation.js +53 -0
  61. package/lib/commonjs/hooks/useSlideDetailAnimation.js.map +1 -0
  62. package/lib/commonjs/index.js +152 -0
  63. package/lib/commonjs/index.js.map +1 -0
  64. package/lib/commonjs/initialize.js +84 -0
  65. package/lib/commonjs/initialize.js.map +1 -0
  66. package/lib/commonjs/interceptors/networkInterceptor.js +466 -0
  67. package/lib/commonjs/interceptors/networkInterceptor.js.map +1 -0
  68. package/lib/commonjs/native/NativeDebugLibs.js +58 -0
  69. package/lib/commonjs/native/NativeDebugLibs.js.map +1 -0
  70. package/lib/commonjs/package.json +1 -0
  71. package/lib/commonjs/types/index.js +6 -0
  72. package/lib/commonjs/types/index.js.map +1 -0
  73. package/lib/commonjs/utils/colors.js +48 -0
  74. package/lib/commonjs/utils/colors.js.map +1 -0
  75. package/lib/commonjs/utils/copyToComputer.js +97 -0
  76. package/lib/commonjs/utils/copyToComputer.js.map +1 -0
  77. package/lib/commonjs/utils/createChannelFeature.js +48 -0
  78. package/lib/commonjs/utils/createChannelFeature.js.map +1 -0
  79. package/lib/commonjs/utils/createEventChannel.js +21 -0
  80. package/lib/commonjs/utils/createEventChannel.js.map +1 -0
  81. package/lib/commonjs/utils/createObservableStore.js +38 -0
  82. package/lib/commonjs/utils/createObservableStore.js.map +1 -0
  83. package/lib/commonjs/utils/layout.js +8 -0
  84. package/lib/commonjs/utils/layout.js.map +1 -0
  85. package/lib/commonjs/utils/safeStringify.js +27 -0
  86. package/lib/commonjs/utils/safeStringify.js.map +1 -0
  87. package/lib/commonjs/utils/urlRewriterRegistry.js +14 -0
  88. package/lib/commonjs/utils/urlRewriterRegistry.js.map +1 -0
  89. package/lib/module/components/ClipboardTab.js +86 -0
  90. package/lib/module/components/ClipboardTab.js.map +1 -0
  91. package/lib/module/components/ConsoleLogTab.js +157 -0
  92. package/lib/module/components/ConsoleLogTab.js.map +1 -0
  93. package/lib/module/components/DebugPanel.js +225 -0
  94. package/lib/module/components/DebugPanel.js.map +1 -0
  95. package/lib/module/components/DebugView.js +61 -0
  96. package/lib/module/components/DebugView.js.map +1 -0
  97. package/lib/module/components/EnvironmentTab.js +282 -0
  98. package/lib/module/components/EnvironmentTab.js.map +1 -0
  99. package/lib/module/components/FeatureTabBar.js +177 -0
  100. package/lib/module/components/FeatureTabBar.js.map +1 -0
  101. package/lib/module/components/FloatIcon.js +182 -0
  102. package/lib/module/components/FloatIcon.js.map +1 -0
  103. package/lib/module/components/FloatPanelView.js +209 -0
  104. package/lib/module/components/FloatPanelView.js.map +1 -0
  105. package/lib/module/components/NavigationLogTab.js +126 -0
  106. package/lib/module/components/NavigationLogTab.js.map +1 -0
  107. package/lib/module/components/NetworkLogTab.js +399 -0
  108. package/lib/module/components/NetworkLogTab.js.map +1 -0
  109. package/lib/module/components/ThirdPartyLibsTab.js +91 -0
  110. package/lib/module/components/ThirdPartyLibsTab.js.map +1 -0
  111. package/lib/module/components/TrackLogTab.js +225 -0
  112. package/lib/module/components/TrackLogTab.js.map +1 -0
  113. package/lib/module/components/ZustandLogTab.js +306 -0
  114. package/lib/module/components/ZustandLogTab.js.map +1 -0
  115. package/lib/module/components/shared/CollapsibleSection.js +78 -0
  116. package/lib/module/components/shared/CollapsibleSection.js.map +1 -0
  117. package/lib/module/components/shared/CopyButton.js +58 -0
  118. package/lib/module/components/shared/CopyButton.js.map +1 -0
  119. package/lib/module/components/shared/JsonView.js +152 -0
  120. package/lib/module/components/shared/JsonView.js.map +1 -0
  121. package/lib/module/components/shared/LogListScreen.js +169 -0
  122. package/lib/module/components/shared/LogListScreen.js.map +1 -0
  123. package/lib/module/core/DebugToolkit.js +118 -0
  124. package/lib/module/core/DebugToolkit.js.map +1 -0
  125. package/lib/module/core/DebugToolkitProvider.js +60 -0
  126. package/lib/module/core/DebugToolkitProvider.js.map +1 -0
  127. package/lib/module/features/ClipboardFeature.js +16 -0
  128. package/lib/module/features/ClipboardFeature.js.map +1 -0
  129. package/lib/module/features/ConsoleLogFeature.js +109 -0
  130. package/lib/module/features/ConsoleLogFeature.js.map +1 -0
  131. package/lib/module/features/EnvironmentFeature.js +156 -0
  132. package/lib/module/features/EnvironmentFeature.js.map +1 -0
  133. package/lib/module/features/NavigationLogFeature.js +32 -0
  134. package/lib/module/features/NavigationLogFeature.js.map +1 -0
  135. package/lib/module/features/NetworkFeature.js +101 -0
  136. package/lib/module/features/NetworkFeature.js.map +1 -0
  137. package/lib/module/features/ThirdPartyLibsFeature.js +46 -0
  138. package/lib/module/features/ThirdPartyLibsFeature.js.map +1 -0
  139. package/lib/module/features/TrackFeature.js +27 -0
  140. package/lib/module/features/TrackFeature.js.map +1 -0
  141. package/lib/module/features/ZustandLogFeature.js +53 -0
  142. package/lib/module/features/ZustandLogFeature.js.map +1 -0
  143. package/lib/module/hooks/useNavigationLogger.js +74 -0
  144. package/lib/module/hooks/useNavigationLogger.js.map +1 -0
  145. package/lib/module/hooks/useSlideDetailAnimation.js +50 -0
  146. package/lib/module/hooks/useSlideDetailAnimation.js.map +1 -0
  147. package/lib/module/index.js +28 -0
  148. package/lib/module/index.js.map +1 -0
  149. package/lib/module/initialize.js +80 -0
  150. package/lib/module/initialize.js.map +1 -0
  151. package/lib/module/interceptors/networkInterceptor.js +460 -0
  152. package/lib/module/interceptors/networkInterceptor.js.map +1 -0
  153. package/lib/module/native/NativeDebugLibs.js +54 -0
  154. package/lib/module/native/NativeDebugLibs.js.map +1 -0
  155. package/lib/module/package.json +1 -0
  156. package/lib/module/types/index.js +4 -0
  157. package/lib/module/types/index.js.map +1 -0
  158. package/lib/module/utils/colors.js +43 -0
  159. package/lib/module/utils/colors.js.map +1 -0
  160. package/lib/module/utils/copyToComputer.js +91 -0
  161. package/lib/module/utils/copyToComputer.js.map +1 -0
  162. package/lib/module/utils/createChannelFeature.js +44 -0
  163. package/lib/module/utils/createChannelFeature.js.map +1 -0
  164. package/lib/module/utils/createEventChannel.js +17 -0
  165. package/lib/module/utils/createEventChannel.js.map +1 -0
  166. package/lib/module/utils/createObservableStore.js +34 -0
  167. package/lib/module/utils/createObservableStore.js.map +1 -0
  168. package/lib/module/utils/layout.js +4 -0
  169. package/lib/module/utils/layout.js.map +1 -0
  170. package/lib/module/utils/safeStringify.js +23 -0
  171. package/lib/module/utils/safeStringify.js.map +1 -0
  172. package/lib/module/utils/urlRewriterRegistry.js +10 -0
  173. package/lib/module/utils/urlRewriterRegistry.js.map +1 -0
  174. package/lib/typescript/src/components/ClipboardTab.d.ts +4 -0
  175. package/lib/typescript/src/components/ClipboardTab.d.ts.map +1 -0
  176. package/lib/typescript/src/components/ConsoleLogTab.d.ts +4 -0
  177. package/lib/typescript/src/components/ConsoleLogTab.d.ts.map +1 -0
  178. package/lib/typescript/src/components/DebugPanel.d.ts +9 -0
  179. package/lib/typescript/src/components/DebugPanel.d.ts.map +1 -0
  180. package/lib/typescript/src/components/DebugView.d.ts +19 -0
  181. package/lib/typescript/src/components/DebugView.d.ts.map +1 -0
  182. package/lib/typescript/src/components/EnvironmentTab.d.ts +4 -0
  183. package/lib/typescript/src/components/EnvironmentTab.d.ts.map +1 -0
  184. package/lib/typescript/src/components/FeatureTabBar.d.ts +13 -0
  185. package/lib/typescript/src/components/FeatureTabBar.d.ts.map +1 -0
  186. package/lib/typescript/src/components/FloatIcon.d.ts +12 -0
  187. package/lib/typescript/src/components/FloatIcon.d.ts.map +1 -0
  188. package/lib/typescript/src/components/FloatPanelView.d.ts +9 -0
  189. package/lib/typescript/src/components/FloatPanelView.d.ts.map +1 -0
  190. package/lib/typescript/src/components/NavigationLogTab.d.ts +4 -0
  191. package/lib/typescript/src/components/NavigationLogTab.d.ts.map +1 -0
  192. package/lib/typescript/src/components/NetworkLogTab.d.ts +4 -0
  193. package/lib/typescript/src/components/NetworkLogTab.d.ts.map +1 -0
  194. package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts +4 -0
  195. package/lib/typescript/src/components/ThirdPartyLibsTab.d.ts.map +1 -0
  196. package/lib/typescript/src/components/TrackLogTab.d.ts +4 -0
  197. package/lib/typescript/src/components/TrackLogTab.d.ts.map +1 -0
  198. package/lib/typescript/src/components/ZustandLogTab.d.ts +4 -0
  199. package/lib/typescript/src/components/ZustandLogTab.d.ts.map +1 -0
  200. package/lib/typescript/src/components/shared/CollapsibleSection.d.ts +9 -0
  201. package/lib/typescript/src/components/shared/CollapsibleSection.d.ts.map +1 -0
  202. package/lib/typescript/src/components/shared/CopyButton.d.ts +12 -0
  203. package/lib/typescript/src/components/shared/CopyButton.d.ts.map +1 -0
  204. package/lib/typescript/src/components/shared/JsonView.d.ts +6 -0
  205. package/lib/typescript/src/components/shared/JsonView.d.ts.map +1 -0
  206. package/lib/typescript/src/components/shared/LogListScreen.d.ts +21 -0
  207. package/lib/typescript/src/components/shared/LogListScreen.d.ts.map +1 -0
  208. package/lib/typescript/src/core/DebugToolkit.d.ts +20 -0
  209. package/lib/typescript/src/core/DebugToolkit.d.ts.map +1 -0
  210. package/lib/typescript/src/core/DebugToolkitProvider.d.ts +15 -0
  211. package/lib/typescript/src/core/DebugToolkitProvider.d.ts.map +1 -0
  212. package/lib/typescript/src/features/ClipboardFeature.d.ts +7 -0
  213. package/lib/typescript/src/features/ClipboardFeature.d.ts.map +1 -0
  214. package/lib/typescript/src/features/ConsoleLogFeature.d.ts +9 -0
  215. package/lib/typescript/src/features/ConsoleLogFeature.d.ts.map +1 -0
  216. package/lib/typescript/src/features/EnvironmentFeature.d.ts +8 -0
  217. package/lib/typescript/src/features/EnvironmentFeature.d.ts.map +1 -0
  218. package/lib/typescript/src/features/NavigationLogFeature.d.ts +10 -0
  219. package/lib/typescript/src/features/NavigationLogFeature.d.ts.map +1 -0
  220. package/lib/typescript/src/features/NetworkFeature.d.ts +15 -0
  221. package/lib/typescript/src/features/NetworkFeature.d.ts.map +1 -0
  222. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts +3 -0
  223. package/lib/typescript/src/features/ThirdPartyLibsFeature.d.ts.map +1 -0
  224. package/lib/typescript/src/features/TrackFeature.d.ts +14 -0
  225. package/lib/typescript/src/features/TrackFeature.d.ts.map +1 -0
  226. package/lib/typescript/src/features/ZustandLogFeature.d.ts +31 -0
  227. package/lib/typescript/src/features/ZustandLogFeature.d.ts.map +1 -0
  228. package/lib/typescript/src/hooks/useNavigationLogger.d.ts +13 -0
  229. package/lib/typescript/src/hooks/useNavigationLogger.d.ts.map +1 -0
  230. package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts +11 -0
  231. package/lib/typescript/src/hooks/useSlideDetailAnimation.d.ts.map +1 -0
  232. package/lib/typescript/src/index.d.ts +26 -0
  233. package/lib/typescript/src/index.d.ts.map +1 -0
  234. package/lib/typescript/src/initialize.d.ts +32 -0
  235. package/lib/typescript/src/initialize.d.ts.map +1 -0
  236. package/lib/typescript/src/interceptors/networkInterceptor.d.ts +18 -0
  237. package/lib/typescript/src/interceptors/networkInterceptor.d.ts.map +1 -0
  238. package/lib/typescript/src/native/NativeDebugLibs.d.ts +11 -0
  239. package/lib/typescript/src/native/NativeDebugLibs.d.ts.map +1 -0
  240. package/lib/typescript/src/types/index.d.ts +109 -0
  241. package/lib/typescript/src/types/index.d.ts.map +1 -0
  242. package/lib/typescript/src/utils/colors.d.ts +21 -0
  243. package/lib/typescript/src/utils/colors.d.ts.map +1 -0
  244. package/lib/typescript/src/utils/copyToComputer.d.ts +30 -0
  245. package/lib/typescript/src/utils/copyToComputer.d.ts.map +1 -0
  246. package/lib/typescript/src/utils/createChannelFeature.d.ts +18 -0
  247. package/lib/typescript/src/utils/createChannelFeature.d.ts.map +1 -0
  248. package/lib/typescript/src/utils/createEventChannel.d.ts +7 -0
  249. package/lib/typescript/src/utils/createEventChannel.d.ts.map +1 -0
  250. package/lib/typescript/src/utils/createObservableStore.d.ts +9 -0
  251. package/lib/typescript/src/utils/createObservableStore.d.ts.map +1 -0
  252. package/lib/typescript/src/utils/layout.d.ts +2 -0
  253. package/lib/typescript/src/utils/layout.d.ts.map +1 -0
  254. package/lib/typescript/src/utils/safeStringify.d.ts +6 -0
  255. package/lib/typescript/src/utils/safeStringify.d.ts.map +1 -0
  256. package/lib/typescript/src/utils/urlRewriterRegistry.d.ts +7 -0
  257. package/lib/typescript/src/utils/urlRewriterRegistry.d.ts.map +1 -0
  258. package/package.json +67 -24
  259. package/src/components/ClipboardTab.tsx +81 -0
  260. package/src/components/ConsoleLogTab.tsx +95 -0
  261. package/src/components/DebugPanel.tsx +215 -0
  262. package/src/components/DebugView.tsx +80 -0
  263. package/src/components/EnvironmentTab.tsx +276 -0
  264. package/src/components/FeatureTabBar.tsx +204 -0
  265. package/src/components/FloatIcon.tsx +171 -0
  266. package/src/components/FloatPanelView.tsx +202 -0
  267. package/src/components/NavigationLogTab.tsx +66 -0
  268. package/src/components/NetworkLogTab.tsx +270 -0
  269. package/src/components/ThirdPartyLibsTab.tsx +63 -0
  270. package/src/components/TrackLogTab.tsx +110 -0
  271. package/src/components/ZustandLogTab.tsx +203 -0
  272. package/src/components/shared/CollapsibleSection.tsx +78 -0
  273. package/src/components/shared/CopyButton.tsx +68 -0
  274. package/src/components/shared/JsonView.tsx +125 -0
  275. package/src/components/shared/LogListScreen.tsx +164 -0
  276. package/src/core/DebugToolkit.tsx +150 -0
  277. package/src/core/DebugToolkitProvider.tsx +83 -0
  278. package/src/features/ClipboardFeature.ts +15 -0
  279. package/src/features/ConsoleLogFeature.ts +116 -0
  280. package/src/features/EnvironmentFeature.ts +186 -0
  281. package/src/features/NavigationLogFeature.ts +44 -0
  282. package/src/features/NetworkFeature.ts +126 -0
  283. package/src/features/ThirdPartyLibsFeature.ts +42 -0
  284. package/src/features/TrackFeature.ts +34 -0
  285. package/src/features/ZustandLogFeature.ts +101 -0
  286. package/src/hooks/useNavigationLogger.ts +102 -0
  287. package/src/hooks/useSlideDetailAnimation.ts +45 -0
  288. package/src/index.ts +48 -0
  289. package/src/initialize.ts +122 -0
  290. package/src/interceptors/networkInterceptor.ts +646 -0
  291. package/src/native/NativeDebugLibs.ts +74 -0
  292. package/src/types/index.ts +127 -0
  293. package/src/utils/colors.ts +38 -0
  294. package/src/utils/copyToComputer.ts +104 -0
  295. package/src/utils/createChannelFeature.ts +55 -0
  296. package/src/utils/createEventChannel.ts +22 -0
  297. package/src/utils/createObservableStore.ts +42 -0
  298. package/src/utils/layout.ts +1 -0
  299. package/src/utils/safeStringify.ts +25 -0
  300. package/src/utils/urlRewriterRegistry.ts +10 -0
  301. package/.cursor/rules/react-native.mdc +0 -41
  302. package/index.js +0 -41
  303. package/ios/BuildTypeModule.h +0 -9
  304. package/ios/BuildTypeModule.m +0 -42
  305. package/ios/RNDebugLibs.h +0 -10
  306. package/ios/RNDebugLibs.m +0 -79
  307. package/lib/DebugToolKit.js +0 -126
  308. package/lib/EnvironmentManager.ts +0 -80
  309. package/lib/NativeDebugLibs.js +0 -67
  310. package/lib/features/ConsoleLogFeature.js +0 -70
  311. package/lib/features/NavigationLogFeature.js +0 -45
  312. package/lib/features/NetworkFeature.js +0 -389
  313. package/lib/features/PerformanceFeature.js +0 -390
  314. package/lib/features/ThirdPartyLibsFeature.js +0 -63
  315. package/lib/features/TrackFeature.js +0 -94
  316. package/lib/features/ZustandLogFeature.js +0 -44
  317. package/lib/hooks/useNavigationLogger.js +0 -92
  318. package/lib/index.js +0 -114
  319. package/lib/navigation/NavigationLogger.js +0 -1
  320. package/lib/types/TrackTypes.ts +0 -92
  321. package/lib/utils/DebugConst.js +0 -67
  322. package/lib/utils/StorageUtils.js +0 -80
  323. package/lib/views/ConsoleLogDetails.js +0 -314
  324. package/lib/views/FloatPanelView.js +0 -697
  325. package/lib/views/HttpLogDetails.js +0 -648
  326. package/lib/views/NavigationLogDetails.js +0 -302
  327. package/lib/views/RestartModal.js +0 -75
  328. package/lib/views/SubViewConsoleLogs.js +0 -209
  329. package/lib/views/SubViewEnvironment.js +0 -73
  330. package/lib/views/SubViewHTTPLogs.js +0 -235
  331. package/lib/views/SubViewNavigationLogs.js +0 -199
  332. package/lib/views/SubViewPerformance.js +0 -515
  333. package/lib/views/SubViewThirdPartyLibs.js +0 -239
  334. package/lib/views/SubViewTrackLogs.js +0 -318
  335. package/lib/views/SubViewZustandLogs.js +0 -279
  336. package/lib/views/TabView.js +0 -66
  337. package/lib/views/TrackLogDetails.js +0 -481
  338. package/lib/views/ZustandLogDetails.js +0 -355
  339. package/react-native-debug-toolkit.podspec +0 -25
  340. package/react-native.config.js +0 -18
@@ -1,126 +0,0 @@
1
- import React from 'react'
2
- import { BackHandler, Pressable, Text } from 'react-native'
3
- import RootSiblings from 'react-native-root-siblings'
4
- import FloatPanelView from './views/FloatPanelView'
5
- import NativeDebugLibs from './NativeDebugLibs'
6
-
7
- export default class DebugToolKit {
8
- static instance = null
9
-
10
- constructor(config = {}) {
11
- if (DebugToolKit.instance) {
12
- return DebugToolKit.instance
13
- }
14
-
15
- // Set the debug mode flag directly from NativeDebugLibs
16
- // this.isDebugMode = NativeDebugLibs.isDebugBuild()
17
- this.isDebugMode = true
18
-
19
- this.floatPanel = null
20
- this.features = []
21
- this.isPanelVisible = false
22
-
23
- const featuresToLoad = config.features || []
24
-
25
- // Only load features in debug mode
26
- if (this.isDebugMode) {
27
- featuresToLoad.forEach(featureOrCreator => {
28
- const feature = typeof featureOrCreator === 'function'
29
- ? featureOrCreator()
30
- : featureOrCreator
31
- this.addFeature(feature)
32
- })
33
-
34
- if (config.autoShow) {
35
- this.showDebugPanel()
36
- }
37
-
38
- BackHandler.addEventListener('hardwareBackPress', () => true)
39
- } else {
40
- console.log('[DebugToolKit] Not initializing features - not in debug mode')
41
- }
42
-
43
- DebugToolKit.instance = this
44
- }
45
-
46
- addFeature(feature) {
47
- if (!this.isDebugMode) return this;
48
-
49
- if (feature && typeof feature.name === 'string') {
50
- this.features.push(feature)
51
- feature.setup?.()
52
- } else {
53
- console.warn('[DebugToolKit] Invalid feature added:', feature)
54
- }
55
- return this
56
- }
57
-
58
-
59
- clearAll = () => {
60
- // Clear all logs from all features
61
- this.features.forEach((feature) => {
62
- if (typeof feature.cleanup === 'function') {
63
- feature.cleanup();
64
- }
65
- // Re-setup the feature to initialize it again
66
- if (typeof feature.setup === 'function') {
67
- feature.setup();
68
- }
69
- });
70
-
71
- }
72
-
73
- showDebugPanel = () => {
74
- if (!this.isDebugMode) {
75
- return
76
- }
77
-
78
- if (!this.floatPanel) {
79
- this.floatPanel = new RootSiblings(
80
- <FloatPanelView
81
- features={this.features}
82
- close={this.hideDebugPanel}
83
- clearAll={this.clearAll}
84
- />,
85
- )
86
- }
87
- this.isPanelVisible = true
88
- }
89
-
90
- hideDebugPanel = () => {
91
- if (this.floatPanel) {
92
- this.floatPanel.destroy()
93
- this.floatPanel = null
94
- }
95
- }
96
-
97
- updateDebugPanel() {
98
- if (this.floatPanel) {
99
- this.floatPanel.update(
100
- <FloatPanelView
101
- features={this.features}
102
- close={this.hideDebugPanel}
103
- clearAll={this.clearAll}
104
- />,
105
- )
106
- }
107
- }
108
-
109
- destroy() {
110
- this.hideDebugPanel()
111
-
112
- if (this.restartModal) {
113
- this.restartModal.destroy()
114
- this.restartModal = null
115
- }
116
-
117
- this.features.forEach((feature) => {
118
- if (typeof feature.cleanup === 'function') {
119
- feature.cleanup()
120
- }
121
- })
122
-
123
- this.features = []
124
- BackHandler.removeEventListener('hardwareBackPress')
125
- }
126
- }
@@ -1,80 +0,0 @@
1
- import AsyncStorage from '@react-native-async-storage/async-storage';
2
-
3
- export type BaseEnvironmentConfig = {
4
- [key: string]: any;
5
- };
6
-
7
- export class EnvironmentManager<T extends BaseEnvironmentConfig> {
8
- private static instance: EnvironmentManager<any>;
9
- private currentEnv: string;
10
- private environments: Record<string, T>;
11
- private listeners: ((env: T) => void)[] = [];
12
- static ENV_STORAGE_KEY = '@debug_toolkit_env';
13
-
14
- protected constructor() {
15
- this.environments = {};
16
- this.currentEnv = '';
17
- }
18
-
19
- public static getInstance<T extends BaseEnvironmentConfig>(): EnvironmentManager<T> {
20
- if (!EnvironmentManager.instance) {
21
- EnvironmentManager.instance = new EnvironmentManager<T>();
22
- }
23
- return EnvironmentManager.instance;
24
- }
25
-
26
- public async initialize(environments: Record<string, T>, defaultEnv: string): Promise<string> {
27
- if (!__DEV__) return defaultEnv;
28
-
29
- this.environments = environments;
30
-
31
- try {
32
- const savedEnv = await AsyncStorage.getItem(EnvironmentManager.ENV_STORAGE_KEY);
33
- this.currentEnv = savedEnv || defaultEnv;
34
- await AsyncStorage.setItem(EnvironmentManager.ENV_STORAGE_KEY, this.currentEnv);
35
- return this.currentEnv;
36
- } catch (error) {
37
- console.error('EnvironmentManager initialization error:', error);
38
- this.currentEnv = defaultEnv;
39
- return defaultEnv;
40
- }
41
- }
42
-
43
- public async changeEnvironment(newValue: string): Promise<void> {
44
- if (newValue === this.currentEnv) return;
45
-
46
- try {
47
- await AsyncStorage.setItem(EnvironmentManager.ENV_STORAGE_KEY, newValue);
48
- this.currentEnv = newValue;
49
-
50
- const envConfig = this.environments[newValue];
51
- this.listeners.forEach(listener => listener(envConfig));
52
- } catch (error) {
53
- console.error('Failed to change environment:', error);
54
- throw error;
55
- }
56
- }
57
-
58
- public getCurrentEnvironment(): string {
59
- return this.currentEnv;
60
- }
61
-
62
- public getEnvironmentConfig(): T {
63
- return this.environments[this.currentEnv];
64
- }
65
-
66
- public getEnvironments(): Record<string, T> {
67
- return this.environments;
68
- }
69
-
70
- public onEnvironmentChange(listener: (env: T) => void): () => void {
71
- this.listeners.push(listener);
72
- return () => {
73
- this.listeners = this.listeners.filter(l => l !== listener);
74
- };
75
- }
76
-
77
- public destroy(): void {
78
- this.listeners = [];
79
- }
80
- }
@@ -1,67 +0,0 @@
1
- import { NativeModules, Platform } from 'react-native'
2
-
3
- const { RNDebugLibs, BuildTypeModule } = NativeModules
4
-
5
- export default class NativeDebugLibs {
6
- // Build type methods
7
- static getBuildType() {
8
- if (BuildTypeModule) {
9
- return BuildTypeModule.getBuildType();
10
- }
11
- return Promise.resolve(null);
12
- }
13
-
14
- static getBuildTypeSync() {
15
- console.log('BuildTypeModule', BuildTypeModule);
16
- if (BuildTypeModule) {
17
- console.log('BuildTypeModule.getBuildTypeSync()', BuildTypeModule.getBuildTypeSync());
18
- return BuildTypeModule.getBuildTypeSync();
19
- }
20
- return null;
21
- }
22
-
23
- static isDebugBuild() {
24
- if (BuildTypeModule) {
25
- return BuildTypeModule.getBuildTypeSync() === 'debug';
26
- }
27
- return false;
28
- }
29
-
30
- // FLEX methods (iOS only)
31
- static showExplorer() {
32
- if (Platform.OS === 'ios' && RNDebugLibs) {
33
- RNDebugLibs.showExplorer()
34
- }
35
- }
36
-
37
- static hideExplorer() {
38
- if (Platform.OS === 'ios' && RNDebugLibs) {
39
- RNDebugLibs.hideExplorer()
40
- }
41
- }
42
-
43
- static toggleExplorer() {
44
- if (Platform.OS === 'ios' && RNDebugLibs) {
45
- RNDebugLibs.toggleExplorer()
46
- }
47
- }
48
-
49
- // DoraemonKit/DoKit methods
50
- static installDoraemonKit(productId) {
51
- // if (RNDebugLibs) {
52
- // RNDebugLibs.installDoraemonKit(productId)
53
- // }
54
- }
55
-
56
- static showDoraemonKit() {
57
- // if (RNDebugLibs) {
58
- // RNDebugLibs.showDoraemonKit()
59
- // }
60
- }
61
-
62
- static hideDoraemonKit() {
63
- // if (RNDebugLibs) {
64
- // RNDebugLibs.hideDoraemonKit()
65
- // }
66
- }
67
- }
@@ -1,70 +0,0 @@
1
- const MAX_LOGS = 200; // Max number of console logs to store
2
- const logs = [];
3
- const originalConsole = {}; // Store original console methods
4
-
5
- const _interceptConsole = () => {
6
- const levels = ['log', 'info', 'warn', 'error'];
7
- levels.forEach(level => {
8
- if (typeof console[level] === 'function') { // Check if it's actually a function
9
- originalConsole[level] = console[level]; // Store original
10
-
11
- console[level] = (...args) => {
12
- // Call original console method first
13
- originalConsole[level].apply(console, args); // Use apply for proper context
14
-
15
- // Add log entry
16
- if (logs.length >= MAX_LOGS) {
17
- logs.shift(); // Remove the oldest log if limit is reached
18
- }
19
-
20
- // Store log data
21
- logs.push({
22
- timestamp: new Date(),
23
- level: level,
24
- data: args, // Store all arguments passed to console[level]
25
- });
26
-
27
- // TODO: Notify UI if needed
28
- };
29
- }
30
- });
31
- };
32
-
33
- const _restoreConsole = () => {
34
- Object.keys(originalConsole).forEach(level => {
35
- if (originalConsole[level]) {
36
- console[level] = originalConsole[level];
37
- delete originalConsole[level]; // Clean up stored method
38
- }
39
- });
40
- };
41
-
42
- const setup = () => {
43
- _interceptConsole();
44
- };
45
-
46
- const getData = () => {
47
- return logs;
48
- };
49
-
50
- const cleanup = () => {
51
- _restoreConsole();
52
- logs.length = 0; // More efficient way to clear array
53
- };
54
-
55
- // Factory function remains similar but uses the module-level functions
56
- export const createConsoleLogFeature = () => {
57
- // Ensure setup is only called once if multiple features might be created (though unlikely for console)
58
- // A simple flag could work here if needed, but maybe setup belongs in the main toolkit init.
59
- return {
60
- name: 'console',
61
- label: 'Console Logs',
62
- setup: setup, // Reference module-level function
63
- getData: getData, // Reference module-level function
64
- cleanup: cleanup, // Reference module-level function
65
- };
66
- };
67
-
68
- // Note: This refactor removes the class structure entirely, relying on module scope
69
- // for the "singleton" nature. Decide if this fits the overall pattern of other features.
70
- // The original class-based singleton is also perfectly valid.
@@ -1,45 +0,0 @@
1
- const MAX_LOGS = 200; // Max number of navigation logs to store
2
- const logs = [];
3
- const originalNavigationMethods = {}; // Store original navigation methods
4
-
5
- const setup = () => {
6
- // Note: Actual navigation interception will be done in the main app code
7
- // This is just a setup function for compatibility with the feature API
8
- };
9
-
10
- // Function to add navigation log
11
- export const addNavigationLog = (action, from, to, startTime, duration, debugLog) => {
12
- // Store log data
13
- logs.push({
14
- timestamp: new Date(),
15
- action: action, // push, pop, replace, etc.
16
- from: from, // source route info
17
- to: to, // destination route info
18
- startTime: startTime,
19
- duration: duration,
20
- debugLog: debugLog,
21
- });
22
-
23
- // Trim logs if they exceed the maximum limit
24
- if (logs.length > MAX_LOGS) {
25
- logs.splice(0, logs.length - MAX_LOGS);
26
- }
27
- };
28
-
29
- const getData = () => {
30
- return logs;
31
- };
32
-
33
- const cleanup = () => {
34
- logs.length = 0; // Clear array
35
- };
36
-
37
- export const createNavigationLogFeature = () => {
38
- return {
39
- name: 'navigation',
40
- label: 'Navigation Logs',
41
- setup: setup,
42
- getData: getData,
43
- cleanup: cleanup,
44
- };
45
- };