This skill is organized to match the Electron EGG official documentation structure (https://www.kaka996.com/, https://www.kaka996.com/pages/987b1c/, https://www.kaka996.com/pages/a99b72/). When working with Electron EGG:
- Identify the topic from the user's request:
- Installation/ๅฎ่ฃ
โ examples/guide/installation.md
- Quick Start/ๅฟซ้ๅผๅง โ examples/guide/quick-start.md
- Features/ๅ่ฝ็นๆง โ examples/features/
- API/API ๆๆกฃ โ api/
- Load the appropriate example file from the
examples/ directory:
Guide (ไฝฟ็จๆๆกฃ):
- examples/guide/intro.md - Introduction to Electron EGG
- examples/guide/installation.md - Installation guide
- examples/guide/quick-start.md - Quick start guide
- examples/guide/project-structure.md - Project structure
- examples/guide/configuration.md - Configuration
- examples/guide/build.md - Build and package
Features (ๅ่ฝ็นๆง):
- examples/features/main-process.md - Main process
- examples/features/renderer-process.md - Renderer process
- examples/features/ipc-communication.md - IPC communication
- examples/features/window-management.md - Window management
- examples/features/menu.md - Menu
- examples/features/tray.md - System tray
- examples/features/auto-updater.md - Auto updater
- examples/features/plugin-system.md - Plugin system
- Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Electron EGG is based on Electron and Egg.js
- Main process and renderer process separation
- IPC communication between processes
- Each example file includes key concepts, code examples, and key points
- Reference API documentation in the
api/ directory when needed:
- api/main-api.md - Main process API
- api/renderer-api.md - Renderer process API
- api/ipc-api.md - IPC API
- api/window-api.md - Window API
- api/config-api.md - Configuration API
API Files:
- api/main-api.md - Application class, BrowserWindow, ipcMain, app methods
- api/renderer-api.md - ipcRenderer, contextBridge, DOM APIs
- api/ipc-api.md - IPC communication methods and events
- api/window-api.md - Window creation and management
- api/config-api.md - Configuration options and environment variables
- Use templates from the
templates/ directory:
- templates/installation.md - Installation templates
- templates/project-setup.md - Project setup templates
- templates/configuration.md - Configuration templates
1. Understanding Electron EGG
Electron EGG is a desktop application development framework based on Electron and Egg.js, providing a complete development toolchain and best practices.
Key Concepts:
- Electron: Cross-platform desktop application framework
- Egg.js: Node.js enterprise application framework
- Main Process: Main application process
- Renderer Process: UI rendering process
- IPC: Inter-process communication
- Plugin System: Extensible plugin architecture
2. Installation
Using npm:
```bash
npm install electron-egg
```
Using yarn:
```bash
yarn add electron-egg
```
Using pnpm:
```bash
pnpm add electron-egg
```
3. Basic Setup
```javascript
// main.js
const { Application } = require('electron-egg')
const app = new Application({
// Configuration
})
app.start()
```
Doc mapping (one-to-one with official documentation)
examples/ โ https://www.kaka996.com/pages/987b1c/api/ โ https://www.kaka996.com/pages/a99b72/