cloudinary-community / cloudinary-util

https://cloudinary-util.vercel.app
MIT License
12 stars 19 forks source link

feat: added all the gravity types as a Zod enum #172

Closed nickytonline closed 3 months ago

nickytonline commented 3 months ago

Description

This PR converts the gravity Zod schema from a string to an enum with all the permitted values for gravity to provide a better experience in editors as well as validation of allowed values for gravity.

~I marked this as a breaking change in case anyone using the cloudinary-util package has a value which is not in the newly introduced Zod enum, as previously it was any string. If that is the case, that gravity option probably never worked for them, but just erring on the safe side for a release.~

I haven't made any documentation updates here as there does not appear to be any docs related to the options including gravity, but if there is a separate repository that requires a documentation update, happy to make changes there as well.

Issue Ticket Number

Fixes #170

Type of change

Checklist

nickytonline commented 3 months ago

I've run the build and tests locally, but just wondering if I need to pnpm link into a project like the getCldOgImageUrl to test, or is the test suite here good enough to confirm the fix?

colbyfayock commented 3 months ago

i think the test suite should be good enough!

as far as the docs, ive been linking to the cloudinary docs for a comprehensive look at the actual values so i think you should be good

colbyfayock commented 3 months ago

this is great, thanks @nickytonline!

colbyfayock commented 3 months ago

@all-contributors please add @nickytonline for code

allcontributors[bot] commented 3 months ago

@colbyfayock

I've put up a pull request to add @nickytonline! :tada: