Add SolidStart integration and refactor fedify init internals#652
Add SolidStart integration and refactor fedify init internals#6522chanhaeng wants to merge 29 commits intofedify-dev:mainfrom
fedify init internals#652Conversation
There was a problem hiding this comment.
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.
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>
|
@codex review |
There was a problem hiding this comment.
💡 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".
dahlia
left a comment
There was a problem hiding this comment.
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.
packages/express/src/index.ts
Outdated
|
|
||
| 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}`; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
2chanhaeng
left a comment
There was a problem hiding this comment.
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.
Summary
Add
@fedify/solidstartpackage for SolidStart integration and overhaulfedify initinternals: centralize dependency versions, replacerunSubCommandwith@david/dax, and improve test infrastructure.Related issue
test-init#591fedify initdependency versions #637Changes
packages/solidstart: Addpackages/solidstart/providingfedifyMiddleware()for SolidStart's middleware system. (by @dodok8)packages/init:scripts/update_init_deps.tsto auto-update dependency versions.runSubCommandwith@david/dax.mise test:init.packages/express: Fix bug by replacingreq.hostwithreq.header("Host").packages/astro: Fix bug by adding--no-installfor non-Deno package managers.docs: Add docs about SolidStart integration. (by @dodok8)examples/solidstart: Add an example app using SolidStart integration. (by @dodok8)Benefits
fedify inittemplates are now centralizedand auto-updatable, reducing manual maintenance.
runSubCommandwith@david/daxsimplifies subprocesshandling and removes custom error classes.
running multiple test apps sequentially.
Additional notes
req.host→req.header("Host")) isindependent of SolidStart but was discovered during integration
testing.