#Multiple Extensions (Package)

6 messages ยท Page 1 of 1 (latest)

placid flare
#

I'm trying to convert my package Image Scout to TypeScript using the extension-sdk.

Currently having issues, as I'd like to compile both an Interface AND Endpoint, but it appears the package.json "directus:extension" is an object.

Don't seem to be able to pass an array to compile more than one type, that could be really useful.
The current code to compile based on directus:extension would just enter a loop if type is array and follow the instructions inside.

#

Interesting!.. I've just found "Hybrid Extensions" in the sdk build.ts file, leading me into Custom Operations in the docs.
I'll keep this thread updated on my progress, docs are feeling a little light on this ๐Ÿ˜„

#

Hmmm... Operations seems unique to Flows, not sure how to create a Hybrid Interface/API.

placid flare
#

Further research shows I may just be able to write custom scripts in my package.json

"build-endpoint": "directus-extension build -t endpoint -i ./src/endpoints/index.ts -o ./dist/endpoints/resauce-image-scout/index.js",
"build-interface": "directus-extension build -t interface -i ./src/interface/index.ts -o ./dist/interface/resauce-image-scout/index.js",
"build": "npm run build-endpoint && npm run build-interface"

random dome
#

Hey @placid flare, Hybrid is a dedicated category of extensions, which is currently exclusive to Flow Operations, which means there is no way to create a hybrid Interface/Endpoint. That being said, we decided to implement a new bundle extension type (https://github.com/directus/directus/pull/15672) that works similar to a Hybrid extension and that will allow you to bundle multiple extensions into single App and API entrypoints.

GitHub

Description
This adds a new bundle type to the extensions system which is package-only and which will allow you to create a single package extension that includes multiple other extensions. Those e...

placid flare
#

Looks promising ๐Ÿ™‚ Maybe I'll look to move to bundle, for now using multiple commands seems to be doing the trick ๐Ÿ˜„ Ta!