From efa84601d2d67154516158feb971410cfb1f22b6 Mon Sep 17 00:00:00 2001 From: Denis Badurina Date: Thu, 16 Jan 2025 13:37:00 +0100 Subject: [PATCH 1/2] export cts and no cjs for deno --- package.json | 73 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 127c2aad..9bb8d85d 100644 --- a/package.json +++ b/package.json @@ -17,41 +17,72 @@ "main": "dist/index.js", "exports": { ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.cjs", - "import": "./dist/index.js", + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + }, + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, "browser": "./dist/client.js" }, "./client": { - "types": "./dist/client.d.ts", - "require": "./dist/client.cjs", - "import": "./dist/client.js", + "require": { + "types": "./dist/client.d.cts", + "default": "./dist/client.cjs" + }, + "import": { + "types": "./dist/client.d.ts", + "default": "./dist/client.js" + }, "browser": "./dist/client.js" }, "./use/ws": { - "types": "./dist/use/ws.d.ts", - "require": "./dist/use/ws.cjs", - "import": "./dist/use/ws.js" + "require": { + "types": "./dist/use/ws.d.cts", + "default": "./dist/use/ws.cjs" + }, + "import": { + "types": "./dist/use/ws.d.ts", + "default": "./dist/use/ws.js" + } }, "./use/uWebSockets": { - "types": "./dist/use/uWebSockets.d.ts", - "require": "./dist/use/uWebSockets.cjs", - "import": "./dist/use/uWebSockets.js" + "require": { + "types": "./dist/use/uWebSockets.d.cts", + "default": "./dist/use/uWebSockets.cjs" + }, + "import": { + "types": "./dist/use/uWebSockets.d.ts", + "default": "./dist/use/uWebSockets.js" + } }, "./use/@fastify/websocket": { - "types": "./dist/use/@fastify/websocket.d.ts", - "require": "./dist/use/@fastify/websocket.cjs", - "import": "./dist/use/@fastify/websocket.js" + "require": { + "types": "./dist/use/@fastify/websocket.d.cts", + "default": "./dist/use/@fastify/websocket.cjs" + }, + "import": { + "types": "./dist/use/@fastify/websocket.d.ts", + "default": "./dist/use/@fastify/websocket.js" + } }, "./use/bun": { - "types": "./dist/use/bun.d.ts", - "require": "./dist/use/bun.cjs", - "import": "./dist/use/bun.js" + "require": { + "types": "./dist/use/bun.d.cts", + "default": "./dist/use/bun.cjs" + }, + "import": { + "types": "./dist/use/bun.d.ts", + "default": "./dist/use/bun.js" + } }, "./use/deno": { - "types": "./dist/use/deno.d.ts", - "require": "./dist/use/deno.cjs", - "import": "./dist/use/deno.js" + "import": { + "types": "./dist/use/deno.d.ts", + "default": "./dist/use/deno.js" + } }, "./package.json": "./package.json" }, From 799422c4d211c7bafb04a07bad58d4eecec9c2fb Mon Sep 17 00:00:00 2001 From: Denis Badurina Date: Thu, 16 Jan 2025 13:38:47 +0100 Subject: [PATCH 2/2] changesets --- .changeset/itchy-hounds-remain.md | 7 +++++++ .changeset/little-toes-cheer.md | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/itchy-hounds-remain.md create mode 100644 .changeset/little-toes-cheer.md diff --git a/.changeset/itchy-hounds-remain.md b/.changeset/itchy-hounds-remain.md new file mode 100644 index 00000000..4d51e885 --- /dev/null +++ b/.changeset/itchy-hounds-remain.md @@ -0,0 +1,7 @@ +--- +'graphql-ws': patch +--- + +Remove exports for CommonJS for Deno exports in package.json + +[Deno supports ECMAScript modules exclusively.](https://docs.deno.com/runtime/fundamentals/modules/) diff --git a/.changeset/little-toes-cheer.md b/.changeset/little-toes-cheer.md new file mode 100644 index 00000000..fd4b9364 --- /dev/null +++ b/.changeset/little-toes-cheer.md @@ -0,0 +1,5 @@ +--- +'graphql-ws': patch +--- + +Define exports for CommonJS TypeScript definitions in package.json