a79086e4e8
新增网盘功能 - FileServer 增加 GET /drive/meta|list|download, 每机长期 token 校验 + 目录穿越防护 - 新增 drive.ts 客户端: listDrive / getDriveRoot / downloadDriveFile / collectDriveFiles - ipc 暴露 drive:list|root|download|openFolder|pickDir, DB 增 drive_token 列 + ALTER 迁移 - 新增 DrivePanel.vue, 聊天框加"网盘" tab, 设置页加网盘分区 - 支持整目录递归下载并保持层级 修复远程功能 - 终端: 控制端收到的 output 帧被直接丢弃 (case 'output': return), 导致 xterm 全空白 - ChatServer: ws 构造即 listen, 'listening' 可能早于 start() 挂监听, 导致永久挂起 - USB: serverAttach 自行生成 sessionId 与控制端不一致 (数据帧查表落空); libusb 枚举误用 getDevices() (WebUSB 语义, 只返回已授权设备) 改 loadDevices(); control transfer 传数字 bmRequestType (node-usb v3 要字符串枚举); detachKernelDriver 挪到 selectConfiguration 之前 (否则 EBUSY) - 转发 UI: store 的 onOpened 是 no-op 致对方发起的转发不显示、无轮询致流量/TTL 不刷新、 对方发起的会话关不掉 (新增 closeSession, server 侧关闭需通知对端否则端口泄漏)、 入口/目标补归属标注、方向标签语义统一、监听端口输入框加宽 修复"在线却显示等待重连" - 根因: 启动时主进程先连上对端 (connectTo 早于 createMainWindow), device:wsState 在渲染层订阅前发出去被丢弃; 之后连接一直保持, 再无 open 事件 -> UI 永久停在等待重连 - 改为推全量快照 + 渲染层 mount 时主动拉取 (app:state); 渲染层先注册监听再 await - 通道语义改为 outgoing 或 inbound 任一 WS 活着即可用 (原来只看 outgoing) 修复 Linux 安装后没图标 - linux.icon 指向单张 PNG 时 app-builder 解析不出尺寸 (size=0), 图标被装进 hicolor/0x0/ 非法目录, 桌面环境找不到; 改为指向 resources/icons 目录 (8 个标准尺寸) - StartupWMClass 填的是 productName, 与窗口真实 WM_CLASS (可执行文件名) 对不上, 任务栏找不到启动器; 改为 local-net-msg 其他 - 新增 scripts/selftest 自测框架 (两个虚拟节点 + 真实 ChatServer/ChatClient), 30 条用例全过 - 重写 scripts/make-icon.js 生成多尺寸图标集 (原脚本引用的源图已不存在, sharp 依赖也缺) - 新增 docs/drive.md, docs/connection-status.md
127 lines
4.7 KiB
JSON
127 lines
4.7 KiB
JSON
{
|
|
"name": "local-net-msg",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "局域网即时通讯 (Electron + Vue 3) - 飞书风格",
|
|
"homepage": "https://github.com/localnetmsg/local-net-msg",
|
|
"author": "LocalNetMsg <dev@localnetmsg.local>",
|
|
"main": "out/main/index.js",
|
|
"scripts": {
|
|
"dev": "electron-vite dev",
|
|
"build": "electron-vite build",
|
|
"preview": "electron-vite preview",
|
|
"start": "electron-vite preview",
|
|
"typecheck:node": "tsc --noEmit -p tsconfig.node.json",
|
|
"typecheck:web": "vue-tsc --noEmit -p src/renderer/tsconfig.json",
|
|
"typecheck": "npm run typecheck:node && npm run typecheck:web",
|
|
"selftest:build": "esbuild scripts/selftest/main.ts --bundle --platform=node --format=cjs --target=node20 --outfile=scripts/selftest/.out/selftest.cjs --alias:electron=./scripts/selftest/electron-stub.cjs --alias:@lydell/node-pty=./scripts/selftest/pty-shim.cjs --external:better-sqlite3 --external:serialport --external:usb --external:node-hid --external:sudo-prompt --external:ws",
|
|
"selftest": "npm run selftest:build && cross-env ELECTRON_RUN_AS_NODE=1 electron scripts/selftest/.out/selftest.cjs",
|
|
"package:win": "cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ electron-vite build && electron-builder --win --x64",
|
|
"package:mac": "cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ electron-vite build && electron-builder --mac",
|
|
"package:linux": "cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ electron-vite build && electron-builder --linux",
|
|
"package:dir": "cross-env ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ electron-vite build && electron-builder --dir",
|
|
"postinstall": "electron-builder install-app-deps"
|
|
},
|
|
"dependencies": {
|
|
"@element-plus/icons-vue": "^2.3.1",
|
|
"@lydell/node-pty": "^1.2.0-beta.12",
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/addon-web-links": "^0.12.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"better-sqlite3": "^11.5.0",
|
|
"electron-store": "^8.2.0",
|
|
"element-plus": "^2.8.4",
|
|
"highlight.js": "^11.10.0",
|
|
"markdown-it": "^14.3.0",
|
|
"node-hid": "^3.3.0",
|
|
"pinia": "^2.2.4",
|
|
"serialport": "^13.0.0",
|
|
"sudo-prompt": "^9.2.1",
|
|
"usb": "^3.0.1",
|
|
"ws": "^8.18.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/better-sqlite3": "^7.6.11",
|
|
"@types/markdown-it": "^14.1.2",
|
|
"@types/node": "^22.7.5",
|
|
"@types/ws": "^8.5.12",
|
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
"cross-env": "^7.0.3",
|
|
"electron": "^32.1.2",
|
|
"electron-builder": "^24.13.3",
|
|
"electron-vite": "^2.3.0",
|
|
"typescript": "^5.6.2",
|
|
"vite": "^5.4.8",
|
|
"vue": "^3.5.10",
|
|
"vue-router": "^4.4.5",
|
|
"vue-tsc": "^2.1.6"
|
|
},
|
|
"build": {
|
|
"appId": "com.localnetmsg.app",
|
|
"productName": "LocalNetMsg",
|
|
"copyright": "Copyright © 2026",
|
|
"directories": {
|
|
"output": "dist-Electron",
|
|
"buildResources": "resources"
|
|
},
|
|
"npmRebuild": false,
|
|
"files": [
|
|
"out/**/*",
|
|
"package.json"
|
|
],
|
|
"asarUnpack": [
|
|
"**/node_modules/@lydell/node-pty/**/*",
|
|
"**/node_modules/@lydell/node-pty-*/*",
|
|
"**/node_modules/@node-usb/**/*",
|
|
"**/node_modules/usb/prebuilds/**/*",
|
|
"**/node_modules/@serialport/**/prebuilds/**/*",
|
|
"**/node_modules/node-hid/prebuilds/**/*"
|
|
],
|
|
"extraResources": [
|
|
{
|
|
"from": "resources/icon.png",
|
|
"to": "icon.png"
|
|
}
|
|
],
|
|
"win": {
|
|
"icon": "resources/icon.png",
|
|
"target": [
|
|
{
|
|
"target": "nsis",
|
|
"arch": [
|
|
"x64"
|
|
]
|
|
}
|
|
],
|
|
"artifactName": "${productName}-${version}-Setup.${ext}"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"perMachine": false,
|
|
"allowElevation": true,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"createDesktopShortcut": true,
|
|
"createStartMenuShortcut": true,
|
|
"shortcutName": "LocalNetMsg"
|
|
},
|
|
"mac": {
|
|
"icon": "resources/icon.png",
|
|
"target": "dmg",
|
|
"category": "public.app-category.social-networking"
|
|
},
|
|
"linux": {
|
|
"icon": "resources/icons",
|
|
"target": [
|
|
"deb"
|
|
],
|
|
"category": "Network",
|
|
"synopsis": "LAN instant messaging",
|
|
"description": "LocalNetMsg — a LAN instant messaging desktop app.",
|
|
"maintainer": "LocalNetMsg <dev@localnetmsg.local>",
|
|
"desktop": {
|
|
"StartupWMClass": "local-net-msg"
|
|
}
|
|
}
|
|
}
|
|
}
|