cf-content-types-generator icon indicating copy to clipboard operation
cf-content-types-generator copied to clipboard

feat: add option for default modifier for v10 types

Open johannessjoberg opened this issue 1 year ago • 7 comments

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.

johannessjoberg avatar May 29 '24 09:05 johannessjoberg

@marcolink What are your thoughts on these changes?

johannessjoberg avatar Jun 03 '24 07:06 johannessjoberg

Bump

johannessjoberg avatar Jul 09 '24 07:07 johannessjoberg

@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).

zkeetonev avatar Sep 10 '24 20:09 zkeetonev

cc @johannessjoberg

marcolink avatar Sep 25 '24 18:09 marcolink

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 :)

johannessjoberg avatar Sep 26 '24 09:09 johannessjoberg

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 avatar Sep 26 '24 10:09 marcolink

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.

andreaspalsson avatar Oct 07 '24 07:10 andreaspalsson