farmOS / farmOS.js

A JavaScript library for working with farmOS data structures and interacting with farmOS servers.
MIT License
15 stars 13 forks source link

Support configuration for non-core entities #63

Closed jgaehring closed 2 years ago

jgaehring commented 2 years ago

This was done largely as an effort to support the farm_profile module, which adds a profile entity to farmOS instances. However, because profiles are not yet an official part of core, we needed to enable a way for farmOS.js consumers to define their own entities. I had very roughly implemented this functionality but had never properly tested it, so it was not a huge surprise it didn't really work. More could still be done to document this and annotate the types, but I'm holding off on that until we've put this through the paces a little more rigorously.

There should also be more tests, but for right now, due to time constraints, I'm just pushing a separate branch on my fork, with the script I used for testing. In due time that might be a starting point for more tests, and maybe an example for the docs.

I will likely make use of this feature in Field Kit, too, so I can add images there w/o first addressing #47. Then I can circle back and implement files in farmOS.js based on what I learn "in the wild". That may be the best time to solidify the docs, types, tests, etc.