Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions installer/templates/phx_single/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ config :<%= @app_name %>, <%= @endpoint_module %>,<%= if @inside_docker_env? do
# configured to run both http and https servers on
# different ports.<%= if @html do %>

# Watch static and templates for browser reloading.
# Reload browser tabs when matching files change.
config :<%= @app_name %>, <%= @endpoint_module %>,
live_reload: [
web_console_logger: true,
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.*(po)$",<% end %>
~r"lib/<%= @lib_web_name %>/(?:controllers|live|components|router)/?.*\.(ex|heex)$"
# Static assets, except user uploads
~r"priv/static/(?!uploads/).*\.(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
# Gettext translations
~r"priv/gettext/.*\.po$",<% end %>
# Router, Controllers, LiveViews and LiveComponents
~r"lib/<%= @lib_web_name %>/router\.ex$",
~r"lib/<%= @lib_web_name %>/(controllers|live|components)/.*\.(ex|heex)$"
]
]<% end %>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ config :<%= @web_app_name %>, <%= @endpoint_module %>,<%= if @inside_docker_env?
# configured to run both http and https servers on
# different ports.<%= if @html do %>

# Watch static and templates for browser reloading.
# Reload browser tabs when matching files change.
config :<%= @web_app_name %>, <%= @endpoint_module %>,
live_reload: [
web_console_logger: true,
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
~r"priv/gettext/.*(po)$",<% end %>
~r"lib/<%= @web_app_name %>/(?:controllers|live|components|router)/?.*\.(ex|heex)$"
# Static assets, except user uploads
~r"priv/static/(?!uploads/).*\.(js|css|png|jpeg|jpg|gif|svg)$",<%= if @gettext do %>
# Gettext translations
~r"priv/gettext/.*\.po$",<% end %>
# Router, Controllers, LiveViews and LiveComponents
~r"lib/<%= @web_app_name %>/router\.ex$",
~r"lib/<%= @web_app_name %>/(controllers|live|components)/.*\.(ex|heex)$"
]
]<% end %>

Expand Down
4 changes: 3 additions & 1 deletion installer/test/phx_new_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ defmodule Mix.Tasks.Phx.NewTest do
Mix.Tasks.Phx.New.run([@app_name])

assert_file("phx_blog/README.md")

assert_file("phx_blog/AGENTS.md", fn file ->
assert file =~ "### UI/UX & design guidelines"
end)
Expand Down Expand Up @@ -144,7 +145,8 @@ defmodule Mix.Tasks.Phx.NewTest do

assert_file("phx_blog/config/dev.exs", fn file ->
assert file =~ "esbuild: {Esbuild,"
assert file =~ "lib/phx_blog_web/(?:controllers|live|components|router)/?.*\\.(ex|heex)$"
assert file =~ "lib/phx_blog_web/router\\.ex$"
assert file =~ "lib/phx_blog_web/(controllers|live|components)/.*\\.(ex|heex)$"
assert file =~ "http: [ip: {127, 0, 0, 1}"
end)

Expand Down
5 changes: 3 additions & 2 deletions installer/test/phx_new_umbrella_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do

assert_file(root_path(@app, "config/dev.exs"), fn file ->
assert file =~ ~r[esbuild: {Esbuild]
assert file =~ "lib/#{@app}_web/(?:controllers|live|components|router)/?.*\\.(ex|heex)$"
assert file =~ "lib/#{@app}_web/router\\.ex$"
assert file =~ "lib/#{@app}_web/(controllers|live|components)/.*\\.(ex|heex)$"
assert file =~ "config :#{@app}_web, dev_routes: true"
end)

Expand Down Expand Up @@ -734,7 +735,7 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do
test "umbrella with --no-agents-md" do
in_tmp("umbrella with no agents md", fn ->
Mix.Tasks.Phx.New.run([@app, "--umbrella", "--no-agents-md"])

refute_file(root_path(@app, "AGENTS.md"))
end)
end
Expand Down