-
Notifications
You must be signed in to change notification settings - Fork 2
feat: migration to fastify-fusion framework #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add comprehensive migration plan for moving mockhttp to use fastify-fusion, which consolidates 7 dependencies into a single package with sensible defaults. Key points: - Remove 7 dependencies: @fastify/helmet, @fastify/rate-limit, @fastify/static, @fastify/swagger, @fastify/swagger-ui, pino, pino-pretty - Add fastify-fusion as replacement - Keep 6 dependencies: @fastify/cookie, @scalar/api-reference, detect-port, fastify, hookified, html-escaper - Gain CORS and caching features as opt-in extras - Detailed step-by-step migration instructions included
Replace manual Fastify plugin registration with fastify-fusion's fuse() function, consolidating common plugins and reducing dependency count. Changes: - Add fastify-fusion for helmet, rate-limit, static, and logging - Remove fastify-config.ts (logging now handled by fastify-fusion) - Simplify swagger.ts to export only the description - Update mock-http.ts to use fuse() for plugin registration - Keep @fastify/swagger and @fastify/swagger-ui for custom Scalar UI Dependencies removed (handled by fastify-fusion): - @fastify/helmet - @fastify/rate-limit - pino - pino-pretty All 346 tests pass with 100% function/line coverage.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #116 +/- ##
===========================================
- Coverage 100.00% 99.63% -0.37%
===========================================
Files 41 40 -1
Lines 1108 1105 -3
Branches 194 198 +4
===========================================
- Hits 1108 1101 -7
- Misses 0 2 +2
- Partials 0 2 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cover the helmet: false branch in fastify-fusion configuration.
There was a problem hiding this 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: c8933a1ff0
ℹ️ 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".
…tion Fastify logging must be enabled when creating the instance - it cannot be enabled afterward. Move logging configuration from fuse() options back to Fastify() constructor to restore observability.
Remove @fastify/swagger and @fastify/swagger-ui dependencies - now handled by fastify-fusion's openApi option. Configure docsRoutePath to "/docs/ui" to avoid conflict with custom Scalar homepage at "/". Dependencies now handled by fastify-fusion: - @fastify/helmet - @fastify/rate-limit - @fastify/swagger - @fastify/swagger-ui - pino / pino-pretty Net reduction: 6 dependencies removed, 1 added (fastify-fusion)
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feat: migration to fastify-fusion framework