Conversation
👷 Deploy request for astro-loaders pending review.Visit the deploys page to approve it
|
|
|
|
||
| // 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.
| ); | ||
| if ("createSchema" in loader && loader.createSchema) { | ||
| const result = await loader.createSchema(); | ||
| return result.schema as z.ZodTypeAny; |
There was a problem hiding this comment.
There's probably a cleaner way to update mock-loader without needing to cast as.
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.