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
|
|
@ -1,71 +0,0 @@
|
|||
// src/renderer/App.tsx — 루트 컴포넌트
|
||||
// 테마 시스템: auto(시스템) / dark / light. 기본은 auto → 다크.
|
||||
// i18n: I18nProvider가 전체 트리를 감쌈. ConfigService에서 언어 로드.
|
||||
|
||||
import { useState, useEffect, useMemo, useRef } from 'react'
|
||||
import { ThemeProvider, CssBaseline, useMediaQuery } from '@mui/material'
|
||||
import { getTheme } from './theme'
|
||||
import { I18nProvider } from './i18n'
|
||||
import { AppLayout } from './components/AppLayout'
|
||||
import { UpgradePromptModal } from './components/UpgradePromptModal'
|
||||
import { startSystemAudioCapture, stopSystemAudioCapture } from './utils/systemAudioCapture'
|
||||
import type { ThemeMode, ConfigChangedEvent } from '@shared/types'
|
||||
|
||||
export function App(): React.ReactElement {
|
||||
const [themeMode, setThemeMode] = useState<ThemeMode>('auto')
|
||||
const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')
|
||||
const systemAudioCleanupRef = useRef<(() => void) | null>(null)
|
||||
|
||||
// 설정에서 테마 로드 + 변경 감지
|
||||
useEffect(() => {
|
||||
window.electronAPI.config.getTheme().then((result) => {
|
||||
if (result.success) {
|
||||
setThemeMode(result.data)
|
||||
}
|
||||
})
|
||||
|
||||
const unsub = window.electronAPI.config.onChanged((e: ConfigChangedEvent) => {
|
||||
if (e.key === 'theme') {
|
||||
setThemeMode(e.value as ThemeMode)
|
||||
}
|
||||
})
|
||||
return unsub
|
||||
}, [])
|
||||
|
||||
// 시스템 오디오 캡처: 메인 프로세스의 시작/중지 요청에 응답
|
||||
useEffect(() => {
|
||||
const unsubStart = window.electronAPI.caption.onStartSystemAudio(() => {
|
||||
startSystemAudioCapture((pcm16Buffer) => {
|
||||
window.electronAPI.caption.sendSystemAudioData(pcm16Buffer)
|
||||
}).catch(() => {
|
||||
// 시스템 오디오 캡처 실패 시 무시 — 마이크 자막만 사용
|
||||
})
|
||||
})
|
||||
|
||||
const unsubStop = window.electronAPI.caption.onStopSystemAudio(() => {
|
||||
stopSystemAudioCapture()
|
||||
})
|
||||
|
||||
systemAudioCleanupRef.current = () => {
|
||||
stopSystemAudioCapture()
|
||||
}
|
||||
|
||||
return () => {
|
||||
unsubStart()
|
||||
unsubStop()
|
||||
systemAudioCleanupRef.current?.()
|
||||
}
|
||||
}, [])
|
||||
|
||||
const theme = useMemo(() => getTheme(themeMode, prefersDark), [themeMode, prefersDark])
|
||||
|
||||
return (
|
||||
<I18nProvider>
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
<AppLayout />
|
||||
<UpgradePromptModal />
|
||||
</ThemeProvider>
|
||||
</I18nProvider>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue