CharDesk Docs

Ownership and Dependency Direction

Layer responsibility and allowed dependency edges.

HEAD a63778e
shared <- domains <- widgets <- app
LayerOwnsBoundary
sharedDomain-neutral primitivesDepends only on shared and external packages
domainsBusiness rules and stateCross-domain access uses the owning domain's public.ts
widgetsProduct interaction and presentationCoordinates public contracts; owns no domain validation or persistence
appComposition and application lifecycleConstructs runtimes and application-wide side effects

A domain reads its own source directly. Its public.ts contains explicit named re-exports only; composition belongs in src/app. Production cross-domain imports use the owner's public.ts; tests may use its /testing entry when present.

Use domain reference to select the business owner. The boundary check enforces layer and import direction; the state ownership check guards Canvas stores, content projection, and Yjs mutation.