Skip to content

Commit 2cbc9b1

Browse files
committed
fix(deps): Remove vulnerable unmaintained ip package
Fixes vuejs#698
1 parent d5f9427 commit 2cbc9b1

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

packages/electron/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"electron": "^33.4.3",
4343
"execa": "catalog:",
4444
"h3": "^1.15.1",
45-
"ip": "^2.0.1",
4645
"pathe": "catalog:",
4746
"socket.io": "^4.8.1",
4847
"socket.io-client": "^4.8.1"

packages/electron/src/devtools.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1+
import os from 'node:os'
12
import { functions } from '@vue/devtools-core'
23
import { createRpcClient, setElectronClientContext } from '@vue/devtools-kit'
3-
import ip from 'ip'
44
import io from 'socket.io-client/dist/socket.io.js'
55
import { createConnectionApp, initDevTools } from '../client/devtools-panel'
66

77
const port = window.process.env.PORT || 8098
88

9+
function address() {
10+
return Object.values(os.networkInterfaces()).map((addresses) => {
11+
return addresses?.filter((details) => {
12+
return !details.internal && details.family === 'IPv4'
13+
})
14+
}).flat()[0]
15+
}
16+
917
function init() {
1018
const localhost = `http://localhost:${port}`
1119
const socket = io(localhost)
1220
let reload: Function | null = null
1321

1422
const app = createConnectionApp('#app', {
1523
local: localhost,
16-
network: `http://${ip.address()}:${port}`,
24+
network: `http://${address()}:${port}`,
1725
})
1826

1927
socket.on('vue-devtools:init', () => {

pnpm-lock.yaml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)