Developer Overview
Developer Overview
Plugin Model
- BaseModule: lifecycle =
created → onInit → start → stop → onDestroy. - Plugin Capsule: every plugin runs in its own process, described by a manifest.
- Channel System:
ChannelType.MAINandChannelType.PLUGINhandle IPC with promise-based replies.
Directory Layout
apps/core-app/
├── src/main/ # main process, modules, channels
├── src/renderer/ # renderer (Vue 3)
└── ...
plugins/
└── my-plugin/
├── manifest.json
├── init/
│ └── index.ts
├── preload/
└── src/
Lifecycle
- Load – manifest is parsed and entry scripts are registered.
- Init –
init/index.tsruns with context (logger, storage, channel). - Run – plugin listens to events, renders UI, or exposes services.
- Destroy –
onDestroyclears timers, listeners, and temporary files.
Sandbox Policy
- File access is scoped to the plugin directory.
- HTTPS calls are allowed; sensitive domains must be declared.
- Storage API enforces the 10 MB quota per plugin.
Developer Loop
pnpm core:devlaunches Electron with hot reload for plugins.pnpm utils:testvalidates shared SDK behavior.pnpm core:build:snapshotensures the packaged app loads your plugin.
Was this helpful?