Installation
Choisissez le package chargé de générer votre HTML. En cas de doute, comparez d’abord Astro, Svelte et Core.
Prérequis
Section intitulée « Prérequis »- Node.js 22.12 ou supérieur
- Zod 4 (peer dependency)
- Pour Astro : Astro 5, 6 ou 7
- Pour Svelte : Svelte 5 (avec support des runes) ou SvelteKit 2
Installation pour Astro
Section intitulée « Installation pour Astro »Le package @unschema-graph/astro inclut l’intégration Astro, le composant <Schema />, l’inspecteur Dev Toolbar et les helpers de collections de contenu.
Option A : Configuration automatique (Recommandée)
Section intitulée « Option A : Configuration automatique (Recommandée) »Utilisez la CLI officielle d’Astro pour installer et configurer l’intégration en une seule commande :
npx astro add @unschema-graph/astroOption B : Installation manuelle
Section intitulée « Option B : Installation manuelle »Installez le package et ses dépendances :
pnpm
pnpm add @unschema-graph/astro zodnpm
npm install @unschema-graph/astro zodyarn
yarn add @unschema-graph/astro zodbun
bun add @unschema-graph/astro zodAjoutez schemaGraph() dans votre fichier astro.config.mjs :
import { defineConfig } from 'astro/config';import { schemaGraph } from '@unschema-graph/astro';
export default defineConfig({ site: 'https://mon-site.fr', integrations: [schemaGraph()],});Installation pour Svelte 5 & SvelteKit
Section intitulée « Installation pour Svelte 5 & SvelteKit »Le package @unschema-graph/svelte inclut le composant natif Svelte 5 <Schema /> et réexporte le catalogue complet des builders du Core.
pnpm
pnpm add @unschema-graph/svelte zodnpm
npm install @unschema-graph/svelte zodyarn
yarn add @unschema-graph/svelte zodbun
bun add @unschema-graph/svelte zodAucun plugin de build ni configuration Vite n’est requis ! Importez directement vos composants et builders dans vos fichiers .svelte.
Installation TypeScript Universel / Core
Section intitulée « Installation TypeScript Universel / Core »Pour les scripts Node.js, Nitro, Fastify, Next.js, Remix ou les pipelines de build :
pnpm
pnpm add @unschema-graph/core zodnpm
npm install @unschema-graph/core zodyarn
yarn add @unschema-graph/core zodbun
bun add @unschema-graph/core zodPoints d’entrée des packages
Section intitulée « Points d’entrée des packages »| Package / Import | Description |
|---|---|
@unschema-graph/astro |
Intégration Astro, composant <Schema />, catalogue complet des builders et utilitaires |
@unschema-graph/astro/content |
Helpers de mapping pour les collections Astro (toArticle, toBlogPosting, toNewsArticle) (également réexportés depuis @unschema-graph/astro) |
@unschema-graph/svelte |
Composant natif Svelte 5 <Schema /> avec réexport complet de tous les builders |
@unschema-graph/core |
Moteur TypeScript universel : builders, graphes @graph, sérialisation et durées |
@unschema-graph/core/audit |
Moteur d’audit programmatique du HTML JSON-LD |
Continuez avec votre premier schéma dans Astro, Svelte ou Core.