Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define exports for CommonJS TypeScript definitions in package.json #618

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/itchy-hounds-remain.md
Original file line number Diff line number Diff line change
@@ -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/)
5 changes: 5 additions & 0 deletions .changeset/little-toes-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphql-ws': patch
---

Define exports for CommonJS TypeScript definitions in package.json
73 changes: 52 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Loading