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
|
@@ -57,9 +57,11 @@ async function loadSettings() {
|
|
|
57
57
|
return {};
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function saveSettings(settings) {
|
|
60
|
+
async function saveSettings(settings) {
|
|
61
61
|
try {
|
|
62
|
-
const
|
|
62
|
+
const existing = await loadSettings();
|
|
63
|
+
const merged = { ...existing, ...settings };
|
|
64
|
+
const raw = JSON.stringify(merged);
|
|
63
65
|
if (customStorage) {
|
|
64
66
|
customStorage.setItem(SETTINGS_KEY, raw);
|
|
65
67
|
return;
|
|
@@ -50,8 +50,9 @@
|
|
|
50
50
|
"activeBadge": "ACTIVE",
|
|
51
51
|
"dormantBadge": "DORMANT",
|
|
52
52
|
"protectedBadge": "PROTECTED",
|
|
53
|
-
"modulesAndTools": "Modules &
|
|
54
|
-
"
|
|
53
|
+
"modulesAndTools": "Modules & Tabs",
|
|
54
|
+
"ramLimits": "RAM & Limits",
|
|
55
|
+
"uiPreferences": "UI & Appearance",
|
|
55
56
|
"zeroOverheadTitle": "Zero Background Overhead",
|
|
56
57
|
"zeroOverheadDesc": "Check the modules you wish to activate. Disabled modules consume 0% CPU & memory until saved.",
|
|
57
58
|
"unsavedPending": "● Unsaved selections pending",
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -14,5 +14,6 @@ export { usePerformanceTracker, useComponentProfiler, useNavigationProfiler, tra
|
|
|
14
14
|
export { InspectLog, InspectTrackTime, InspectCatch, type InspectLogOptions, } from './decorators';
|
|
15
15
|
export { getNativeDeviceMetrics, enableNativeCrashProtection, subscribeNativeCrashes, showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, startNativeFpsMonitoring, stopNativeFpsMonitoring, getNativeFpsMetrics, getNativeStorageItem, setNativeStorageItem, isNativeModuleAvailable, type NativeDeviceMetrics, type NativeCrashEvent, type FloatingButtonOptions, type NativeFpsMetrics, } from './native/NativeInspector';
|
|
16
16
|
export { sendSessionTelemetryPing, trackTelemetryEvent, trackInspectorOpen, trackTabSwitch, trackLogExport, GA4_MEASUREMENT_ID, GA4_API_SECRET, } from './helpers';
|
|
17
|
+
export { runLivePackageAudit, logCodeQualityIssue, clearCustomAuditIssues, } from './helpers/packageAuditor';
|
|
17
18
|
export { BrandSquareIcon, BrandCircleIcon, } from './components/NetworkIcons';
|
|
18
19
|
export { ActiveTab, Method, StatusFilter, SortOrder, LocalFilter, ModalAnimationType, SettingsPage, SettingsSubTab, LogFilter, ConsoleLogType, AnalyticsEventSource, GAEventCategory, StackFrameType, DiffResultType, BundleSubTab, PerformanceSubTab, CrashType, CrashExportFormat, CrashDetailSubTab, CrashFilterType, BreadcrumbType, } from './types';
|
package/dist/commonjs/index.js
CHANGED
|
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.registerComponentProfile = exports.getHermesMemoryStats = exports.measureAsync = exports.trackHeavyTask = exports.trackNavigationTransition = exports.trackComponentRender = exports.useNavigationProfiler = exports.useComponentProfiler = exports.usePerformanceTracker = exports.registerGAPlugin = exports.getEventCategory = exports.getLastActionForReducer = exports.clearActionHistory = exports.getActionHistory = exports.subscribeReduxState = exports.getReduxState = exports.inspectorReduxMiddleware = exports.connectReduxStore = exports.ErrorBoundary = exports.CrashTab = exports.computeCrashFingerprint = exports.recordUserActionBreadcrumb = exports.recordReduxBreadcrumb = exports.recordNetworkBreadcrumb = exports.recordNavigationBreadcrumb = exports.addCrashBreadcrumb = exports.recordCustomCrash = exports.parseCrashStackTrace = exports.exportCrashReport = exports.simulateTestCrash = exports.clearCrashRecords = exports.getCrashRecords = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.setupGlobalCrashHandler = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.setupAnalyticsLogger = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = exports.addAxiosInterceptors = exports.subscribeNetworkLogs = exports.clearNetworkLogs = exports.setupNetworkLogger = void 0;
|
|
40
|
-
exports.
|
|
41
|
-
exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.PerformanceSubTab = void 0;
|
|
40
|
+
exports.GAEventCategory = exports.AnalyticsEventSource = exports.ConsoleLogType = exports.LogFilter = exports.SettingsSubTab = exports.SettingsPage = exports.ModalAnimationType = exports.LocalFilter = exports.SortOrder = exports.StatusFilter = exports.Method = exports.ActiveTab = exports.BrandCircleIcon = exports.BrandSquareIcon = exports.clearCustomAuditIssues = exports.logCodeQualityIssue = exports.runLivePackageAudit = exports.GA4_API_SECRET = exports.GA4_MEASUREMENT_ID = exports.trackLogExport = exports.trackTabSwitch = exports.trackInspectorOpen = exports.trackTelemetryEvent = exports.sendSessionTelemetryPing = exports.isNativeModuleAvailable = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeDeviceShake = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.InspectCatch = exports.InspectTrackTime = exports.InspectLog = exports.generateFixSnippet = exports.getInitialPerformanceEvents = exports.getInitialRenderProfiles = exports.getPerformanceEvents = exports.subscribePerformanceEvents = exports.clearPerformanceEvents = exports.logPerformanceEvent = exports.getRenderProfiles = exports.subscribeRenderProfiles = void 0;
|
|
41
|
+
exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.PerformanceSubTab = exports.BundleSubTab = exports.DiffResultType = exports.StackFrameType = void 0;
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const react_native_1 = require("react-native");
|
|
44
44
|
const native_1 = require("@react-navigation/native");
|
|
@@ -64,14 +64,22 @@ const analyticsLogger_1 = require("./customHooks/analyticsLogger");
|
|
|
64
64
|
const reduxLogger_1 = require("./customHooks/reduxLogger");
|
|
65
65
|
const performanceTracker_1 = require("./customHooks/performanceTracker");
|
|
66
66
|
const bundleAnalyzer_1 = require("./customHooks/bundleAnalyzer");
|
|
67
|
+
const storageInspector_1 = require("./customHooks/storageInspector");
|
|
68
|
+
const deviceInfo_1 = require("./helpers/deviceInfo");
|
|
69
|
+
const packageAuditor_1 = require("./helpers/packageAuditor");
|
|
67
70
|
const NativeInspector_2 = require("./native/NativeInspector");
|
|
68
71
|
const constants_1 = require("./constants");
|
|
69
72
|
// Stylesheet
|
|
70
73
|
const styles_1 = require("./styles");
|
|
71
|
-
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, appIcon, environment, initialVisible, visible: controlledVisible, }) => {
|
|
74
|
+
const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigationRef, appIcon, environment, initialVisible, visible: controlledVisible, initialTab, enablePerformanceHud = false, }) => {
|
|
75
|
+
// Zero-overhead production stub: if disabled, return null immediately
|
|
76
|
+
if (!enabled || !isEnabled) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
72
79
|
// Set custom storage synchronously during render phase
|
|
73
80
|
(0, settingsStore_1.setCustomStorage)(storage || null);
|
|
74
81
|
const [isDark, setIsDark] = (0, react_1.useState)(false);
|
|
82
|
+
const [isPerformanceHudEnabled, setIsPerformanceHudEnabled] = (0, react_1.useState)(enablePerformanceHud);
|
|
75
83
|
const [reduxState, setReduxState] = (0, react_1.useState)(null);
|
|
76
84
|
// Per-reducer last action is kept in component state so the
|
|
77
85
|
// Redux tab re-renders live on every dispatch, independent of the state tree ref.
|
|
@@ -86,6 +94,11 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
86
94
|
setVisible(controlledVisible);
|
|
87
95
|
}
|
|
88
96
|
}, [controlledVisible]);
|
|
97
|
+
(0, react_1.useEffect)(() => {
|
|
98
|
+
if (enablePerformanceHud !== undefined) {
|
|
99
|
+
setIsPerformanceHudEnabled(enablePerformanceHud);
|
|
100
|
+
}
|
|
101
|
+
}, [enablePerformanceHud]);
|
|
89
102
|
const [isReady, setIsReady] = (0, react_1.useState)(false);
|
|
90
103
|
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
91
104
|
const [selectedLogs, setSelectedLogs] = (0, react_1.useState)(new Set());
|
|
@@ -117,6 +130,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
117
130
|
const [sectionFilters, setSectionFilters] = (0, react_1.useState)({});
|
|
118
131
|
const [collapsedSections, setCollapsedSections] = (0, react_1.useState)(new Set());
|
|
119
132
|
const [showHeaderInfo, setShowHeaderInfo] = (0, react_1.useState)(true);
|
|
133
|
+
const [isWalkthroughVisible, setIsWalkthroughVisible] = (0, react_1.useState)(true);
|
|
134
|
+
const hasCompletedWalkthroughRef = (0, react_1.useRef)(null);
|
|
120
135
|
const [sortOrder, setSortOrder] = (0, react_1.useState)('newest');
|
|
121
136
|
// #7 — sort order for the Logs (console) tab
|
|
122
137
|
const [logSortOrder, setLogSortOrder] = (0, react_1.useState)('newest');
|
|
@@ -125,7 +140,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
125
140
|
const [showReqDiff, setShowReqDiff] = (0, react_1.useState)(false);
|
|
126
141
|
const [showResDiff, setShowResDiff] = (0, react_1.useState)(false);
|
|
127
142
|
// ─── Analytics state ───────────────────────────────────────────────────────
|
|
128
|
-
const [activeTab, setActiveTab] = (0, react_1.useState)('apis');
|
|
143
|
+
const [activeTab, setActiveTab] = (0, react_1.useState)(initialTab || 'apis');
|
|
129
144
|
const [analyticsEvents, setAnalyticsEvents] = (0, react_1.useState)([]);
|
|
130
145
|
// ─── Logs state ────────────────────────────────────────────────────────────
|
|
131
146
|
const [consoleLogs, setConsoleLogs] = (0, react_1.useState)([]);
|
|
@@ -181,6 +196,47 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
181
196
|
setLastReadCrashesCount(crashRecords.length);
|
|
182
197
|
}
|
|
183
198
|
}, [activeTab, crashRecords.length]);
|
|
199
|
+
// ─── Storage state ─────────────────────────────────────────────────────────
|
|
200
|
+
const [storageEntries, setStorageEntries] = (0, react_1.useState)([]);
|
|
201
|
+
const [selectedStorageKey, setSelectedStorageKey] = (0, react_1.useState)(null);
|
|
202
|
+
const refreshStorageEntries = (0, react_1.useCallback)(async () => {
|
|
203
|
+
try {
|
|
204
|
+
const entries = await (0, storageInspector_1.fetchAllStorageEntries)();
|
|
205
|
+
setStorageEntries(entries);
|
|
206
|
+
}
|
|
207
|
+
catch { }
|
|
208
|
+
}, []);
|
|
209
|
+
const updateStorageEntry = (0, react_1.useCallback)(async (key, value) => {
|
|
210
|
+
await (0, storageInspector_1.setStorageItem)(key, value);
|
|
211
|
+
await refreshStorageEntries();
|
|
212
|
+
}, [refreshStorageEntries]);
|
|
213
|
+
const deleteStorageEntry = (0, react_1.useCallback)(async (key) => {
|
|
214
|
+
await (0, storageInspector_1.removeStorageItem)(key);
|
|
215
|
+
await refreshStorageEntries();
|
|
216
|
+
}, [refreshStorageEntries]);
|
|
217
|
+
const clearAllStorageEntries = (0, react_1.useCallback)(async () => {
|
|
218
|
+
await (0, storageInspector_1.clearAllStorage)();
|
|
219
|
+
await refreshStorageEntries();
|
|
220
|
+
}, [refreshStorageEntries]);
|
|
221
|
+
(0, react_1.useEffect)(() => {
|
|
222
|
+
refreshStorageEntries();
|
|
223
|
+
const unsub = (0, storageInspector_1.subscribeStorageChanges)(refreshStorageEntries);
|
|
224
|
+
return () => unsub();
|
|
225
|
+
}, [refreshStorageEntries]);
|
|
226
|
+
// ─── Device info state ──────────────────────────────────────────────────────
|
|
227
|
+
const [deviceInfo] = (0, react_1.useState)(() => (0, deviceInfo_1.getSystemDiagnostics)());
|
|
228
|
+
// ─── Code Quality & Package Audit state ─────────────────────────────────────
|
|
229
|
+
const [auditReport, setAuditReport] = (0, react_1.useState)(() => (0, packageAuditor_1.runLivePackageAudit)());
|
|
230
|
+
(0, react_1.useEffect)(() => {
|
|
231
|
+
const unsub = (0, packageAuditor_1.subscribeAuditChanges)(setAuditReport);
|
|
232
|
+
return () => unsub();
|
|
233
|
+
}, []);
|
|
234
|
+
const refreshAuditReport = (0, react_1.useCallback)(() => {
|
|
235
|
+
setAuditReport((0, packageAuditor_1.runLivePackageAudit)());
|
|
236
|
+
}, []);
|
|
237
|
+
const logCustomAuditIssue = (0, react_1.useCallback)((issue) => {
|
|
238
|
+
(0, packageAuditor_1.logCodeQualityIssue)(issue);
|
|
239
|
+
}, []);
|
|
184
240
|
const [maxConsoleLogs, setMaxConsoleLogs] = (0, react_1.useState)(100);
|
|
185
241
|
const [showConsoleLevels, setShowConsoleLevels] = (0, react_1.useState)({
|
|
186
242
|
info: true,
|
|
@@ -221,6 +277,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
221
277
|
logs: true,
|
|
222
278
|
analytics: false,
|
|
223
279
|
redux: false,
|
|
280
|
+
storage: false,
|
|
281
|
+
device: false,
|
|
282
|
+
audit: false,
|
|
224
283
|
bundle: false,
|
|
225
284
|
performance: false,
|
|
226
285
|
crash: false,
|
|
@@ -275,6 +334,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
275
334
|
logs: true,
|
|
276
335
|
analytics: false,
|
|
277
336
|
redux: false,
|
|
337
|
+
storage: false,
|
|
338
|
+
device: false,
|
|
339
|
+
audit: false,
|
|
278
340
|
bundle: false,
|
|
279
341
|
performance: false,
|
|
280
342
|
crash: false,
|
|
@@ -312,14 +374,24 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
312
374
|
setModalHeightPercent(saved.modalHeightPercent);
|
|
313
375
|
if (saved.modalAnimationType)
|
|
314
376
|
setModalAnimationType(saved.modalAnimationType);
|
|
315
|
-
if (saved.tabVisibility)
|
|
377
|
+
if (saved.tabVisibility) {
|
|
378
|
+
const savedVis = saved.tabVisibility;
|
|
316
379
|
setTabVisibility(prev => ({
|
|
317
380
|
...prev,
|
|
318
|
-
...
|
|
381
|
+
...savedVis,
|
|
382
|
+
storage: savedVis.storage ?? false,
|
|
383
|
+
device: savedVis.device ?? false,
|
|
384
|
+
audit: savedVis.audit ?? false,
|
|
319
385
|
apis: true, // APIs is always required
|
|
320
386
|
}));
|
|
321
|
-
|
|
387
|
+
}
|
|
388
|
+
if (initialTab) {
|
|
389
|
+
setActiveTab(initialTab);
|
|
390
|
+
}
|
|
391
|
+
else if (saved.defaultTab) {
|
|
322
392
|
setDefaultTab(saved.defaultTab);
|
|
393
|
+
setActiveTab(saved.defaultTab);
|
|
394
|
+
}
|
|
323
395
|
if (saved.isAutoRamLimitEnabled != null)
|
|
324
396
|
setIsAutoRamLimitEnabled(saved.isAutoRamLimitEnabled);
|
|
325
397
|
if (saved.maxNetworkLogs != null)
|
|
@@ -340,7 +412,10 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
340
412
|
setShowDuplicateLogs(saved.showDuplicateLogs);
|
|
341
413
|
if (saved.showUpdateToast != null)
|
|
342
414
|
setShowUpdateToast(saved.showUpdateToast);
|
|
343
|
-
if (
|
|
415
|
+
if (initialTab) {
|
|
416
|
+
setActiveTab(initialTab);
|
|
417
|
+
}
|
|
418
|
+
else if (saved.defaultTab) {
|
|
344
419
|
const dt = saved.defaultTab;
|
|
345
420
|
const vis = {
|
|
346
421
|
...{
|
|
@@ -348,6 +423,9 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
348
423
|
logs: true,
|
|
349
424
|
analytics: false,
|
|
350
425
|
redux: false,
|
|
426
|
+
storage: false,
|
|
427
|
+
device: false,
|
|
428
|
+
audit: false,
|
|
351
429
|
bundle: false,
|
|
352
430
|
performance: false,
|
|
353
431
|
crash: false,
|
|
@@ -357,6 +435,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
357
435
|
};
|
|
358
436
|
setActiveTab(vis[dt] ? dt : 'apis');
|
|
359
437
|
}
|
|
438
|
+
hasCompletedWalkthroughRef.current = saved.hasCompletedWalkthrough === true;
|
|
360
439
|
settingsHydratedRef.current = true;
|
|
361
440
|
});
|
|
362
441
|
return () => {
|
|
@@ -816,6 +895,17 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
816
895
|
? defaultTab
|
|
817
896
|
: 'apis';
|
|
818
897
|
setActiveTab(target);
|
|
898
|
+
setSelected(null);
|
|
899
|
+
setSelectedEvent(null);
|
|
900
|
+
setSelectedLog(null);
|
|
901
|
+
setSelectedReduxSlice(null);
|
|
902
|
+
setSelectedReduxAction(null);
|
|
903
|
+
setSelectedCrash(null);
|
|
904
|
+
// Trigger first-time walkthrough strictly on first FAB launch if not yet completed
|
|
905
|
+
if (hasCompletedWalkthroughRef.current === false) {
|
|
906
|
+
setIsWalkthroughVisible(true);
|
|
907
|
+
hasCompletedWalkthroughRef.current = true;
|
|
908
|
+
}
|
|
819
909
|
// Track inspector opened event in GA4
|
|
820
910
|
(0, helpers_1.trackInspectorOpen)({ activeTab: target });
|
|
821
911
|
// Instant synchronization of data collected while modal was closed
|
|
@@ -1661,6 +1751,12 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1661
1751
|
setModalAnimationType,
|
|
1662
1752
|
hasNavigationContext,
|
|
1663
1753
|
setNavState,
|
|
1754
|
+
isWalkthroughVisible,
|
|
1755
|
+
setIsWalkthroughVisible,
|
|
1756
|
+
openWalkthrough: () => {
|
|
1757
|
+
setSettingsPage(null);
|
|
1758
|
+
setIsWalkthroughVisible(true);
|
|
1759
|
+
},
|
|
1664
1760
|
// ─── Tabs ───────────────────────────────────────────────────────────
|
|
1665
1761
|
activeTab,
|
|
1666
1762
|
switchActiveTab,
|
|
@@ -1795,6 +1891,20 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1795
1891
|
setCrashRecords([]);
|
|
1796
1892
|
setSelectedCrash(null);
|
|
1797
1893
|
},
|
|
1894
|
+
// ─── Storage ─────────────────────────────────────────────────────────
|
|
1895
|
+
storageEntries,
|
|
1896
|
+
refreshStorageEntries,
|
|
1897
|
+
updateStorageEntry,
|
|
1898
|
+
deleteStorageEntry,
|
|
1899
|
+
clearAllStorageEntries,
|
|
1900
|
+
selectedStorageKey,
|
|
1901
|
+
setSelectedStorageKey,
|
|
1902
|
+
// ─── Device ──────────────────────────────────────────────────────────
|
|
1903
|
+
deviceInfo,
|
|
1904
|
+
// ─── Audit / Code Quality ─────────────────────────────────────────────
|
|
1905
|
+
auditReport,
|
|
1906
|
+
refreshAuditReport,
|
|
1907
|
+
logCustomAuditIssue,
|
|
1798
1908
|
// ─── Settings ───────────────────────────────────────────────────────
|
|
1799
1909
|
settingsActiveSubTab,
|
|
1800
1910
|
setSettingsActiveSubTab,
|
|
@@ -1819,13 +1929,17 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1819
1929
|
isAutoRamLimitEnabled,
|
|
1820
1930
|
setIsAutoRamLimitEnabled,
|
|
1821
1931
|
deviceFreeRamMb,
|
|
1932
|
+
isPerformanceHudEnabled,
|
|
1933
|
+
setIsPerformanceHudEnabled,
|
|
1822
1934
|
reduxAutoRefresh,
|
|
1823
1935
|
setReduxAutoRefreshState,
|
|
1824
1936
|
reduxExpandDepth,
|
|
1825
1937
|
setReduxExpandDepth,
|
|
1826
1938
|
};
|
|
1827
1939
|
return (<InspectorContext_1.InspectorContext.Provider value={contextValue}>
|
|
1828
|
-
<
|
|
1940
|
+
<react_native_1.View style={react_native_1.StyleSheet.absoluteFill} pointerEvents="box-none">
|
|
1941
|
+
<MainScreen_1.default />
|
|
1942
|
+
</react_native_1.View>
|
|
1829
1943
|
</InspectorContext_1.InspectorContext.Provider>);
|
|
1830
1944
|
};
|
|
1831
1945
|
const NetworkInspectorWrapper = (props) => {
|
|
@@ -1937,6 +2051,10 @@ Object.defineProperty(exports, "trackTabSwitch", { enumerable: true, get: functi
|
|
|
1937
2051
|
Object.defineProperty(exports, "trackLogExport", { enumerable: true, get: function () { return helpers_2.trackLogExport; } });
|
|
1938
2052
|
Object.defineProperty(exports, "GA4_MEASUREMENT_ID", { enumerable: true, get: function () { return helpers_2.GA4_MEASUREMENT_ID; } });
|
|
1939
2053
|
Object.defineProperty(exports, "GA4_API_SECRET", { enumerable: true, get: function () { return helpers_2.GA4_API_SECRET; } });
|
|
2054
|
+
var packageAuditor_2 = require("./helpers/packageAuditor");
|
|
2055
|
+
Object.defineProperty(exports, "runLivePackageAudit", { enumerable: true, get: function () { return packageAuditor_2.runLivePackageAudit; } });
|
|
2056
|
+
Object.defineProperty(exports, "logCodeQualityIssue", { enumerable: true, get: function () { return packageAuditor_2.logCodeQualityIssue; } });
|
|
2057
|
+
Object.defineProperty(exports, "clearCustomAuditIssues", { enumerable: true, get: function () { return packageAuditor_2.clearCustomAuditIssues; } });
|
|
1940
2058
|
var NetworkIcons_1 = require("./components/NetworkIcons");
|
|
1941
2059
|
Object.defineProperty(exports, "BrandSquareIcon", { enumerable: true, get: function () { return NetworkIcons_1.BrandSquareIcon; } });
|
|
1942
2060
|
Object.defineProperty(exports, "BrandCircleIcon", { enumerable: true, get: function () { return NetworkIcons_1.BrandCircleIcon; } });
|
|
@@ -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];
|
|
@@ -9,6 +9,9 @@ exports.ActiveTab = {
|
|
|
9
9
|
Analytics: 'analytics',
|
|
10
10
|
Logs: 'logs',
|
|
11
11
|
Redux: 'redux',
|
|
12
|
+
Storage: 'storage',
|
|
13
|
+
Device: 'device',
|
|
14
|
+
Audit: 'audit',
|
|
12
15
|
Bundle: 'bundle',
|
|
13
16
|
Performance: 'performance',
|
|
14
17
|
Crash: 'crash',
|
|
@@ -49,12 +52,16 @@ exports.SettingsPage = {
|
|
|
49
52
|
Logs: 'logs',
|
|
50
53
|
Analytics: 'analytics',
|
|
51
54
|
Redux: 'redux',
|
|
55
|
+
Storage: 'storage',
|
|
56
|
+
Device: 'device',
|
|
57
|
+
Audit: 'audit',
|
|
52
58
|
Bundle: 'bundle',
|
|
53
59
|
Performance: 'performance',
|
|
54
60
|
Crash: 'crash',
|
|
55
61
|
};
|
|
56
62
|
exports.SettingsSubTab = {
|
|
57
63
|
Module: 'module',
|
|
64
|
+
Limits: 'limits',
|
|
58
65
|
Ui: 'ui',
|
|
59
66
|
};
|
|
60
67
|
exports.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;
|