team-alembic / ash_authentication

The Ash Authentication framework
MIT License
89 stars 46 forks source link

Add AshAuthentication igniter installer #782

Open zachdaniel opened 3 weeks ago

zachdaniel commented 3 weeks ago

This generates resources & configs, but not plugs/phoenix related code. It also adjusts the documentation to align with the installer/be getting-started oriented.

zachdaniel commented 3 weeks ago

@jimsynz thought you might want to see how this looks. To try it out, you could clone it down and say

mix igniter.new my_app --with phx.new --install ash,ash_postgres
# and then (so you can see the diff)
cd my_app

mix igniter.install ash_authentication@../ash_authentication

It's uh...pretty awesome :) Seems mega convenient. I'm planning on leaving out the phoenix code and the plug code from this. We can tell people in the getting-started guide "if you are using phoenix, run mix igniter.install ash_authentication_phoenix, otherwise, copy this controller into your app". So actually...I'll write some tests next week and we can ship it.

zachdaniel commented 3 weeks ago

@jimsynz so credo is annoying me here. It wants me to do aliases, but the ending of the modules in igniter mostly map to modules that exist in Elixir. I.e Igniter.Code.Module I could split it up, and do Code.Module but that screws up the greppability of these things, I hate splitting modules like that up. I'll do it if you make me, but I personally prefer using the full names in this case, enough to make a stink about it 😆

zachdaniel commented 3 weeks ago

Alright, this isn't quite ready, need to fix a few things first

zachdaniel commented 2 weeks ago

I need to ship something in ash core for this to be ready, but also I've realized that all of these generated things should be generated with descriptions. Will do that too.

zachdaniel commented 2 weeks ago

Hopefully will be ready to merge tomorrow.

zachdaniel commented 2 weeks ago

@jimsynz okay, this is ready for final review :) (I hope)

almirsarajcic commented 2 days ago

@jimsynz thought you might want to see how this looks. To try it out, you could clone it down and say

mix igniter.new my_app --with phx.new --install ash,ash_postgres
# and then (so you can see the diff)
cd my_app

mix igniter.install ash_authentication@../ash_authentication

It's uh...pretty awesome :) Seems mega convenient. I'm planning on leaving out the phoenix code and the plug code from this. We can tell people in the getting-started guide "if you are using phoenix, run mix igniter.install ash_authentication_phoenix, otherwise, copy this controller into your app". So actually...I'll write some tests next week and we can ship it.

Just one small correction. When testing, path: needs to be added after @ as that will add :path option to the dependency record in mix.exs, i.e.

mix igniter.install ash_authentication@path:../ash_authentication