From c9627f7c261dd72750f896fa31ae492ceb7f5a74 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Wed, 6 May 2026 19:55:50 +0200 Subject: [PATCH] feat(astro-seo-graph)!: drop Astro 5, require Astro 6 + zod 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: peerDependencies.astro is now ^6.0.0 (was ^5.0.0 || ^6.0.0); dependencies.zod is now ^4.4.3 (was ^3.24.0). Why: Astro 5.x ships zod 3 and Astro 6.x ships zod 4. Supporting both meant shipping zod 3 as a runtime dep while Astro 6 users had zod 4 from astro:content. zod brands schemas with version-specific symbols, so seoSchema(image)/imageSchema(image) returned zod 3 schemas that couldn't compose cleanly into the user's z.object({...}) from astro:content (zod 4) — composition produced TS type errors and only worked at runtime by accident. Validation: - pnpm why zod -r now shows a single resolved version (4.4.3) across the workspace; the dual-zod-in-tree state is gone. - Build, typecheck, tests (473 across 3 packages), and Prettier all green. - Our zod usage is core surface only (z.object, z.string, z.enum, .min, .max, .optional, .default in content-helpers.ts; no zod 4- specific syntax). Verified no zod usage in .astro components. Astro 5 users stay on 1.4.1 (bug fixes only, no new features). Co-Authored-By: Claude Opus 4.7 --- .changeset/astro-seo-graph-2-0.md | 23 +++++++++++++++++++++++ packages/astro-seo-graph/package.json | 4 ++-- pnpm-lock.yaml | 17 ++++++----------- 3 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .changeset/astro-seo-graph-2-0.md diff --git a/.changeset/astro-seo-graph-2-0.md b/.changeset/astro-seo-graph-2-0.md new file mode 100644 index 0000000..2086c1a --- /dev/null +++ b/.changeset/astro-seo-graph-2-0.md @@ -0,0 +1,23 @@ +--- +'@jdevalk/astro-seo-graph': major +--- + +**Breaking:** drop Astro 5 from peer deps; require Astro 6 and zod 4. + +Why: Astro 5.x ships zod 3 and Astro 6.x ships zod 4. Supporting both Astro majors meant shipping zod 3 as a runtime dep while users on Astro 6 had zod 4 from `astro:content`. zod brands schemas with version-specific symbols, so `seoSchema(image)` (returned as a zod 3 schema) couldn't compose cleanly into a user's `z.object({ ... })` from `astro:content` (zod 4) — composition produced TS type errors and worked at runtime only by accident. + +**What changed:** + +- `peerDependencies.astro` is now `^6.0.0` (was `^5.0.0 || ^6.0.0`). +- `dependencies.zod` is now `^4.4.3` (was `^3.24.0`). + +**What didn't change:** + +- The exported API surface (``, `createSchemaEndpoint`, `createSchemaMap`, `createApiCatalog`, `createMarkdownEndpoint`, `createIndexNowKeyRoute`, `seoSchema`, `imageSchema`, `buildAlternateLinks`, `breadcrumbsFromUrl`, `gitLastmod`, `aggregate`, `renderLlmsTxt`, `renderMarkdownAlternate`, all types) — all unchanged. +- Our zod usage is core surface only (`z.object`, `z.string`, `z.enum`, `.min`, `.max`, `.optional`, `.default`) — no zod 4-specific syntax. + +**Migration:** + +If you're already on Astro 6, install: `pnpm add @jdevalk/astro-seo-graph@2`. Your `seo` and `featureImage` collection fields will start composing without the silent type drift they had under 1.x. + +If you're still on Astro 5, stay on `@jdevalk/astro-seo-graph@1.4.1`. The 1.x line gets bug fixes only — no new features ship to it. diff --git a/packages/astro-seo-graph/package.json b/packages/astro-seo-graph/package.json index 0c2fad7..e97022c 100644 --- a/packages/astro-seo-graph/package.json +++ b/packages/astro-seo-graph/package.json @@ -51,12 +51,12 @@ "test": "vitest run" }, "peerDependencies": { - "astro": "^5.0.0 || ^6.0.0" + "astro": "^6.0.0" }, "dependencies": { "@jdevalk/seo-graph-core": "workspace:*", "schema-dts": "^2.0.0", - "zod": "^3.24.0" + "zod": "^4.4.3" }, "devDependencies": { "@types/node": "^22.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c56099e..d47a769 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: specifier: ^2.0.0 version: 2.0.0(typescript@5.9.3) zod: - specifier: ^3.24.0 - version: 3.25.76 + specifier: ^4.4.3 + version: 4.4.3 devDependencies: '@types/node': specifier: ^22.0.0 @@ -2406,11 +2406,8 @@ packages: resolution: {integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==} engines: {node: '>=12.20'} - zod@3.25.76: - resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==} - - zod@4.3.6: - resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -3257,7 +3254,7 @@ snapshots: vitefu: 1.1.3(vite@7.3.2(@types/node@22.19.17)(yaml@2.8.3)) xxhash-wasm: 1.1.0 yargs-parser: 22.0.0 - zod: 4.3.6 + zod: 4.4.3 optionalDependencies: sharp: 0.34.5 transitivePeerDependencies: @@ -4956,8 +4953,6 @@ snapshots: yocto-queue@1.2.2: {} - zod@3.25.76: {} - - zod@4.3.6: {} + zod@4.4.3: {} zwitch@2.0.4: {}