Skip to content

Commit a86dfa7

Browse files
ci: use Node.js 24
Reference: https://github.com/nodejs/Release
1 parent d38fbda commit a86dfa7

File tree

6 files changed

+41
-21
lines changed

6 files changed

+41
-21
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
node-version:
20-
- 14
21-
- 20
20+
- 24
2221

2322
services:
2423
postgres:

lib/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { encode, decode } from "@msgpack/msgpack";
2-
import { Pool } from "pg";
2+
import { type Pool } from "pg";
33
import { ClusterAdapterWithHeartbeat, MessageType } from "socket.io-adapter";
44
import type {
55
ClusterAdapterOptions,
@@ -8,8 +8,9 @@ import type {
88
Offset,
99
ServerId,
1010
} from "socket.io-adapter";
11+
import createDebug from "debug";
1112

12-
const debug = require("debug")("socket.io-postgres-adapter");
13+
const debug = createDebug("socket.io-postgres-adapter");
1314

1415
const hasBinary = (obj: any, toJSON?: boolean): boolean => {
1516
if (!obj || typeof obj !== "object") {
@@ -102,7 +103,7 @@ export function createAdapter(
102103
const channelToAdapters = new Map<string, PostgresAdapter>();
103104
let isConnectionInProgress = false;
104105
let client: any;
105-
let cleanupTimer: NodeJS.Timer;
106+
let cleanupTimer: NodeJS.Timeout;
106107

107108
const scheduleReconnection = () => {
108109
const reconnectionDelay = Math.floor(2000 * (0.5 + Math.random()));

package-lock.json

Lines changed: 27 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"devDependencies": {
3232
"@types/expect.js": "^0.3.29",
3333
"@types/mocha": "^10.0.1",
34-
"@types/node": "^14.14.7",
34+
"@types/node": "^24.7.0",
3535
"expect.js": "0.3.1",
3636
"mocha": "^10.2.0",
3737
"nyc": "^15.1.0",

test/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { createServer } from "http";
22
import { Server, Socket as ServerSocket } from "socket.io";
33
import { io as ioc, Socket as ClientSocket } from "socket.io-client";
4-
import expect = require("expect.js");
5-
import { createAdapter } from "../lib";
4+
import expect from "expect.js";
5+
import { createAdapter } from "../lib/index.ts";
66
import type { AddressInfo } from "net";
7-
import { times, sleep, shouldNotHappen } from "./util";
8-
import { Pool } from "pg";
7+
import { times, sleep, shouldNotHappen } from "./util.ts";
8+
import pg from "pg";
99

1010
const NODES_COUNT = 3;
1111

@@ -19,7 +19,7 @@ describe("@socket.io/postgres-adapter", () => {
1919
servers = [];
2020
serverSockets = [];
2121
clientSockets = [];
22-
pool = new Pool({
22+
pool = new pg.Pool({
2323
user: "postgres",
2424
host: "localhost",
2525
database: "postgres",

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"allowJs": false,
55
"target": "es2017",
66
"module": "commonjs",
7-
"declaration": true
7+
"declaration": true,
8+
"skipLibCheck": true,
9+
"esModuleInterop": true
810
},
911
"include": [
1012
"./lib/**/*"

0 commit comments

Comments
 (0)