Skip to content

Commit ea31859

Browse files
ci: test with Deno v2
1 parent 0b0616c commit ea31859

File tree

10 files changed

+16
-14
lines changed

10 files changed

+16
-14
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: ''
55
labels: 'to triage'
66
assignees: ''
7-
87
---
98

109
**Describe the bug**

.github/ISSUE_TEMPLATE/feature_request.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: 'enhancement'
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/PULL_REQUEST_TEMPLATE/bug_fix.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: A fix for a known issue
44
title: ''
55
labels: 'to triage'
66
assignees: ''
7-
87
---
98

109
Related issue or discussion:

.github/PULL_REQUEST_TEMPLATE/feature.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: A new awesome feature
44
title: ''
55
labels: 'enhancement'
66
assignees: ''
7-
87
---
98

109
Related issue or discussion:

.github/workflows/ci.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313
strategy:
1414
matrix:
1515
deno-version:
16-
- 1.25.2
16+
- 1.x
17+
- 2.x
1718

1819
services:
1920
redis:
@@ -31,7 +32,7 @@ jobs:
3132
uses: actions/checkout@v2
3233

3334
- name: Use Deno ${{ matrix.deno-version }}
34-
uses: denolib/setup-deno@v2
35+
uses: denoland/setup-deno@v2
3536
with:
3637
deno-version: ${{ matrix.deno-version }}
3738

packages/engine.io/lib/server.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ export class Server extends EventEmitter<
167167

168168
try {
169169
await this.verify(req, url);
170-
} catch ({ code, context }) {
170+
} catch (err) {
171+
const { code, context } = err as {
172+
code: ERROR_CODES;
173+
context: Record<string, unknown>;
174+
};
171175
const message = ERROR_MESSAGES.get(code)!;
172176
this.emitReserved("connection_error", {
173177
req,

packages/socket.io/lib/namespace.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,14 @@ export class Namespace<
258258
try {
259259
await this.run(socket);
260260
} catch (err) {
261+
const e = err as Error & { data: string };
261262
getLogger("socket.io").debug(
262263
"[namespace] middleware error, sending CONNECT_ERROR packet to the client",
263264
);
264265
socket._cleanup();
265266
return socket._error({
266-
message: err.message || err,
267-
data: err.data,
267+
message: e.message || err as string,
268+
data: e.data,
268269
});
269270
}
270271

packages/socket.io/lib/parent-namespace.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ParentNamespace<
3232
// };
3333
}
3434

35-
public emit<Ev extends EventNames<EmitEvents>>(
35+
override emit<Ev extends EventNames<EmitEvents>>(
3636
ev: Ev,
3737
...args: EventParams<EmitEvents, Ev>
3838
): boolean {

packages/socket.io/lib/server.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export interface ServerOptions {
4545
}
4646

4747
export interface ServerReservedEvents<
48-
ListenEvents,
49-
EmitEvents,
50-
ServerSideEvents,
48+
ListenEvents extends EventsMap,
49+
EmitEvents extends EventsMap,
50+
ServerSideEvents extends EventsMap,
5151
SocketData,
5252
> extends
5353
NamespaceReservedEvents<

vendor/deno.land/x/[email protected]/connection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
BufWriter,
99
} from "./vendor/https/deno.land/std/io/buffer.ts";
1010
import { delay } from "./vendor/https/deno.land/std/async/delay.ts";
11-
type Closer = Deno.Closer;
11+
type Closer = { close: () => void };
1212

1313
export interface Connection {
1414
closer: Closer;

0 commit comments

Comments
 (0)