ash-project / igniter

A code generation and project patching framework.
https://hexdocs.pm/igniter/readme.html
MIT License
92 stars 9 forks source link

Options for ignore files when moving and for configuring module locations #29

Open zachdaniel opened 2 months ago

zachdaniel commented 2 months ago

For example:

# This is a configuration file for igniter.
# For option documentation, see hexdocs.pm/igniter/Igniter.Project.IgniterConfig.html
# To keep it up to date, use `mix igniter.setup`

[
  module_location: :outside_matching_folder,
  dont_move_files: [
    ~r/file_paths/,
    "lib/this_file.ex"
  ],
  module_names: %{
    ~r/MyAppWeb\..*Controller/ => "lib/my_app_web/controllers"
    ~r/MyAppWeb\..*Live/ => "lib/my_app_web/live"
    ~r/MyAppWeb\..*Views/ => "lib/my_app_web/views",
    "This.Specific.Module" => "lib/this_place"
  }
]
zachdaniel commented 2 months ago

We've done everything but the module_names feature, which actually needs to be a bit more complex because in that instance the _controller.ex is stripped off of the end. Will need to figure out how to model those conventions, otherwise folks will need to add lots of dont_move_files configurations.

zachdaniel commented 1 month ago

I think module_names will likely need to be regexes as keys and functions as values.