Magic Apps

Documentation

macmagic.app

Coding standards

Stack and workspace

Layer Technology
Runtime Electron 44 (Chromium + Node.js)
Language TypeScript 5.7, strict mode
Build tsup (ESM + CJS dual output, DTS generation)
Package manager pnpm 11 with workspaces
Tests Vitest
Lint / format ESLint 9 (typescript-eslint), Prettier
CI GitHub Actions (macOS runner)
Packaging electron-builder (DMG, arm64)
graph TD
  subgraph "packages/"
    core["@magimail/core"]
  end

  subgraph "apps/"
    magimail["magimail (Electron app)"]
    magical["magical (Google Calendar client)"]
  end

  magimail --> core
  magical -.-> core

Where code belongs

packages/core stays clean, reusable and free of direct DOM manipulation in host processes. It imports nothing from the Electron main process and holds what both apps use unchanged:

apps/ owns everything that reaches Electron or the OS: window lifecycle (BrowserWindow / WebContentsView), the AppKit toolbar bridge, the Swift process supervisor (swift-helper.ts) and Gmail DOM CSS injection.

CSS injection

Native macOS integration

The N-API addon and the Swift helper are the two native processes, and their mechanics are in ../shared/process-model-and-ipc.md. Two rules apply when you edit them:

Code integrity