Skip to content

Commit eb7df50

Browse files
Fix cloudflare workers-types usage (#140)
Co-authored-by: Petr Heinz <[email protected]>
1 parent 47b3d14 commit eb7df50

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

packages/edge/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@
4040
"url": "https://github.com/logtail/logtail-js/issues"
4141
},
4242
"dependencies": {
43-
"@cloudflare/workers-types": "^4.20230904.0",
4443
"@logtail/core": "^0.5.6",
4544
"@logtail/types": "^0.5.6",
4645
"@msgpack/msgpack": "^2.5.1",
4746
"@types/stack-trace": "^0.0.33",
4847
"minimatch": "^9.0.5",
4948
"stack-trace": "0.0.10"
5049
},
50+
"devDependencies": {
51+
"@cloudflare/workers-types": "^4.20230904.0"
52+
},
53+
"peerDependencies": {
54+
"@cloudflare/workers-types": "^4.20230904.0"
55+
},
5156
"gitHead": "0f816cacc21b352576a5707741f9151aa1481041"
5257
}

packages/edge/src/edge.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ILogtailLog, LogLevel } from "@logtail/types";
33
import { Edge } from "./edge";
44

55
import { Mock } from "jest-mock";
6-
import { ExecutionContext } from "@cloudflare/workers-types";
6+
import type { ExecutionContext } from "@cloudflare/workers-types";
77

88
addEventListener("fetch", (event) => {
99
console.log(event);
@@ -117,7 +117,7 @@ describe("edge tests", () => {
117117
const edgeWithCtx = edge.withExecutionContext({
118118
waitUntil() {},
119119
passThroughOnException() {},
120-
} as ExecutionContext);
120+
} as unknown as ExecutionContext);
121121

122122
edgeWithCtx.log(message);
123123
edgeWithCtx.info(message);

packages/edge/src/edge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { encode } from "@msgpack/msgpack";
33
import { Context, ILogLevel, ILogtailLog, ILogtailEdgeOptions, LogLevel } from "@logtail/types";
44
import { Base } from "@logtail/core";
55

6-
import { ExecutionContext } from "@cloudflare/workers-types";
6+
import type { ExecutionContext } from "@cloudflare/workers-types";
77

88
import { getStackContext } from "./context";
99
import { EdgeWithExecutionContext } from "./edgeWithExecutionContext";

packages/edge/src/edgeWithExecutionContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Context, ILogLevel, ILogtailLog } from "@logtail/types";
22

3-
import { ExecutionContext } from "@cloudflare/workers-types";
3+
import type { ExecutionContext } from "@cloudflare/workers-types";
44

55
import { Edge } from "./edge";
66

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@
302302
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
303303

304304
"@cloudflare/workers-types@^4.20230904.0":
305-
version "4.20240620.0"
306-
resolved "https://registry.yarnpkg.com/@cloudflare/workers-types/-/workers-types-4.20240620.0.tgz#1e996c0b81a1dab392f0292bea036fd7bb3b73f3"
307-
integrity sha512-CQD8YS6evRob7LChvIX3gE3zYo0KVgaLDOu1SwNP1BVIS2Sa0b+FC8S1e1hhrNN8/E4chYlVN+FDAgA4KRDUEQ==
305+
version "4.20250719.0"
306+
resolved "https://registry.yarnpkg.com/@cloudflare/workers-types/-/workers-types-4.20250719.0.tgz#f84eda1416f30768a77f710780a4eb3fdd197d54"
307+
integrity sha512-tSc2FM2QPWA8ZmDniQXz+4qVKuf8zrwVwqlkXxxGBsQHxTpcukuMibYcYWxwonzbzK7YzSug+iena2F8gGOuOw==
308308

309309
"@colors/[email protected]", "@colors/colors@^1.6.0":
310310
version "1.6.0"

0 commit comments

Comments
 (0)