rn-inspector 0.2.4 → 0.3.1
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 +10 -19
- package/dist/config/Index.d.ts +7 -0
- package/dist/config/Index.d.ts.map +1 -0
- package/dist/config/Index.js +36 -0
- package/dist/config/Index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +335 -1058
- package/dist/index.js.map +1 -1
- package/dist/snippets/INJECT_INSPECTOR_SNIPPET.d.ts +2 -0
- package/dist/snippets/INJECT_INSPECTOR_SNIPPET.d.ts.map +1 -0
- package/dist/snippets/INJECT_INSPECTOR_SNIPPET.js +186 -0
- package/dist/snippets/INJECT_INSPECTOR_SNIPPET.js.map +1 -0
- package/dist/snippets/INJECT_NETWORK_SNIPPET.d.ts +2 -0
- package/dist/snippets/INJECT_NETWORK_SNIPPET.d.ts.map +1 -0
- package/dist/snippets/INJECT_NETWORK_SNIPPET.js +999 -0
- package/dist/snippets/INJECT_NETWORK_SNIPPET.js.map +1 -0
- package/dist/snippets/INJECT_STORAGE_SNIPPET.d.ts +2 -0
- package/dist/snippets/INJECT_STORAGE_SNIPPET.d.ts.map +1 -0
- package/dist/snippets/INJECT_STORAGE_SNIPPET.js +126 -0
- package/dist/snippets/INJECT_STORAGE_SNIPPET.js.map +1 -0
- package/dist/types/Index.d.ts +35 -0
- package/dist/types/Index.d.ts.map +1 -0
- package/dist/types/Index.js +3 -0
- package/dist/types/Index.js.map +1 -0
- package/package.json +3 -2
- package/ui/assets/index-DQmlFNcZ.js +166 -0
- package/ui/index.html +13 -13
- package/ui/assets/index-B9bpXjqR.js +0 -166
package/README.md
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
# rn-inspector CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/rn-inspector)
|
|
4
|
+
[](https://www.npmjs.com/package/rn-inspector)
|
|
4
5
|
|
|
5
|
-
`rn-inspector` is a
|
|
6
|
+
`rn-inspector` is a focused CLI + Web UI that helps you debug **React Native** apps by:
|
|
6
7
|
|
|
7
8
|
- Proxying **Metro** messages.
|
|
8
|
-
- Attaching to **DevTools** targets (
|
|
9
|
-
- Streaming **console logs** and **
|
|
9
|
+
- Attaching to **DevTools** targets (single or multiple devices/emulators).
|
|
10
|
+
- Streaming **console logs**, **network requests**, and selected **storage state** into a modern, glassy web UI.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## What's new in 0.2.4
|
|
14
|
-
|
|
15
|
-
- **Console**: Removed all truncation limits for nested objects; logs now show full payloads.
|
|
16
|
-
- **Network**: Much broader capture on RN CLI/Expo—hooks into `fetch`, `XHR`, native `Networking`, `ImageLoader`, `Image` component methods, WebSockets (incl. messages and sends), Blob/FileReader operations.
|
|
17
|
-
- **Stability**: Higher body limits (up to 500KB) and richer source tagging for requests (fetch/xhr/native/image/websocket/etc.).
|
|
18
|
-
|
|
19
|
-
This package is the CLI entry point that you install globally.
|
|
12
|
+
This package is the **CLI entry point** you install globally.
|
|
20
13
|
|
|
21
14
|
---
|
|
22
15
|
|
|
@@ -48,7 +41,7 @@ After installing, the `rn-inspector` command is available in your shell.
|
|
|
48
41
|
- Serve the **UI** at `http://localhost:4173`.
|
|
49
42
|
- Auto-discover any available **DevTools targets** (for connected devices/emulators).
|
|
50
43
|
|
|
51
|
-
4. Open the UI in your browser (or use the `o` keyboard shortcut
|
|
44
|
+
4. Open the UI in your browser (or use the `o` keyboard shortcut), pick a device from the header, and start inspecting **Console** and **Network** events.
|
|
52
45
|
|
|
53
46
|
---
|
|
54
47
|
|
|
@@ -60,7 +53,7 @@ rn-inspector \
|
|
|
60
53
|
[--ui-port 4173 | --ui-port=4173] \
|
|
61
54
|
[--ui-ws-port 9230 | --ui-ws-port=9230] \
|
|
62
55
|
[--devtools-url ws://...] \
|
|
63
|
-
[--version
|
|
56
|
+
[--version]
|
|
64
57
|
```
|
|
65
58
|
|
|
66
59
|
### Options
|
|
@@ -84,8 +77,8 @@ rn-inspector \
|
|
|
84
77
|
- Explicit DevTools websocket URL to attach to (for advanced usage).
|
|
85
78
|
- If omitted, `rn-inspector` will **auto-discover** DevTools targets via `http://<host>:<port>/json` on a range of ports (starting around the Metro port) and attach to all matching targets.
|
|
86
79
|
|
|
87
|
-
- `--version
|
|
88
|
-
- Print the `rn-inspector` CLI version and exit
|
|
80
|
+
- `--version`
|
|
81
|
+
- Print the `rn-inspector` CLI version and exit.
|
|
89
82
|
|
|
90
83
|
### Environment variables
|
|
91
84
|
|
|
@@ -132,12 +125,10 @@ The UI includes:
|
|
|
132
125
|
- Live console logs from Metro and DevTools.
|
|
133
126
|
- Level filters (log/info/warn/error).
|
|
134
127
|
- Detail drawer with copy-to-clipboard and timestamps.
|
|
135
|
-
- Glassy search bar and Clear action in the header to filter and reset the current view.
|
|
136
128
|
|
|
137
129
|
- **Network** page
|
|
138
130
|
- HTTP requests captured via an injected fetch wrapper / DevTools Network domain.
|
|
139
131
|
- Detail drawer with headers, payload, and response preview (including text, JSON, images, and some binary types).
|
|
140
|
-
- Glassy search bar and Clear action in the header to filter by URL/method/status and reset the current view.
|
|
141
132
|
|
|
142
133
|
- **Header controls**
|
|
143
134
|
- Global **device selector** (backed by the `deviceId` tagging in the CLI).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DEFAULT_METRO_PORT = 8081;
|
|
2
|
+
export declare const DEFAULT_UI_WS_PORT = 9230;
|
|
3
|
+
export declare const DEFAULT_UI_STATIC_PORT = 4173;
|
|
4
|
+
export declare const baseDir: string;
|
|
5
|
+
export declare function getCliVersion(): string;
|
|
6
|
+
export declare function getMetroPort(envPort?: string | undefined): number;
|
|
7
|
+
//# sourceMappingURL=Index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../../src/config/Index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAG3C,eAAO,MAAM,OAAO,EAAE,MAA8E,CAAC;AAErG,wBAAgB,aAAa,IAAI,MAAM,CAStC;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOjE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.baseDir = exports.DEFAULT_UI_STATIC_PORT = exports.DEFAULT_UI_WS_PORT = exports.DEFAULT_METRO_PORT = void 0;
|
|
7
|
+
exports.getCliVersion = getCliVersion;
|
|
8
|
+
exports.getMetroPort = getMetroPort;
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
exports.DEFAULT_METRO_PORT = 8081;
|
|
12
|
+
exports.DEFAULT_UI_WS_PORT = 9230;
|
|
13
|
+
exports.DEFAULT_UI_STATIC_PORT = 4173;
|
|
14
|
+
const baseFile = typeof __filename !== 'undefined' ? __filename : path_1.default.resolve(process.argv[1] ?? '');
|
|
15
|
+
exports.baseDir = typeof __dirname !== 'undefined' ? __dirname : path_1.default.dirname(baseFile);
|
|
16
|
+
function getCliVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const pkgPath = path_1.default.resolve(exports.baseDir, '../../package.json');
|
|
19
|
+
const raw = fs_1.default.readFileSync(pkgPath, 'utf8');
|
|
20
|
+
const pkg = JSON.parse(raw);
|
|
21
|
+
return pkg.version ?? 'unknown';
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return 'unknown';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getMetroPort(envPort) {
|
|
28
|
+
if (envPort) {
|
|
29
|
+
const parsed = Number(envPort);
|
|
30
|
+
if (!Number.isNaN(parsed) && parsed > 0 && parsed < 65536)
|
|
31
|
+
return parsed;
|
|
32
|
+
console.warn(`[rn-inspector] Ignoring invalid METRO_PORT="${envPort}", falling back to ${exports.DEFAULT_METRO_PORT}`);
|
|
33
|
+
}
|
|
34
|
+
return exports.DEFAULT_METRO_PORT;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=Index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/config/Index.ts"],"names":[],"mappings":";;;;;;AAUA,sCASC;AAED,oCAOC;AA5BD,gDAAwB;AACxB,4CAAoB;AAEP,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAC1B,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAC1B,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,QAAQ,GAAW,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACjG,QAAA,OAAO,GAAW,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErG,SAAgB,aAAa;IAC3B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,cAAI,CAAC,OAAO,CAAC,eAAO,EAAE,oBAAoB,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAG,YAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyB,CAAC;QACpD,OAAO,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,OAA4B;IACvD,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,KAAK;YAAE,OAAO,MAAM,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,+CAA+C,OAAO,sBAAsB,0BAAkB,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,0BAAkB,CAAC;AAC5B,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAsjDA,wBAAsB,IAAI,kBA4BzB"}
|