Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/static-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 9 additions & 5 deletions packages/static-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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,
};
Expand All @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.