Replies: 6 comments 3 replies
-
another useful ref is the |
Beta Was this translation helpful? Give feedback.
-
Oh wow I really had not considered this. What a wonderful idea, I'd be super interested in making this happen! |
Beta Was this translation helpful? Give feedback.
-
I'd pay good money for this! How can we make this happen? I'm happy to help however I can. |
Beta Was this translation helpful? Give feedback.
-
Doesn't seem too hard to generate the schemas (using the library Caleb shared), but I'm not sure what's the best way to hook the schema to the files There's multiple ways:
Generating the JSON schemas would already be pretty great, so at least users can hook it themselves in the meantime while we figure out the best way to hook it automatically |
Beta Was this translation helpful? Give feedback.
-
I started implementing this here: withastro/astro#10145 |
Beta Was this translation helpful? Give feedback.
-
Closing, this is landed as experimental in 4.5 |
Beta Was this translation helpful? Give feedback.
-
Summary
Auto-generate Content Collection JSON
$schema
s for TypeScript-style autocompletion/hints (in tools like VSCode)Background & Motivation
I've been thoroughly enjoying using
'data'
-based Content Collections within Astro, but sorely missing the immediate auto-completion/hints that come when writing TypeScriptI recently had to edit a
vercel.json
file, which starts with the following:...and found the DX within VSCode incredibly valuable. I didn't have to jump to documentation or a config file, I just let VSCode do its thing!
Then it occurred to me: could Astro do the same?
Goals
$schema
files to reference within JSON dataExample
Beta Was this translation helpful? Give feedback.
All reactions