-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add docs for astro/zod
#12828
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
Add docs for astro/zod
#12828
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Before I think too much about this, does this mean we can/should move some of our Zod content OUT of the content collections guide and link here instead? |
|
Yes, I think so. For the "cheatsheet" I actually took inspiration on what we currently have in the content collections guide. So, I think the content collections cheatsheet is no longer required and we could link to that section. I didn't add that to "Things to consider" (I will), but, yes, this was also something I thought about. Maybe we could link there in some places. For Actions, this might be tricky though because there are limitations related to actions. But another thing we could consider is adding sections like "Using zod with FEATURE" in that page to explain the limitations and link to that section from the related guide/reference. I considered that for the And no rush, we could eventually talk about this in T&D if there is nothing else. 😄 |
|
That's true! We have a Talking and Doc'ing in... 14.5 hours! 😆 |
|
I made a few updates to the page to develop a bit why this module is useful and how Zod works. This gives us a few headings to linked to in our current docs. And I replaces a few links to Zod with a link to the reference page instead. Usually, we use the import name as heading, but I wonder if in this case we shouldn't be more verbose and replace While checking the Zod mentions in our docs to replace the links, I also found a ~2-3 years old commented docs in a recipe... If we don't use it, maybe it's time to remove it? 😅 This has been merged as is in #2795 |
sarah11918
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this looks great, @ArmandPhilippot ! As we discussed with the core team today, we can probably go ahead and update all the code examples now on the content collections and actions page that show z being imported from other places.
(Updating the code samples should have all been taken care of on the v6 branch already, BUT we will want to be attentive merging this PR's changes into the v6 branch re: moving content off the collections page and into reference. With any luck, since we didn't change a lot of that surrounding schema content, it should be pretty easy to figure out.)
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
sarah11918
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks great! What an improvement, and to other pages, too.

Description (required)
astro/zodmodule.Context: in v6, the other exports (e.g. from
astro:content) will be removed and onlyastro/zodwill be available to import Zod. So, I think it makes sense to document this module now.Things to think about:
astro/zodin "Runtime API"?This sounded okay to me to add this module alongside the others modules (even in this is a
/module, not a virtual one) but because this is a re-export maybe not and maybe "Other development APIs" is more appropriate?In addition to re-exporting
z, this also re-exportzflattened... which contains a lot of things, so showing everything is probably too verbose and it's not our role to document Zod APIs. But, we could be a bit more verbose for things commonly used in Astro to link from our other pages.Related issues & labels (optional)
astro/zod#12814