diff --git a/package.json b/package.json index f7924fe4..e910bd23 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "barrelsby": "2.8.1", "lerna": "10.0.0" }, - "packageManager": "pnpm@11.19.0", + "packageManager": "pnpm@11.20.0", "engines": { "node": ">=22" } diff --git a/packages/static-server/package.json b/packages/static-server/package.json index 9d661981..09d0c06e 100644 --- a/packages/static-server/package.json +++ b/packages/static-server/package.json @@ -38,7 +38,7 @@ "@fastify/static": "10.1.2", "@node-cli/logger": "workspace:*", "@node-cli/parser": "workspace:*", - "fastify": "5.11.0", + "fastify": "5.11.2", "fastify-plugin": "6.0.0", "fs-extra": "11.4.0", "kleur": "4.1.5", diff --git a/packages/static-server/src/server.ts b/packages/static-server/src/server.ts index b0315d0c..228235c7 100755 --- a/packages/static-server/src/server.ts +++ b/packages/static-server/src/server.ts @@ -6,7 +6,7 @@ import fastifyCompress from "@fastify/compress"; import fastifyCors from "@fastify/cors"; import fastifyStatic, { FastifyStaticOptions } from "@fastify/static"; import { Logger } from "@node-cli/logger"; -import Fastify from "fastify"; +import Fastify, { FastifyServerOptions } from "fastify"; import fs from "fs-extra"; import kleur from "kleur"; import open from "open"; @@ -28,11 +28,9 @@ if (fs.pathExistsSync(customPath)) { logger.printErrorsAndExit([`Folder ${customPath} does not exist!`], 0); } -const fastifyOptions: { - disableRequestLogging?: boolean; +const fastifyOptions: FastifyServerOptions & { http2?: boolean; https?: any; - logger?: any; } = { disableRequestLogging: true, }; @@ -56,7 +54,13 @@ if (config.flags.http2) { fastifyOptions.https = { key, cert }; } -const fastify = Fastify(fastifyOptions); +/* + * fastify@5.11.2 narrowed its HTTP overloads with `http2?: false`, so an + * options object carrying a `boolean` http2 no longer matches any of them. + * Build the server through the plain HTTP signature - as it has always + * resolved - and let the http2/https options through at runtime. + */ +const fastify = Fastify(fastifyOptions as FastifyServerOptions); if (config.flags.logs) { fastify.register(fastifyLogs); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e79f23e..3ca45b1f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -315,8 +315,8 @@ importers: specifier: workspace:* version: link:../parser fastify: - specifier: 5.11.0 - version: 5.11.0 + specifier: 5.11.2 + version: 5.11.2 fastify-plugin: specifier: 6.0.0 version: 6.0.0 @@ -2523,8 +2523,8 @@ packages: fastify-plugin@6.0.0: resolution: {integrity: sha512-fZOty7z3O7vOliF6d8bHE3wiEh1KcNnKEQensSgTk9C1DvN6nRLS++XVd86v33Hw/8u9Un8A1zDrQ8ujcQDHEg==} - fastify@5.11.0: - resolution: {integrity: sha512-Y/Ecx1yt0hYzrQR+QVLbxaUN8wCX+MQzMevh29r5RRvlOIArmi4+WAXXaGl5Hw5gBr2wduZpZaT3gRCnXoyVgA==} + fastify@5.11.2: + resolution: {integrity: sha512-i/eJG7nXR9OkbFgoX4jFiPOHoRq0rXqDACVAXELh5Fdg6BFBErIVZ8MyibGCwup9Go1pYrxZJ0ogIub8vVdEcQ==} fastq@1.20.1: resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} @@ -6667,7 +6667,7 @@ snapshots: fastify-plugin@6.0.0: {} - fastify@5.11.0: + fastify@5.11.2: dependencies: '@fastify/ajv-compiler': 4.0.5 '@fastify/error': 4.2.0