What would you guys think about allowing
crystal init to receive as an argument a URL with a project template? of course, some files in the project would require to be
ECR templates so the project name is properly inserted. As a bonus, there could be a flag like
template-arguments in which the user could pass a list of key value pairs with parameters for the project.
Ultimately, it could look like:
$ crystal init myapp --url=http://github.com/coolframework/template --template-arguments db_engine=postgres
Of course you could question how is this useful or why is it required. I believe there are several advantages:
I like to think that crystal best practices would tend to evolve faster than the language. Or at least there could be useful setup that can be shared with others (I thought about this when adding GitHub Actions for publishing a CLI App I created, and thought there should be a simple way to share that with others).
Organizations could leverage this by providing their users with pre-approved project templates for say, micro services, that serve some standard.
It gives framework creators the leverage for creating boilerplate without creating that infrastructure themselves (think about rails, in which you need rails for setting up a rails project in which rails is included as a dependency).
So what do you guys think? I’ll be willing to give it a try at the implementation if you feel this would be a cool addition to crystal.