Custom Directus Extension Placement #16
Replies: 7 comments 1 reply
-
"Right now, my plan is to bundle the custom extensions into a structure like this: I would suggest keeping the extensions in a separate directory in the root. That way, we can build the extensions and deploy them, but also we would be able to mount them locally to be able to have breakpoints in the extensions and speed up custom extension development locally. In the Directus docker compose, we can make adjustments to load the extensions into the Directus docker image while also being able to expose the debugger port. We can consider putting the custom extensions to a separate repo (or sub module) or NPM, but I don't see that as being absolutely necessary since these extensions really do apply to the Citrine Directus instance which would not really be used outside of Citrine so keeping it in same repo makes sense to me. |
Beta Was this translation helpful? Give feedback.
-
I would vote for own package in citrineos-core. No preference on using docker compose volumes or publishing it to the npm registry. |
Beta Was this translation helpful? Give feedback.
-
Draft PR opened with extension in root: citrineos/citrineos-core#64 |
Beta Was this translation helpful? Give feedback.
-
I for sure see the point of having it in citrine-core. But I think a repo under the citrine project that gets pulled in for server/swarm as a submodule would be better. Directus isn't really part of our solution, it's a UI to show our solution, it offers lots of nice features to build nice complex back office things. But that's all on top of citrine, not really part of it. If we do keep it in the core repo, we should have a parent directory like |
Beta Was this translation helpful? Give feedback.
-
This is a good point. What sort of naming/folder structure would make sense? We could make it just "ChargingStationsUI"? Or, 'DirectusExtensions' and have the bundle be a subfolder as @ChrisWeissmann suggested? |
Beta Was this translation helpful? Give feedback.
-
+1 to making a folder dedicated to Directus extensions called something like |
Beta Was this translation helpful? Give feedback.
-
I have a new question, since we've made this change--does it continue to make sense to bundle the charging-stations related extensions? Or should they all be separate now? @elliot-sabitov you were implying there's additional overhead to keeping it as a bundle. would you prefer they be broken out: |
Beta Was this translation helpful? Give feedback.
-
In order to facilitate showing the live ChargingStations connection status on Directus, I've needed to create a few custom extensions (see the feature/evse-connection-status branch). Directus custom extensions require their own package structure because they need to be built using a particular package.json. Right now, my plan is to bundle the custom extensions into a structure like this:
Server/data/directus/extensions/directus-extension-citrineos-charging-stations/package.json
We can run npm commands from that directory to install dependencies and build the code. By committing the
dist/
folder, you won't need to rebuild the code unless you're making changes to it.This works, but is awkward.
There's a few other options--
Server/data/directus/extensions
folder.What are your thoughts?
Beta Was this translation helpful? Give feedback.
All reactions