rnassist 1.0.1 → 1.0.2
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/index.js +17 -2
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -10,8 +10,22 @@ const { llmService } = require("./llm");
|
|
|
10
10
|
const { default: ora } = require("ora");
|
|
11
11
|
const { scrapping } = require("./scrapper");
|
|
12
12
|
const bugsJson = require("./bugs.json")
|
|
13
|
+
const { execSync } = require('child_process')
|
|
13
14
|
require("dotenv").config({ quiet: true });
|
|
14
|
-
|
|
15
|
+
function checkForUpdates() {
|
|
16
|
+
try {
|
|
17
|
+
const latest = execSync('npm show rnassist version').toString().trim()
|
|
18
|
+
const current = require('./package.json').version
|
|
19
|
+
if (latest !== current) {
|
|
20
|
+
console.log(chalk.yellow(`New version available: ${latest}. Updating...`))
|
|
21
|
+
execSync('npm install -g rnassist', { stdio: 'inherit' })
|
|
22
|
+
console.log(chalk.green('Updated! Please re-run your command.'))
|
|
23
|
+
process.exit(0)
|
|
24
|
+
}
|
|
25
|
+
} catch(e) {
|
|
26
|
+
// silently fail if no internet
|
|
27
|
+
}
|
|
28
|
+
}
|
|
15
29
|
async function isReactNativeApp(folder) {
|
|
16
30
|
try {
|
|
17
31
|
const hasPackage = await fs.readFile(
|
|
@@ -28,12 +42,13 @@ async function isReactNativeApp(folder) {
|
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
async function main() {
|
|
45
|
+
checkForUpdates();
|
|
31
46
|
const isRN = await isReactNativeApp(process.cwd());
|
|
32
47
|
if (!isRN) {
|
|
33
48
|
console.log("This is not a React Native project.");
|
|
34
49
|
process.exit();
|
|
35
50
|
}
|
|
36
|
-
connectMetro();
|
|
51
|
+
await connectMetro();
|
|
37
52
|
const scannerData = await getData();
|
|
38
53
|
const program = new Command();
|
|
39
54
|
program.command("update-bugs").description("updating bugs from react native").action(()=> scrapping())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rnassist",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "AI-powered debugger and performance analyzer for React Native projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@google/generative-ai": "^0.24.1",
|
|
19
19
|
"axios": "^1.13.6",
|
|
20
20
|
"chalk": "^5.6.2",
|
|
21
|
+
"child_process": "^1.0.2",
|
|
21
22
|
"commander": "^14.0.3",
|
|
22
23
|
"dotenv": "^17.3.1",
|
|
23
24
|
"express": "^5.2.1",
|