feat: add directus provider - #787
Conversation
|
|
✅ Deploy Preview for nuxt-image-v1 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Live Preview ready!
|
I really can't wait to test nuxt.studio 🥲 |
|
LGTM |
|
Would you be able to merge the latest main and add snapshots/expected values for directus? 🙏 |
I've yet never used/created vitest, but there is always a first time right? I should add the entry inside the const missingProviderTests = [
'directus', // covered in a unique test
'strapi', // covered in a unique test
'layer0' // backwards-compatible alias for edgio
]and what else? |
|
You could add entries for directus in this file: Lines 2 to 23 in 28f550d Only use the approach I adopted for If you think it needs more testing, then you can also add additional tests in the |
Directus does support all the listed ones inside
Any options and transformations are added as query parameters to the url. |
|
|
|
Ok, so the last commit should do it |
|
Would you run pnpm i to ensure you're running the latest dependencies? |
Pulled latest commits, I started a Directus test via docker and the requests are perfectly fulfilled. |
Upsy. Thanks, I was a bit on a rush. Co-authored-by: Daniel Roe <daniel@roe.dev>
| const transforms = modifiers.transforms | ||
| if (transforms && transforms.length > 0) { | ||
| // We stringify and encode in URL the list of lists, then apply it back to the modifiers | ||
| modifiers.transforms = new URLSearchParams(JSON.stringify(transforms)).toString().replace(/=+$/, '') as unknown as (string | number)[][] |
There was a problem hiding this comment.
This is a little bit inconsistent with other providers using ufo utils but should be fine...
There was a problem hiding this comment.
Thanks for the note. I'm not yet familiar with ufo, but since it is on my learning list I'll try to update this once I'm more confident
pi0
left a comment
There was a problem hiding this comment.
Haven't locally tried but looks 💯

Lately I started experimenting with Directus Headless CMS and to my surprise it has a nice implementation and usage of sharp.
So I decided to add it as a provider for ease of use.