diff --git a/.gitignore b/.gitignore index b2f6b67f73..603181926a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ phoenix-*.ez .DS_Store -/priv/templates/phx.gen.live/core_components.ex +/priv/templates/phx.gen.live/core_components.ex.eex diff --git a/installer/lib/phx_new/ecto.ex b/installer/lib/phx_new/ecto.ex index bd471acc70..c230fecb1e 100644 --- a/installer/lib/phx_new/ecto.ex +++ b/installer/lib/phx_new/ecto.ex @@ -6,15 +6,15 @@ defmodule Phx.New.Ecto do @pre "phx_umbrella/apps/app_name" template(:new, [ - {:config, :project, "#{@pre}/config/config.exs": "config/config.exs"}, + {:config, :project, "#{@pre}/config/config.exs.eex": "config/config.exs"}, {:eex, :app, - "#{@pre}/lib/app_name/application.ex": "lib/:app/application.ex", - "#{@pre}/lib/app_name.ex": "lib/:app.ex", - "#{@pre}/test/test_helper.exs": "test/test_helper.exs", - "#{@pre}/README.md": "README.md", - "#{@pre}/mix.exs": "mix.exs", - "#{@pre}/gitignore": ".gitignore", - "#{@pre}/formatter.exs": ".formatter.exs"} + "#{@pre}/lib/app_name/application.ex.eex": "lib/:app/application.ex", + "#{@pre}/lib/app_name.ex.eex": "lib/:app.ex", + "#{@pre}/test/test_helper.exs.eex": "test/test_helper.exs", + "#{@pre}/README.md.eex": "README.md", + "#{@pre}/mix.exs.eex": "mix.exs", + "#{@pre}/gitignore.eex": ".gitignore", + "#{@pre}/formatter.exs.eex": ".formatter.exs"} ]) def prepare_project(%Project{} = project) do diff --git a/installer/lib/phx_new/generator.ex b/installer/lib/phx_new/generator.ex index 76d76c3e64..66bdd01fbd 100644 --- a/installer/lib/phx_new/generator.ex +++ b/installer/lib/phx_new/generator.ex @@ -221,7 +221,7 @@ defmodule Phx.New.Generator do path = Project.join_path(project, :project, "config/config.exs") extra = - Phx.New.Umbrella.render(:new, "phx_umbrella/config/extra_config.exs", project.binding) + Phx.New.Umbrella.render(:new, "phx_umbrella/config/extra_config.exs.eex", project.binding) File.write(path, [File.read!(path), extra]) end diff --git a/installer/lib/phx_new/mailer.ex b/installer/lib/phx_new/mailer.ex index bfa99276e9..88e9959e0a 100644 --- a/installer/lib/phx_new/mailer.ex +++ b/installer/lib/phx_new/mailer.ex @@ -4,7 +4,7 @@ defmodule Phx.New.Mailer do alias Phx.New.{Project} template(:new, [ - {:eex, :app, "phx_mailer/lib/app_name/mailer.ex": "lib/:app/mailer.ex"} + {:eex, :app, "phx_mailer/lib/app_name/mailer.ex.eex": "lib/:app/mailer.ex"} ]) def prepare_project(%Project{} = project) do diff --git a/installer/lib/phx_new/single.ex b/installer/lib/phx_new/single.ex index 0d472d80ae..333ea5ee6f 100644 --- a/installer/lib/phx_new/single.ex +++ b/installer/lib/phx_new/single.ex @@ -5,26 +5,26 @@ defmodule Phx.New.Single do template(:new, [ {:config, :project, - "phx_single/config/config.exs": "config/config.exs", - "phx_single/config/dev.exs": "config/dev.exs", - "phx_single/config/prod.exs": "config/prod.exs", - "phx_single/config/runtime.exs": "config/runtime.exs", - "phx_single/config/test.exs": "config/test.exs"}, + "phx_single/config/config.exs.eex": "config/config.exs", + "phx_single/config/dev.exs.eex": "config/dev.exs", + "phx_single/config/prod.exs.eex": "config/prod.exs", + "phx_single/config/runtime.exs.eex": "config/runtime.exs", + "phx_single/config/test.exs.eex": "config/test.exs"}, {:eex, :web, - "phx_single/lib/app_name/application.ex": "lib/:app/application.ex", - "phx_single/lib/app_name.ex": "lib/:app.ex", - "phx_web/controllers/error_json.ex": "lib/:lib_web_name/controllers/error_json.ex", - "phx_web/endpoint.ex": "lib/:lib_web_name/endpoint.ex", - "phx_web/router.ex": "lib/:lib_web_name/router.ex", - "phx_web/telemetry.ex": "lib/:lib_web_name/telemetry.ex", - "phx_single/lib/app_name_web.ex": "lib/:lib_web_name.ex", - "phx_single/mix.exs": "mix.exs", - "phx_single/README.md": "README.md", - "phx_single/formatter.exs": ".formatter.exs", - "phx_single/gitignore": ".gitignore", - "phx_test/support/conn_case.ex": "test/support/conn_case.ex", - "phx_single/test/test_helper.exs": "test/test_helper.exs", - "phx_test/controllers/error_json_test.exs": + "phx_single/lib/app_name/application.ex.eex": "lib/:app/application.ex", + "phx_single/lib/app_name.ex.eex": "lib/:app.ex", + "phx_web/controllers/error_json.ex.eex": "lib/:lib_web_name/controllers/error_json.ex", + "phx_web/endpoint.ex.eex": "lib/:lib_web_name/endpoint.ex", + "phx_web/router.ex.eex": "lib/:lib_web_name/router.ex", + "phx_web/telemetry.ex.eex": "lib/:lib_web_name/telemetry.ex", + "phx_single/lib/app_name_web.ex.eex": "lib/:lib_web_name.ex", + "phx_single/mix.exs.eex": "mix.exs", + "phx_single/README.md.eex": "README.md", + "phx_single/formatter.exs.eex": ".formatter.exs", + "phx_single/gitignore.eex": ".gitignore", + "phx_test/support/conn_case.ex.eex": "test/support/conn_case.ex", + "phx_single/test/test_helper.exs.eex": "test/test_helper.exs", + "phx_test/controllers/error_json_test.exs.eex": "test/:lib_web_name/controllers/error_json_test.exs"}, {:keep, :web, "phx_web/controllers": "lib/:lib_web_name/controllers", @@ -33,51 +33,51 @@ defmodule Phx.New.Single do template(:gettext, [ {:eex, :web, - "phx_gettext/gettext.ex": "lib/:lib_web_name/gettext.ex", - "phx_gettext/en/LC_MESSAGES/errors.po": "priv/gettext/en/LC_MESSAGES/errors.po", - "phx_gettext/errors.pot": "priv/gettext/errors.pot"} + "phx_gettext/gettext.ex.eex": "lib/:lib_web_name/gettext.ex", + "phx_gettext/en/LC_MESSAGES/errors.po.eex": "priv/gettext/en/LC_MESSAGES/errors.po", + "phx_gettext/errors.pot.eex": "priv/gettext/errors.pot"} ]) template(:html, [ {:eex, :web, - "phx_web/controllers/error_html.ex": "lib/:lib_web_name/controllers/error_html.ex", - "phx_test/controllers/error_html_test.exs": + "phx_web/controllers/error_html.ex.eex": "lib/:lib_web_name/controllers/error_html.ex", + "phx_test/controllers/error_html_test.exs.eex": "test/:lib_web_name/controllers/error_html_test.exs", - "phx_web/components/core_components.ex": "lib/:lib_web_name/components/core_components.ex", - "phx_web/controllers/page_controller.ex": "lib/:lib_web_name/controllers/page_controller.ex", - "phx_web/controllers/page_html.ex": "lib/:lib_web_name/controllers/page_html.ex", - "phx_web/controllers/page_html/home.html.heex": + "phx_web/components/core_components.ex.eex": "lib/:lib_web_name/components/core_components.ex", + "phx_web/controllers/page_controller.ex.eex": "lib/:lib_web_name/controllers/page_controller.ex", + "phx_web/controllers/page_html.ex.eex": "lib/:lib_web_name/controllers/page_html.ex", + "phx_web/controllers/page_html/home.html.heex.eex": "lib/:lib_web_name/controllers/page_html/home.html.heex", - "phx_test/controllers/page_controller_test.exs": + "phx_test/controllers/page_controller_test.exs.eex": "test/:lib_web_name/controllers/page_controller_test.exs", - "phx_web/components/layouts/root.html.heex": + "phx_web/components/layouts/root.html.heex.eex": "lib/:lib_web_name/components/layouts/root.html.heex", - "phx_web/components/layouts.ex": "lib/:lib_web_name/components/layouts.ex"}, - {:eex, :web, "phx_assets/logo.svg": "priv/static/images/logo.svg"} + "phx_web/components/layouts.ex.eex": "lib/:lib_web_name/components/layouts.ex"}, + {:eex, :web, "phx_assets/logo.svg.eex": "priv/static/images/logo.svg"} ]) template(:ecto, [ {:eex, :app, - "phx_ecto/repo.ex": "lib/:app/repo.ex", - "phx_ecto/formatter.exs": "priv/repo/migrations/.formatter.exs", - "phx_ecto/seeds.exs": "priv/repo/seeds.exs", - "phx_ecto/data_case.ex": "test/support/data_case.ex"}, + "phx_ecto/repo.ex.eex": "lib/:app/repo.ex", + "phx_ecto/formatter.exs.eex": "priv/repo/migrations/.formatter.exs", + "phx_ecto/seeds.exs.eex": "priv/repo/seeds.exs", + "phx_ecto/data_case.ex.eex": "test/support/data_case.ex"}, {:keep, :app, "phx_ecto/priv/repo/migrations": "priv/repo/migrations"} ]) template(:css, [ {:eex, :web, - "phx_assets/app.css": "assets/css/app.css", - "phx_assets/heroicons.js": "assets/vendor/heroicons.js", - "phx_assets/daisyui.js": "assets/vendor/daisyui.js", - "phx_assets/daisyui-theme.js": "assets/vendor/daisyui-theme.js"} + "phx_assets/app.css.eex": "assets/css/app.css", + "phx_assets/heroicons.js.eex": "assets/vendor/heroicons.js", + "phx_assets/daisyui.js.eex": "assets/vendor/daisyui.js", + "phx_assets/daisyui-theme.js.eex": "assets/vendor/daisyui-theme.js"} ]) template(:js, [ {:eex, :web, - "phx_assets/app.js": "assets/js/app.js", - "phx_assets/topbar.js": "assets/vendor/topbar.js", - "phx_assets/tsconfig.json": "assets/tsconfig.json"} + "phx_assets/app.js.eex": "assets/js/app.js", + "phx_assets/topbar.js.eex": "assets/vendor/topbar.js", + "phx_assets/tsconfig.json.eex": "assets/tsconfig.json"} ]) template(:no_js, [ @@ -102,7 +102,7 @@ defmodule Phx.New.Single do ]) template(:mailer, [ - {:eex, :app, "phx_mailer/lib/app_name/mailer.ex": "lib/:app/mailer.ex"} + {:eex, :app, "phx_mailer/lib/app_name/mailer.ex.eex": "lib/:app/mailer.ex"} ]) def prepare_project(%Project{app: app, base_path: base_path} = project) when not is_nil(app) do diff --git a/installer/lib/phx_new/umbrella.ex b/installer/lib/phx_new/umbrella.ex index 8a42543ec2..83768780df 100644 --- a/installer/lib/phx_new/umbrella.ex +++ b/installer/lib/phx_new/umbrella.ex @@ -5,16 +5,16 @@ defmodule Phx.New.Umbrella do template(:new, [ {:eex, :project, - "phx_umbrella/gitignore": ".gitignore", - "phx_umbrella/config/config.exs": "config/config.exs", - "phx_umbrella/config/dev.exs": "config/dev.exs", - "phx_umbrella/config/test.exs": "config/test.exs", - "phx_umbrella/config/prod.exs": "config/prod.exs", - "phx_umbrella/config/runtime.exs": "config/runtime.exs", - "phx_umbrella/mix.exs": "mix.exs", - "phx_umbrella/README.md": "README.md", - "phx_umbrella/formatter.exs": ".formatter.exs"}, - {:config, :project, "phx_umbrella/config/extra_config.exs": "config/config.exs"} + "phx_umbrella/gitignore.eex": ".gitignore", + "phx_umbrella/config/config.exs.eex": "config/config.exs", + "phx_umbrella/config/dev.exs.eex": "config/dev.exs", + "phx_umbrella/config/test.exs.eex": "config/test.exs", + "phx_umbrella/config/prod.exs.eex": "config/prod.exs", + "phx_umbrella/config/runtime.exs.eex": "config/runtime.exs", + "phx_umbrella/mix.exs.eex": "mix.exs", + "phx_umbrella/README.md.eex": "README.md", + "phx_umbrella/formatter.exs.eex": ".formatter.exs"}, + {:config, :project, "phx_umbrella/config/extra_config.exs.eex": "config/config.exs"} ]) def prepare_project(%Project{app: app} = project) when not is_nil(app) do diff --git a/installer/lib/phx_new/web.ex b/installer/lib/phx_new/web.ex index f4915f4802..58c94ae422 100644 --- a/installer/lib/phx_new/web.ex +++ b/installer/lib/phx_new/web.ex @@ -6,54 +6,54 @@ defmodule Phx.New.Web do @pre "phx_umbrella/apps/app_name_web" template(:new, [ - {:prod_config, :project, "#{@pre}/config/runtime.exs": "config/runtime.exs"}, + {:prod_config, :project, "#{@pre}/config/runtime.exs.eex": "config/runtime.exs"}, {:config, :project, - "#{@pre}/config/config.exs": "config/config.exs", - "#{@pre}/config/dev.exs": "config/dev.exs", - "#{@pre}/config/prod.exs": "config/prod.exs", - "#{@pre}/config/test.exs": "config/test.exs"}, + "#{@pre}/config/config.exs.eex": "config/config.exs", + "#{@pre}/config/dev.exs.eex": "config/dev.exs", + "#{@pre}/config/prod.exs.eex": "config/prod.exs", + "#{@pre}/config/test.exs.eex": "config/test.exs"}, {:keep, :web, "phx_web/controllers": "lib/:web_app/controllers", "phx_test/channels": "test/:web_app/channels", "phx_test/controllers": "test/:web_app/controllers"}, {:eex, :web, - "#{@pre}/lib/app_name.ex": "lib/:web_app.ex", - "#{@pre}/lib/app_name/application.ex": "lib/:web_app/application.ex", - "phx_web/endpoint.ex": "lib/:web_app/endpoint.ex", - "phx_web/router.ex": "lib/:web_app/router.ex", - "phx_web/telemetry.ex": "lib/:web_app/telemetry.ex", - "phx_web/controllers/error_json.ex": "lib/:web_app/controllers/error_json.ex", - "#{@pre}/mix.exs": "mix.exs", - "#{@pre}/README.md": "README.md", - "#{@pre}/gitignore": ".gitignore", - "#{@pre}/test/test_helper.exs": "test/test_helper.exs", - "phx_test/support/conn_case.ex": "test/support/conn_case.ex", - "phx_test/controllers/error_json_test.exs": "test/:web_app/controllers/error_json_test.exs", - "#{@pre}/formatter.exs": ".formatter.exs"} + "#{@pre}/lib/app_name.ex.eex": "lib/:web_app.ex", + "#{@pre}/lib/app_name/application.ex.eex": "lib/:web_app/application.ex", + "phx_web/endpoint.ex.eex": "lib/:web_app/endpoint.ex", + "phx_web/router.ex.eex": "lib/:web_app/router.ex", + "phx_web/telemetry.ex.eex": "lib/:web_app/telemetry.ex", + "phx_web/controllers/error_json.ex.eex": "lib/:web_app/controllers/error_json.ex", + "#{@pre}/mix.exs.eex": "mix.exs", + "#{@pre}/README.md.eex": "README.md", + "#{@pre}/gitignore.eex": ".gitignore", + "#{@pre}/test/test_helper.exs.eex": "test/test_helper.exs", + "phx_test/support/conn_case.ex.eex": "test/support/conn_case.ex", + "phx_test/controllers/error_json_test.exs.eex": "test/:web_app/controllers/error_json_test.exs", + "#{@pre}/formatter.exs.eex": ".formatter.exs"} ]) template(:gettext, [ {:eex, :web, - "phx_gettext/gettext.ex": "lib/:web_app/gettext.ex", - "phx_gettext/en/LC_MESSAGES/errors.po": "priv/gettext/en/LC_MESSAGES/errors.po", - "phx_gettext/errors.pot": "priv/gettext/errors.pot"} + "phx_gettext/gettext.ex.eex": "lib/:web_app/gettext.ex", + "phx_gettext/en/LC_MESSAGES/errors.po.eex": "priv/gettext/en/LC_MESSAGES/errors.po", + "phx_gettext/errors.pot.eex": "priv/gettext/errors.pot"} ]) template(:html, [ {:eex, :web, - "phx_web/components/core_components.ex": "lib/:web_app/components/core_components.ex", - "phx_web/components/layouts.ex": "lib/:web_app/components/layouts.ex", - "phx_web/controllers/page_controller.ex": "lib/:web_app/controllers/page_controller.ex", - "phx_web/controllers/error_html.ex": "lib/:web_app/controllers/error_html.ex", - "phx_web/controllers/page_html.ex": "lib/:web_app/controllers/page_html.ex", - "phx_web/controllers/page_html/home.html.heex": + "phx_web/components/core_components.ex.eex": "lib/:web_app/components/core_components.ex", + "phx_web/components/layouts.ex.eex": "lib/:web_app/components/layouts.ex", + "phx_web/controllers/page_controller.ex.eex": "lib/:web_app/controllers/page_controller.ex", + "phx_web/controllers/error_html.ex.eex": "lib/:web_app/controllers/error_html.ex", + "phx_web/controllers/page_html.ex.eex": "lib/:web_app/controllers/page_html.ex", + "phx_web/controllers/page_html/home.html.heex.eex": "lib/:web_app/controllers/page_html/home.html.heex", - "phx_test/controllers/page_controller_test.exs": + "phx_test/controllers/page_controller_test.exs.eex": "test/:web_app/controllers/page_controller_test.exs", - "phx_test/controllers/error_html_test.exs": "test/:web_app/controllers/error_html_test.exs", - "phx_assets/topbar.js": "assets/vendor/topbar.js", - "phx_web/components/layouts/root.html.heex": "lib/:web_app/components/layouts/root.html.heex"}, - {:eex, :web, "phx_assets/logo.svg": "priv/static/images/logo.svg"} + "phx_test/controllers/error_html_test.exs.eex": "test/:web_app/controllers/error_html_test.exs", + "phx_assets/topbar.js.eex": "assets/vendor/topbar.js", + "phx_web/components/layouts/root.html.heex.eex": "lib/:web_app/components/layouts/root.html.heex"}, + {:eex, :web, "phx_assets/logo.svg.eex": "priv/static/images/logo.svg"} ]) def prepare_project(%Project{app: app} = project) when not is_nil(app) do diff --git a/installer/templates/phx_assets/app.css b/installer/templates/phx_assets/app.css.eex similarity index 100% rename from installer/templates/phx_assets/app.css rename to installer/templates/phx_assets/app.css.eex diff --git a/installer/templates/phx_assets/app.js b/installer/templates/phx_assets/app.js.eex similarity index 100% rename from installer/templates/phx_assets/app.js rename to installer/templates/phx_assets/app.js.eex diff --git a/installer/templates/phx_assets/daisyui-theme.js b/installer/templates/phx_assets/daisyui-theme.js.eex similarity index 100% rename from installer/templates/phx_assets/daisyui-theme.js rename to installer/templates/phx_assets/daisyui-theme.js.eex diff --git a/installer/templates/phx_assets/daisyui.js b/installer/templates/phx_assets/daisyui.js.eex similarity index 100% rename from installer/templates/phx_assets/daisyui.js rename to installer/templates/phx_assets/daisyui.js.eex diff --git a/installer/templates/phx_assets/heroicons.js b/installer/templates/phx_assets/heroicons.js.eex similarity index 100% rename from installer/templates/phx_assets/heroicons.js rename to installer/templates/phx_assets/heroicons.js.eex diff --git a/installer/templates/phx_assets/logo.svg b/installer/templates/phx_assets/logo.svg.eex similarity index 100% rename from installer/templates/phx_assets/logo.svg rename to installer/templates/phx_assets/logo.svg.eex diff --git a/installer/templates/phx_assets/topbar.js b/installer/templates/phx_assets/topbar.js.eex similarity index 100% rename from installer/templates/phx_assets/topbar.js rename to installer/templates/phx_assets/topbar.js.eex diff --git a/installer/templates/phx_assets/tsconfig.json b/installer/templates/phx_assets/tsconfig.json.eex similarity index 100% rename from installer/templates/phx_assets/tsconfig.json rename to installer/templates/phx_assets/tsconfig.json.eex diff --git a/installer/templates/phx_ecto/data_case.ex b/installer/templates/phx_ecto/data_case.ex.eex similarity index 100% rename from installer/templates/phx_ecto/data_case.ex rename to installer/templates/phx_ecto/data_case.ex.eex diff --git a/installer/templates/phx_ecto/formatter.exs b/installer/templates/phx_ecto/formatter.exs.eex similarity index 100% rename from installer/templates/phx_ecto/formatter.exs rename to installer/templates/phx_ecto/formatter.exs.eex diff --git a/installer/templates/phx_ecto/repo.ex b/installer/templates/phx_ecto/repo.ex.eex similarity index 100% rename from installer/templates/phx_ecto/repo.ex rename to installer/templates/phx_ecto/repo.ex.eex diff --git a/installer/templates/phx_ecto/seeds.exs b/installer/templates/phx_ecto/seeds.exs.eex similarity index 100% rename from installer/templates/phx_ecto/seeds.exs rename to installer/templates/phx_ecto/seeds.exs.eex diff --git a/installer/templates/phx_gettext/en/LC_MESSAGES/errors.po b/installer/templates/phx_gettext/en/LC_MESSAGES/errors.po.eex similarity index 100% rename from installer/templates/phx_gettext/en/LC_MESSAGES/errors.po rename to installer/templates/phx_gettext/en/LC_MESSAGES/errors.po.eex diff --git a/installer/templates/phx_gettext/errors.pot b/installer/templates/phx_gettext/errors.pot.eex similarity index 100% rename from installer/templates/phx_gettext/errors.pot rename to installer/templates/phx_gettext/errors.pot.eex diff --git a/installer/templates/phx_gettext/gettext.ex b/installer/templates/phx_gettext/gettext.ex.eex similarity index 100% rename from installer/templates/phx_gettext/gettext.ex rename to installer/templates/phx_gettext/gettext.ex.eex diff --git a/installer/templates/phx_mailer/lib/app_name/mailer.ex b/installer/templates/phx_mailer/lib/app_name/mailer.ex.eex similarity index 100% rename from installer/templates/phx_mailer/lib/app_name/mailer.ex rename to installer/templates/phx_mailer/lib/app_name/mailer.ex.eex diff --git a/installer/templates/phx_single/README.md b/installer/templates/phx_single/README.md.eex similarity index 100% rename from installer/templates/phx_single/README.md rename to installer/templates/phx_single/README.md.eex diff --git a/installer/templates/phx_single/config/config.exs b/installer/templates/phx_single/config/config.exs.eex similarity index 100% rename from installer/templates/phx_single/config/config.exs rename to installer/templates/phx_single/config/config.exs.eex diff --git a/installer/templates/phx_single/config/dev.exs b/installer/templates/phx_single/config/dev.exs.eex similarity index 100% rename from installer/templates/phx_single/config/dev.exs rename to installer/templates/phx_single/config/dev.exs.eex diff --git a/installer/templates/phx_single/config/prod.exs b/installer/templates/phx_single/config/prod.exs.eex similarity index 100% rename from installer/templates/phx_single/config/prod.exs rename to installer/templates/phx_single/config/prod.exs.eex diff --git a/installer/templates/phx_single/config/runtime.exs b/installer/templates/phx_single/config/runtime.exs.eex similarity index 100% rename from installer/templates/phx_single/config/runtime.exs rename to installer/templates/phx_single/config/runtime.exs.eex diff --git a/installer/templates/phx_single/config/test.exs b/installer/templates/phx_single/config/test.exs.eex similarity index 100% rename from installer/templates/phx_single/config/test.exs rename to installer/templates/phx_single/config/test.exs.eex diff --git a/installer/templates/phx_single/formatter.exs b/installer/templates/phx_single/formatter.exs.eex similarity index 100% rename from installer/templates/phx_single/formatter.exs rename to installer/templates/phx_single/formatter.exs.eex diff --git a/installer/templates/phx_single/gitignore b/installer/templates/phx_single/gitignore.eex similarity index 100% rename from installer/templates/phx_single/gitignore rename to installer/templates/phx_single/gitignore.eex diff --git a/installer/templates/phx_single/lib/app_name.ex b/installer/templates/phx_single/lib/app_name.ex.eex similarity index 100% rename from installer/templates/phx_single/lib/app_name.ex rename to installer/templates/phx_single/lib/app_name.ex.eex diff --git a/installer/templates/phx_single/lib/app_name/application.ex b/installer/templates/phx_single/lib/app_name/application.ex.eex similarity index 100% rename from installer/templates/phx_single/lib/app_name/application.ex rename to installer/templates/phx_single/lib/app_name/application.ex.eex diff --git a/installer/templates/phx_single/lib/app_name_web.ex b/installer/templates/phx_single/lib/app_name_web.ex.eex similarity index 100% rename from installer/templates/phx_single/lib/app_name_web.ex rename to installer/templates/phx_single/lib/app_name_web.ex.eex diff --git a/installer/templates/phx_single/mix.exs b/installer/templates/phx_single/mix.exs.eex similarity index 100% rename from installer/templates/phx_single/mix.exs rename to installer/templates/phx_single/mix.exs.eex diff --git a/installer/templates/phx_single/test/test_helper.exs b/installer/templates/phx_single/test/test_helper.exs.eex similarity index 100% rename from installer/templates/phx_single/test/test_helper.exs rename to installer/templates/phx_single/test/test_helper.exs.eex diff --git a/installer/templates/phx_test/controllers/error_html_test.exs b/installer/templates/phx_test/controllers/error_html_test.exs.eex similarity index 100% rename from installer/templates/phx_test/controllers/error_html_test.exs rename to installer/templates/phx_test/controllers/error_html_test.exs.eex diff --git a/installer/templates/phx_test/controllers/error_json_test.exs b/installer/templates/phx_test/controllers/error_json_test.exs.eex similarity index 100% rename from installer/templates/phx_test/controllers/error_json_test.exs rename to installer/templates/phx_test/controllers/error_json_test.exs.eex diff --git a/installer/templates/phx_test/controllers/page_controller_test.exs b/installer/templates/phx_test/controllers/page_controller_test.exs.eex similarity index 100% rename from installer/templates/phx_test/controllers/page_controller_test.exs rename to installer/templates/phx_test/controllers/page_controller_test.exs.eex diff --git a/installer/templates/phx_test/support/conn_case.ex b/installer/templates/phx_test/support/conn_case.ex.eex similarity index 100% rename from installer/templates/phx_test/support/conn_case.ex rename to installer/templates/phx_test/support/conn_case.ex.eex diff --git a/installer/templates/phx_umbrella/README.md b/installer/templates/phx_umbrella/README.md.eex similarity index 100% rename from installer/templates/phx_umbrella/README.md rename to installer/templates/phx_umbrella/README.md.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/README.md b/installer/templates/phx_umbrella/apps/app_name/README.md.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/README.md rename to installer/templates/phx_umbrella/apps/app_name/README.md.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/config/config.exs b/installer/templates/phx_umbrella/apps/app_name/config/config.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/config/config.exs rename to installer/templates/phx_umbrella/apps/app_name/config/config.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/formatter.exs b/installer/templates/phx_umbrella/apps/app_name/formatter.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/formatter.exs rename to installer/templates/phx_umbrella/apps/app_name/formatter.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/gitignore b/installer/templates/phx_umbrella/apps/app_name/gitignore.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/gitignore rename to installer/templates/phx_umbrella/apps/app_name/gitignore.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/lib/app_name.ex b/installer/templates/phx_umbrella/apps/app_name/lib/app_name.ex.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/lib/app_name.ex rename to installer/templates/phx_umbrella/apps/app_name/lib/app_name.ex.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/lib/app_name/application.ex b/installer/templates/phx_umbrella/apps/app_name/lib/app_name/application.ex.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/lib/app_name/application.ex rename to installer/templates/phx_umbrella/apps/app_name/lib/app_name/application.ex.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/mix.exs b/installer/templates/phx_umbrella/apps/app_name/mix.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/mix.exs rename to installer/templates/phx_umbrella/apps/app_name/mix.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name/test/test_helper.exs b/installer/templates/phx_umbrella/apps/app_name/test/test_helper.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name/test/test_helper.exs rename to installer/templates/phx_umbrella/apps/app_name/test/test_helper.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/README.md b/installer/templates/phx_umbrella/apps/app_name_web/README.md.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/README.md rename to installer/templates/phx_umbrella/apps/app_name_web/README.md.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/config/config.exs b/installer/templates/phx_umbrella/apps/app_name_web/config/config.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/config/config.exs rename to installer/templates/phx_umbrella/apps/app_name_web/config/config.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs b/installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs rename to installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/config/prod.exs b/installer/templates/phx_umbrella/apps/app_name_web/config/prod.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/config/prod.exs rename to installer/templates/phx_umbrella/apps/app_name_web/config/prod.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/config/runtime.exs b/installer/templates/phx_umbrella/apps/app_name_web/config/runtime.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/config/runtime.exs rename to installer/templates/phx_umbrella/apps/app_name_web/config/runtime.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/config/test.exs b/installer/templates/phx_umbrella/apps/app_name_web/config/test.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/config/test.exs rename to installer/templates/phx_umbrella/apps/app_name_web/config/test.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/formatter.exs b/installer/templates/phx_umbrella/apps/app_name_web/formatter.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/formatter.exs rename to installer/templates/phx_umbrella/apps/app_name_web/formatter.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/gitignore b/installer/templates/phx_umbrella/apps/app_name_web/gitignore.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/gitignore rename to installer/templates/phx_umbrella/apps/app_name_web/gitignore.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/lib/app_name.ex b/installer/templates/phx_umbrella/apps/app_name_web/lib/app_name.ex.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/lib/app_name.ex rename to installer/templates/phx_umbrella/apps/app_name_web/lib/app_name.ex.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/lib/app_name/application.ex b/installer/templates/phx_umbrella/apps/app_name_web/lib/app_name/application.ex.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/lib/app_name/application.ex rename to installer/templates/phx_umbrella/apps/app_name_web/lib/app_name/application.ex.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/mix.exs b/installer/templates/phx_umbrella/apps/app_name_web/mix.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/mix.exs rename to installer/templates/phx_umbrella/apps/app_name_web/mix.exs.eex diff --git a/installer/templates/phx_umbrella/apps/app_name_web/test/test_helper.exs b/installer/templates/phx_umbrella/apps/app_name_web/test/test_helper.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/apps/app_name_web/test/test_helper.exs rename to installer/templates/phx_umbrella/apps/app_name_web/test/test_helper.exs.eex diff --git a/installer/templates/phx_umbrella/config/config.exs b/installer/templates/phx_umbrella/config/config.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/config.exs rename to installer/templates/phx_umbrella/config/config.exs.eex diff --git a/installer/templates/phx_umbrella/config/dev.exs b/installer/templates/phx_umbrella/config/dev.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/dev.exs rename to installer/templates/phx_umbrella/config/dev.exs.eex diff --git a/installer/templates/phx_umbrella/config/extra_config.exs b/installer/templates/phx_umbrella/config/extra_config.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/extra_config.exs rename to installer/templates/phx_umbrella/config/extra_config.exs.eex diff --git a/installer/templates/phx_umbrella/config/prod.exs b/installer/templates/phx_umbrella/config/prod.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/prod.exs rename to installer/templates/phx_umbrella/config/prod.exs.eex diff --git a/installer/templates/phx_umbrella/config/runtime.exs b/installer/templates/phx_umbrella/config/runtime.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/runtime.exs rename to installer/templates/phx_umbrella/config/runtime.exs.eex diff --git a/installer/templates/phx_umbrella/config/test.exs b/installer/templates/phx_umbrella/config/test.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/config/test.exs rename to installer/templates/phx_umbrella/config/test.exs.eex diff --git a/installer/templates/phx_umbrella/formatter.exs b/installer/templates/phx_umbrella/formatter.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/formatter.exs rename to installer/templates/phx_umbrella/formatter.exs.eex diff --git a/installer/templates/phx_umbrella/gitignore b/installer/templates/phx_umbrella/gitignore.eex similarity index 100% rename from installer/templates/phx_umbrella/gitignore rename to installer/templates/phx_umbrella/gitignore.eex diff --git a/installer/templates/phx_umbrella/mix.exs b/installer/templates/phx_umbrella/mix.exs.eex similarity index 100% rename from installer/templates/phx_umbrella/mix.exs rename to installer/templates/phx_umbrella/mix.exs.eex diff --git a/installer/templates/phx_web/components/core_components.ex b/installer/templates/phx_web/components/core_components.ex.eex similarity index 100% rename from installer/templates/phx_web/components/core_components.ex rename to installer/templates/phx_web/components/core_components.ex.eex diff --git a/installer/templates/phx_web/components/layouts.ex b/installer/templates/phx_web/components/layouts.ex.eex similarity index 100% rename from installer/templates/phx_web/components/layouts.ex rename to installer/templates/phx_web/components/layouts.ex.eex diff --git a/installer/templates/phx_web/components/layouts/root.html.heex b/installer/templates/phx_web/components/layouts/root.html.heex.eex similarity index 100% rename from installer/templates/phx_web/components/layouts/root.html.heex rename to installer/templates/phx_web/components/layouts/root.html.heex.eex diff --git a/installer/templates/phx_web/controllers/error_html.ex b/installer/templates/phx_web/controllers/error_html.ex.eex similarity index 100% rename from installer/templates/phx_web/controllers/error_html.ex rename to installer/templates/phx_web/controllers/error_html.ex.eex diff --git a/installer/templates/phx_web/controllers/error_json.ex b/installer/templates/phx_web/controllers/error_json.ex.eex similarity index 100% rename from installer/templates/phx_web/controllers/error_json.ex rename to installer/templates/phx_web/controllers/error_json.ex.eex diff --git a/installer/templates/phx_web/controllers/page_controller.ex b/installer/templates/phx_web/controllers/page_controller.ex.eex similarity index 100% rename from installer/templates/phx_web/controllers/page_controller.ex rename to installer/templates/phx_web/controllers/page_controller.ex.eex diff --git a/installer/templates/phx_web/controllers/page_html.ex b/installer/templates/phx_web/controllers/page_html.ex.eex similarity index 100% rename from installer/templates/phx_web/controllers/page_html.ex rename to installer/templates/phx_web/controllers/page_html.ex.eex diff --git a/installer/templates/phx_web/controllers/page_html/home.html.heex b/installer/templates/phx_web/controllers/page_html/home.html.heex.eex similarity index 100% rename from installer/templates/phx_web/controllers/page_html/home.html.heex rename to installer/templates/phx_web/controllers/page_html/home.html.heex.eex diff --git a/installer/templates/phx_web/endpoint.ex b/installer/templates/phx_web/endpoint.ex.eex similarity index 100% rename from installer/templates/phx_web/endpoint.ex rename to installer/templates/phx_web/endpoint.ex.eex diff --git a/installer/templates/phx_web/router.ex b/installer/templates/phx_web/router.ex.eex similarity index 100% rename from installer/templates/phx_web/router.ex rename to installer/templates/phx_web/router.ex.eex diff --git a/installer/templates/phx_web/telemetry.ex b/installer/templates/phx_web/telemetry.ex.eex similarity index 100% rename from installer/templates/phx_web/telemetry.ex rename to installer/templates/phx_web/telemetry.ex.eex diff --git a/lib/mix/phoenix.ex b/lib/mix/phoenix.ex index 78181df0b1..407ad260e4 100644 --- a/lib/mix/phoenix.ex +++ b/lib/mix/phoenix.ex @@ -39,7 +39,14 @@ defmodule Mix.Phoenix do source = Enum.find_value(roots, fn root -> source = Path.join(root, source_file_path) - if File.exists?(source), do: source + # for backwards compatibility, we also check for files with missing .eex extension + source_with_stripped_eex = String.replace_suffix(source, ".eex", "") + + cond do + File.exists?(source) -> source + File.exists?(source_with_stripped_eex) -> source_with_stripped_eex + true -> nil + end end) || raise "could not find #{source_file_path} in any of the sources" case format do diff --git a/lib/mix/tasks/phx.gen.auth.ex b/lib/mix/tasks/phx.gen.auth.ex index 6baeb87a87..e3a9861be7 100644 --- a/lib/mix/tasks/phx.gen.auth.ex +++ b/lib/mix/tasks/phx.gen.auth.ex @@ -490,14 +490,14 @@ defmodule Mix.Tasks.Phx.Gen.Auth do default_files = [ - "migration.ex": [migrations_pre, "#{timestamp()}_create_#{schema.table}_auth_tables.exs"], - "notifier.ex": [context.dir, "#{singular}_notifier.ex"], - "schema.ex": [context.dir, "#{singular}.ex"], - "schema_token.ex": [context.dir, "#{singular}_token.ex"], - "auth.ex": [web_pre, web_path, "#{singular}_auth.ex"], - "auth_test.exs": [web_test_pre, web_path, "#{singular}_auth_test.exs"], - "session_controller.ex": [controller_pre, "#{singular}_session_controller.ex"], - "session_controller_test.exs": [ + "migration.ex.eex": [migrations_pre, "#{timestamp()}_create_#{schema.table}_auth_tables.exs"], + "notifier.ex.eex": [context.dir, "#{singular}_notifier.ex"], + "schema.ex.eex": [context.dir, "#{singular}.ex"], + "schema_token.ex.eex": [context.dir, "#{singular}_token.ex"], + "auth.ex.eex": [web_pre, web_path, "#{singular}_auth.ex"], + "auth_test.exs.eex": [web_test_pre, web_path, "#{singular}_auth_test.exs"], + "session_controller.ex.eex": [controller_pre, "#{singular}_session_controller.ex"], + "session_controller_test.exs.eex": [ web_test_pre, "controllers", web_path, @@ -505,7 +505,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do ] ] ++ if scope_config.create_new? do - ["scope.ex": [context.dir, "scope.ex"]] + ["scope.ex.eex": [context.dir, "scope.ex"]] else [] end @@ -513,44 +513,44 @@ defmodule Mix.Tasks.Phx.Gen.Auth do case Keyword.fetch(context.opts, :live) do {:ok, true} -> live_files = [ - "registration_live.ex": [ + "registration_live.ex.eex": [ web_pre, "live", web_path, "#{singular}_live", "registration.ex" ], - "registration_live_test.exs": [ + "registration_live_test.exs.eex": [ web_test_pre, "live", web_path, "#{singular}_live", "registration_test.exs" ], - "login_live.ex": [web_pre, "live", web_path, "#{singular}_live", "login.ex"], - "login_live_test.exs": [ + "login_live.ex.eex": [web_pre, "live", web_path, "#{singular}_live", "login.ex"], + "login_live_test.exs.eex": [ web_test_pre, "live", web_path, "#{singular}_live", "login_test.exs" ], - "settings_live.ex": [web_pre, "live", web_path, "#{singular}_live", "settings.ex"], - "settings_live_test.exs": [ + "settings_live.ex.eex": [web_pre, "live", web_path, "#{singular}_live", "settings.ex"], + "settings_live_test.exs.eex": [ web_test_pre, "live", web_path, "#{singular}_live", "settings_test.exs" ], - "confirmation_live.ex": [ + "confirmation_live.ex.eex": [ web_pre, "live", web_path, "#{singular}_live", "confirmation.ex" ], - "confirmation_live_test.exs": [ + "confirmation_live_test.exs.eex": [ web_test_pre, "live", web_path, @@ -563,34 +563,34 @@ defmodule Mix.Tasks.Phx.Gen.Auth do _ -> non_live_files = [ - "registration_new.html.heex": [ + "registration_new.html.heex.eex": [ controller_pre, "#{singular}_registration_html", "new.html.heex" ], - "registration_controller.ex": [controller_pre, "#{singular}_registration_controller.ex"], - "registration_controller_test.exs": [ + "registration_controller.ex.eex": [controller_pre, "#{singular}_registration_controller.ex"], + "registration_controller_test.exs.eex": [ web_test_pre, "controllers", web_path, "#{singular}_registration_controller_test.exs" ], - "registration_html.ex": [controller_pre, "#{singular}_registration_html.ex"], - "session_html.ex": [controller_pre, "#{singular}_session_html.ex"], - "session_new.html.heex": [controller_pre, "#{singular}_session_html", "new.html.heex"], - "session_confirm.html.heex": [ + "registration_html.ex.eex": [controller_pre, "#{singular}_registration_html.ex"], + "session_html.ex.eex": [controller_pre, "#{singular}_session_html.ex"], + "session_new.html.heex.eex": [controller_pre, "#{singular}_session_html", "new.html.heex"], + "session_confirm.html.heex.eex": [ controller_pre, "#{singular}_session_html", "confirm.html.heex" ], - "settings_html.ex": [web_pre, "controllers", web_path, "#{singular}_settings_html.ex"], - "settings_controller.ex": [controller_pre, "#{singular}_settings_controller.ex"], - "settings_edit.html.heex": [ + "settings_html.ex.eex": [web_pre, "controllers", web_path, "#{singular}_settings_html.ex"], + "settings_controller.ex.eex": [controller_pre, "#{singular}_settings_controller.ex"], + "settings_edit.html.heex.eex": [ controller_pre, "#{singular}_settings_html", "edit.html.heex" ], - "settings_controller_test.exs": [ + "settings_controller_test.exs.eex": [ web_test_pre, "controllers", web_path, @@ -620,7 +620,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do Gen.Context.ensure_context_file_exists(context, paths, binding) paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/context_functions.ex", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/context_functions.ex.eex", binding) |> prepend_newline() |> inject_before_final_end(file) end @@ -629,7 +629,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do Gen.Context.ensure_test_file_exists(context, paths, binding) paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/test_cases.exs", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/test_cases.exs.eex", binding) |> prepend_newline() |> inject_before_final_end(test_file) end @@ -642,7 +642,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do Gen.Context.ensure_test_fixtures_file_exists(context, paths, binding) paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/context_fixtures_functions.ex", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/context_fixtures_functions.ex.eex", binding) |> prepend_newline() |> inject_before_final_end(test_fixtures_file) end @@ -651,7 +651,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do test_file = "test/support/conn_case.ex" paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/conn_case.exs", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/conn_case.exs.eex", binding) |> inject_before_final_end(test_file) context @@ -662,7 +662,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do file_path = Path.join(web_prefix, "router.ex") paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/routes.ex", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.auth/routes.ex.eex", binding) |> inject_before_final_end(file_path) context @@ -919,7 +919,7 @@ defmodule Mix.Tasks.Phx.Gen.Auth do auth_content = """ - #{Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.auth/AGENTS.md", binding)} + #{Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.auth/AGENTS.md.eex", binding)} """ diff --git a/lib/mix/tasks/phx.gen.channel.ex b/lib/mix/tasks/phx.gen.channel.ex index f5a4e2aac2..fa1c053a2a 100644 --- a/lib/mix/tasks/phx.gen.channel.ex +++ b/lib/mix/tasks/phx.gen.channel.ex @@ -48,7 +48,7 @@ defmodule Mix.Tasks.Phx.Gen.Channel do if File.exists?(case_path) do [] else - [{:eex, "channel_case.ex", case_path}] + [{:eex, "channel_case.ex.eex", case_path}] end Mix.Phoenix.copy_from( @@ -56,8 +56,8 @@ defmodule Mix.Tasks.Phx.Gen.Channel do "priv/templates/phx.gen.channel", binding, [ - {:eex, "channel.ex", Path.join(web_prefix, "channels/#{binding[:path]}_channel.ex")}, - {:eex, "channel_test.exs", test_path} + {:eex, "channel.ex.eex", Path.join(web_prefix, "channels/#{binding[:path]}_channel.ex")}, + {:eex, "channel_test.exs.eex", test_path} ] ++ maybe_case ) diff --git a/lib/mix/tasks/phx.gen.context.ex b/lib/mix/tasks/phx.gen.context.ex index 8d83c7be00..190c5cb27e 100644 --- a/lib/mix/tasks/phx.gen.context.ex +++ b/lib/mix/tasks/phx.gen.context.ex @@ -198,7 +198,7 @@ defmodule Mix.Tasks.Phx.Gen.Context do unless Context.pre_existing?(context) do Mix.Generator.create_file( file, - Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/context.ex", binding) + Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/context.ex.eex", binding) ) end end @@ -223,7 +223,7 @@ defmodule Mix.Tasks.Phx.Gen.Context do unless Context.pre_existing_tests?(context) do Mix.Generator.create_file( test_file, - Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/context_test.exs", binding) + Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/context_test.exs.eex", binding) ) end end @@ -233,9 +233,9 @@ defmodule Mix.Tasks.Phx.Gen.Context do file = if context.schema.scope do - "test_cases_scope.exs" + "test_cases_scope.exs.eex" else - "test_cases.exs" + "test_cases.exs.eex" end paths @@ -252,7 +252,7 @@ defmodule Mix.Tasks.Phx.Gen.Context do unless Context.pre_existing_test_fixtures?(context) do Mix.Generator.create_file( test_fixtures_file, - Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/fixtures_module.ex", binding) + Mix.Phoenix.eval_from(paths, "priv/templates/phx.gen.context/fixtures_module.ex.eex", binding) ) end end @@ -265,7 +265,7 @@ defmodule Mix.Tasks.Phx.Gen.Context do ensure_test_fixtures_file_exists(context, paths, binding) paths - |> Mix.Phoenix.eval_from("priv/templates/phx.gen.context/fixtures.ex", binding) + |> Mix.Phoenix.eval_from("priv/templates/phx.gen.context/fixtures.ex.eex", binding) |> Mix.Phoenix.prepend_newline() |> inject_eex_before_final_end(test_fixtures_file, binding) @@ -338,16 +338,16 @@ defmodule Mix.Tasks.Phx.Gen.Context do defp schema_access_template(%Context{schema: schema}) do cond do schema.generate? && schema.scope -> - "schema_access_scope.ex" + "schema_access_scope.ex.eex" schema.generate? -> - "schema_access.ex" + "schema_access.ex.eex" schema.scope -> - "access_no_schema_scope.ex" + "access_no_schema_scope.ex.eex" true -> - "access_no_schema.ex" + "access_no_schema.ex.eex" end end diff --git a/lib/mix/tasks/phx.gen.embedded.ex b/lib/mix/tasks/phx.gen.embedded.ex index 4e82eec674..f22a177580 100644 --- a/lib/mix/tasks/phx.gen.embedded.ex +++ b/lib/mix/tasks/phx.gen.embedded.ex @@ -98,7 +98,7 @@ defmodule Mix.Tasks.Phx.Gen.Embedded do @doc false def files_to_be_generated(%Schema{} = schema) do - [{:eex, "embedded_schema.ex", schema.file}] + [{:eex, "embedded_schema.ex.eex", schema.file}] end @doc false diff --git a/lib/mix/tasks/phx.gen.html.ex b/lib/mix/tasks/phx.gen.html.ex index c367714f72..b6283052db 100644 --- a/lib/mix/tasks/phx.gen.html.ex +++ b/lib/mix/tasks/phx.gen.html.ex @@ -197,16 +197,16 @@ defmodule Mix.Tasks.Phx.Gen.Html do test_pre = Path.join([test_prefix, "controllers", web_path]) [ - {:eex, "controller.ex", Path.join([controller_pre, "#{singular}_controller.ex"])}, - {:eex, "edit.html.heex", Path.join([controller_pre, "#{singular}_html", "edit.html.heex"])}, - {:eex, "index.html.heex", + {:eex, "controller.ex.eex", Path.join([controller_pre, "#{singular}_controller.ex"])}, + {:eex, "edit.html.heex.eex", Path.join([controller_pre, "#{singular}_html", "edit.html.heex"])}, + {:eex, "index.html.heex.eex", Path.join([controller_pre, "#{singular}_html", "index.html.heex"])}, - {:eex, "new.html.heex", Path.join([controller_pre, "#{singular}_html", "new.html.heex"])}, - {:eex, "show.html.heex", Path.join([controller_pre, "#{singular}_html", "show.html.heex"])}, - {:eex, "resource_form.html.heex", + {:eex, "new.html.heex.eex", Path.join([controller_pre, "#{singular}_html", "new.html.heex"])}, + {:eex, "show.html.heex.eex", Path.join([controller_pre, "#{singular}_html", "show.html.heex"])}, + {:eex, "resource_form.html.heex.eex", Path.join([controller_pre, "#{singular}_html", "#{singular}_form.html.heex"])}, - {:eex, "html.ex", Path.join([controller_pre, "#{singular}_html.ex"])}, - {:eex, "controller_test.exs", Path.join([test_pre, "#{singular}_controller_test.exs"])} + {:eex, "html.ex.eex", Path.join([controller_pre, "#{singular}_html.ex"])}, + {:eex, "controller_test.exs.eex", Path.join([test_pre, "#{singular}_controller_test.exs"])} ] end diff --git a/lib/mix/tasks/phx.gen.json.ex b/lib/mix/tasks/phx.gen.json.ex index 91fd60bdea..c7cbe3ca29 100644 --- a/lib/mix/tasks/phx.gen.json.ex +++ b/lib/mix/tasks/phx.gen.json.ex @@ -196,11 +196,11 @@ defmodule Mix.Tasks.Phx.Gen.Json do test_pre = Path.join([test_prefix, "controllers", web_path]) [ - {:eex, "controller.ex", Path.join([controller_pre, "#{singular}_controller.ex"])}, - {:eex, "json.ex", Path.join([controller_pre, "#{singular}_json.ex"])}, - {:new_eex, "changeset_json.ex", Path.join([web, "controllers/changeset_json.ex"])}, - {:eex, "controller_test.exs", Path.join([test_pre, "#{singular}_controller_test.exs"])}, - {:new_eex, "fallback_controller.ex", Path.join([web, "controllers/fallback_controller.ex"])} + {:eex, "controller.ex.eex", Path.join([controller_pre, "#{singular}_controller.ex"])}, + {:eex, "json.ex.eex", Path.join([controller_pre, "#{singular}_json.ex"])}, + {:new_eex, "changeset_json.ex.eex", Path.join([web, "controllers/changeset_json.ex"])}, + {:eex, "controller_test.exs.eex", Path.join([test_pre, "#{singular}_controller_test.exs"])}, + {:new_eex, "fallback_controller.ex.eex", Path.join([web, "controllers/fallback_controller.ex"])} ] end diff --git a/lib/mix/tasks/phx.gen.live.ex b/lib/mix/tasks/phx.gen.live.ex index 9b9e253a26..7324b6ceed 100644 --- a/lib/mix/tasks/phx.gen.live.ex +++ b/lib/mix/tasks/phx.gen.live.ex @@ -219,11 +219,11 @@ defmodule Mix.Tasks.Phx.Gen.Live do test_live = Path.join([test_prefix, "live", web_path]) [ - {:eex, "show.ex", Path.join(web_live, "show.ex")}, - {:eex, "index.ex", Path.join(web_live, "index.ex")}, - {:eex, "form.ex", Path.join(web_live, "form.ex")}, - {:eex, "live_test.exs", Path.join(test_live, "#{schema.singular}_live_test.exs")}, - {:new_eex, "core_components.ex", + {:eex, "show.ex.eex", Path.join(web_live, "show.ex")}, + {:eex, "index.ex.eex", Path.join(web_live, "index.ex")}, + {:eex, "form.ex.eex", Path.join(web_live, "form.ex")}, + {:eex, "live_test.exs.eex", Path.join(test_live, "#{schema.singular}_live_test.exs")}, + {:new_eex, "core_components.ex.eex", Path.join([web_prefix, "components", "core_components.ex"])} ] end diff --git a/lib/mix/tasks/phx.gen.notifier.ex b/lib/mix/tasks/phx.gen.notifier.ex index 6b9de9f890..f11136f97a 100644 --- a/lib/mix/tasks/phx.gen.notifier.ex +++ b/lib/mix/tasks/phx.gen.notifier.ex @@ -166,8 +166,8 @@ defmodule Mix.Tasks.Phx.Gen.Notifier do defp files_to_be_generated(%Context{} = context) do [ - {:eex, "notifier.ex", context.file}, - {:eex, "notifier_test.exs", context.test_file} + {:eex, "notifier.ex.eex", context.file}, + {:eex, "notifier_test.exs.eex", context.test_file} ] end diff --git a/lib/mix/tasks/phx.gen.presence.ex b/lib/mix/tasks/phx.gen.presence.ex index e3d8947613..c7867b4796 100644 --- a/lib/mix/tasks/phx.gen.presence.ex +++ b/lib/mix/tasks/phx.gen.presence.ex @@ -43,7 +43,7 @@ defmodule Mix.Tasks.Phx.Gen.Presence do ] files = [ - {:eex, "presence.ex", Path.join(web_prefix, "channels/#{binding[:path]}.ex")} + {:eex, "presence.ex.eex", Path.join(web_prefix, "channels/#{binding[:path]}.ex")} ] Mix.Phoenix.copy_from(paths(), "priv/templates/phx.gen.presence", binding, files) diff --git a/lib/mix/tasks/phx.gen.release.ex b/lib/mix/tasks/phx.gen.release.ex index 3455f6e5c8..84d9300287 100755 --- a/lib/mix/tasks/phx.gen.release.ex +++ b/lib/mix/tasks/phx.gen.release.ex @@ -107,7 +107,7 @@ defmodule Mix.Tasks.Phx.Gen.Release do Mix.Phoenix.copy_from(paths(), "priv/templates/phx.gen.release", binding, [ {:eex, "rel/migrate.sh.eex", "rel/overlays/bin/migrate"}, {:eex, "rel/migrate.bat.eex", "rel/overlays/bin/migrate.bat"}, - {:eex, "release.ex", Mix.Phoenix.context_lib_path(app, "release.ex")} + {:eex, "release.ex.eex", Mix.Phoenix.context_lib_path(app, "release.ex")} ]) end diff --git a/lib/mix/tasks/phx.gen.schema.ex b/lib/mix/tasks/phx.gen.schema.ex index d58b51f1d7..617403e461 100644 --- a/lib/mix/tasks/phx.gen.schema.ex +++ b/lib/mix/tasks/phx.gen.schema.ex @@ -213,7 +213,7 @@ defmodule Mix.Tasks.Phx.Gen.Schema do @doc false def files_to_be_generated(%Schema{} = schema) do - [{:eex, "schema.ex", schema.file}] + [{:eex, "schema.ex.eex", schema.file}] end @doc false @@ -238,7 +238,7 @@ defmodule Mix.Tasks.Phx.Gen.Schema do migration_path = Path.join(migration_dir, "#{timestamp()}_create_#{schema.table}.exs") Mix.Phoenix.copy_from paths, "priv/templates/phx.gen.schema", binding, [ - {:eex, "migration.exs", migration_path}, + {:eex, "migration.exs.eex", migration_path}, ] end diff --git a/lib/mix/tasks/phx.gen.socket.ex b/lib/mix/tasks/phx.gen.socket.ex index 16896bbec6..d98a7bb5f9 100644 --- a/lib/mix/tasks/phx.gen.socket.ex +++ b/lib/mix/tasks/phx.gen.socket.ex @@ -59,8 +59,8 @@ defmodule Mix.Tasks.Phx.Gen.Socket do Mix.Phoenix.check_module_name_availability!(binding[:module] <> "Socket") Mix.Phoenix.copy_from(paths(), "priv/templates/phx.gen.socket", binding, [ - {:eex, "socket.ex", Path.join(web_prefix, "channels/#{binding[:path]}_socket.ex")}, - {:eex, "socket.js", "assets/js/#{binding[:path]}_socket.js"} + {:eex, "socket.ex.eex", Path.join(web_prefix, "channels/#{binding[:path]}_socket.ex")}, + {:eex, "socket.js.eex", "assets/js/#{binding[:path]}_socket.js"} ]) Mix.shell().info(""" diff --git a/mix.exs b/mix.exs index b91eab08d9..7f40322f43 100644 --- a/mix.exs +++ b/mix.exs @@ -299,10 +299,10 @@ defmodule Phoenix.MixProject do defp copy_core_components(_) do source = - Path.join(__DIR__, "installer/templates/phx_web/components/core_components.ex") + Path.join(__DIR__, "installer/templates/phx_web/components/core_components.ex.eex") destination_dir = Path.join([__DIR__, "priv", "templates", "phx.gen.live"]) - destination = Path.join(destination_dir, "core_components.ex") + destination = Path.join(destination_dir, "core_components.ex.eex") File.cp!(source, destination) end end diff --git a/priv/templates/phx.gen.auth/AGENTS.md b/priv/templates/phx.gen.auth/AGENTS.md.eex similarity index 100% rename from priv/templates/phx.gen.auth/AGENTS.md rename to priv/templates/phx.gen.auth/AGENTS.md.eex diff --git a/priv/templates/phx.gen.auth/auth.ex b/priv/templates/phx.gen.auth/auth.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/auth.ex rename to priv/templates/phx.gen.auth/auth.ex.eex diff --git a/priv/templates/phx.gen.auth/auth_test.exs b/priv/templates/phx.gen.auth/auth_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/auth_test.exs rename to priv/templates/phx.gen.auth/auth_test.exs.eex diff --git a/priv/templates/phx.gen.auth/confirmation_live.ex b/priv/templates/phx.gen.auth/confirmation_live.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/confirmation_live.ex rename to priv/templates/phx.gen.auth/confirmation_live.ex.eex diff --git a/priv/templates/phx.gen.auth/confirmation_live_test.exs b/priv/templates/phx.gen.auth/confirmation_live_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/confirmation_live_test.exs rename to priv/templates/phx.gen.auth/confirmation_live_test.exs.eex diff --git a/priv/templates/phx.gen.auth/conn_case.exs b/priv/templates/phx.gen.auth/conn_case.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/conn_case.exs rename to priv/templates/phx.gen.auth/conn_case.exs.eex diff --git a/priv/templates/phx.gen.auth/context_fixtures_functions.ex b/priv/templates/phx.gen.auth/context_fixtures_functions.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/context_fixtures_functions.ex rename to priv/templates/phx.gen.auth/context_fixtures_functions.ex.eex diff --git a/priv/templates/phx.gen.auth/context_functions.ex b/priv/templates/phx.gen.auth/context_functions.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/context_functions.ex rename to priv/templates/phx.gen.auth/context_functions.ex.eex diff --git a/priv/templates/phx.gen.auth/login_live.ex b/priv/templates/phx.gen.auth/login_live.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/login_live.ex rename to priv/templates/phx.gen.auth/login_live.ex.eex diff --git a/priv/templates/phx.gen.auth/login_live_test.exs b/priv/templates/phx.gen.auth/login_live_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/login_live_test.exs rename to priv/templates/phx.gen.auth/login_live_test.exs.eex diff --git a/priv/templates/phx.gen.auth/migration.ex b/priv/templates/phx.gen.auth/migration.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/migration.ex rename to priv/templates/phx.gen.auth/migration.ex.eex diff --git a/priv/templates/phx.gen.auth/notifier.ex b/priv/templates/phx.gen.auth/notifier.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/notifier.ex rename to priv/templates/phx.gen.auth/notifier.ex.eex diff --git a/priv/templates/phx.gen.auth/registration_controller.ex b/priv/templates/phx.gen.auth/registration_controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_controller.ex rename to priv/templates/phx.gen.auth/registration_controller.ex.eex diff --git a/priv/templates/phx.gen.auth/registration_controller_test.exs b/priv/templates/phx.gen.auth/registration_controller_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_controller_test.exs rename to priv/templates/phx.gen.auth/registration_controller_test.exs.eex diff --git a/priv/templates/phx.gen.auth/registration_html.ex b/priv/templates/phx.gen.auth/registration_html.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_html.ex rename to priv/templates/phx.gen.auth/registration_html.ex.eex diff --git a/priv/templates/phx.gen.auth/registration_live.ex b/priv/templates/phx.gen.auth/registration_live.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_live.ex rename to priv/templates/phx.gen.auth/registration_live.ex.eex diff --git a/priv/templates/phx.gen.auth/registration_live_test.exs b/priv/templates/phx.gen.auth/registration_live_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_live_test.exs rename to priv/templates/phx.gen.auth/registration_live_test.exs.eex diff --git a/priv/templates/phx.gen.auth/registration_new.html.heex b/priv/templates/phx.gen.auth/registration_new.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.auth/registration_new.html.heex rename to priv/templates/phx.gen.auth/registration_new.html.heex.eex diff --git a/priv/templates/phx.gen.auth/routes.ex b/priv/templates/phx.gen.auth/routes.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/routes.ex rename to priv/templates/phx.gen.auth/routes.ex.eex diff --git a/priv/templates/phx.gen.auth/schema.ex b/priv/templates/phx.gen.auth/schema.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/schema.ex rename to priv/templates/phx.gen.auth/schema.ex.eex diff --git a/priv/templates/phx.gen.auth/schema_token.ex b/priv/templates/phx.gen.auth/schema_token.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/schema_token.ex rename to priv/templates/phx.gen.auth/schema_token.ex.eex diff --git a/priv/templates/phx.gen.auth/scope.ex b/priv/templates/phx.gen.auth/scope.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/scope.ex rename to priv/templates/phx.gen.auth/scope.ex.eex diff --git a/priv/templates/phx.gen.auth/session_confirm.html.heex b/priv/templates/phx.gen.auth/session_confirm.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.auth/session_confirm.html.heex rename to priv/templates/phx.gen.auth/session_confirm.html.heex.eex diff --git a/priv/templates/phx.gen.auth/session_controller.ex b/priv/templates/phx.gen.auth/session_controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/session_controller.ex rename to priv/templates/phx.gen.auth/session_controller.ex.eex diff --git a/priv/templates/phx.gen.auth/session_controller_test.exs b/priv/templates/phx.gen.auth/session_controller_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/session_controller_test.exs rename to priv/templates/phx.gen.auth/session_controller_test.exs.eex diff --git a/priv/templates/phx.gen.auth/session_html.ex b/priv/templates/phx.gen.auth/session_html.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/session_html.ex rename to priv/templates/phx.gen.auth/session_html.ex.eex diff --git a/priv/templates/phx.gen.auth/session_new.html.heex b/priv/templates/phx.gen.auth/session_new.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.auth/session_new.html.heex rename to priv/templates/phx.gen.auth/session_new.html.heex.eex diff --git a/priv/templates/phx.gen.auth/settings_controller.ex b/priv/templates/phx.gen.auth/settings_controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_controller.ex rename to priv/templates/phx.gen.auth/settings_controller.ex.eex diff --git a/priv/templates/phx.gen.auth/settings_controller_test.exs b/priv/templates/phx.gen.auth/settings_controller_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_controller_test.exs rename to priv/templates/phx.gen.auth/settings_controller_test.exs.eex diff --git a/priv/templates/phx.gen.auth/settings_edit.html.heex b/priv/templates/phx.gen.auth/settings_edit.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_edit.html.heex rename to priv/templates/phx.gen.auth/settings_edit.html.heex.eex diff --git a/priv/templates/phx.gen.auth/settings_html.ex b/priv/templates/phx.gen.auth/settings_html.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_html.ex rename to priv/templates/phx.gen.auth/settings_html.ex.eex diff --git a/priv/templates/phx.gen.auth/settings_live.ex b/priv/templates/phx.gen.auth/settings_live.ex.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_live.ex rename to priv/templates/phx.gen.auth/settings_live.ex.eex diff --git a/priv/templates/phx.gen.auth/settings_live_test.exs b/priv/templates/phx.gen.auth/settings_live_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/settings_live_test.exs rename to priv/templates/phx.gen.auth/settings_live_test.exs.eex diff --git a/priv/templates/phx.gen.auth/test_cases.exs b/priv/templates/phx.gen.auth/test_cases.exs.eex similarity index 100% rename from priv/templates/phx.gen.auth/test_cases.exs rename to priv/templates/phx.gen.auth/test_cases.exs.eex diff --git a/priv/templates/phx.gen.channel/channel.ex b/priv/templates/phx.gen.channel/channel.ex.eex similarity index 100% rename from priv/templates/phx.gen.channel/channel.ex rename to priv/templates/phx.gen.channel/channel.ex.eex diff --git a/priv/templates/phx.gen.channel/channel_case.ex b/priv/templates/phx.gen.channel/channel_case.ex.eex similarity index 100% rename from priv/templates/phx.gen.channel/channel_case.ex rename to priv/templates/phx.gen.channel/channel_case.ex.eex diff --git a/priv/templates/phx.gen.channel/channel_test.exs b/priv/templates/phx.gen.channel/channel_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.channel/channel_test.exs rename to priv/templates/phx.gen.channel/channel_test.exs.eex diff --git a/priv/templates/phx.gen.context/access_no_schema.ex b/priv/templates/phx.gen.context/access_no_schema.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/access_no_schema.ex rename to priv/templates/phx.gen.context/access_no_schema.ex.eex diff --git a/priv/templates/phx.gen.context/access_no_schema_scope.ex b/priv/templates/phx.gen.context/access_no_schema_scope.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/access_no_schema_scope.ex rename to priv/templates/phx.gen.context/access_no_schema_scope.ex.eex diff --git a/priv/templates/phx.gen.context/context.ex b/priv/templates/phx.gen.context/context.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/context.ex rename to priv/templates/phx.gen.context/context.ex.eex diff --git a/priv/templates/phx.gen.context/context_test.exs b/priv/templates/phx.gen.context/context_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.context/context_test.exs rename to priv/templates/phx.gen.context/context_test.exs.eex diff --git a/priv/templates/phx.gen.context/fixtures.ex b/priv/templates/phx.gen.context/fixtures.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/fixtures.ex rename to priv/templates/phx.gen.context/fixtures.ex.eex diff --git a/priv/templates/phx.gen.context/fixtures_module.ex b/priv/templates/phx.gen.context/fixtures_module.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/fixtures_module.ex rename to priv/templates/phx.gen.context/fixtures_module.ex.eex diff --git a/priv/templates/phx.gen.context/schema_access.ex b/priv/templates/phx.gen.context/schema_access.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/schema_access.ex rename to priv/templates/phx.gen.context/schema_access.ex.eex diff --git a/priv/templates/phx.gen.context/schema_access_scope.ex b/priv/templates/phx.gen.context/schema_access_scope.ex.eex similarity index 100% rename from priv/templates/phx.gen.context/schema_access_scope.ex rename to priv/templates/phx.gen.context/schema_access_scope.ex.eex diff --git a/priv/templates/phx.gen.context/test_cases.exs b/priv/templates/phx.gen.context/test_cases.exs.eex similarity index 100% rename from priv/templates/phx.gen.context/test_cases.exs rename to priv/templates/phx.gen.context/test_cases.exs.eex diff --git a/priv/templates/phx.gen.context/test_cases_scope.exs b/priv/templates/phx.gen.context/test_cases_scope.exs.eex similarity index 100% rename from priv/templates/phx.gen.context/test_cases_scope.exs rename to priv/templates/phx.gen.context/test_cases_scope.exs.eex diff --git a/priv/templates/phx.gen.embedded/embedded_schema.ex b/priv/templates/phx.gen.embedded/embedded_schema.ex.eex similarity index 100% rename from priv/templates/phx.gen.embedded/embedded_schema.ex rename to priv/templates/phx.gen.embedded/embedded_schema.ex.eex diff --git a/priv/templates/phx.gen.html/controller.ex b/priv/templates/phx.gen.html/controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.html/controller.ex rename to priv/templates/phx.gen.html/controller.ex.eex diff --git a/priv/templates/phx.gen.html/controller_test.exs b/priv/templates/phx.gen.html/controller_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.html/controller_test.exs rename to priv/templates/phx.gen.html/controller_test.exs.eex diff --git a/priv/templates/phx.gen.html/edit.html.heex b/priv/templates/phx.gen.html/edit.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.html/edit.html.heex rename to priv/templates/phx.gen.html/edit.html.heex.eex diff --git a/priv/templates/phx.gen.html/html.ex b/priv/templates/phx.gen.html/html.ex.eex similarity index 100% rename from priv/templates/phx.gen.html/html.ex rename to priv/templates/phx.gen.html/html.ex.eex diff --git a/priv/templates/phx.gen.html/index.html.heex b/priv/templates/phx.gen.html/index.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.html/index.html.heex rename to priv/templates/phx.gen.html/index.html.heex.eex diff --git a/priv/templates/phx.gen.html/new.html.heex b/priv/templates/phx.gen.html/new.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.html/new.html.heex rename to priv/templates/phx.gen.html/new.html.heex.eex diff --git a/priv/templates/phx.gen.html/resource_form.html.heex b/priv/templates/phx.gen.html/resource_form.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.html/resource_form.html.heex rename to priv/templates/phx.gen.html/resource_form.html.heex.eex diff --git a/priv/templates/phx.gen.html/show.html.heex b/priv/templates/phx.gen.html/show.html.heex.eex similarity index 100% rename from priv/templates/phx.gen.html/show.html.heex rename to priv/templates/phx.gen.html/show.html.heex.eex diff --git a/priv/templates/phx.gen.json/changeset_json.ex b/priv/templates/phx.gen.json/changeset_json.ex.eex similarity index 100% rename from priv/templates/phx.gen.json/changeset_json.ex rename to priv/templates/phx.gen.json/changeset_json.ex.eex diff --git a/priv/templates/phx.gen.json/controller.ex b/priv/templates/phx.gen.json/controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.json/controller.ex rename to priv/templates/phx.gen.json/controller.ex.eex diff --git a/priv/templates/phx.gen.json/controller_test.exs b/priv/templates/phx.gen.json/controller_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.json/controller_test.exs rename to priv/templates/phx.gen.json/controller_test.exs.eex diff --git a/priv/templates/phx.gen.json/fallback_controller.ex b/priv/templates/phx.gen.json/fallback_controller.ex.eex similarity index 100% rename from priv/templates/phx.gen.json/fallback_controller.ex rename to priv/templates/phx.gen.json/fallback_controller.ex.eex diff --git a/priv/templates/phx.gen.json/json.ex b/priv/templates/phx.gen.json/json.ex.eex similarity index 100% rename from priv/templates/phx.gen.json/json.ex rename to priv/templates/phx.gen.json/json.ex.eex diff --git a/priv/templates/phx.gen.live/form.ex b/priv/templates/phx.gen.live/form.ex.eex similarity index 100% rename from priv/templates/phx.gen.live/form.ex rename to priv/templates/phx.gen.live/form.ex.eex diff --git a/priv/templates/phx.gen.live/index.ex b/priv/templates/phx.gen.live/index.ex.eex similarity index 100% rename from priv/templates/phx.gen.live/index.ex rename to priv/templates/phx.gen.live/index.ex.eex diff --git a/priv/templates/phx.gen.live/live_test.exs b/priv/templates/phx.gen.live/live_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.live/live_test.exs rename to priv/templates/phx.gen.live/live_test.exs.eex diff --git a/priv/templates/phx.gen.live/show.ex b/priv/templates/phx.gen.live/show.ex.eex similarity index 100% rename from priv/templates/phx.gen.live/show.ex rename to priv/templates/phx.gen.live/show.ex.eex diff --git a/priv/templates/phx.gen.notifier/notifier.ex b/priv/templates/phx.gen.notifier/notifier.ex.eex similarity index 100% rename from priv/templates/phx.gen.notifier/notifier.ex rename to priv/templates/phx.gen.notifier/notifier.ex.eex diff --git a/priv/templates/phx.gen.notifier/notifier_test.exs b/priv/templates/phx.gen.notifier/notifier_test.exs.eex similarity index 100% rename from priv/templates/phx.gen.notifier/notifier_test.exs rename to priv/templates/phx.gen.notifier/notifier_test.exs.eex diff --git a/priv/templates/phx.gen.presence/presence.ex b/priv/templates/phx.gen.presence/presence.ex.eex similarity index 100% rename from priv/templates/phx.gen.presence/presence.ex rename to priv/templates/phx.gen.presence/presence.ex.eex diff --git a/priv/templates/phx.gen.release/release.ex b/priv/templates/phx.gen.release/release.ex.eex similarity index 100% rename from priv/templates/phx.gen.release/release.ex rename to priv/templates/phx.gen.release/release.ex.eex diff --git a/priv/templates/phx.gen.schema/migration.exs b/priv/templates/phx.gen.schema/migration.exs.eex similarity index 100% rename from priv/templates/phx.gen.schema/migration.exs rename to priv/templates/phx.gen.schema/migration.exs.eex diff --git a/priv/templates/phx.gen.schema/schema.ex b/priv/templates/phx.gen.schema/schema.ex.eex similarity index 100% rename from priv/templates/phx.gen.schema/schema.ex rename to priv/templates/phx.gen.schema/schema.ex.eex diff --git a/priv/templates/phx.gen.socket/socket.ex b/priv/templates/phx.gen.socket/socket.ex.eex similarity index 100% rename from priv/templates/phx.gen.socket/socket.ex rename to priv/templates/phx.gen.socket/socket.ex.eex diff --git a/priv/templates/phx.gen.socket/socket.js b/priv/templates/phx.gen.socket/socket.js.eex similarity index 100% rename from priv/templates/phx.gen.socket/socket.js rename to priv/templates/phx.gen.socket/socket.js.eex diff --git a/test/mix/tasks/phx.gen.live_test.exs b/test/mix/tasks/phx.gen.live_test.exs index aa96be1b8a..d59b5683ff 100644 --- a/test/mix/tasks/phx.gen.live_test.exs +++ b/test/mix/tasks/phx.gen.live_test.exs @@ -30,8 +30,8 @@ defmodule Mix.Tasks.Phx.Gen.LiveTest do end test "components are in sync with installer" do - assert File.read!("priv/templates/phx.gen.live/core_components.ex") == - File.read!("installer/templates/phx_web/components/core_components.ex") + assert File.read!("priv/templates/phx.gen.live/core_components.ex.eex") == + File.read!("installer/templates/phx_web/components/core_components.ex.eex") end test "invalid mix arguments", config do