fastify / fastify/fastify-websocket
`@types/ws` is missing which results in loosing typing withing handler
- Dominant language
- JavaScript
- Stars
- 468
- Forks
- 84
- PR merge metrics
- No merged PRs in 30d
Description
### Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the bug has not already been reported
### Fastify version
4.27.0
### Plugin version
10.0.1
### Node.js version
20.12.2
### Operating system
Windows
### Operating system version (i.e. 20.04, 11.3, 10)
10
### Description
When using this plugin with TypeScript the socket within the handler isn't typed correctly because it reexports `WebSocket.WebSocket` from `ws` which isn't listed as a dependency.
```
app.get('/new-status-route', {websocket: true}, async (socket, req) => {
// socket is any instead of WebSocket.WebSocket
```
Therefore it's necessary to install it additionally.
I think the typical solution would be listing it in `dependencies` rathern than `devDependencies`.
### Link to code that reproduces the bug
_No response_
### Expected Behavior
The plugin also installs `@types/ws` which leads to the correct type of `socket` within the handler.
Contributor guide
Assessment
This issue has not been assessed yet.