packwiz icon indicating copy to clipboard operation
packwiz copied to clipboard

JSON schemas for modpack files

Open dalbitresb12 opened this issue 4 months ago • 1 comments

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 avatar Oct 15 '24 02:10 dalbitresb12