Skip to content

chore: downgrade astro to v4 - #335

Open
superplane-dev-shiroyasha[bot] wants to merge 1 commit into
mainfrom
change-astro-to-v4
Open

superplane-dev-shiroyasha[bot] wants to merge 1 commit into
mainfrom
change-astro-to-v4

Conversation

@superplane-dev-shiroyasha

Copy link
Copy Markdown

NEWWE-9

This change moves the website from Astro 7 to Astro 4.16. The Astro integrations are moved to versions that work with Astro 4. The code is changed to use the older Astro 4 APIs. The production build passes.

Dependencies

  • Change astro to ^4.16.19.
  • Change the integrations to these versions: @astrojs/mdx 3, @astrojs/react 3, @astrojs/starlight 0.28, @astrojs/sitemap ~3.1 and @astrojs/rss 4.0.
  • Pin @astrojs/sitemap to 3.1.x. Version 3.2.1 causes the build to fail with Astro 4.16.
  • Remove @astrojs/markdown-remark and the unified() processor line in astro.config.mjs.
  • Regenerate package-lock.json.

Content collections

  • Move src/content.config.ts to src/content/config.ts.
  • Use the older collection style. The collections do not use loaders. The releases collection uses type: "content" and z from astro:content.

Release pages and RSS feed

  • Use entry.render() and entry.slug in place of render() and entry.id. The release URLs do not change.
  • In rss.xml.js, import the MDX container renderer from @astrojs/mdx. The /container-renderer path does not exist in MDX 3.

Help center (Starlight)

  • Change the social setting to the object format that Starlight 0.28 uses.
  • Put autogenerate directly on the "API docs" sidebar group.
  • Delete src/content/docs/help/mcp-connections.mdx. This file and mcp-connections/index.mdx have the same URL. Astro 4 fails the build when two files have the same URL. The index file is kept because it has more content and the images.

Review notes

  • Check the removed mcp-connections.mdx file. If you need text from it, move that text to mcp-connections/index.mdx.
  • Only the build output was checked. The dev server and the pages were not checked in a browser.

Created via SuperPlane.

Move to Astro 4.16 with compatible integrations (mdx 3, react 3,
starlight 0.28, sitemap 3.1, rss 4.0). Adapt to the older APIs:
legacy content collections in src/content/config.ts, entry.render()
and entry.slug, Starlight social/autogenerate config shape, and the
MDX container renderer import. Drop the unused markdown-remark
dependency and the shadowed help/mcp-connections.mdx duplicate of
mcp-connections/index.mdx, which Astro 4 rejects.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-authored-by: Igor Sarcevic <igor@superplane.com>
Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying operately-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: cd36398
Status: ✅  Deploy successful!
Preview URL: https://243c75ef.operately-website.pages.dev
Branch Preview URL: https://change-astro-to-v4.operately-website.pages.dev

View logs

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.

1 participant