yak(boundary-repo-as-sibling-boundary-web-repo-forbidden-tgrc): boundary: Repo as sibling boundary, web->Repo forbidden
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user