yazi-rs / schemas

JSON Schemas for Yazi configuration files.
https://yazi-rs.github.io
MIT License
1 stars 5 forks source link

Update schemas to match latest changes #15

Open uncenter opened 8 months ago

uncenter commented 8 months ago

This is a "living" issue and will update over time as changes are made in https://github.com/sxyazi/yazi.

dydyamotya commented 6 months ago

Hello! Please update [which] key is schema. It is updated in documentation, but causes formatter errors.

uncenter commented 6 months ago

Has there been a release including that change yet? I'm afraid we haven't implemented proper versioning so far and that means unfortunately the schemas will only be updated on new releases.

dydyamotya commented 6 months ago

I've just installed yazi and downloaded the config from the site, as mentioned in the documentation. And it showed, that the scheme is wrong.

Like that: image

uncenter commented 6 months ago

You must have installed it from main, since that PR landed only two weeks ago whereas the latest release was three weeks ago. You can comment out the schema key until the next release. I apologize for the issue, I'm still considering the best way to deal with versioning.

sxyazi commented 6 months ago

I'm still considering the best way to deal with versioning.

Perhaps we can just add it? If it is included in the user's configuration but not defined in our scheme, an error will occur; however, if it is included in our scheme but not defined by the user, no error occurs.

uncenter commented 6 months ago

That approach doesn't work for all changes though, but you are right it would be inconsequential in this instance. If a property is renamed though, I can't change it since it will likely break the schema for more users than it fixes it for. I don't think it makes sense for me to update the schema for some changes but not others because of that.

sxyazi commented 6 months ago

If a property is renamed though, I can't change it since it will likely break the schema for more users than it fixes it for.

rename is add + delete, such as renaming foo to bar:

We already know that "adding" will not be a problem, and the deletion occurs after our release, so there will be no problem either.

uncenter commented 6 months ago

I'm not sure I'm willing to manage the complexity and timing of adding/removing properties like you explained around a release schedule I don't control.

sxyazi commented 6 months ago

This is based on the assumption that renaming is not expected to occur frequently. Renaming in the Yazi configuration file has only occurred once so far, renaming layout to ratio, and it was a major change, https://github.com/sxyazi/yazi/issues/461

Most of the time, we simply add new fields or remove existing ones.

uncenter commented 6 months ago

Still seems like unnecessary complexity when the real goal here is a proper versioning system imo. See #17.

sxyazi commented 6 months ago

Still seems like unnecessary complexity when the real goal here is a proper versioning system imo.

Sorry, I don't understand, could you be more specific - what part do you think is complex?

To me, it simply moves the "adding" work we do at release time to an earlier stage. For deletions, we can add comments like // TODO: remove this and then delete them after release.

uncenter commented 6 months ago

I'm not a fan of adding debt like that though where the schemes have to be updated so often.

sxyazi commented 6 months ago

I'm not a fan of adding debt like that though

I don't understand why this would be "adding debt"

where the schemes have to be updated so often.

If it's because you don't have enough time, rather than "complexity", I can understand, and I will maintain it myself, as this is much easier than version control and won't require users to manually modify the scheme version in the configuration file every time they update Yazi - I'm not sure how many users would want to do this.

uncenter commented 6 months ago

won't require users to manually modify the scheme version in the configuration file every time they update Yazi

You've completely misunderstood my point? That was one of the various things versioning allows. We can allow users to just use the latest, or maybe there is a Yazi bug that prevents them from upgrading and in that case they can update the schema URL to pin it at a version and not have issues. Let's continue this in #17.

uncenter commented 6 months ago

I've just installed yazi and downloaded the config from the site, as mentioned in the documentation. And it showed, that the scheme is wrong.

Like that: image

As Yazi 0.2.4 has been released, the schema should be updated. Apologies for the issues.

lukeemhigh commented 2 weeks ago

Hi, I'm getting schema error for the confirm property:

image

On Yazi 0.3.1 (Arch Linux 2024-08-17)

uncenter commented 2 weeks ago

Hi, I'm getting schema error for the confirm property:

image

On Yazi 0.3.1 (Arch Linux 2024-08-17)

The schema is actually correctly informing you, though it is out of date (see #30). You are on Yazi 0.3.1, the new confirm feature is in Yazi 0.3.2!

lukeemhigh commented 2 weeks ago

Hi, I'm getting schema error for the confirm property: image On Yazi 0.3.1 (Arch Linux 2024-08-17)

The schema is actually correctly informing you, though it is out of date (see #30). You are on Yazi 0.3.1, the new confirm feature is in Yazi 0.3.2!

Thank you, I updated to the latest git package in the AUR and all taplo warnings disappeared.