chore: upgrade to node 24 and read app version from workspace root
- base the docker image on node:24-slim and require node >=24 via engines in the root package.json - read app name and version from the workspace root package.json for config, swagger, startup log and mcp server info; drop the server workspace version - bind test http servers to 127.0.0.1 so tests pass in containers without ipv6 loopback - bump version to 1.19.1
This commit is contained in:
1 parent
d1e16f0386
commit
2afa07902e
13 files changed
+105
-20
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
import { appPackage } from "../src/common/app-package";
|
||||
import { validateAppConfig } from "../src/config/app.config";
|
||||
|
||||
describe("appPackage", () => {
|
||||
const root = JSON.parse(
|
||||
fs.readFileSync(path.resolve(__dirname, "../../package.json"), "utf8"),
|
||||
) as { name: string; version: string; workspaces: string[] };
|
||||
|
||||
it("reads name and version from the workspace root package.json", () => {
|
||||
expect(root.workspaces).toContain("server");
|
||||
expect(appPackage()).toEqual({ name: root.name, version: root.version });
|
||||
});
|
||||
|
||||
it("feeds APP_NAME and APP_VERSION", () => {
|
||||
const config = validateAppConfig({});
|
||||
expect(config.APP_NAME).toBe(root.name);
|
||||
expect(config.APP_VERSION).toBe(root.version);
|
||||
});
|
||||
});
|
||||
@@ -58,7 +58,7 @@ describe("Exec Context File Methods Integration Tests", () => {
|
||||
|
||||
// Start a test HTTP server for downloadFile tests
|
||||
testServer = await createTestServer();
|
||||
testServerUrl = `http://localhost:${(testServer.address() as AddressInfo).port}`;
|
||||
testServerUrl = `http://127.0.0.1:${(testServer.address() as AddressInfo).port}`;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -94,7 +94,9 @@ describe("Exec Context File Methods Integration Tests", () => {
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(0, "localhost", () => {
|
||||
// Explicit IPv4: "localhost" may bind ::1, which is unreachable in some
|
||||
// containers (e.g. Docker without IPv6)
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
resolve(server);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("McpController", () => {
|
||||
|
||||
// Start a test HTTP server for downloadFile tests
|
||||
testServer = await createTestServer();
|
||||
testServerUrl = `http://localhost:${(testServer.address() as AddressInfo).port}`;
|
||||
testServerUrl = `http://127.0.0.1:${(testServer.address() as AddressInfo).port}`;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -78,7 +78,9 @@ describe("McpController", () => {
|
||||
}
|
||||
});
|
||||
|
||||
server.listen(0, "localhost", () => {
|
||||
// Explicit IPv4: "localhost" may bind ::1, which is unreachable in some
|
||||
// containers (e.g. Docker without IPv6)
|
||||
server.listen(0, "127.0.0.1", () => {
|
||||
resolve(server);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user