ash icon indicating copy to clipboard operation
ash copied to clipboard

two "mix ash_phoenix.gen.live" commands for the same resource create assets in two directories

Open at7heb opened this issue 9 months ago • 0 comments

Describe the bug I ran two identical mix ash_phoenix.gen.live commands. They each created their a new directory for the show.ex, index.ex, and form_component.ex files. When I started the server, there were warning messages about redefinition of a module.

    warning: redefining module DofAppWeb.AwardLive.Show (current version loaded from _build/dev/lib/dof_app/ebin/Elixir.DofAppWeb.AwardLive.Show.beam)
    │
  1 │ defmodule DofAppWeb.AwardLive.Show do
    │ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/dof_app_web/live/award_live/show.ex:1: DofAppWeb.AwardLive.Show (module)

To Reproduce create a project with ash, phoenix, and LiveView. Create a domain and a resource run the mix ash_phoenix.gen.live ... twice. then find the lib/.../*_live directories. I saw two:

heb@Howards-MacBook-Pro dof_app % find lib/dof_app_web -name '*_live' -print
lib/dof_app_web/education_live
lib/dof_app_web/judge_live
lib/dof_app_web/award_live
lib/dof_app_web/live/award_live
heb@Howards-MacBook-Pro dof_app % 

The second (lib/dof_app_web/live/award_live) directory was created when I ran the command the second time.

Expected behavior I would like the same directory to be used for each execution of mix ash_phoenix.gen.live. I would like to use git for version control of the *.ex files.

Runtime

heb@Howards-MacBook-Pro dof_app % elixir -v
Erlang/OTP 27 [erts-15.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Elixir 1.18.1 (compiled with Erlang/OTP 27)
heb@Howards-MacBook-Pro dof_app %  - MacBook Pro, OS 15.3.2 (24D81)
  • Ash version: "ash": {:hex, :ash, "3.4.71"
  • any related extension versions: "ash_phoenix": {:hex, :ash_phoenix, "2.1.23",

Additional context This is for a (the?) science fair domain.dof means day of fair. I apologize because I started programming using a model 33 teletype, with symbols limited to 6 characters.

at7heb avatar Mar 24 '25 17:03 at7heb