-
Notifications
You must be signed in to change notification settings - Fork 6
Generation
github-wiki-action edited this page Mar 29, 2022
·
2 revisions
-
Clone Elixir templates project to your local directory.
-
Create a new project using
mix phx.new sample_project
ormix new sample_project
command -
Answer the prompt
Fetch and install dependencies? [Yn]
withn
(not install) -
Change directory into
sample_project
usingcd sample_project
command -
Edit
mix.exs
file and add this line to the dependencies.
{:nimble_template, "~> 3.0", path: "~/elixir-templates", only: :dev, runtime: false}
Modify the path to locate the elixir-templates
directory. For example ~/elixir-templates
if inside the home directory.
- Then go back to the Terminal and run
mix do deps.get, deps.compile
- Choose which template you want to use inside your project
- Web:
mix nimble_template.gen --web
- Live:
mix nimble_template.gen --live
- API:
mix nimble_template.gen --api
- Answer the interactive prompt that will be displayed during the setup
-
Clone Elixir templates project to your local directory.
-
Generate a new Phoenix project
- Web project:
make create_phoenix_project PROJECT_DIRECTORY=sample_project OPTIONS="--no-live"
- Live project:
make create_phoenix_project PROJECT_DIRECTORY=sample_project OPTIONS=""
- API project:
make create_phoenix_project PROJECT_DIRECTORY=sample_project OPTIONS="--no-html --no-assets --no-live"
-
Answer the prompt
Fetch and install dependencies? [Yn]
withn
(not install) -
Apply the template
- Web variant:
make apply_phoenix_template PROJECT_DIRECTORY=sample_project VARIANT=web
- Live variant:
make apply_phoenix_template PROJECT_DIRECTORY=sample_project VARIANT=live
- API variant:
make apply_phoenix_template PROJECT_DIRECTORY=sample_project VARIANT=api
Developed by Nimble