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:
- The destination directory is created if it doesn't exist.
- All files and directories in the destination are deleted, except for
.git
,_build
, anddeps
. - All files in
lib/my_app
andtest/my_app
are copied to the destination. - All files specified in the base_files section of the Blueprint are copied to the destination.
- All Lib Dependencies of the app are
copied to the destination. This includes all of
lib/dep_name
andtest/dep_name
automatically. - For each file copied, a set of
transformations are applied to the file
contents – except for files specified with
cp
andcp_r
. 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.