That’s a cool idea
mix ash.gen.calculation Name.Of.Calc --resource MyApp.Foo.Bar could also add it to the resource module. I think you might be surprised at just how actually doable that is.
For an adventurous soul:
mix igniter.gen.task ash.gen.calculation- update the docs of the task
- modify the positional and schema keys to have the described options
- use
Igniter.Project.Module.create_moduleto create the module - go to
Ash.Resource.Igniterand copy theadd_new_attributelogic into aadd_new_calculationfunction and adjust it accordingly - call that new function from the igniter task if the resource flag is set.
Alternatively, there are plans to make mix ash.gen.resource merge into existing resources, so we could add --calculation foo:type:Module to that task, and if the module doesn’t exist it is created as a shell (by delegating to mix ash.gen.calculation) meaning that the calculation gen task doesn’t know about resources it just creates the shell of a calculation.






















