Understood.
There are a lot of interesting complexities in having a `mix deps.add` task, and the process that we’ve built for igniter has quite a few useful components that I think are unlikely to make it into a core `mix deps.add --install` task.
We support composing additional required installers, specifying option schemas, composing their arguments, etc. Composiing installers requires multiple phases of user confirmation, i.e “add a dep, run an installer, that installer requires adding another dep”, and synthesizing all of the appropriate changes into one diff at the end (aside from dependency changes). We wouldn’t be able to compose installers if a requirement for making this work is that `mix deps.add —install` is invoked from the CLI.
If `mix deps.add —install` can be invoked from something like `Mix.Task.run` then I’m pretty sure we’re back in the world where the “reread mix.exs and unload/reload” logic has to exist. So we’d either have to go considerably down in terms of QoL features we’ve built up in igniter.
There are additional things that we are going to tackle soon, specifically if you wanted to support doing something like `mix deps.add package —only test`, the rereading of the mix.exs would not compile that module if your task was run in dev env, and so its installer would not be run. Furthermore, some installers would prefer to express explicitly that they should be added with `runtime: false` and `only: [:test]`. We will handle this in igniter by storing these nested installers and printing them to the user to show them what tasks they have to run, because those requested installations must be run in a different environment, and reinstalling with a —only test flag will patch that into the mix.exs
> run these installers after you’re done
> MIX_ENV=test mix igniter.install test_dep1,test_dep2 —only test
Sorry for the wall of text 😂 Ultimately my vote goes to the command that can be used to reload a project (or whichever strategy is taken). Easy to say, maybe hard to actually make happen. We have something that works “okay” for now, so I’m not pushing for anything in a rush, and I’m more than happy to contribute towards this effort.