react-native-debug-toolkit 3.2.6 → 3.2.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/ios/DebugToolkitDevConnect.mm +20 -33
- package/package.json +1 -1
|
@@ -24,24 +24,9 @@ RCT_EXPORT_MODULE(DebugToolkitDevConnect)
|
|
|
24
24
|
return NO;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
- (
|
|
28
|
-
reason:(NSString *)reason
|
|
29
|
-
result:(id)result
|
|
30
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
27
|
+
- (dispatch_queue_t)methodQueue
|
|
31
28
|
{
|
|
32
|
-
|
|
33
|
-
if (self->_bundleManager) {
|
|
34
|
-
if (bundleURL) {
|
|
35
|
-
self->_bundleManager.bundleURL = bundleURL;
|
|
36
|
-
} else {
|
|
37
|
-
[self->_bundleManager resetBundleURL];
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
RCTReloadCommandSetBundleURL(bundleURL);
|
|
41
|
-
}
|
|
42
|
-
resolve(result ?: [NSNull null]);
|
|
43
|
-
RCTTriggerReloadCommandListeners(reason);
|
|
44
|
-
});
|
|
29
|
+
return dispatch_get_main_queue();
|
|
45
30
|
}
|
|
46
31
|
|
|
47
32
|
RCT_EXPORT_METHOD(getMetroHost:(RCTPromiseResolveBlock)resolve
|
|
@@ -80,25 +65,26 @@ RCT_EXPORT_METHOD(applyMetroHost:(NSString *)hostPort
|
|
|
80
65
|
NSString *normalizedHostPort = [NSString stringWithFormat:@"%@:%d", host, portNumber.intValue];
|
|
81
66
|
settings.jsLocation = normalizedHostPort;
|
|
82
67
|
|
|
83
|
-
NSURL *bundleURL = nil;
|
|
84
68
|
if (DebugToolkitBundleRoot.length == 0) {
|
|
85
69
|
if (_bundleManager) {
|
|
86
70
|
[_bundleManager resetBundleURL];
|
|
87
|
-
bundleURL = _bundleManager.bundleURL;
|
|
88
71
|
}
|
|
89
72
|
} else {
|
|
90
|
-
bundleURL = [settings jsBundleURLForBundleRoot:DebugToolkitBundleRoot];
|
|
73
|
+
NSURL *bundleURL = [settings jsBundleURLForBundleRoot:DebugToolkitBundleRoot];
|
|
74
|
+
if (_bundleManager) {
|
|
75
|
+
_bundleManager.bundleURL = bundleURL;
|
|
76
|
+
} else {
|
|
77
|
+
RCTReloadCommandSetBundleURL(bundleURL);
|
|
78
|
+
}
|
|
91
79
|
}
|
|
92
80
|
|
|
93
|
-
NSMutableDictionary *result = [@{
|
|
94
|
-
if (bundleURL.absoluteString) {
|
|
95
|
-
result[@"bundleURL"] = bundleURL.absoluteString;
|
|
81
|
+
NSMutableDictionary *result = [@{@"hostPort" : normalizedHostPort} mutableCopy];
|
|
82
|
+
if (_bundleManager && _bundleManager.bundleURL.absoluteString) {
|
|
83
|
+
result[@"bundleURL"] = _bundleManager.bundleURL.absoluteString;
|
|
96
84
|
}
|
|
97
85
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
result:result
|
|
101
|
-
resolve:resolve];
|
|
86
|
+
RCTTriggerReloadCommandListeners(@"DevConnect - apply changes");
|
|
87
|
+
resolve(result);
|
|
102
88
|
}
|
|
103
89
|
|
|
104
90
|
RCT_EXPORT_METHOD(resetMetroHost:(RCTPromiseResolveBlock)resolve
|
|
@@ -106,10 +92,13 @@ RCT_EXPORT_METHOD(resetMetroHost:(RCTPromiseResolveBlock)resolve
|
|
|
106
92
|
{
|
|
107
93
|
[[RCTBundleURLProvider sharedSettings] resetToDefaults];
|
|
108
94
|
NSURL *bundleURL = [[RCTBundleURLProvider sharedSettings] jsBundleURLForFallbackExtension:nil];
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
if (_bundleManager) {
|
|
96
|
+
_bundleManager.bundleURL = bundleURL;
|
|
97
|
+
} else {
|
|
98
|
+
RCTReloadCommandSetBundleURL(bundleURL);
|
|
99
|
+
}
|
|
100
|
+
RCTTriggerReloadCommandListeners(@"DevConnect - reset to default");
|
|
101
|
+
resolve([NSNull null]);
|
|
113
102
|
}
|
|
114
103
|
|
|
115
104
|
RCT_EXPORT_METHOD(getPreference:(NSString *)key
|
|
@@ -145,7 +134,6 @@ RCT_EXPORT_METHOD(getLocalIp:(RCTPromiseResolveBlock)resolve
|
|
|
145
134
|
{
|
|
146
135
|
struct ifaddrs *interfaces = NULL;
|
|
147
136
|
if (getifaddrs(&interfaces) == 0) {
|
|
148
|
-
// First pass: prefer Wi-Fi interface (en0)
|
|
149
137
|
struct ifaddrs *iface = interfaces;
|
|
150
138
|
while (iface != NULL) {
|
|
151
139
|
if (iface->ifa_addr->sa_family == AF_INET && !(iface->ifa_flags & IFF_LOOPBACK)) {
|
|
@@ -161,7 +149,6 @@ RCT_EXPORT_METHOD(getLocalIp:(RCTPromiseResolveBlock)resolve
|
|
|
161
149
|
}
|
|
162
150
|
iface = iface->ifa_next;
|
|
163
151
|
}
|
|
164
|
-
// Second pass: any non-loopback IPv4
|
|
165
152
|
iface = interfaces;
|
|
166
153
|
while (iface != NULL) {
|
|
167
154
|
if (iface->ifa_addr->sa_family == AF_INET && !(iface->ifa_flags & IFF_LOOPBACK)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-debug-toolkit",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "A local-first React Native debug toolkit with Web Console, HTTP API, and MCP support for AI-readable app logs",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|