Skip to content

Add SolidStart integration and refactor fedify init internals#652

Open
2chanhaeng wants to merge 29 commits intofedify-dev:mainfrom
2chanhaeng:main
Open

Add SolidStart integration and refactor fedify init internals#652
2chanhaeng wants to merge 29 commits intofedify-dev:mainfrom
2chanhaeng:main

Conversation

@2chanhaeng
Copy link
Copy Markdown
Contributor

Summary

Add @fedify/solidstart package for SolidStart integration and overhaul
fedify init internals: centralize dependency versions, replace
runSubCommand with @david/dax, and improve test infrastructure.

Related issue

Changes

  • packages/solidstart: Add packages/solidstart/ providing fedifyMiddleware() for SolidStart's middleware system. (by @dodok8)
  • packages/init:
    • Add SolidStart web framework option. (by @dodok8)
    • Extract hardcoded third-party dependency versions and add scripts/update_init_deps.ts to auto-update dependency versions.
    • Refactor code like replacing runSubCommand with @david/dax.
    • Use port 0 binding from 10000 while mise test:init.
    • Print skipped and failed cases with reasons and directories.
  • packages/express: Fix bug by replacing req.host with req.header("Host").
  • packages/astro: Fix bug by adding --no-install for non-Deno package managers.
  • docs: Add docs about SolidStart integration. (by @dodok8)
  • examples/solidstart: Add an example app using SolidStart integration. (by @dodok8)

Benefits

  • SolidStart users can integrate Fedify with a single middleware call. (by @dodok8)
  • Dependency versions for fedify init templates are now centralized
    and auto-updatable, reducing manual maintenance.
  • Replacing runSubCommand with @david/dax simplifies subprocess
    handling and removes custom error classes.
  • Dynamic port allocation in tests eliminates port conflicts when
    running multiple test apps sequentially.

Additional notes

@issues-auto-labeler issues-auto-labeler bot added component/build Build system and packaging component/cli CLI tools related component/federation Federation object related component/integration Web framework integration labels Mar 28, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the @fedify/solidstart package for SolidStart integration, providing a new middleware, comprehensive documentation, and an example project. Significant refactoring was performed on the @fedify/init package to centralize dependency versions in JSON files and migrate command execution to the dax library. Feedback highlights the need to update CHANGES.md with missing bug fixes and proper contributor credit, ensure consistency in middleware implementation examples, and move hardcoded dependency versions in the new SolidStart integration logic to the centralized configuration.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 14.87759% with 452 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/init/src/test/server.ts 3.61% 160 Missing ⚠️
packages/init/src/test/port.ts 10.43% 103 Missing ⚠️
packages/init/src/webframeworks/solidstart.ts 12.90% 81 Missing ⚠️
packages/init/src/test/lookup.ts 32.14% 57 Missing ⚠️
packages/init/src/action/utils.ts 40.00% 12 Missing ⚠️
packages/init/src/webframeworks/hono.ts 8.33% 11 Missing ⚠️
packages/init/src/webframeworks/elysia.ts 9.09% 10 Missing ⚠️
packages/init/src/webframeworks/astro.ts 10.00% 9 Missing ⚠️
packages/init/src/webframeworks/express.ts 12.50% 7 Missing ⚠️
packages/init/src/lib.ts 75.00% 1 Missing ⚠️
... and 1 more
Files with missing lines Coverage Δ
packages/init/src/const.ts 100.00% <100.00%> (ø)
packages/init/src/webframeworks/const.ts 100.00% <100.00%> (ø)
packages/init/src/webframeworks/mod.ts 100.00% <100.00%> (ø)
packages/init/src/lib.ts 48.38% <75.00%> (ø)
packages/init/src/webframeworks/next.ts 23.40% <50.00%> (ø)
packages/init/src/webframeworks/express.ts 16.92% <12.50%> (ø)
packages/init/src/webframeworks/astro.ts 12.79% <10.00%> (ø)
packages/init/src/webframeworks/elysia.ts 13.41% <9.09%> (ø)
packages/init/src/webframeworks/hono.ts 15.85% <8.33%> (ø)
packages/init/src/action/utils.ts 54.71% <40.00%> (-8.92%) ⬇️
... and 4 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

2chanhaeng and others added 23 commits March 29, 2026 01:10
Extract the Fedify middleware for SolidStart into a dedicated package
(@fedify/solidstart), providing a fedifyMiddleware() helper that handles
ActivityPub content negotiation with SolidStart's middleware system.

Uses a WeakMap<Request, Response> internally for 406 response storage,
so users don't need to declare App.RequestEventLocals.

Update the example to use the new package instead of inline middleware.

fedify-dev#476

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a SolidStart section to docs/manual/integration.md with installation
instructions, app.config.ts setup, and middleware usage example.

Add @fedify/solidstart changelog entry under Version 2.1.0, and update
packages/fedify/README.md with JSR link for the new package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SolidStart as a web framework option in the `fedify init` command,
allowing users to scaffold new Fedify+SolidStart projects.  All
boilerplate files (app config, middleware, routes, entry points) are
provided as templates since no suitable degit template exists for
SolidStart.

The lookup test skips the solidstart+deno combination because Deno's
`links` feature does not populate `node_modules/`, which Vite (used by
vinxi) requires for SSR module resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deno import maps use exact string matching, so the base
"@solidjs/start" entry does not resolve subpath specifiers like
"@solidjs/start/config" or "@solidjs/start/server".  This adds
explicit mappings for all subpaths used by the generated template
files and @fedify/solidstart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidate lookup-test-only exclusions into a single pattern-based rule table so framework-wide and combination-specific bans follow the same matching logic. This keeps the supported-option checks unchanged while making the temporary lookup exclusions easier to maintain.

Add regression tests for lookup case parsing and wildcard-based filtering.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@dahlia dahlia self-assigned this Mar 29, 2026
@dahlia
Copy link
Copy Markdown
Member

dahlia commented Mar 29, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3c746fd88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

This PR is trying to address three separate issues at once: SolidStart integration, the Express host-resolution fix, and the fedify init refactor/test changes. That makes review, testing, backporting, and potential rollback much harder than necessary.

For future work, please split unrelated changes into separate PRs, ideally one PR per issue or per coherent change set. Smaller PRs are much easier to review and merge safely.

This is especially important here because features and bug fixes may need different review, testing, and backport paths.


function fromERequest(req: ERequest): Request {
const url = `${req.protocol}://${req.host ?? req.header("Host")}${req.url}`;
const url = `${req.protocol}://${req.header("Host")}${req.url}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

req.header("Host") always uses the raw Host header, so this breaks deployments that sit behind a reverse proxy and rely on Express's trust proxy handling. If a proxied request arrives with a public X-Forwarded-Host, Fedify will reconstruct the request URL with the proxy's internal host instead of the external origin, which can break actor URLs and request/signature matching for federation endpoints.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How about update version of Express to 5.x? In 5.x, req.host is redesigned to return the full host with port while respecting trust proxy and X-Forwarded-Host.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, okay. The existing code seems to already depend on Express 5.x… However, still it's worked with Express 4.x when there's no port number in the Host/X-Forwarded-Host, right? I think we should still support both Express 4.x and 5.x, with noticing that it won't work if you use Express 4.x behind the reverse proxy with some port number in the docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e534dca!

Copy link
Copy Markdown
Contributor Author

@2chanhaeng 2chanhaeng left a comment

Choose a reason for hiding this comment

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

This PR is trying to address three separate issues at once: SolidStart integration, the Express host-resolution fix, and the fedify init refactor/test changes. That makes review, testing, backporting, and potential rollback much harder than necessary.

For future work, please split unrelated changes into separate PRs, ideally one PR per issue or per coherent change set. Smaller PRs are much easier to review and merge safely.

This is especially important here because features and bug fixes may need different review, testing, and backport paths.

Yes, I agree. You're right. But as I was working, I kept finding more things to fix. "I'll just do this one thing", "Just one more thing", but then the commits got all tangled up so I strugged to figure out how to split it up for the PR. I'll be more careful next time.

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

Labels

component/build Build system and packaging component/cli CLI tools related component/federation Federation object related component/integration Web framework integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto update fedify init dependency versions Assign random port number while test-init

3 participants