Skip to content

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Jan 12, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feat: migration to fastify-fusion framework

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
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.63%. Comparing base (f2d9a26) to head (77a4d15).

Files with missing lines Patch % Lines
src/mock-http.ts 76.47% 2 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Cover the helmet: false branch in fastify-fusion configuration.
Copy link

@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: 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".

claude and others added 4 commits January 12, 2026 22:12
…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)
@jaredwray jaredwray closed this Jan 13, 2026
@jaredwray jaredwray deleted the claude/fastify-fusion-migration-plan-5XFKF branch January 13, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants