Closed sumwatt closed 6 years ago
Rough exmple of what the a batch generator might look like. I purloined most of the code from the Generator class and made some modifications. I looked at YAML mapping but wasn't quite sure how to map unknown keys so I just cast each to the appropriate type. The branch code should work for model/controller/view/scaffold
@sumwatt IMO this should most likely live on its own shard. I do not believe this should be embedded in the framework
@sumwatt Yeah, I apologize for opening this issue in your repo, I thought this would be an interesting tool for amber cli, although this can live perfectly in his own shard :sweat_smile:
Closing this issue since this we agree that this should live in its own shard
It would be nice to have a feature in the CLI whereby you can enter a command to parse a yaml file and generate multiple models, classes and views from the yaml file.
Example command:
amber batch mysite.yml
... that will process a file like:
It will use the CLI generator to create all of the Models, Views, and Controllers in a single step.
An alternative syntax may be something like:
Use case
I was looking at the RealWorld project and started mocking up a model based on API specs using Yaml as it allows me to visualize how the application needs to be modeled. Since YAML files generally have structure, it was visually helpful to see the application layout before generating.
But I thought it might also be useful for: