View Source How It Works
With Uniform, multiple apps are maintained together in a single Elixir codebase. When you're ready to deploy an app, it's "ejected" to a separate codebase that only contains the code needed by the app.
The Base Project
The Base Project is the single Elixir project that houses multiple separate apps. Apps are developed and tested together in the Base Project.
The Base Project's
lib directory is central. It contains directories for:
So the directory structure of a Base Project might look like this.
Each Base Project needs a Blueprint module configuring which files are copied to ejected repositories.
What is "Ejecting"?
"Ejecting" an app means copying the app's code to a separate, standalone codebase – without including code the app doesn't need.
- Unused Lib Dependencies are excluded from
- Unused Mix Dependencies are removed from
Ejecting is done with
mix uniform.eject my_app_name
mix uniform.gen.app my_new_app
To set up an Ejectable App manually:
- Make a directory inside
libfor your app (E.g.
- Add uniform.exs inside it
Exactly which files get ejected?
There are four rules that determine which files are copied during ejection.
Basically, the Blueprint's
base_files are ejected along with every directory
test whose name matches (1) the app being ejected and (2) its