react-native-inapp-inspector 2.0.5 → 2.0.7
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/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +11 -0
- package/dist/commonjs/components/Inspector/AuditTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AuditTab.js +741 -0
- package/dist/commonjs/components/Inspector/DeviceTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/DeviceTab.js +717 -0
- package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.js +600 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -25
- package/dist/commonjs/components/Inspector/MainScreen.js +19 -2
- package/dist/commonjs/components/Inspector/NetworkDetail.js +15 -0
- package/dist/commonjs/components/Inspector/PerformanceHud.d.ts +7 -0
- package/dist/commonjs/components/Inspector/PerformanceHud.js +210 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -18
- package/dist/commonjs/components/Inspector/RequestReplayModal.d.ts +9 -0
- package/dist/commonjs/components/Inspector/RequestReplayModal.js +792 -0
- package/dist/commonjs/components/Inspector/RequestReplayView.d.ts +8 -0
- package/dist/commonjs/components/Inspector/RequestReplayView.js +871 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +448 -49
- package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +610 -0
- package/dist/commonjs/components/Inspector/TabBar.js +23 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +12 -0
- package/dist/commonjs/components/NetworkIcons.js +72 -3
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/storageInspector.d.ts +13 -0
- package/dist/commonjs/customHooks/storageInspector.js +179 -0
- package/dist/commonjs/helpers/deviceInfo.d.ts +4 -0
- package/dist/commonjs/helpers/deviceInfo.js +94 -0
- package/dist/commonjs/helpers/index.d.ts +2 -0
- package/dist/commonjs/helpers/index.js +12 -1
- package/dist/commonjs/helpers/packageAuditor.d.ts +5 -0
- package/dist/commonjs/helpers/packageAuditor.js +182 -0
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -1
- package/dist/commonjs/helpers/settingsStore.js +4 -2
- package/dist/commonjs/i18n/locales/en.json +3 -2
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +127 -9
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/types/enums.d.ts +7 -0
- package/dist/commonjs/types/enums.js +7 -0
- package/dist/commonjs/types/interfaces.d.ts +77 -0
- package/dist/esm/components/Inspector/AuditTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AuditTab.js +702 -0
- package/dist/esm/components/Inspector/DeviceTab.d.ts +3 -0
- package/dist/esm/components/Inspector/DeviceTab.js +678 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.js +560 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +28 -25
- package/dist/esm/components/Inspector/MainScreen.js +19 -2
- package/dist/esm/components/Inspector/NetworkDetail.js +16 -1
- package/dist/esm/components/Inspector/PerformanceHud.d.ts +7 -0
- package/dist/esm/components/Inspector/PerformanceHud.js +170 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +31 -19
- package/dist/esm/components/Inspector/RequestReplayModal.d.ts +9 -0
- package/dist/esm/components/Inspector/RequestReplayModal.js +752 -0
- package/dist/esm/components/Inspector/RequestReplayView.d.ts +8 -0
- package/dist/esm/components/Inspector/RequestReplayView.js +831 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +449 -50
- package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
- package/dist/esm/components/Inspector/StorageTab.js +571 -0
- package/dist/esm/components/Inspector/TabBar.js +24 -3
- package/dist/esm/components/NetworkIcons.d.ts +12 -0
- package/dist/esm/components/NetworkIcons.js +57 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/storageInspector.d.ts +13 -0
- package/dist/esm/customHooks/storageInspector.js +170 -0
- package/dist/esm/helpers/deviceInfo.d.ts +4 -0
- package/dist/esm/helpers/deviceInfo.js +89 -0
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +10 -0
- package/dist/esm/helpers/packageAuditor.d.ts +5 -0
- package/dist/esm/helpers/packageAuditor.js +173 -0
- package/dist/esm/helpers/settingsStore.d.ts +1 -1
- package/dist/esm/helpers/settingsStore.js +4 -2
- package/dist/esm/i18n/locales/en.json +3 -2
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +123 -8
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/types/enums.d.ts +7 -0
- package/dist/esm/types/enums.js +7 -0
- package/dist/esm/types/interfaces.d.ts +77 -0
- package/ios/NetworkInspectorModule.mm +12 -5
- package/package.json +4 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react';
|
|
2
|
-
import { Alert, Animated, PanResponder, Platform, UIManager, LogBox, InteractionManager, } from 'react-native';
|
|
2
|
+
import { Alert, Animated, PanResponder, Platform, UIManager, LogBox, InteractionManager, View, StyleSheet, } from 'react-native';
|
|
3
3
|
import { NavigationContext } from '@react-navigation/native';
|
|
4
4
|
// i18n
|
|
5
5
|
import { I18nextProvider, i18n } from './i18n';
|
|
@@ -23,14 +23,22 @@ import { subscribeAnalyticsEvents, clearAnalyticsEvents, autoSetupAnalyticsLogge
|
|
|
23
23
|
import { getReduxState, subscribeReduxState, setReduxAutoRefresh, getLastActionForReducer, clearActionHistory, isReduxConnected, setReduxModuleEnabled, } from './customHooks/reduxLogger';
|
|
24
24
|
import { setPerformanceModuleEnabled } from './customHooks/performanceTracker';
|
|
25
25
|
import { setBundleModuleEnabled } from './customHooks/bundleAnalyzer';
|
|
26
|
+
import { fetchAllStorageEntries, setStorageItem, removeStorageItem, clearAllStorage, subscribeStorageChanges, } from './customHooks/storageInspector';
|
|
27
|
+
import { getSystemDiagnostics } from './helpers/deviceInfo';
|
|
28
|
+
import { runLivePackageAudit, subscribeAuditChanges, logCodeQualityIssue, } from './helpers/packageAuditor';
|
|
26
29
|
import { showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, isNativeModuleAvailable, } from './native/NativeInspector';
|
|
27
30
|
import { LIB_VERSION } from './constants';
|
|
28
31
|
// Stylesheet
|
|
29
32
|
import { toggleGlobalTheme } from './styles';
|
|
30
|
-
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, appIcon, environment, initialVisible, visible: controlledVisible, }) => {
|
|
33
|
+
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, appIcon, environment, initialVisible, visible: controlledVisible, initialTab, enablePerformanceHud = false, }) => {
|
|
34
|
+
// Zero-overhead production stub: if disabled, return null immediately
|
|
35
|
+
if (!enabled || !isEnabled) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
31
38
|
// Set custom storage synchronously during render phase
|
|
32
39
|
setCustomStorage(storage || null);
|
|
33
40
|
const [isDark, setIsDark] = useState(false);
|
|
41
|
+
const [isPerformanceHudEnabled, setIsPerformanceHudEnabled] = useState(enablePerformanceHud);
|
|
34
42
|
const [reduxState, setReduxState] = useState(null);
|
|
35
43
|
// Per-reducer last action is kept in component state so the
|
|
36
44
|
// Redux tab re-renders live on every dispatch, independent of the state tree ref.
|
|
@@ -45,6 +53,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
45
53
|
setVisible(controlledVisible);
|
|
46
54
|
}
|
|
47
55
|
}, [controlledVisible]);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (enablePerformanceHud !== undefined) {
|
|
58
|
+
setIsPerformanceHudEnabled(enablePerformanceHud);
|
|
59
|
+
}
|
|
60
|
+
}, [enablePerformanceHud]);
|
|
48
61
|
const [isReady, setIsReady] = useState(false);
|
|
49
62
|
const [selected, setSelected] = useState(null);
|
|
50
63
|
const [selectedLogs, setSelectedLogs] = useState(new Set());
|
|
@@ -76,6 +89,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
76
89
|
const [sectionFilters, setSectionFilters] = useState({});
|
|
77
90
|
const [collapsedSections, setCollapsedSections] = useState(new Set());
|
|
78
91
|
const [showHeaderInfo, setShowHeaderInfo] = useState(true);
|
|
92
|
+
const [isWalkthroughVisible, setIsWalkthroughVisible] = useState(true);
|
|
93
|
+
const hasCompletedWalkthroughRef = useRef(null);
|
|
79
94
|
const [sortOrder, setSortOrder] = useState('newest');
|
|
80
95
|
// #7 — sort order for the Logs (console) tab
|
|
81
96
|
const [logSortOrder, setLogSortOrder] = useState('newest');
|
|
@@ -84,7 +99,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
84
99
|
const [showReqDiff, setShowReqDiff] = useState(false);
|
|
85
100
|
const [showResDiff, setShowResDiff] = useState(false);
|
|
86
101
|
// ─── Analytics state ───────────────────────────────────────────────────────
|
|
87
|
-
const [activeTab, setActiveTab] = useState('apis');
|
|
102
|
+
const [activeTab, setActiveTab] = useState(initialTab || 'apis');
|
|
88
103
|
const [analyticsEvents, setAnalyticsEvents] = useState([]);
|
|
89
104
|
// ─── Logs state ────────────────────────────────────────────────────────────
|
|
90
105
|
const [consoleLogs, setConsoleLogs] = useState([]);
|
|
@@ -140,6 +155,47 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
140
155
|
setLastReadCrashesCount(crashRecords.length);
|
|
141
156
|
}
|
|
142
157
|
}, [activeTab, crashRecords.length]);
|
|
158
|
+
// ─── Storage state ─────────────────────────────────────────────────────────
|
|
159
|
+
const [storageEntries, setStorageEntries] = useState([]);
|
|
160
|
+
const [selectedStorageKey, setSelectedStorageKey] = useState(null);
|
|
161
|
+
const refreshStorageEntries = useCallback(async () => {
|
|
162
|
+
try {
|
|
163
|
+
const entries = await fetchAllStorageEntries();
|
|
164
|
+
setStorageEntries(entries);
|
|
165
|
+
}
|
|
166
|
+
catch { }
|
|
167
|
+
}, []);
|
|
168
|
+
const updateStorageEntry = useCallback(async (key, value) => {
|
|
169
|
+
await setStorageItem(key, value);
|
|
170
|
+
await refreshStorageEntries();
|
|
171
|
+
}, [refreshStorageEntries]);
|
|
172
|
+
const deleteStorageEntry = useCallback(async (key) => {
|
|
173
|
+
await removeStorageItem(key);
|
|
174
|
+
await refreshStorageEntries();
|
|
175
|
+
}, [refreshStorageEntries]);
|
|
176
|
+
const clearAllStorageEntries = useCallback(async () => {
|
|
177
|
+
await clearAllStorage();
|
|
178
|
+
await refreshStorageEntries();
|
|
179
|
+
}, [refreshStorageEntries]);
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
refreshStorageEntries();
|
|
182
|
+
const unsub = subscribeStorageChanges(refreshStorageEntries);
|
|
183
|
+
return () => unsub();
|
|
184
|
+
}, [refreshStorageEntries]);
|
|
185
|
+
// ─── Device info state ──────────────────────────────────────────────────────
|
|
186
|
+
const [deviceInfo] = useState(() => getSystemDiagnostics());
|
|
187
|
+
// ─── Code Quality & Package Audit state ─────────────────────────────────────
|
|
188
|
+
const [auditReport, setAuditReport] = useState(() => runLivePackageAudit());
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
const unsub = subscribeAuditChanges(setAuditReport);
|
|
191
|
+
return () => unsub();
|
|
192
|
+
}, []);
|
|
193
|
+
const refreshAuditReport = useCallback(() => {
|
|
194
|
+
setAuditReport(runLivePackageAudit());
|
|
195
|
+
}, []);
|
|
196
|
+
const logCustomAuditIssue = useCallback((issue) => {
|
|
197
|
+
logCodeQualityIssue(issue);
|
|
198
|
+
}, []);
|
|
143
199
|
const [maxConsoleLogs, setMaxConsoleLogs] = useState(100);
|
|
144
200
|
const [showConsoleLevels, setShowConsoleLevels] = useState({
|
|
145
201
|
info: true,
|
|
@@ -180,6 +236,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
180
236
|
logs: true,
|
|
181
237
|
analytics: false,
|
|
182
238
|
redux: false,
|
|
239
|
+
storage: false,
|
|
240
|
+
device: false,
|
|
241
|
+
audit: false,
|
|
183
242
|
bundle: false,
|
|
184
243
|
performance: false,
|
|
185
244
|
crash: false,
|
|
@@ -234,6 +293,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
234
293
|
logs: true,
|
|
235
294
|
analytics: false,
|
|
236
295
|
redux: false,
|
|
296
|
+
storage: false,
|
|
297
|
+
device: false,
|
|
298
|
+
audit: false,
|
|
237
299
|
bundle: false,
|
|
238
300
|
performance: false,
|
|
239
301
|
crash: false,
|
|
@@ -271,14 +333,24 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
271
333
|
setModalHeightPercent(saved.modalHeightPercent);
|
|
272
334
|
if (saved.modalAnimationType)
|
|
273
335
|
setModalAnimationType(saved.modalAnimationType);
|
|
274
|
-
if (saved.tabVisibility)
|
|
336
|
+
if (saved.tabVisibility) {
|
|
337
|
+
const savedVis = saved.tabVisibility;
|
|
275
338
|
setTabVisibility(prev => ({
|
|
276
339
|
...prev,
|
|
277
|
-
...
|
|
340
|
+
...savedVis,
|
|
341
|
+
storage: savedVis.storage ?? false,
|
|
342
|
+
device: savedVis.device ?? false,
|
|
343
|
+
audit: savedVis.audit ?? false,
|
|
278
344
|
apis: true, // APIs is always required
|
|
279
345
|
}));
|
|
280
|
-
|
|
346
|
+
}
|
|
347
|
+
if (initialTab) {
|
|
348
|
+
setActiveTab(initialTab);
|
|
349
|
+
}
|
|
350
|
+
else if (saved.defaultTab) {
|
|
281
351
|
setDefaultTab(saved.defaultTab);
|
|
352
|
+
setActiveTab(saved.defaultTab);
|
|
353
|
+
}
|
|
282
354
|
if (saved.isAutoRamLimitEnabled != null)
|
|
283
355
|
setIsAutoRamLimitEnabled(saved.isAutoRamLimitEnabled);
|
|
284
356
|
if (saved.maxNetworkLogs != null)
|
|
@@ -299,7 +371,10 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
299
371
|
setShowDuplicateLogs(saved.showDuplicateLogs);
|
|
300
372
|
if (saved.showUpdateToast != null)
|
|
301
373
|
setShowUpdateToast(saved.showUpdateToast);
|
|
302
|
-
if (
|
|
374
|
+
if (initialTab) {
|
|
375
|
+
setActiveTab(initialTab);
|
|
376
|
+
}
|
|
377
|
+
else if (saved.defaultTab) {
|
|
303
378
|
const dt = saved.defaultTab;
|
|
304
379
|
const vis = {
|
|
305
380
|
...{
|
|
@@ -307,6 +382,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
307
382
|
logs: true,
|
|
308
383
|
analytics: false,
|
|
309
384
|
redux: false,
|
|
385
|
+
storage: false,
|
|
386
|
+
device: false,
|
|
387
|
+
audit: false,
|
|
310
388
|
bundle: false,
|
|
311
389
|
performance: false,
|
|
312
390
|
crash: false,
|
|
@@ -316,6 +394,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
316
394
|
};
|
|
317
395
|
setActiveTab(vis[dt] ? dt : 'apis');
|
|
318
396
|
}
|
|
397
|
+
hasCompletedWalkthroughRef.current = saved.hasCompletedWalkthrough === true;
|
|
319
398
|
settingsHydratedRef.current = true;
|
|
320
399
|
});
|
|
321
400
|
return () => {
|
|
@@ -775,6 +854,17 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
775
854
|
? defaultTab
|
|
776
855
|
: 'apis';
|
|
777
856
|
setActiveTab(target);
|
|
857
|
+
setSelected(null);
|
|
858
|
+
setSelectedEvent(null);
|
|
859
|
+
setSelectedLog(null);
|
|
860
|
+
setSelectedReduxSlice(null);
|
|
861
|
+
setSelectedReduxAction(null);
|
|
862
|
+
setSelectedCrash(null);
|
|
863
|
+
// Trigger first-time walkthrough strictly on first FAB launch if not yet completed
|
|
864
|
+
if (hasCompletedWalkthroughRef.current === false) {
|
|
865
|
+
setIsWalkthroughVisible(true);
|
|
866
|
+
hasCompletedWalkthroughRef.current = true;
|
|
867
|
+
}
|
|
778
868
|
// Track inspector opened event in GA4
|
|
779
869
|
trackInspectorOpen({ activeTab: target });
|
|
780
870
|
// Instant synchronization of data collected while modal was closed
|
|
@@ -1620,6 +1710,12 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1620
1710
|
setModalAnimationType,
|
|
1621
1711
|
hasNavigationContext,
|
|
1622
1712
|
setNavState,
|
|
1713
|
+
isWalkthroughVisible,
|
|
1714
|
+
setIsWalkthroughVisible,
|
|
1715
|
+
openWalkthrough: () => {
|
|
1716
|
+
setSettingsPage(null);
|
|
1717
|
+
setIsWalkthroughVisible(true);
|
|
1718
|
+
},
|
|
1623
1719
|
// ─── Tabs ───────────────────────────────────────────────────────────
|
|
1624
1720
|
activeTab,
|
|
1625
1721
|
switchActiveTab,
|
|
@@ -1754,6 +1850,20 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1754
1850
|
setCrashRecords([]);
|
|
1755
1851
|
setSelectedCrash(null);
|
|
1756
1852
|
},
|
|
1853
|
+
// ─── Storage ─────────────────────────────────────────────────────────
|
|
1854
|
+
storageEntries,
|
|
1855
|
+
refreshStorageEntries,
|
|
1856
|
+
updateStorageEntry,
|
|
1857
|
+
deleteStorageEntry,
|
|
1858
|
+
clearAllStorageEntries,
|
|
1859
|
+
selectedStorageKey,
|
|
1860
|
+
setSelectedStorageKey,
|
|
1861
|
+
// ─── Device ──────────────────────────────────────────────────────────
|
|
1862
|
+
deviceInfo,
|
|
1863
|
+
// ─── Audit / Code Quality ─────────────────────────────────────────────
|
|
1864
|
+
auditReport,
|
|
1865
|
+
refreshAuditReport,
|
|
1866
|
+
logCustomAuditIssue,
|
|
1757
1867
|
// ─── Settings ───────────────────────────────────────────────────────
|
|
1758
1868
|
settingsActiveSubTab,
|
|
1759
1869
|
setSettingsActiveSubTab,
|
|
@@ -1778,13 +1888,17 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1778
1888
|
isAutoRamLimitEnabled,
|
|
1779
1889
|
setIsAutoRamLimitEnabled,
|
|
1780
1890
|
deviceFreeRamMb,
|
|
1891
|
+
isPerformanceHudEnabled,
|
|
1892
|
+
setIsPerformanceHudEnabled,
|
|
1781
1893
|
reduxAutoRefresh,
|
|
1782
1894
|
setReduxAutoRefreshState,
|
|
1783
1895
|
reduxExpandDepth,
|
|
1784
1896
|
setReduxExpandDepth,
|
|
1785
1897
|
};
|
|
1786
1898
|
return (<InspectorContext.Provider value={contextValue}>
|
|
1787
|
-
<
|
|
1899
|
+
<View style={StyleSheet.absoluteFill} pointerEvents="box-none">
|
|
1900
|
+
<MainScreen />
|
|
1901
|
+
</View>
|
|
1788
1902
|
</InspectorContext.Provider>);
|
|
1789
1903
|
};
|
|
1790
1904
|
const NetworkInspectorWrapper = (props) => {
|
|
@@ -1813,5 +1927,6 @@ export { usePerformanceTracker, useComponentProfiler, useNavigationProfiler, tra
|
|
|
1813
1927
|
export { InspectLog, InspectTrackTime, InspectCatch, } from './decorators';
|
|
1814
1928
|
export { getNativeDeviceMetrics, enableNativeCrashProtection, subscribeNativeCrashes, showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, startNativeFpsMonitoring, stopNativeFpsMonitoring, getNativeFpsMetrics, getNativeStorageItem, setNativeStorageItem, isNativeModuleAvailable, } from './native/NativeInspector';
|
|
1815
1929
|
export { sendSessionTelemetryPing, trackTelemetryEvent, trackInspectorOpen, trackTabSwitch, trackLogExport, GA4_MEASUREMENT_ID, GA4_API_SECRET, } from './helpers';
|
|
1930
|
+
export { runLivePackageAudit, logCodeQualityIssue, clearCustomAuditIssues, } from './helpers/packageAuditor';
|
|
1816
1931
|
export { BrandSquareIcon, BrandCircleIcon, } from './components/NetworkIcons';
|
|
1817
1932
|
export { ActiveTab, Method, StatusFilter, SortOrder, LocalFilter, ModalAnimationType, SettingsPage, SettingsSubTab, LogFilter, ConsoleLogType, AnalyticsEventSource, GAEventCategory, StackFrameType, DiffResultType, BundleSubTab, PerformanceSubTab, CrashType, CrashExportFormat, CrashDetailSubTab, CrashFilterType, BreadcrumbType, } from './types';
|
|
@@ -3,6 +3,9 @@ export declare const ActiveTab: {
|
|
|
3
3
|
readonly Analytics: "analytics";
|
|
4
4
|
readonly Logs: "logs";
|
|
5
5
|
readonly Redux: "redux";
|
|
6
|
+
readonly Storage: "storage";
|
|
7
|
+
readonly Device: "device";
|
|
8
|
+
readonly Audit: "audit";
|
|
6
9
|
readonly Bundle: "bundle";
|
|
7
10
|
readonly Performance: "performance";
|
|
8
11
|
readonly Crash: "crash";
|
|
@@ -49,6 +52,9 @@ export declare const SettingsPage: {
|
|
|
49
52
|
readonly Logs: "logs";
|
|
50
53
|
readonly Analytics: "analytics";
|
|
51
54
|
readonly Redux: "redux";
|
|
55
|
+
readonly Storage: "storage";
|
|
56
|
+
readonly Device: "device";
|
|
57
|
+
readonly Audit: "audit";
|
|
52
58
|
readonly Bundle: "bundle";
|
|
53
59
|
readonly Performance: "performance";
|
|
54
60
|
readonly Crash: "crash";
|
|
@@ -56,6 +62,7 @@ export declare const SettingsPage: {
|
|
|
56
62
|
export type SettingsPage = (typeof SettingsPage)[keyof typeof SettingsPage] | null;
|
|
57
63
|
export declare const SettingsSubTab: {
|
|
58
64
|
readonly Module: "module";
|
|
65
|
+
readonly Limits: "limits";
|
|
59
66
|
readonly Ui: "ui";
|
|
60
67
|
};
|
|
61
68
|
export type SettingsSubTab = (typeof SettingsSubTab)[keyof typeof SettingsSubTab];
|
package/dist/esm/types/enums.js
CHANGED
|
@@ -6,6 +6,9 @@ export const ActiveTab = {
|
|
|
6
6
|
Analytics: 'analytics',
|
|
7
7
|
Logs: 'logs',
|
|
8
8
|
Redux: 'redux',
|
|
9
|
+
Storage: 'storage',
|
|
10
|
+
Device: 'device',
|
|
11
|
+
Audit: 'audit',
|
|
9
12
|
Bundle: 'bundle',
|
|
10
13
|
Performance: 'performance',
|
|
11
14
|
Crash: 'crash',
|
|
@@ -46,12 +49,16 @@ export const SettingsPage = {
|
|
|
46
49
|
Logs: 'logs',
|
|
47
50
|
Analytics: 'analytics',
|
|
48
51
|
Redux: 'redux',
|
|
52
|
+
Storage: 'storage',
|
|
53
|
+
Device: 'device',
|
|
54
|
+
Audit: 'audit',
|
|
49
55
|
Bundle: 'bundle',
|
|
50
56
|
Performance: 'performance',
|
|
51
57
|
Crash: 'crash',
|
|
52
58
|
};
|
|
53
59
|
export const SettingsSubTab = {
|
|
54
60
|
Module: 'module',
|
|
61
|
+
Limits: 'limits',
|
|
55
62
|
Ui: 'ui',
|
|
56
63
|
};
|
|
57
64
|
export const LogFilter = {
|
|
@@ -3,6 +3,64 @@ import { ViewStyle } from 'react-native';
|
|
|
3
3
|
import { Animated, PanResponderInstance } from 'react-native';
|
|
4
4
|
import type { ActiveTab, BreadcrumbType, CrashType, GroupedListItem, LocalFilter, LogFilter, Method, SettingsPage, SettingsSubTab, SortOrder, StatusFilter } from './index';
|
|
5
5
|
export type SearchScope = 'all' | 'url' | 'reqBody' | 'resBody' | 'headers';
|
|
6
|
+
export interface StorageEntry {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
isJson: boolean;
|
|
11
|
+
parsedJson?: any;
|
|
12
|
+
updatedAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface DeviceInfoData {
|
|
15
|
+
appName: string;
|
|
16
|
+
bundleId: string;
|
|
17
|
+
appVersion: string;
|
|
18
|
+
buildNumber: string;
|
|
19
|
+
reactNativeVersion: string;
|
|
20
|
+
jsEngine: string;
|
|
21
|
+
isHermes: boolean;
|
|
22
|
+
isFabric: boolean;
|
|
23
|
+
isTurboModule: boolean;
|
|
24
|
+
platform: 'ios' | 'android' | 'windows' | 'macos' | 'web';
|
|
25
|
+
osVersion: string;
|
|
26
|
+
deviceModel: string;
|
|
27
|
+
deviceId?: string;
|
|
28
|
+
isDevice: boolean;
|
|
29
|
+
screenWidth: number;
|
|
30
|
+
screenHeight: number;
|
|
31
|
+
screenScale: number;
|
|
32
|
+
screenFontScale: number;
|
|
33
|
+
statusBarHeight: number;
|
|
34
|
+
memoryMb?: number;
|
|
35
|
+
arch?: string;
|
|
36
|
+
locale?: string;
|
|
37
|
+
timeZone?: string;
|
|
38
|
+
}
|
|
39
|
+
export type AuditSeverity = 'critical' | 'warning' | 'info' | 'optimal';
|
|
40
|
+
export type AuditCategory = 'dependency' | 'typescript' | 'peer' | 'performance' | 'security';
|
|
41
|
+
export interface AuditIssue {
|
|
42
|
+
id: string;
|
|
43
|
+
title: string;
|
|
44
|
+
message: string;
|
|
45
|
+
severity: AuditSeverity;
|
|
46
|
+
category: AuditCategory;
|
|
47
|
+
packageName?: string;
|
|
48
|
+
currentVersion?: string;
|
|
49
|
+
requiredVersion?: string;
|
|
50
|
+
fixCommand?: string;
|
|
51
|
+
fixSnippet?: string;
|
|
52
|
+
timestamp: number;
|
|
53
|
+
}
|
|
54
|
+
export interface PackageHealthReport {
|
|
55
|
+
score: number;
|
|
56
|
+
grade: 'A+' | 'A' | 'B' | 'C' | 'D';
|
|
57
|
+
totalIssues: number;
|
|
58
|
+
criticalCount: number;
|
|
59
|
+
warningCount: number;
|
|
60
|
+
infoCount: number;
|
|
61
|
+
issues: AuditIssue[];
|
|
62
|
+
scannedAt: number;
|
|
63
|
+
}
|
|
6
64
|
export interface ParsedStackFrame {
|
|
7
65
|
method: string;
|
|
8
66
|
file: string;
|
|
@@ -153,6 +211,7 @@ export interface PersistedSettings {
|
|
|
153
211
|
reduxExpandDepth?: number;
|
|
154
212
|
showDuplicateLogs?: boolean;
|
|
155
213
|
showUpdateToast?: boolean;
|
|
214
|
+
hasCompletedWalkthrough?: boolean;
|
|
156
215
|
}
|
|
157
216
|
export interface NetworkInspectorProps {
|
|
158
217
|
enabled?: boolean;
|
|
@@ -164,6 +223,8 @@ export interface NetworkInspectorProps {
|
|
|
164
223
|
environment?: 'DEV' | 'UAT' | 'PrePROD' | 'PROD' | 'QA' | 'Staging' | string;
|
|
165
224
|
initialVisible?: boolean;
|
|
166
225
|
visible?: boolean;
|
|
226
|
+
initialTab?: ActiveTab;
|
|
227
|
+
enablePerformanceHud?: boolean;
|
|
167
228
|
}
|
|
168
229
|
export interface NavigationTrackerProps {
|
|
169
230
|
onStateChange: (state: any) => void;
|
|
@@ -176,12 +237,17 @@ export interface InspectorContextValue {
|
|
|
176
237
|
isEnabled: boolean;
|
|
177
238
|
appIcon?: any;
|
|
178
239
|
environment?: string;
|
|
240
|
+
isPerformanceHudEnabled: boolean;
|
|
241
|
+
setIsPerformanceHudEnabled: React.Dispatch<React.SetStateAction<boolean>>;
|
|
179
242
|
modalHeightPercent: number;
|
|
180
243
|
setModalHeightPercent: React.Dispatch<React.SetStateAction<number>>;
|
|
181
244
|
modalAnimationType: 'slide' | 'fade' | 'none';
|
|
182
245
|
setModalAnimationType: React.Dispatch<React.SetStateAction<'slide' | 'fade' | 'none'>>;
|
|
183
246
|
hasNavigationContext: boolean;
|
|
184
247
|
setNavState: React.Dispatch<React.SetStateAction<any>>;
|
|
248
|
+
isWalkthroughVisible: boolean;
|
|
249
|
+
setIsWalkthroughVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
250
|
+
openWalkthrough: () => void;
|
|
185
251
|
activeTab: ActiveTab;
|
|
186
252
|
switchActiveTab: (key: ActiveTab) => void;
|
|
187
253
|
tabVisibility: Record<ActiveTab, boolean>;
|
|
@@ -305,6 +371,17 @@ export interface InspectorContextValue {
|
|
|
305
371
|
maxCrashLogs: number;
|
|
306
372
|
setMaxCrashLogs: React.Dispatch<React.SetStateAction<number>>;
|
|
307
373
|
clearAllCrashes: () => void;
|
|
374
|
+
storageEntries: StorageEntry[];
|
|
375
|
+
refreshStorageEntries: () => Promise<void>;
|
|
376
|
+
updateStorageEntry: (key: string, value: string) => Promise<void>;
|
|
377
|
+
deleteStorageEntry: (key: string) => Promise<void>;
|
|
378
|
+
clearAllStorageEntries: () => Promise<void>;
|
|
379
|
+
selectedStorageKey: string | null;
|
|
380
|
+
setSelectedStorageKey: React.Dispatch<React.SetStateAction<string | null>>;
|
|
381
|
+
deviceInfo: DeviceInfoData;
|
|
382
|
+
auditReport: PackageHealthReport;
|
|
383
|
+
refreshAuditReport: () => void;
|
|
384
|
+
logCustomAuditIssue: (issue: Omit<AuditIssue, 'id' | 'timestamp'>) => void;
|
|
308
385
|
settingsActiveSubTab: SettingsSubTab;
|
|
309
386
|
setSettingsActiveSubTab: React.Dispatch<React.SetStateAction<SettingsSubTab>>;
|
|
310
387
|
defaultTab: ActiveTab;
|
|
@@ -515,6 +515,10 @@ RCT_EXPORT_METHOD(getDeviceMetrics:(RCTPromiseResolveBlock)resolve
|
|
|
515
515
|
[metrics setObject:[UIDevice currentDevice].systemName forKey:@"deviceBrand"];
|
|
516
516
|
[metrics setObject:[UIDevice currentDevice].systemVersion forKey:@"osVersion"];
|
|
517
517
|
[metrics setObject:@"arm64" forKey:@"cpuAbi"];
|
|
518
|
+
NSString *deviceId = [[UIDevice currentDevice].identifierForVendor UUIDString];
|
|
519
|
+
if (deviceId) {
|
|
520
|
+
[metrics setObject:deviceId forKey:@"deviceId"];
|
|
521
|
+
}
|
|
518
522
|
|
|
519
523
|
// 5. Application Identifiers (Legal & Non-PII)
|
|
520
524
|
NSBundle *mainBundle = [NSBundle mainBundle];
|
|
@@ -557,10 +561,13 @@ static UIWindow *GetAppActiveWindow(void) {
|
|
|
557
561
|
return [UIApplication sharedApplication].windows.firstObject;
|
|
558
562
|
}
|
|
559
563
|
|
|
564
|
+
static BOOL isFloatingButtonRequestedVisible = NO;
|
|
565
|
+
|
|
560
566
|
RCT_EXPORT_METHOD(showFloatingButton:(NSDictionary *)options
|
|
561
567
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
562
568
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
563
569
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
570
|
+
isFloatingButtonRequestedVisible = YES;
|
|
564
571
|
UIWindow *targetWindow = GetAppActiveWindow();
|
|
565
572
|
CGRect screenBounds = targetWindow ? targetWindow.bounds : [UIScreen mainScreen].bounds;
|
|
566
573
|
|
|
@@ -599,6 +606,7 @@ RCT_EXPORT_METHOD(showFloatingButton:(NSDictionary *)options
|
|
|
599
606
|
}
|
|
600
607
|
|
|
601
608
|
void (^attachToWindow)(void) = ^{
|
|
609
|
+
if (!isFloatingButtonRequestedVisible) return;
|
|
602
610
|
UIWindow *activeWin = GetAppActiveWindow();
|
|
603
611
|
if (!activeWin || !floatingButtonView) return;
|
|
604
612
|
|
|
@@ -635,12 +643,11 @@ RCT_EXPORT_METHOD(showFloatingButton:(NSDictionary *)options
|
|
|
635
643
|
RCT_EXPORT_METHOD(hideFloatingButton:(RCTPromiseResolveBlock)resolve
|
|
636
644
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
637
645
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
646
|
+
isFloatingButtonRequestedVisible = NO;
|
|
638
647
|
if (floatingButtonView != nil) {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
floatingButtonView.hidden = YES;
|
|
643
|
-
}];
|
|
648
|
+
floatingButtonView.alpha = 0.0;
|
|
649
|
+
floatingButtonView.hidden = YES;
|
|
650
|
+
[floatingButtonView removeFromSuperview];
|
|
644
651
|
}
|
|
645
652
|
resolve(@(YES));
|
|
646
653
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-inapp-inspector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "The zero-config, all-in-one in-app debugger for React Native & Expo. Inspect Network (fetch/axios), Console logs, Stack Traces, Redux State, Firebase Analytics, and JS Bundle size directly on device.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
"clean": "rm -rf dist",
|
|
45
45
|
"prebuild": "node scripts/gen-version.js",
|
|
46
46
|
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json && node scripts/inject-telemetry.js",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
49
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
47
50
|
"watch": "tsc -w",
|
|
48
51
|
"prepack": "npm run build",
|
|
49
52
|
"publish": "node release.cjs",
|