Docs

Documentation

Dependency Boundaries

This document defines the intended main/renderer/shared boundaries that keep layers from coupling. They describe the direction new code should follow. They are not lint-enforced today (eslint.config.js has no import-boundary rule), and the known exceptions are listed below.

Rules

  1. Renderer must not import main-only modules (e.g., src/main/*).
  2. Main must not import renderer-only modules (e.g., src/renderer/*).
  3. Shared modules (src/shared/*) that the renderer imports must avoid Node APIs that are not available in the sandboxed renderer.
  4. IPC is the only bridge between main and renderer. Use typed IPC contracts.

Allowed Imports

Known exceptions

src/shared/ also holds some main-process-only utilities. They are never imported by the renderer, but they break rule 3 and the "shared imports shared only" line:

When you touch one of these modules, prefer moving main-only logic under src/main/ over adding more exceptions.

Enforcement

Edit this page on GitHub