feat: add Electron packaging with headless mode and --port support

- Add electron-builder for packaging
- Add --port argument support (default: 9997)
- Add electron/main.js as entry point
- Update package.json with build configuration
- Server runs headlessly without GUI window
This commit is contained in:
2026-03-21 23:51:03 +08:00
parent a819563382
commit 953cadd1a6
3 changed files with 202 additions and 8 deletions

View File

@@ -4,17 +4,58 @@
"description": "Web-based terminal using libghostty-vt and xterm.js",
"main": "src/backend/server.js",
"scripts": {
"start": "node src/backend/server.js",
"dev": "node src/backend/server.js",
"build:frontend": "echo 'Frontend is static, no build needed'"
"start": "electron .",
"dev": "electron . --port 9997",
"start:server": "node src/backend/server.js",
"build": "electron-builder",
"build:dir": "electron-builder --dir"
},
"keywords": ["terminal", "web", "ghostty", "xterm"],
"keywords": [
"terminal",
"web",
"ghostty",
"xterm"
],
"license": "MIT",
"author": "XCTerminal",
"dependencies": {
"ws": "^8.18.0",
"node-pty": "^1.0.0"
"node-pty": "^1.0.0",
"ws": "^8.18.0"
},
"devDependencies": {
"electron": "^41.0.3",
"electron-builder": "^26.8.1",
"express": "^4.18.2"
},
"build": {
"appId": "com.xcterminal.app",
"productName": "XCTerminal",
"directories": {
"output": "dist"
},
"win": {
"target": [
{
"target": "portable",
"arch": ["x64"]
}
]
},
"linux": {
"target": ["AppImage"]
},
"mac": {
"target": ["dmg"]
},
"files": [
"src/**/*",
"node_modules/**/*",
"!node_modules/.cache/**/*"
],
"extraMetadata": {
"main": "src/backend/server.js"
},
"nodeGypRebuild": false,
"npmRebuild": false
}
}
}