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,67 +0,0 @@
|
|||
// src/main/ipc/instruction-handlers.ts
|
||||
|
||||
import { ipcMain } from 'electron'
|
||||
import { ipcSuccess, ipcError, ErrorCode } from '@shared/errors'
|
||||
import { getCustomInstructionService } from '../services/CustomInstructionService'
|
||||
import type { CustomInstruction } from '../services/CustomInstructionService'
|
||||
|
||||
// IPC_CHANNELS에 instruction 채널이 없으므로 직접 문자열 사용
|
||||
// (Phase 6 전용, 설계서 02에는 미포함)
|
||||
const CHANNELS = {
|
||||
GET_ALL: 'instruction:getAll',
|
||||
GET_BY_ID: 'instruction:getById',
|
||||
CREATE: 'instruction:create',
|
||||
UPDATE: 'instruction:update',
|
||||
DELETE: 'instruction:delete',
|
||||
REORDER: 'instruction:reorder'
|
||||
} as const
|
||||
|
||||
export function registerInstructionHandlers(): void {
|
||||
ipcMain.handle(CHANNELS.GET_ALL, async () => {
|
||||
return ipcSuccess(getCustomInstructionService().getAll())
|
||||
})
|
||||
|
||||
ipcMain.handle(CHANNELS.GET_BY_ID, async (_event, params: { id: string }) => {
|
||||
return ipcSuccess(getCustomInstructionService().getById(params.id))
|
||||
})
|
||||
|
||||
ipcMain.handle(
|
||||
CHANNELS.CREATE,
|
||||
async (
|
||||
_event,
|
||||
params: { name: string; description: string; prompt: string; icon?: string }
|
||||
) => {
|
||||
try {
|
||||
const result = getCustomInstructionService().create(params)
|
||||
return ipcSuccess(result)
|
||||
} catch {
|
||||
return ipcError(ErrorCode.ConfigWriteFailed, 'Failed to create instruction')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(
|
||||
CHANNELS.UPDATE,
|
||||
async (_event, params: { id: string; data: Partial<CustomInstruction> }) => {
|
||||
try {
|
||||
const result = getCustomInstructionService().update(params.id, params.data)
|
||||
return ipcSuccess(result)
|
||||
} catch {
|
||||
return ipcError(ErrorCode.ConfigWriteFailed, 'Failed to update instruction')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle(CHANNELS.DELETE, async (_event, params: { id: string }) => {
|
||||
const result = getCustomInstructionService().delete(params.id)
|
||||
if (!result) {
|
||||
return ipcError(ErrorCode.ConfigWriteFailed, 'Cannot delete builtin instruction')
|
||||
}
|
||||
return ipcSuccess(undefined)
|
||||
})
|
||||
|
||||
ipcMain.handle(CHANNELS.REORDER, async (_event, params: { ids: string[] }) => {
|
||||
getCustomInstructionService().reorder(params.ids)
|
||||
return ipcSuccess(undefined)
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue