typewriter
typewriter copied to clipboard
Customizable prefix when generating the iOS client
Hey lovely typewriter team,
I am actually not completely sure if this is a bug report or a feature request. I'll just write it as a feature request. Please feel free to correct me if this is something that should actually work.
My current situation
I am currently trying to use typewriter in an iOS project. Unfortunately there is a name collision.
- In the Analytics/Segment iOS SDK there is a
SEGContext
class. - In our test plan there is a property (I hope that's how you call them) called
context
. When I usenpx typewriter
it generates a secondSEGContext
class.
Proposal
We could make the SEG
prefix configurable in the typewriter.yml
configuration file. In that case I could change the SEG
prefix to e.g. SEGGenerated
which would lead to a SEGGeneratedContext
class to be generated an thus resolve the collision.
Alternatives
- Instead of making the prefix configurable, we could also change the prefix for the generated files (e.g. to SEGG) to prevent collisions
- I saw there already is some kind of mechanism to resolve collisions (some duplicate types have a number appended). Maybe there is a way to leverage this as well?
Looking forward to your feedback and ideas!
I just saw this being closed as completed but can't find any more context. How did you decide to implement it?