aaronrenner / phx_gen_auth

An authentication system generator for Phoenix 1.5 applications.
772 stars 55 forks source link

Basic scaffolding and notifier generator #1

Closed aaronrenner closed 4 years ago

aaronrenner commented 4 years ago

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

  1. 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.
  2. 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.
  3. 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.