Add core DDEV project management (list/describe/start/stop/restart)

Wire up the full stack for step 2 of the build plan: a ddev.ts CLI
wrapper in the main process (execFile + JSON envelope parsing, with a
PATH fallback since GUI apps on macOS don't inherit Homebrew's PATH),
IPC handlers exposed through a typed preload window.api surface,
TanStack Query hooks for polling/mutations, and a two-pane UI (project
list sidebar + detail panel with URLs, services, and DB credentials).

Verified end-to-end against a real scratch DDEV project: typecheck,
lint, and tests pass, and the running app correctly displays live
project data and reflects state changes (start/stop) via polling.
This commit is contained in:
R3ap3R
2026-08-02 23:31:45 -05:00
parent 25eb6b7b58
commit 602659c45f
17 changed files with 573 additions and 16 deletions
+14 -2
View File
@@ -1,8 +1,20 @@
import { contextBridge } from 'electron'
import { contextBridge, ipcRenderer } from 'electron'
import { electronAPI } from '@electron-toolkit/preload'
import type { DdevProjectDetail, DdevProjectSummary } from '../shared/types'
// Custom APIs for renderer
const api = {}
const api = {
projects: {
list: (): Promise<DdevProjectSummary[]> => ipcRenderer.invoke('projects:list'),
describe: (name: string): Promise<DdevProjectDetail> =>
ipcRenderer.invoke('projects:describe', name),
start: (name: string): Promise<void> => ipcRenderer.invoke('projects:start', name),
stop: (name: string): Promise<void> => ipcRenderer.invoke('projects:stop', name),
restart: (name: string): Promise<void> => ipcRenderer.invoke('projects:restart', name)
}
}
export type Api = typeof api
// Use `contextBridge` APIs to expose Electron APIs to
// renderer only if context isolation is enabled, otherwise