View Source Uniform Manifests (uniform.exs)
As explained in the How It Works guide, Ejectable
Apps are defined by the existence of a
uniform.exs
file inside the app's lib
directory.
Each app has its own uniform.exs
.
structure
Structure
uniform.exs
contains a keyword list with three supported options: mix_deps
,
lib_deps
, and extra
.
Each key is optional and defaults to []
.
# the simplest valid uniform.exs
[]
A typical uniform.exs
might look something like this.
# lib/my_app/uniform.exs
[
mix_deps: [:gql, :timex],
lib_deps: [:ui_components, :auth],
extra: [
some_data: "just for this app"
]
]
mix_deps
mix_deps
mix_deps
lists Mix Dependencies of the
app.
Provide the same atom as you do in mix.exs
. (E.g. :ecto
.)
lib_deps
lib_deps
lib_deps
lists Lib Dependencies of the
app.
Provide the directory in lib
as an atom. (E.g. :ui_components
for
lib/ui_components
.)
extra
extra
extra
contains a keyword list of arbitrary, developer-defined data. The
contents are placed in app.extra
. (See Uniform.App
)
When you need mix uniform.eject
to emit different variations of code for
different apps beyond including/excluding dependencies, you'll probably want to
use app.extra
with one of these tools:
Note that app.extra
also contains keys returned by the extra
callback. (uniform.exs
has precedence for
conflicting keys.)