new integration: json schema for data collections
Intro
- Reads
content/config.tsfor data collections every timeastro syncruns. - Converts the zod schema to json schema using
zod-to-json-schema - Writes each schema to
<root>/.astro/<collection>.schema.jsonwhere<root>is the directory wherepackage.jsonandastro.config.mjsusually go, and<collection>is the name of the data collection as read from the exportedcollectionsvalue.
⚠️ No Changeset found
Latest commit: 8fc7ab66899c2dd7179a600fabbe7d3e9493b35e
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
To preview, either download this package and add it manually: astro-json-schema-0.0.0.tgz
or run this command:
npm i https://github.com/lilnasy/gratelets/files/13798701/astro-json-schema-0.0.0.tgz
And add the integration to astro config:
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import jsonSchema from 'astro-json-schema';
// https://astro.build/config
export default defineConfig({
site: 'https://example.com',
integrations: [mdx(), sitemap(), jsonSchema()],
})
T