Surplus logo
Surplus Docsby Sharing Excess
GuidesDevelopers

Dependency graph

Exact import edges evolve with the codebase; this is the intended layering for the TypeScript workspace.

flowchart TB
  subgraph apps [Apps]
    client[apps_client]
    server[apps_server]
    docs[apps_docs]
  end
  subgraph packages [Packages]
    contracts[packages_contracts]
    types[packages_types]
    utils[packages_utils]
    postgres[packages_postgres]
    redis[packages_redis]
    services[packages_services]
    sharedDeps[packages_sharedDeps]
  end
  client --> contracts
  client --> types
  client --> utils
  server --> contracts
  server --> types
  server --> utils
  server --> postgres
  server --> redis
  server --> services
  services --> postgres
  services --> redis
  services --> types
  services --> utils
  postgres --> types
  contracts --> types
  docs --> utils

Rules of thumb

  • packages/contracts and packages/types stay free of server-only imports so the client can depend on them safely.
  • packages/services depends on postgres, redis, types, and utils, but not on apps/*.
  • Apps wire concrete clients (DB URLs, Redis, S3, …) and pass them into services.

When in doubt, open package.json in each package for the authoritative workspace:* list.

On this page