Add context data tests for @fedify/elysia#969
Conversation
`mise run check-each elysia` failed because Deno could not resolve the bare `elysia` import. The package declares elysia only in `peerDependencies`, which Deno ignores, and no import map listed it. Every type error the task reported traced back to that one unresolved import. This commit includes the following changes: - Added `elysia` to the root deno.json imports, pointing at `npm:elysia@^1.3.8`, the same range as the pnpm catalog. This only affects the development environment: the published package still declares elysia through `peerDependencies`, so nothing changes for users. - Regenerated deno.lock to match. - Switched the `fedify()` signature to `AnyElysia` with an explicit return type. The public API no longer depends on Elysia's internal generics, and TypeScript still links each `federation` to its `contextDataFactory`. Assisted-by: Claude Code:claude-fable-5
This commit includes the following changes: - Added two tests with a minimal fake federation: fedify() calls the context data factory when handling a request, and the factory's return value reaches federation.fetch() as its contextData option. - Added the test and test:bun scripts to package.json because `mise run test-each elysia` did not pick up the new tests without them. The tests now run on Node.js and Bun, the runtimes Elysia targets. Assisted-by: Claude Code:claude-fable-5
✅ Deploy Preview for fedify-json-schema canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe Elysia plugin now uses ChangesElysia integration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Closes #852
Summary
Task 1)
mise run check-each elysiafailed because Deno could not resolve theelysiaimport, so I added anelysiadependency to the root deno.json file.Task 2) I also gave the
fedify()function in./packages/elysia/src/index.tsan explicit type signature, so its public API keeps theTContextDatainference.Task 3) Added tests for issue #852.
for Task 1:

for Task 2:

Test Plan
Tested with the commands below, and all of them passed.
mise run check-each elysiamise run test-each elysiadeno test --allow-all ./packages/elysiabun test ./packages/elysiamise run testAI assistance disclosure: Claude Code (claude-fable-5) helped implement and verify the change.