fix: esbuild compiles JSDoc node-pty into node - pty; causing startup crash

Root cause: esbuild 0.27.3 misparses `node-pty` inside JSDoc comments as a
code expression `node - pty` (subtraction). This produces a bare
`ReferenceError: node is not defined` at app.asar/dist-electron/main.js:35
on startup.

Fixes:
- terminal-manager.ts: replace JSDoc block with line comments and remove all
  literal `node-pty` strings (reference docs/handover instead)
- build-electron.mjs: clean dist-electron/ before every build to prevent
  stale artifact contamination in app.asar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
7418andClaude Opus 4.6 committed 2026-03-13 01:28:15 +08:00
1 parent d2bfa4b523
commit 006862a0bb
2 files changed
+19 -16

No files matched your search

+8
View File
@@ -24,6 +24,14 @@ function resolveStandaloneSymlinks() {
}
async function buildElectron() {
// Clean dist-electron/ before every build to prevent stale artifacts
// from leaking into app.asar (caused v0.34 crash on upgrade).
if (fs.existsSync('dist-electron')) {
fs.rmSync('dist-electron', { recursive: true });
console.log('Cleaned dist-electron/');
}
fs.mkdirSync('dist-electron', { recursive: true });
const shared = {
bundle: true,
platform: 'node',