@@ -280,6 +280,9 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
280280 )
281281 # yes to esbuild
282282 |> run_upgrade ( input: "y\n " )
283+ |> assert_has_patch ( "mix.exs" , """
284+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
285+ """ )
283286 |> assert_has_patch ( "config/config.exs" , """
284287 - | args: ~w(js/app.js --bundle --outdir=../priv/static/assets),
285288 + | args: ~w(js/app.js --bundle --outdir=../priv/static/assets --alias:@=.),
@@ -308,6 +311,9 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
308311 )
309312 # yes to esbuild (no deps prompt since no existing deps)
310313 |> run_upgrade ( input: "y\n " )
314+ |> assert_has_patch ( "mix.exs" , """
315+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
316+ """ )
311317 |> assert_has_patch ( "config/config.exs" , """
312318 - | args: ["js/app.js", "--bundle", "--outdir=../priv/static/assets"],
313319 + | args: ["js/app.js", "--bundle", "--outdir=../priv/static/assets", "--alias:@=."],
@@ -333,6 +339,9 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
333339 )
334340 # yes to esbuild
335341 |> run_upgrade ( input: "y\n " )
342+ |> assert_has_patch ( "mix.exs" , """
343+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
344+ """ )
336345 |> assert_has_patch ( "config/config.exs" , """
337346 - | args: ~w(js/app.js --bundle --outdir=../priv/static/assets),
338347 + | args: ~w(js/app.js --bundle --outdir=../priv/static/assets --alias:@=.),
@@ -361,6 +370,9 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
361370 )
362371 # yes to esbuild (no deps prompt since no existing deps)
363372 |> run_upgrade ( input: "y\n " )
373+ |> assert_has_patch ( "mix.exs" , """
374+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
375+ """ )
364376 |> assert_has_warning ( & ( & 1 =~ "Failed to update esbuild configuration for colocated hooks" ) )
365377 |> refute_has_notice ( )
366378 end
@@ -381,6 +393,9 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
381393 )
382394 # no to deps prompt, yes to esbuild
383395 |> run_upgrade ( input: "y\n " )
396+ |> assert_has_patch ( "mix.exs" , """
397+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
398+ """ )
384399 |> assert_has_warning ( & ( & 1 =~ "Failed to update esbuild configuration for colocated hooks" ) )
385400 |> refute_has_notice ( )
386401 end
@@ -444,6 +459,10 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
444459 |> assert_has_patch ( "mix.exs" , """
445460 + | {:lazy_html, ">= 0.0.0", only: :test},
446461 """ )
462+ |> assert_has_patch ( "mix.exs" , """
463+ - | {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
464+ + | {:esbuild, "~> 0.10", runtime: Mix.env() == :dev}
465+ """ )
447466 |> assert_has_patch ( "config/dev.exs" , """
448467 - | reloadable_compilers: [:elixir, :app]
449468 + | reloadable_compilers: [:phoenix_live_view, :elixir, :app]
@@ -483,7 +502,8 @@ defmodule Phoenix.LiveView.Igniter.UpgradeTo1_1Test do
483502 defp deps do
484503 [
485504 {:phoenix, "~> 1.7.0"},
486- {:phoenix_live_view, "~> 0.20.0"}
505+ {:phoenix_live_view, "~> 0.20.0"},
506+ {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
487507 ]
488508 end
489509 end
0 commit comments