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

Host farmOS core JSON Schema on farmos.org or docs.farmos.org #50

Open jgaehring opened 2 years ago

jgaehring commented 2 years ago

Right now I'm taking advantage of the raw file link that GitHub provides and using it as the $id for the core schemata I'm store in this repo:

https://github.com/farmOS/farmOS.js/blob/100a908fb76296a36fd5b57f54e9687a33160cbf/core_schemata/update-script.js#L5-L7

This provides a pretty stable link, as can be seen for the activity log schema: https://raw.githubusercontent.com/farmOS/farmOS.js/100a908fb76296a36fd5b57f54e9687a33160cbf/core_schemata/log/activity.json

Note that I'm using the commit hash in the URL above, since I've not yet merged my schema branch into main, but eventually it will also be available at the exact same URL you can see as the $id of that schema: https://raw.githubusercontent.com/farmOS/farmOS.js/main/core_schemata/log/activity.json

This is a rather nice temporary solution, but what would be truly nice for the long run is to use farmOS.js as one of the source repos for docs.farmos.org (jgaehring/farmos.org-2.x#8), which is the plan regardless, and use gatsby-source-git to host these JSON documents on docs.farmos.org, and eventually farmos.org itself.

I've also provided an npm script in the package.json, so running npm run update-core-schemata will always update those JSON documents as long as you have a local farmOS server running alongside the Node process. It might be possible to incorporate that into our CI workflow somehow, although that probably merits its own issue.

jgaehring commented 2 years ago

Actually, bumping this up to the beta milestone, cuz why not. It'll be really sweet to have these hosted on docs.farmos.org as soon part of the beta release.

jgaehring commented 2 years ago

See https://github.com/farmOS/farmos.org-EXPERIMENTAL/issues/8#issuecomment-986906165.

jgaehring commented 1 year ago

Just want to note that in the course of 2d2b5d4 I realized this hadn't been updated for a while and that I may have added some non-standard bundles locally that shouldn't be included. There were also some bugs with update-script.js that I didn't take the time to troubleshoot, but will need to be resolved as a part of this issue.