krzysztofzablocki / Sourcery

Meta-programming for Swift, stop writing boilerplate code.
http://merowing.info
MIT License
7.65k stars 616 forks source link

Sourcery Template list / index ? #315

Closed mackoj closed 7 years ago

mackoj commented 7 years ago

It's would be great to have a list/directory/repo of all available Sourcery Template available ?

ilyapuchka commented 7 years ago

Hey @mackoj All the templates shipped with Sourcery are currently listed in the docs in Example section.

Antondomashnev commented 7 years ago

@ilyapuchka let's maybe update the title for the section from Example to Bundled Templates? I could submit a PR for it, if makes sense.

mackoj commented 7 years ago

I mean from other source like this one for example https://github.com/AliSoftware/SourceryTemplates .

Antondomashnev commented 7 years ago

@mackoj I think we can add this in a similar way like here https://github.com/SwiftGen/SwiftGen#attributions

ilyapuchka commented 7 years ago

As @AliSoftware mentions here we need to develop contribution guidelines for contributing templates. It may contain requirements for templates description and documentation, tests and so on. Then we can accept new templates as PRs. I also think there is no need for all of them being listed in the Sourcery docs, because there they serve more as a reference. I think it will make sense to separate templates to a dedicated repo and setup some simple github.io page for it.

mackoj commented 7 years ago

I think having contributions guidelines for contributions templates is clearly the good way to go. It's more important to have quality templates than having a lot of them. But I think they should be in Sourcery repo for discovery purpose.

Antondomashnev commented 7 years ago

@mackoj I don't think that idea to keep them separated - bad idea. I see the only drawback, that currently templates are developed with the Sourcery version from master branch, not from Releases. So for example when I added the tests for templates they were updated with new Stencil features, which were not available in the 0.6.0 release. And so the developer can download the template and it won't compile unless developer also uses Sourcery complied from master.

ilyapuchka commented 7 years ago

There should be a reference to particular minimum version of Sourcery that is supported. We might do something like what fastlane does whit putting minimum version in fastfile, using special annotation for that in templates, but that might be an over-complication.