igniter icon indicating copy to clipboard operation
igniter copied to clipboard

`Igniter.Project.Config.configure/6` doesn't update nested Keyword

Open APB9785 opened this issue 1 year ago • 2 comments

Describe the bug Igniter.Project.Config.configure/6 doesn't look into the keywords list properly

To Reproduce Have a dev.exs with contents like

config :demo, DemoWeb.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 4000],
  check_origin: false,
  code_reloader: true,
  debug_errors: true,
  secret_key_base: "A0DSgxjGCYZ6fCIrBlg6L+qC/cdoFq5Rmomm53yacVmN95Wcpl57Gv0sTJjKjtIp",
  watchers: [
    esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
    tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]}
  ]

and run

Igniter.Project.Config.configure(
  igniter,
  "dev.exs",
  :demo,
  [DemoWeb.Endpoint, :http, :port],
  {:code, Sourceror.parse_string!("4100")}
)

Expected behavior Should replace port 4000 -> 4100

Actual behavior No changes apply

Workaround The function works properly if we go one level higher, updating the entire :http list instead of just the :port key within

Igniter.Project.Config.configure(
  igniter,
  "dev.exs",
  :demo,
  [DemoWeb.Endpoint, :http],
  {:code, Sourceror.parse_string!("[ip: {127, 0, 0, 1}, port: 4100]")}
)

Runtime

  • Elixir version 1.16
  • Erlang version 26
  • OS X 14.6.1
  • Igniter version 0.5.8
  • any related extension versions

APB9785 avatar Jan 15 '25 21:01 APB9785

Thanks for the report! I won't be able to tackle this in the near future, but PRs are welcome!

zachdaniel avatar Jan 15 '25 21:01 zachdaniel

I will go ahead and work on this bug!

daphnerosepurcell avatar Jun 16 '26 00:06 daphnerosepurcell