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

JSON schemas for modpack files #325

Open
dalbitresb12 opened this issue Oct 15, 2024 · 1 comment
Open

JSON schemas for modpack files #325

dalbitresb12 opened this issue Oct 15, 2024 · 1 comment

Comments

@dalbitresb12
Copy link

dalbitresb12 commented Oct 15, 2024

Hello!

I've been working on the JSON schemas for pack.toml, index.toml, and mod.pw.toml in my fork of SchemaStore. These cover all the latest features I could find in documentation (and undocumented options that I found in the code). These schemas can be read by tools like Taplo LSP (and their VS Code extension, Even Better TOML).

Taplo does have some issues with their schema implementation right now (tamasfe/taplo#650, tamasfe/taplo#515, tamasfe/taplo#514), but these issues should get solved. Their implementation also doesn't support if/else/then (part of draft-07, which the documentation says it doesn't support, tamasfe/taplo#497) which could be used for extra validation, so that when options.no-internal-hashes = true, index.hash can be omitted. Right now, it's just not required at all.

These are ready to be submitted to the public SchemaStore with a PR, but I wanted to ask before submitting the PR over there what would you prefer as the author of packwiz. Either these:

  1. Are submitted and maintained in the repository of SchemaStore. You could request that maintainers of this repository are added to the CODEOWNERS file as documented here, so that PRs in their repository can be merged by any maintainer of packwiz.
  2. Are submitted to this repository and linked as external files to the SchemaStore catalog, as documented here.
    • A downside of this approach is that we lose the tests/negative tests since those are run by the tools available in the SchemaStore repository. I don't know if we could/should replicate those if we keep the schemas in this repository.

Let me know what you think. I can make the PR for this repository if you prefer the second approach.

@dalbitresb12
Copy link
Author

Related: #58

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

1 participant