rnassist 1.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/.env.example ADDED
@@ -0,0 +1 @@
1
+ GEMINI_API_KEY = your-api-key-here
package/Readme.md ADDED
@@ -0,0 +1,110 @@
1
+ # rnassist
2
+
3
+ AI-powered debugger and performance analyzer for React Native projects.
4
+
5
+ Run it inside any React Native project to get real-time analysis of your code, dependencies, runtime errors, network calls, and known bugs — all in one terminal report.
6
+
7
+ ---
8
+
9
+ ![rnassist scan output](https://raw.githubusercontent.com/adityasingh-ops/rnassist/main/assets/scan.png)
10
+
11
+ ## How It Works
12
+
13
+ ```
14
+ rnassist scan
15
+
16
+ Reads all .ts .tsx .js .jsx files
17
+
18
+ Checks dependencies against known RN bug database
19
+
20
+ Connects to your running app via Metro WebSocket
21
+ Collects: runtime errors, console logs, network calls
22
+
23
+ Sends everything to Gemini AI
24
+
25
+ Prints a specific, actionable report in your terminal
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Requirements
31
+
32
+ - Node.js 18+
33
+ - A React Native or Expo project
34
+ - Metro bundler running (`npx expo start` or `npx react-native start`)
35
+
36
+ ---
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ npm install -g rnassist
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Usage
47
+
48
+ Navigate to your React Native project root, then run:
49
+
50
+ ### Scan
51
+
52
+ ```bash
53
+ rnassist scan
54
+ ```
55
+
56
+ Watches your running app. Trigger some actions in the simulator or device, then press `Ctrl+C` to analyze. You will get a full report covering:
57
+
58
+ - Runtime crashes and errors
59
+ - Performance bottlenecks (JS thread, re-renders, memory leaks)
60
+ - Bad patterns and anti-patterns
61
+ - Known bugs matched to your exact dependency versions
62
+ - Network calls made during the session
63
+
64
+ ### Update Bug Database
65
+
66
+ ```bash
67
+ rnassist update-bugs
68
+ ```
69
+
70
+ Fetches the latest React Native changelog from GitHub and updates the local bug database. Run this periodically to stay up to date with known fixes.
71
+
72
+ ---
73
+
74
+ ## Example Output
75
+
76
+ ```
77
+ ===========================================================================================
78
+ [!] CRITICAL CRASH
79
+ ===========================================================================================
80
+ FILE: /app/(tabs)/biometric.tsx
81
+ LINE: 22
82
+
83
+ 21 | const data = undefined;
84
+ 22 | console.log(data.name); <--- CRASH HERE
85
+
86
+ FIX: Use optional chaining: console.log(data?.name)
87
+
88
+ ===========================================================================================
89
+ [!] PERFORMANCE — JS THREAD BOTTLENECK
90
+ ===========================================================================================
91
+ FILE: /Hooks/useProduct.tsx
92
+
93
+ fetchProduct is recreated on every render.
94
+ Wrap in useCallback to stabilize the reference.
95
+ ```
96
+
97
+ ---
98
+
99
+ ## What It Analyzes
100
+
101
+ - All `.ts`, `.tsx`, `.js`, `.jsx` files in your project (skips `node_modules`, `android`, `ios`, `build`)
102
+ - `package.json` dependencies matched against a database of known RN bugs
103
+ - Live runtime data from your running app via Chrome DevTools Protocol
104
+ - React Native core bug fixes from the official changelog
105
+
106
+ ---
107
+
108
+ ## License
109
+
110
+ ISC
Binary file
package/bugs.js ADDED
@@ -0,0 +1,18 @@
1
+ const bugsJson = require("./bugs.json")
2
+
3
+ async function filteredDependencies(data){
4
+ const filteredData = []
5
+
6
+ for(const [name, version] of Object.entries(data)){
7
+ const cleanVersion = version.replace(/[\^~>=<]/g, '').trim()
8
+ if(bugsJson[name] && bugsJson[name][cleanVersion]){
9
+ filteredData.push({
10
+ package:name,
11
+ currentVersion:cleanVersion,
12
+ ...bugsJson[name][cleanVersion]
13
+ })
14
+ }
15
+ }
16
+ return filteredData;
17
+ }
18
+ module.exports = {filteredDependencies}