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

Generate schemas automatically at build time #24

Open
mikavilpas opened this issue Jun 18, 2024 · 3 comments
Open

Generate schemas automatically at build time #24

mikavilpas opened this issue Jun 18, 2024 · 3 comments

Comments

@mikavilpas
Copy link

I'm not sure how this could fit the existing ecosystem, but bear with me. 🙂 I looked over the currently open issues and there seems to be some issues with versioning as well as the schemas falling behind the newest changes. Maybe this could be improved a bit.

I would like to propose an approach where the schemas are generated automatically. A while ago I helped contribute a similar change in mfontanini/presenterm#228 and mfontanini/presenterm#236. The maintainer proposed doing it using https://docs.rs/schemars/latest/schemars/ , and it worked nicely.

@uncenter
Copy link
Member

as well as the schemas falling behind the newest changes

I'm not sure if you meant to phrase it like this but the schemas are and have been update to date with the latest version for a while now. There is a brief delay when a new version is release where i have to update the schemas but this is usually resolved within a day - there are no outstanding issues with the schema at the moment.

I would like to propose an approach where the schemas are generated automatically.

Sure! schemars looks okay, @sxyazi do you think that is something we can consider? We should transfer this issue over to the main repository if so. I'm curious how the size compares though? These schemas are pretty refined and reuse a lot of shared types and definitions, not sure how complex of conditions it can handle. Also for the record I don't think this solves our versioning issues?

@mikavilpas
Copy link
Author

Oh, sorry if it came off badly - I have had 0 issues with yazi's schemas myself. I no longer remember what I meant, but maybe it's not that important.

If the current way of updating works - great 👍🏻. If this suggestion seems worth trying, great too 🙂

I don't think this solves our versioning issues?

I think you're correct - one schema applies for one version as far as I am aware.

Right now I think yazi has a latest stable release as well as a constantly changing bleeding edge. As long as the latest release is bound to either a git tag or branch, the schema's url in the configuration file can point to that and it should stay up to date.

not sure how complex of conditions it can handle

Hmm this is a good point. The schemas I worked on for presenterm were quite simple. Maybe a small proof-of-concept could be a good idea.

@uncenter
Copy link
Member

I don't think this solves our versioning issues?

I think you're correct - one schema applies for one version as far as I am aware.

Right now I think yazi has a latest stable release as well as a constantly changing bleeding edge. As long as the latest release is bound to either a git tag or branch, the schema's url in the configuration file can point to that and it should stay up to date.

I believe I mentioned branching/tagging in #17 but for some reason we didn't land on it. Anyway, sure yeah that sounds doable.

not sure how complex of conditions it can handle

Hmm this is a good point. The schemas I worked on for presenterm were quite simple. Maybe a small proof-of-concept could be a good idea.

Definitely, would appreciate that!

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

No branches or pull requests

2 participants