Conversation
👷 Deploy request for astro-loaders pending review.Visit the deploys page to approve it
|
🦋 Changeset detectedLatest commit: 1232524 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
||
| // Legacy schemas from original implementation for exact backward compatibility | ||
| export const LegacyNSSchema = z.record(z.string()); | ||
| export const LegacyNSSchema = z.record(z.string(), z.unknown()); |
There was a problem hiding this comment.
Zod 4 requires two arguments for z.record(): https://zod.dev/v4/changelog?id=drops-single-argument-usage
| }, | ||
| schema: () => | ||
| zodSchemaFromAirtableTable({ | ||
| createSchema: async () => { |
There was a problem hiding this comment.
Since the schema generation is async we need to use createSchema now: https://docs.astro.build/en/guides/upgrade-to/v6/#removed-schema-function-signature-content-loader-api
| "airtable": "^0.12.2", | ||
| "ts-pattern": "^5.6.2" | ||
| "ts-pattern": "^5.6.2", | ||
| "zod-to-ts": "^1.2.0" |
There was a problem hiding this comment.
zod-to-ts v2.0.0 is available, but the API is different from what the Astro docs expect. Since Astro v5 used zod-to-ts@1.2.0, I kept the version there for parity.
| ...options | ||
| }: MockLoaderOptions): Loader { | ||
| async function getSchema() { | ||
| async function getSchema(): Promise<z.ZodType<Record<string, unknown>>> { |
There was a problem hiding this comment.
Unfortunately had to cast getSchema() since there are conflicting types between Astro 6/Zod 4 and @anatine/zod-mock.
|
@ascorbic Pushed a change which should fix the type error that was causing the test to fail. Added a basic changeset! |
Hi @ascorbic!
This upgrades all Astro packages with
pnpm dlx @astrojs/upgradeand adds^6.0.0to the peerDependency range for all packages.Supersedes #100. Supersedes #112.