fix: properly parse --port argument in packaged Electron app

- Use regex on full argv string instead of iterating args
- Move express to dependencies for packaging
- Add electron folder to files list in build config
This commit is contained in:
2026-03-22 00:37:58 +08:00
parent 38f6d5e97c
commit d023705220
2 changed files with 26 additions and 50 deletions

View File

@@ -2,7 +2,7 @@
"name": "ghostty-web",
"version": "0.1.0",
"description": "Web-based terminal using libghostty-vt and xterm.js",
"main": "src/backend/server.js",
"main": "electron/main.js",
"scripts": {
"start": "electron .",
"dev": "electron . --port 9997",
@@ -19,13 +19,13 @@
"license": "MIT",
"author": "XCTerminal",
"dependencies": {
"express": "^4.18.2",
"node-pty": "^1.0.0",
"ws": "^8.18.0"
},
"devDependencies": {
"electron": "^41.0.3",
"electron-builder": "^26.8.1",
"express": "^4.18.2"
"electron-builder": "^26.8.1"
},
"build": {
"appId": "com.xcterminal.app",
@@ -49,12 +49,13 @@
"target": ["dmg"]
},
"files": [
"electron/**/*",
"src/**/*",
"node_modules/**/*",
"!node_modules/.cache/**/*"
],
"extraMetadata": {
"main": "src/backend/server.js"
"main": "electron/main.js"
},
"nodeGypRebuild": false,
"npmRebuild": false