feat(V2-1a): Monorepo 구조 전환 — apps/desktop으로 V1 이동
- npm workspaces 루트 (apps/*, packages/*) 세팅 - V1 전체를 apps/desktop/으로 git mv (src, resources, tests, sidecar, scripts, electron.vite.config.ts, electron-builder.yml, vitest.config.ts, tsconfig.node.json, tsconfig.web.json) - apps/desktop/package.json 신규 (name=@d3ro/desktop) - productName: 'd3ro-voice' 명시 — app.getName()을 고정하여 userData 경로 %APPDATA%\d3ro-voice\ 그대로 유지 (기존 DB/설정 연속성 보장) - 루트 package.json을 workspace 루트로 재구성, 공통 devDep만 유지 (typescript, eslint, prettier) - turbo.json, tsconfig.base.json 추가 (Turborepo 자체 설치는 별도 sub-phase) - memory/project_status.md 생성 (규칙 13) 검증: - npm run typecheck 통과 - npm run build 통과 (electron-vite main+preload+renderer) - npm run dev 실제 실행 → DB/핫키/Ollama 자동 실행 모두 정상
This commit is contained in:
parent
3a160b9032
commit
45a580878a
178 changed files with 214 additions and 0 deletions
43
apps/desktop/src/main/index.ts
Normal file
43
apps/desktop/src/main/index.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// src/main/index.ts — 앱 진입점
|
||||
|
||||
import { app } from 'electron'
|
||||
import { bootstrap } from './bootstrap'
|
||||
import { setupLifecycle } from './lifecycle'
|
||||
import { getMainWindow } from './windows/WindowManager'
|
||||
|
||||
// EPIPE 에러 방지: electron-log가 stdout/stderr에 쓸 때 파이프가 끊기면 크래시 방지
|
||||
process.stdout?.on?.('error', () => { /* ignore EPIPE */ })
|
||||
process.stderr?.on?.('error', () => { /* ignore EPIPE */ })
|
||||
process.on('uncaughtException', (err) => {
|
||||
if (err.message?.includes('EPIPE')) return // EPIPE는 무시
|
||||
// 기타 예외는 로그만
|
||||
try { require('electron-log').default?.error?.('Uncaught:', err) } catch { /* noop */ }
|
||||
})
|
||||
|
||||
// 단일 인스턴스 잠금
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
|
||||
if (!gotTheLock) {
|
||||
app.quit()
|
||||
} else {
|
||||
app.on('second-instance', () => {
|
||||
// 기존 인스턴스의 메인 윈도우를 활성화
|
||||
const mainWindow = getMainWindow()
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
mainWindow.focus()
|
||||
}
|
||||
})
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
await bootstrap()
|
||||
setupLifecycle()
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
// Windows에서는 모든 윈도우 닫아도 앱 유지 (트레이)
|
||||
if (process.platform !== 'darwin') {
|
||||
// closeToTray 설정 확인은 lifecycle에서 처리
|
||||
}
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue