Skip to content

Conversation

@ArmandPhilippot
Copy link
Member

@ArmandPhilippot ArmandPhilippot commented Dec 3, 2025

Description (required)

  • Adds a new page to document astro/zod module.
  • Replaces the Zod cheatsheet from the Content Collections guide with a link to the new reference page
  • Replaces a few links to Zod GitHub/website with links to our reference page

Context: in v6, the other exports (e.g. from astro:content) will be removed and only astro/zod will be available to import Zod. So, I think it makes sense to document this module now.

Things to think about:

  1. Do we want astro/zod in "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?
  2. How much do we want to document?
    In addition to re-exporting z, this also re-export z flattened... 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)

@ArmandPhilippot ArmandPhilippot added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Dec 3, 2025
@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 52fe24f
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6931ca6d132c1e0007a23b5d
😎 Deploy Preview https://deploy-preview-12828--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Dec 3, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/actions.mdx Source changed, localizations will be marked as outdated.
en/guides/content-collections.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-actions.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-content.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-zod.mdx Localization added, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@sarah11918
Copy link
Member

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?

@ArmandPhilippot
Copy link
Member Author

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 ZodType we show in different APIs to explain what it is (through a link)... but I'm not sure. The type is complex, this is not our role to document it, and I'm not sure this would help more than just saying ZodType.

And no rush, we could eventually talk about this in T&D if there is nothing else. 😄

@sarah11918
Copy link
Member

That's true! We have a Talking and Doc'ing in... 14.5 hours! 😆

@ArmandPhilippot
Copy link
Member Author

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 z with z utility. Looking at the table of contents, this single letter is a bit awkward:

Table of Contents of the astro/zod page

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add new content Document something that is not in docs. May require testing, confirmation, or affect other pages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document astro/zod

3 participants