View Source mix uniform.eject (Uniform v0.1.0)

Ejects an Ejectable App to a standalone code repository.

examples

Examples

$ mix uniform.eject Trillo
$ mix uniform.eject Tweeter --confirm
$ mix uniform.eject Hatmail --confirm --destination ../../new/dir

command-line-options

Command line options

  • --destination – output directory for the ejected code. Read the Configuration section of the Getting Started guide to understand how the destination is chosen if this option is omitted.
  • --confirm – affirm "yes" to the prompt asking you whether you want to eject.

ejection-step-by-step

Ejection Step By Step

When you eject an app by running mix uniform.eject MyApp, the following happens:

  1. The destination directory is created if it doesn't exist.
  2. All files and directories in the destination are deleted, except for .git, _build, and deps.
  3. All files in lib/my_app and test/my_app are copied to the destination.
  4. All files specified in the base_files section of the Blueprint are copied to the destination.
  5. All Lib Dependencies of the app are copied to the destination. This includes all of lib/dep_name and test/dep_name automatically.
  6. For each file copied, a set of transformations are applied to the file contents – except for files specified with cp and cp_r.
  7. mix format is ran on the ejected codebase.

In step 2, .git is kept to preserve the Git repository and history. deps is kept to avoid having to download all dependencies after ejection. _build is kept to avoid having to recompile the entire project after ejection.

In step 7, running mix format tidies up things like chains of newlines that may appear from applying Code Fences. It also prevents you from having to think about code formatting in modify.