decap-cms
decap-cms copied to clipboard
Hand editing YAML without schema types/autocomplete is a time-sink
I'm not sure the best solution (if one doesn't already exist) -- but every time I have to hand-edit the config.yml
file -- a part of me dies inside knowing how much time and mental energy is being wasted. I'm not sure if there is some kind of LSP for yaml that can take in a url to a schema and provide autocomplete in VSCode, but if not, there's got to be something we can do.
Simply having a typescript definition of the schema would allow me to author it in typescript and generate the yaml file myself if need-be. I imagine this already exists somewhere?
Something modern like the config of TinaCMS would save countless people countless hours!
Apologies if there is already a solution to this that has eluded me! If so, I would really appreciate some advice :)
And of course, thank you all for all the hard work on Decap!!
@FractalHQ there is room for improvement here for sure. This has been mentioned a few times recently on Discord and here.
Before anyone can start improving this there has to be a clear idea of what we want in this feature. So at this point, I ask you to define your idea in more detail and provide some examples.
Some resources: schema: https://www.oxygenxml.com/samples/json-schema-documentation/netlify/oneFile/Netlify.html advanced yaml (I use aliases all the time): https://www.educative.io/blog/advanced-yaml-syntax-cheatsheet
Thanks for the links @martinjagodic!
Is there a json
file of that schema you linked in that html
file? I could generate a typescript interface from json, and even provide the json schema to the YAML VSCode extension to solve the problem directly -- I'm hoping we can get autocomplete / intellisense based on the schema json directly in the config.yml
file without any extra steps.
I discussed and gave a link to a schema in discord that I improved upon the link @martinjagodic linked above. Here is the file on github I used for a validator test I did in Rust (not relevant to the conversation). It might be a more complete schema than the one linked.
https://github.com/talves/json-schema-validator-example/blob/main/schema.json
Here is a link to a visualizer of the json: https://json-schema.app/view/%23?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftalves%2Fjson-schema-validator-example%2Fmain%2Fschema.json
Note: This json schema follows draft 2020-12 which is the newest and not supported by a lot of online validators.
@talves you're a legend!! Giving that json file to the YAML extension is such a huge instant win 🥳