Add @fedify/astro, make an examples and make @fedify/init support Astro#593
Add @fedify/astro, make an examples and make @fedify/init support Astro#593dahlia merged 14 commits intofedify-dev:mainfrom
@fedify/astro, make an examples and make @fedify/init support Astro#593Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands Fedify's web framework compatibility by introducing a dedicated integration for Astro. It includes a new Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces excellent support for the Astro framework by adding a new @fedify/astro package, a comprehensive example project, and updating @fedify/init. The code is well-structured, particularly the refactoring within the init package. I've identified a few areas for improvement, mainly within the new example code, including some configuration issues, invalid SVG files, and unsafe type assertions that could be made more robust. Overall, this is a valuable contribution to the project.
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds first-class Astro support to Fedify by introducing a new @fedify/astro integration package, an Astro example app, and refactoring @fedify/init to scaffold Astro projects alongside existing frameworks.
Changes:
- Added
@fedify/astropackage providing an Astro integration (fedifyIntegration) and middleware (fedifyMiddleware). - Added a full
examples/astrodemo and wired it into the examples test runner. - Refactored
@fedify/initweb-framework registry into per-framework modules and added Astro scaffolding/templates.
Reviewed changes
Copilot reviewed 65 out of 72 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds new package/example to the workspace and catalogs Astro. |
| packages/init/src/webframeworks/utils.ts | Extracts shared init instruction + PM→runtime helper. |
| packages/init/src/webframeworks/nitro.ts | Moves Nitro init config into its own module. |
| packages/init/src/webframeworks/next.ts | Moves Next.js init config into its own module. |
| packages/init/src/webframeworks/mod.ts | New registry module for supported web frameworks. |
| packages/init/src/webframeworks/hono.ts | Moves Hono init config into its own module. |
| packages/init/src/webframeworks/express.ts | Moves Express init config into its own module. |
| packages/init/src/webframeworks/elysia.ts | Moves Elysia init config into its own module. |
| packages/init/src/webframeworks/const.ts | Centralizes default deps used by framework initializers. |
| packages/init/src/webframeworks/astro.ts | Adds Astro scaffolding logic, deps, templates, and tasks. |
| packages/init/src/webframeworks.ts | Removes old monolithic webframeworks registry. |
| packages/init/src/utils.ts | Adds/expands internal utility docs and helpers. |
| packages/init/src/types.ts | Expands types/docs for init data structures and registries. |
| packages/init/src/test/utils.ts | Adjusts init test logging output. |
| packages/init/src/test/lookup.ts | Updates imports to new webframework registry; tweaks error handling. |
| packages/init/src/test/create.ts | Updates imports; improves failure output; updates dry-run flag. |
| packages/init/src/templates/astro/src/middleware.ts.tpl | Adds init template for Astro middleware. |
| packages/init/src/templates/astro/astro.config.node.ts.tpl | Adds init template for Astro Node config. |
| packages/init/src/templates/astro/astro.config.deno.ts.tpl | Adds init template for Astro Deno config. |
| packages/init/src/mod.ts | Adds module-level documentation and re-exports. |
| packages/init/src/lib.ts | Refactors shared helpers/docs; moves instruction helper out. |
| packages/init/src/const.ts | Adds Astro to supported web frameworks and documents constants. |
| packages/init/src/command.ts | Adds/updates command option docs; keeps --dry-run. |
| packages/init/src/ask/wf.ts | Updates import to new webframework registry module. |
| packages/init/src/ask/pm.ts | Updates import to new webframework registry module. |
| packages/init/src/ask/mod.ts | Adds docs for prompt orchestration. |
| packages/init/src/action/utils.ts | Adds docs for small action predicates/helpers. |
| packages/init/src/action/set.ts | Updates import to new webframework registry module. |
| packages/init/src/action/notice.ts | Reorders imports and adds extensive notice docs/output. |
| packages/init/src/action/install.ts | Minor import reordering + docs for install step. |
| packages/init/src/action/env.ts | Adds docs for env recommendation step. |
| packages/init/src/action/deps.ts | Adjusts deps logic for test-mode local linking; minor refactor. |
| packages/init/src/action/const.ts | Documents PACKAGES_PATH usage for test mode. |
| packages/init/src/action/configs.ts | Refactors Deno version detection + unstable/links generation logic. |
| packages/fedify/README.md | Lists @fedify/astro among published packages. |
| packages/astro/tsdown.config.ts | Adds tsdown build config for the new package. |
| packages/astro/src/mod.ts | Implements Astro integration hook + middleware wrapper for Fedify. |
| packages/astro/package.json | Defines npm packaging/exports for @fedify/astro. |
| packages/astro/deno.json | Defines JSR export/tasks for @fedify/astro. |
| packages/astro/README.md | Adds usage docs for the new Astro integration package. |
| mise.toml | Adds a dedicated test:init task. |
| examples/test-examples/mod.ts | Adds Astro example to the examples test matrix. |
| examples/astro/tsconfig.json | Adds Astro strict TS config for the example app. |
| examples/astro/src/pages/users/[identifier]/posts/index.astro | Adds posts list + create form page to the Astro demo. |
| examples/astro/src/pages/users/[identifier]/posts/[id].astro | Adds post detail page to the Astro demo. |
| examples/astro/src/pages/users/[identifier]/index.astro | Adds user profile page to the Astro demo. |
| examples/astro/src/pages/index.astro | Adds home page to the Astro demo. |
| examples/astro/src/middleware.ts | Wires fedifyMiddleware into Astro’s middleware entrypoint. |
| examples/astro/src/lib/store.ts | Adds simple in-memory stores for demo state. |
| examples/astro/src/lib/federation.ts | Implements demo federation logic (actor/inbox/object dispatchers). |
| examples/astro/src/layouts/Layout.astro | Adds demo layout + global styling. |
| examples/astro/public/fedify-logo.svg | Adds static asset for the demo UI. |
| examples/astro/public/astro-square.svg | Adds static asset for the demo UI. |
| examples/astro/public/astro-horizonal.svg | Adds static asset for the demo UI. |
| examples/astro/public/astro-fedify-logo.svg | Adds static asset for the demo UI. |
| examples/astro/package.json | Defines Node-based Astro scripts and deps for the demo. |
| examples/astro/deno.json | Defines Deno tasks/imports for running the demo under Deno. |
| examples/astro/astro.config.node.ts | Adds Astro Node config for the demo. |
| examples/astro/astro.config.deno.ts | Adds Astro Deno config for the demo. |
| examples/astro/README.md | Adds full documentation for running/testing the Astro demo. |
| examples/astro/.gitignore | Ignores .astro build artifacts. |
| docs/package.json | Adds @fedify/astro to docs workspace deps. |
| docs/manual/integration.md | Documents Astro integration in the manual. |
| docs/cli.md | Updates CLI docs to list Astro as an init option. |
| docs/.vitepress/config.mts | Adds @fedify/astro to references list. |
| deno.json | Adds new workspace members and pins astro import. |
| CONTRIBUTING.md | Documents the new package and updates init-testing instructions. |
| CHANGES.md | Adds changelog entries for @fedify/astro + init Astro support. |
| AGENTS.md | Notes packages/astro uses tsdown like other integrations. |
dahlia
left a comment
There was a problem hiding this comment.
Could you upgrade Hongdown to v0.3.7 and reformat Markdown documents?
Summary
Add
@fedify/astro, make an examples and make@fedify/initsupport AstroRelated issue
Changes
packages/astroadded.examples/astroadded.packages/initrefactored and fix some errors.packages/init/src/webframeworks/astro.tsadded.Benefits
Now users can conveniently use Astro and Fedify together more easier.
Checklist
Did you write a regression test to reproduce the bug (if it's a bug fix)?mise teston your machine?Additional Note
test-initcan't testdeno(this is a bug by deno and vite),npmwith Astro.