Upgrade to Fastify 5

Proprietary

Chains the earlier majors: a project several majors behind needs only this recipe, and upgrades the dependencies once, straight to 5.x, so no intermediate version has to resolve. Upgrade a Fastify 4 application to Fastify 5. Rewrites the removed reply.getResponseTime(), request.connection and the reply.redirect(statusCode, url) argument order (ReplaceRemovedFastifyApis), then upgrades fastify and fastify-plugin to 5.x in package.json. Fastify 5 requires Node.js 20 or later. Upgrades the @fastify/* plugins that publish a major for Fastify 5 (cors 10, helmet 12, jwt 9, static 8, swagger 9, swagger-ui 5, cookie 10, rate-limit 10, multipart 9, websocket 11 and others) with it. Not done by this recipe: the @fastify/* plugins not listed and the fastify-* plugins, which have their own versions and need the ones that declare support for Fastify 5, TypeScript 5 or later, which the Fastify 5 type declarations need, the full JSON schema requirement for querystring, params and body shorthand, useSemicolonDelimiter, and raising engines.node.

org.openrewrite.nodejs.migrate.fastify.UpgradeToFastify5
mod run . --recipe=org.openrewrite.nodejs.migrate.fastify.UpgradeToFastify5

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.