react-native-inapp-inspector 1.1.34 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -101
- package/android/build.gradle +13 -1
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +904 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.kt +17 -0
- package/dist/commonjs/components/ConsoleLogCard.js +57 -56
- package/dist/commonjs/components/CopyButton.js +10 -1
- package/dist/commonjs/components/ErrorBoundary.js +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/commonjs/components/Inspector/BundleTab.js +20 -20
- package/dist/commonjs/components/Inspector/ConsoleTab.js +1 -1
- package/dist/commonjs/components/Inspector/CrashDetail.js +16 -12
- package/dist/commonjs/components/Inspector/CrashTab.js +97 -90
- package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -24
- package/dist/commonjs/components/Inspector/MainScreen.js +20 -103
- package/dist/commonjs/components/Inspector/NetworkTab.js +143 -10
- package/dist/commonjs/components/Inspector/PerformanceTab.js +96 -3
- package/dist/commonjs/components/Inspector/ReduxDetail.js +24 -19
- package/dist/commonjs/components/Inspector/ReduxTab.js +30 -18
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1578 -754
- package/dist/commonjs/components/Inspector/TabBar.js +6 -3
- package/dist/commonjs/components/LogCard.js +27 -9
- package/dist/commonjs/components/MetaAccordion.js +42 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +10 -0
- package/dist/commonjs/components/NetworkIcons.js +53 -1
- package/dist/commonjs/components/Toast.js +3 -3
- package/dist/commonjs/components/TouchableScale.d.ts +5 -2
- package/dist/commonjs/components/TouchableScale.js +30 -32
- package/dist/commonjs/constants/index.d.ts +1 -2
- package/dist/commonjs/constants/index.js +4 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +6 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +16 -5
- package/dist/commonjs/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/commonjs/customHooks/bundleAnalyzer.js +26 -17
- package/dist/commonjs/customHooks/consoleLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/consoleLogger.js +10 -1
- package/dist/commonjs/customHooks/crashHandler.d.ts +2 -0
- package/dist/commonjs/customHooks/crashHandler.js +17 -1
- package/dist/commonjs/customHooks/networkLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/networkLogger.js +12 -1
- package/dist/commonjs/customHooks/performanceTracker.d.ts +3 -1
- package/dist/commonjs/customHooks/performanceTracker.js +18 -4
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -0
- package/dist/commonjs/customHooks/reduxLogger.js +10 -1
- package/dist/commonjs/helpers/index.js +10 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +9 -0
- package/dist/commonjs/helpers/settingsStore.js +59 -3
- package/dist/commonjs/i18n/locales/en.json +96 -28
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +307 -73
- package/dist/commonjs/native/NativeInspector.d.ts +125 -0
- package/dist/commonjs/native/NativeInspector.js +313 -0
- package/dist/commonjs/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/commonjs/native/NativeNetworkInspector.js +4 -0
- package/dist/commonjs/styles/AppColors.d.ts +28 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/commonjs/styles/index.js +6 -6
- package/dist/commonjs/types/enums.d.ts +1 -1
- package/dist/commonjs/types/interfaces.d.ts +9 -0
- package/dist/esm/components/ConsoleLogCard.js +58 -57
- package/dist/esm/components/CopyButton.js +10 -1
- package/dist/esm/components/ErrorBoundary.js +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +7 -3
- package/dist/esm/components/Inspector/BundleTab.js +20 -20
- package/dist/esm/components/Inspector/ConsoleTab.js +1 -1
- package/dist/esm/components/Inspector/CrashDetail.js +16 -12
- package/dist/esm/components/Inspector/CrashTab.js +97 -90
- package/dist/esm/components/Inspector/InspectorHeader.js +29 -25
- package/dist/esm/components/Inspector/MainScreen.js +21 -71
- package/dist/esm/components/Inspector/NetworkTab.js +145 -12
- package/dist/esm/components/Inspector/PerformanceTab.js +96 -3
- package/dist/esm/components/Inspector/ReduxDetail.js +24 -19
- package/dist/esm/components/Inspector/ReduxTab.js +30 -18
- package/dist/esm/components/Inspector/SettingsPanel.js +1582 -758
- package/dist/esm/components/Inspector/TabBar.js +7 -4
- package/dist/esm/components/LogCard.js +27 -9
- package/dist/esm/components/MetaAccordion.js +42 -0
- package/dist/esm/components/NetworkIcons.d.ts +10 -0
- package/dist/esm/components/NetworkIcons.js +42 -0
- package/dist/esm/components/Toast.js +3 -3
- package/dist/esm/components/TouchableScale.d.ts +5 -2
- package/dist/esm/components/TouchableScale.js +31 -33
- package/dist/esm/constants/index.d.ts +1 -2
- package/dist/esm/constants/index.js +4 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +6 -0
- package/dist/esm/customHooks/analyticsLogger.js +12 -4
- package/dist/esm/customHooks/bundleAnalyzer.d.ts +2 -0
- package/dist/esm/customHooks/bundleAnalyzer.js +23 -16
- package/dist/esm/customHooks/consoleLogger.d.ts +2 -0
- package/dist/esm/customHooks/consoleLogger.js +7 -0
- package/dist/esm/customHooks/crashHandler.d.ts +2 -0
- package/dist/esm/customHooks/crashHandler.js +14 -0
- package/dist/esm/customHooks/networkLogger.d.ts +2 -0
- package/dist/esm/customHooks/networkLogger.js +9 -0
- package/dist/esm/customHooks/performanceTracker.d.ts +3 -1
- package/dist/esm/customHooks/performanceTracker.js +15 -3
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -0
- package/dist/esm/customHooks/reduxLogger.js +7 -0
- package/dist/esm/helpers/index.js +10 -1
- package/dist/esm/helpers/settingsStore.d.ts +9 -0
- package/dist/esm/helpers/settingsStore.js +58 -3
- package/dist/esm/i18n/locales/en.json +96 -28
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +279 -59
- package/dist/esm/native/NativeInspector.d.ts +125 -0
- package/dist/esm/native/NativeInspector.js +289 -0
- package/dist/esm/native/NativeNetworkInspector.d.ts +22 -0
- package/dist/esm/native/NativeNetworkInspector.js +2 -0
- package/dist/esm/styles/AppColors.d.ts +28 -0
- package/dist/esm/styles/AppColors.js +30 -0
- package/dist/esm/styles/index.js +6 -6
- package/dist/esm/types/enums.d.ts +1 -1
- package/dist/esm/types/interfaces.d.ts +9 -0
- package/ios/NetworkInspectorModule.h +6 -0
- package/ios/NetworkInspectorModule.m +720 -5
- package/package.json +15 -3
- package/react-native-inapp-inspector.podspec +7 -2
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.java +0 -97
- package/android/src/main/java/com/inappinspector/NetworkInspectorPackage.java +0 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-inapp-inspector",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
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",
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
"homepage": "https://github.com/vengatmacuser/react-native-inapp-inspector#readme",
|
|
14
14
|
"main": "dist/commonjs/index.js",
|
|
15
15
|
"module": "dist/esm/index.js",
|
|
16
|
+
"react-native": "dist/commonjs/index.js",
|
|
16
17
|
"types": "dist/commonjs/index.d.ts",
|
|
17
18
|
"sideEffects": false,
|
|
18
19
|
"exports": {
|
|
19
20
|
".": {
|
|
21
|
+
"react-native": "./dist/commonjs/index.js",
|
|
20
22
|
"types": "./dist/commonjs/index.d.ts",
|
|
21
23
|
"import": "./dist/esm/index.js",
|
|
22
|
-
"require": "./dist/commonjs/index.js"
|
|
24
|
+
"require": "./dist/commonjs/index.js",
|
|
25
|
+
"default": "./dist/commonjs/index.js"
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
28
|
"files": [
|
|
@@ -29,9 +32,18 @@
|
|
|
29
32
|
"ios",
|
|
30
33
|
"react-native-inapp-inspector.podspec"
|
|
31
34
|
],
|
|
35
|
+
"codegenConfig": {
|
|
36
|
+
"name": "RNInAppInspectorSpec",
|
|
37
|
+
"type": "modules",
|
|
38
|
+
"jsSrcsDir": "src/native",
|
|
39
|
+
"android": {
|
|
40
|
+
"javaPackageName": "com.inappinspector"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
32
43
|
"scripts": {
|
|
44
|
+
"clean": "rm -rf dist",
|
|
33
45
|
"prebuild": "node scripts/gen-version.js",
|
|
34
|
-
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
46
|
+
"build": "npm run clean && tsc && tsc -p tsconfig.esm.json",
|
|
35
47
|
"watch": "tsc -w",
|
|
36
48
|
"prepack": "npm run build",
|
|
37
49
|
"publish": "node release.cjs",
|
|
@@ -9,10 +9,15 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.license = package['license']
|
|
10
10
|
s.authors = package['author']
|
|
11
11
|
s.homepage = package['homepage']
|
|
12
|
-
s.
|
|
12
|
+
s.platforms = { :ios => "12.4" }
|
|
13
13
|
s.source = { :git => "https://github.com/vengatmacuser/react-native-inapp-inspector.git", :tag => "v#{s.version}" }
|
|
14
14
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
15
15
|
s.requires_arc = true
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
# React Native New Architecture (TurboModules & Codegen) support
|
|
18
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
19
|
+
install_modules_dependencies(s)
|
|
20
|
+
else
|
|
21
|
+
s.dependency "React-Core"
|
|
22
|
+
end
|
|
18
23
|
end
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
package com.inappinspector;
|
|
2
|
-
|
|
3
|
-
import android.os.Handler;
|
|
4
|
-
import android.os.Looper;
|
|
5
|
-
import android.util.Log;
|
|
6
|
-
|
|
7
|
-
import androidx.annotation.NonNull;
|
|
8
|
-
import androidx.annotation.Nullable;
|
|
9
|
-
|
|
10
|
-
import com.facebook.react.bridge.Arguments;
|
|
11
|
-
import com.facebook.react.bridge.Promise;
|
|
12
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
13
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
14
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
15
|
-
import com.facebook.react.bridge.WritableMap;
|
|
16
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
17
|
-
|
|
18
|
-
import java.io.PrintWriter;
|
|
19
|
-
import java.io.StringWriter;
|
|
20
|
-
|
|
21
|
-
public class NetworkInspectorModule extends ReactContextBaseJavaModule {
|
|
22
|
-
private static final String MODULE_NAME = "NetworkInspectorModule";
|
|
23
|
-
private static final String TAG = "NetworkInspector";
|
|
24
|
-
private final ReactApplicationContext reactContext;
|
|
25
|
-
private Thread.UncaughtExceptionHandler defaultHandler;
|
|
26
|
-
private boolean isProtectionEnabled = false;
|
|
27
|
-
|
|
28
|
-
public NetworkInspectorModule(ReactApplicationContext reactContext) {
|
|
29
|
-
super(reactContext);
|
|
30
|
-
this.reactContext = reactContext;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@NonNull
|
|
34
|
-
@Override
|
|
35
|
-
public String getName() {
|
|
36
|
-
return MODULE_NAME;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private void setupNativeCrashProtection() {
|
|
40
|
-
if (isProtectionEnabled) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
|
|
44
|
-
Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> {
|
|
45
|
-
try {
|
|
46
|
-
handleNativeCrash(thread, throwable);
|
|
47
|
-
} catch (Exception e) {
|
|
48
|
-
Log.e(TAG, "Error in native crash handler", e);
|
|
49
|
-
} finally {
|
|
50
|
-
if (defaultHandler != null) {
|
|
51
|
-
defaultHandler.uncaughtException(thread, throwable);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
isProtectionEnabled = true;
|
|
56
|
-
Log.i(TAG, "Native crash protection enabled");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private void handleNativeCrash(Thread thread, Throwable throwable) {
|
|
60
|
-
try {
|
|
61
|
-
StringWriter sw = new StringWriter();
|
|
62
|
-
PrintWriter pw = new PrintWriter(sw);
|
|
63
|
-
throwable.printStackTrace(pw);
|
|
64
|
-
String stackTrace = sw.toString();
|
|
65
|
-
|
|
66
|
-
WritableMap params = Arguments.createMap();
|
|
67
|
-
params.putString("error", throwable.getMessage() != null ? throwable.getMessage() : "Unknown native crash");
|
|
68
|
-
params.putString("name", throwable.getClass().getName());
|
|
69
|
-
params.putString("stack", stackTrace);
|
|
70
|
-
params.putDouble("timestamp", System.currentTimeMillis());
|
|
71
|
-
|
|
72
|
-
if (reactContext.hasActiveReactInstance()) {
|
|
73
|
-
reactContext
|
|
74
|
-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
75
|
-
.emit("onNativeCrash", params);
|
|
76
|
-
}
|
|
77
|
-
} catch (Exception e) {
|
|
78
|
-
Log.e(TAG, "Failed to emit onNativeCrash to JS", e);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@ReactMethod
|
|
83
|
-
public void enableNativeCrashProtection(Promise promise) {
|
|
84
|
-
setupNativeCrashProtection();
|
|
85
|
-
promise.resolve(true);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
@ReactMethod
|
|
89
|
-
public void addListener(String eventName) {
|
|
90
|
-
// Required for RN built-in Event Emitter
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@ReactMethod
|
|
94
|
-
public void removeListeners(double count) {
|
|
95
|
-
// Required for RN built-in Event Emitter
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package com.inappinspector;
|
|
2
|
-
|
|
3
|
-
import androidx.annotation.NonNull;
|
|
4
|
-
|
|
5
|
-
import com.facebook.react.ReactPackage;
|
|
6
|
-
import com.facebook.react.bridge.NativeModule;
|
|
7
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
|
-
import com.facebook.react.uimanager.ViewManager;
|
|
9
|
-
|
|
10
|
-
import java.util.ArrayList;
|
|
11
|
-
import java.util.Collections;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
|
|
14
|
-
public class NetworkInspectorPackage implements ReactPackage {
|
|
15
|
-
@NonNull
|
|
16
|
-
@Override
|
|
17
|
-
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
|
|
18
|
-
List<NativeModule> modules = new ArrayList<>();
|
|
19
|
-
modules.add(new NetworkInspectorModule(reactContext));
|
|
20
|
-
return modules;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@NonNull
|
|
24
|
-
@Override
|
|
25
|
-
public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
|
|
26
|
-
return Collections.emptyList();
|
|
27
|
-
}
|
|
28
|
-
}
|