I ended up copying across mix_helper.exs because I wasn't sure I should be trying to do a path-based Code.require_file into the phoenix dependency.
I had to create my own generator_paths function because I wanted to return [".", :phx_gen_auth] instead of [".", :phoenix]. Eventually, I think this will need to return [".", :phx_gen_auth, :phoenix] if I start calling the phoenix context or schema generators.
It looks like the test project that's generated via in_tmp_project/2 is phx_gen_auth. I'm not sure if there's an easy way to change that app name to something more easily understandable like my_app.
This adds the basic scaffolding for
Mix.Tasks.Phx.Gen.Auth
and generates the<Schema>Notifier
module.The original module is here: https://github.com/dashbitco/mix_phx_gen_auth_demo/pull/1/files#diff-207bcaccba470cef223a589c0a45d2fe
Other notes
mix_helper.exs
because I wasn't sure I should be trying to do a path-basedCode.require_file
into the phoenix dependency.generator_paths
function because I wanted to return[".", :phx_gen_auth]
instead of[".", :phoenix]
. Eventually, I think this will need to return[".", :phx_gen_auth, :phoenix]
if I start calling the phoenix context or schema generators.in_tmp_project/2
isphx_gen_auth
. I'm not sure if there's an easy way to change that app name to something more easily understandable likemy_app
.