cf-content-types-generator
cf-content-types-generator copied to clipboard
feat: add option for default modifier for v10 types
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 use TypeTest directly instead of explicitly stating TypeTest<'WITHOUT_UNRESOLVABLE_LINKS'> or using TypeTestWithoutUnresolvableLinksResponse.
This PR adds a default modifier option to achieve that.
@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 WITH_ALL_LOCALES be added as an option as well? I would also like it if no value is provided to the --modifier flag, then it could just use undefined as a default (Modifiers extends ChainModifiers = undefined).
cc @johannessjoberg
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!
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.