Skip to content

chore: Upgrade to Astro v6#113

Open
kydecker wants to merge 7 commits into
ascorbic:mainfrom
kydecker:astro-6
Open

chore: Upgrade to Astro v6#113
kydecker wants to merge 7 commits into
ascorbic:mainfrom
kydecker:astro-6

Conversation

@kydecker

@kydecker kydecker commented Mar 14, 2026

Copy link
Copy Markdown

Hi @ascorbic!

This upgrades all Astro packages with pnpm dlx @astrojs/upgrade and adds ^6.0.0 to the peerDependency range for all packages.

Supersedes #100. Supersedes #112.

@netlify

netlify Bot commented Mar 14, 2026

Copy link
Copy Markdown

Deploy Preview for astro-loaders failed. Why did it fail? →

Name Link
🔨 Latest commit 30cd46e
🔍 Latest deploy log https://app.netlify.com/projects/astro-loaders/deploys/69fc2cde4e55a50008d14f79

@changeset-bot

changeset-bot Bot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 30cd46e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@ascorbic/airtable-loader Patch
@ascorbic/bluesky-loader Patch
@ascorbic/youtube-loader Patch
@ascorbic/loader-utils Patch
@ascorbic/feed-loader Patch
@ascorbic/mock-loader Patch
@ascorbic/csv-loader Patch

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());

@kydecker kydecker Mar 14, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zod 4 requires two arguments for z.record(): https://zod.dev/v4/changelog?id=drops-single-argument-usage

},
schema: () =>
zodSchemaFromAirtableTable({
createSchema: async () => {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/mock/src/mock-loader.ts Outdated
...options
}: MockLoaderOptions): Loader {
async function getSchema() {
async function getSchema(): Promise<z.ZodType<Record<string, unknown>>> {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately had to cast getSchema() since there are conflicting types between Astro 6/Zod 4 and @anatine/zod-mock.

@kydecker

Copy link
Copy Markdown
Author

@ascorbic Pushed a change which should fix the type error that was causing the test to fail. Added a basic changeset!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants