Skip to content

Commit 1973a65

Browse files
feat(dev): change default npm dev script to device mode and add wrapper script to set environment variable and proxy signal api (#157)
1 parent f3b4dbc commit 1973a65

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

ui/dev_device.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Print header
4+
echo "┌──────────────────────────────────────┐"
5+
echo "│ JetKVM Development Setup │"
6+
echo "└──────────────────────────────────────┘"
7+
8+
# Prompt for IP address
9+
printf "Please enter the IP address of your JetKVM device: "
10+
read ip_address
11+
12+
# Validate input is not empty
13+
if [ -z "$ip_address" ]; then
14+
echo "Error: IP address cannot be empty"
15+
exit 1
16+
fi
17+
18+
# Set the environment variable and run Vite
19+
echo "Starting development server with JetKVM device at: $ip_address"
20+
sleep 1
21+
JETKVM_PROXY_URL="http://$ip_address" vite dev --mode=device

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"node": "21.1.0"
88
},
99
"scripts": {
10-
"dev": "vite dev --mode=development",
10+
"dev": "./dev_device.sh",
11+
"dev:cloud": "vite dev --mode=development",
1112
"build": "npm run build:prod",
1213
"build:device": "tsc && vite build --mode=device --emptyOutDir",
13-
"dev:device": "vite dev --mode=device",
1414
"build:prod": "tsc && vite build --mode=production",
1515
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
1616
},

0 commit comments

Comments
 (0)