-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option for default modifier for v10 types #345
base: master
Are you sure you want to change the base?
feat: add option for default modifier for v10 types #345
Conversation
178ef78
to
dbd9ddd
Compare
@marcolink What are your thoughts on these changes? |
Bump |
@marcolink Would love to see this get merged as it doesn't make sense to repeat this for every usage of the generated types. @johannessjoberg Should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi 👋
I have added a comment. Overall this looks straight forward and valuable 👍
@@ -31,6 +31,7 @@ class ContentfulMdg extends Command { | |||
jsdoc: Flags.boolean({ char: 'd', description: 'add JSDoc comments' }), | |||
typeguard: Flags.boolean({ char: 'g', description: 'add type guards' }), | |||
response: Flags.boolean({ char: 'r', description: 'add response types' }), | |||
modifier: Flags.string({ char: 'm', description: 'add default modifier (v10 only)' }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we:
- allow all possible modifiers
- allow an array of modifiers to also support combinations?
Thanks for feedback @marcolink ! I'm not with Milkywire now and not actively using this package. Ping @andreaspalsson @hannasctyden @ekling to take over from here :) |
TL;DR I have a branch with my suggested way forward that I will push if there is no action on this PR in the next days! |
@marcolink Please feel free to push it. I don't think we will have the bandwidth to update this with support for more modifiers in the coming weeks. |
If you create your contentful client with an option like
contentful.createClient({ ... }).withoutUnresolvableLinks
and reuse it everywhere, it would improve DX to be able to useTypeTest
directly instead of explicitly statingTypeTest<'WITHOUT_UNRESOLVABLE_LINKS'>
or usingTypeTestWithoutUnresolvableLinksResponse
.This PR adds a default modifier option to achieve that.