yak(boundary-repo-as-sibling-boundary-web-repo-forbidden-tgrc): boundary: Repo as sibling boundary, web->Repo forbidden

This commit is contained in:
Willem van den Ende
2026-10-29 10:08:56 +00:00
parent 3ef38bc8fc
commit 13e3186f58
8 changed files with 163 additions and 1 deletions
+4
View File
@@ -1,4 +1,8 @@
defmodule Firehose do
use Boundary,
deps: [Firehose.Repo],
exports: :all
@moduledoc """
Firehose keeps the contexts that define your domain
and business logic.
+10
View File
@@ -3,6 +3,16 @@ defmodule Firehose.Application do
# for more information on OTP Applications
@moduledoc false
# Booting the app is the one job that must reach into the web tier (it starts
# FirehoseWeb.Telemetry and FirehoseWeb.Endpoint) while the web tier reaches
# back into the contexts. Declaring the Application a top-level boundary of
# its own is the layout boundary's README prescribes for `mix phx.new`
# projects, and it keeps the graph acyclic:
# Firehose.Application -> {Firehose, FirehoseWeb} -> Firehose -> Firehose.Repo.
# Putting FirehoseWeb in Firehose's deps instead is a cycle, which boundary
# rejects ("dependency cycle found: Firehose -> FirehoseWeb -> Firehose").
use Boundary, top_level?: true, deps: [Firehose, FirehoseWeb]
use Application
@impl true
+2
View File
@@ -1,4 +1,6 @@
defmodule Firehose.Repo do
use Boundary, top_level?: true, deps: [], exports: []
use Ecto.Repo,
otp_app: :firehose,
adapter: Ecto.Adapters.Postgres
+4
View File
@@ -1,4 +1,8 @@
defmodule FirehoseWeb do
use Boundary,
deps: [Firehose],
exports: [Endpoint, Telemetry]
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, components, channels, and so on.