Open ivyrze opened 3 months ago
Any ideas where to start on this one? I'd like to see this working and am happy to help where I can.
Hi! Sorry for this taking some time. The challenge here is that we are using babel to parse source files, but astro isn't supported by babel or any plugin afaik.
I think, without having looked very much into it yet, we would have to intercept .astro
files and parse them with the astro-compiler. Then we should be able to have a typescript version which we could use to pick up the queries.
Describe the bug
I'm trying to use GROQ typegen in my Astro project, but it doesn't recognize the JSX-in-frontmatter syntax and mistakenly thinks its all errors, for example:
Using the same code in a standard JSX format produces expected results.
To Reproduce
Steps to reproduce the behavior:
sanity-typegen.json
to include.astro
files in thepath
search glob.sanity schema extract && sanity typegen generate
.Expected behavior
The types should generate without error.
Which versions of Sanity are you using?
Run
sanity versions
in the terminal and copy-paste the result here.What operating system are you using?
macOS 14.5
Which versions of Node.js / npm are you running?
Run
npm -v && node -v
in the terminal and copy-paste the result here.