Comments (6)
Was about to write about this, you beat me to the punch.
I think a reasonable approach would be to:
- Add a folder for generic Templates in this repository
- Add generation tests to always keep Templates up-to date with tool version thus avoiding breaking them with updates
- Bundle templates with the binary distribution of the Pod, so that people can use our default implementation if they wish
Makes sense?
from sourcery.
I updated our readme and introduced some example templates which we might tweak, once we approach 1.0 release we can embeed those that are the most generic, take a look at #123
from sourcery.
I think it would be really interesting to have a project that people can pull in as a dependency (like SwiftGen, via Cocoapods or Carthage) which provides some basic templates for protocols like AutoEquatable
or AutoHashable
.
Do you think this is feasible? Another future direction for that would be providing a way for each user of that repository to add their own templates that are less widely applicable (maybe JSON parsing, lenses, etc.).
Basically, I think it would be cool for the example templates in #123 to be usable for an end-user. I'm not sure if that belongs in Sourcery itself, or in a project which has Sourcery as a dependency.
from sourcery.
@bejar37 that's the idea, I made those files separate so we can bring them in as embedded templates later on, I didn't bundle them yet because we are far from 1.0 and a lot of changes are happening
from sourcery.
Oops, I see that I hadn't read your previous comment throughly @krzysztofzablocki . Sorry!
from sourcery.
Actually, lets embeed them in binary distrubtion, people can choose to use them or not :)
from sourcery.
Related Issues (20)
- Add whitespace trimming configuration for Stencil templates
- [QUESTION] Thread-Safe Mocks HOT 1
- [Bug] Failed to resolve dependencies (SPM issue) HOT 5
- Watch mode only watches sources from last configuration file when passing multiple paths to configuration files using `--config` command line options
- Getting generic requirements from methods HOT 1
- Possible to generate asset catalog constants? HOT 1
- Detecting if a variable is an Enum works if enum is declared in the file but doesn't otherwise. HOT 4
- AutoMockable does not generate valid Swift code during method generic requirement parsing HOT 2
- Swift macros and method bodies HOT 1
- Update CHANGELOG
- Generated code doesn't compile if returning type starts with the "any" keyword HOT 5
- Sourcery not passing variable to .stencil file inside {{ }}
- --cacheBasePath is treated as an absolute path
- `SwiftTemplate` fails to build due to `Invalid manifest` HOT 6
- Pull in protocol info from other projects/targets, without generating for those projects/targets HOT 3
- Typealias resolution replaces unrelated generic types HOT 4
- Crash when regenerate changed file HOT 1
- Old swift-collections version
- Associatedtype not parsing to mock
- Generate Mocks for Each Protocol Using Sourcery
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sourcery.