Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jgaehring opened this issue Nov 8, 2021 · 3 comments
Open

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

jgaehring opened this issue Nov 8, 2021 · 3 comments
Milestone

Comments

@jgaehring
Copy link
Member

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:

const $idURI = (entity, bundle) =>
// Eventually, this should point to a location on farmos.org or docs.farmos.org
`https://raw.githubusercontent.com/farmOS/farmOS.js/main/core_schemata/${entity}/${bundle}.json`;

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 (farmOS/farmOS.org#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 jgaehring added this to the 2.0.0 milestone Nov 8, 2021
@jgaehring jgaehring modified the milestones: 2.0.0, 2.0.0-beta Nov 8, 2021
@jgaehring
Copy link
Member Author

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
Copy link
Member Author

See farmOS/farmOS.org#8 (comment).

@jgaehring jgaehring modified the milestones: 2.0.0-beta, 2.0.0 Dec 7, 2021
@jgaehring
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant