Skip to content

Declare public type dependencies#358

Closed
Baijack-star wants to merge 1 commit into
honojs:mainfrom
Baijack-star:fix-ws-public-type-dependency
Closed

Declare public type dependencies#358
Baijack-star wants to merge 1 commit into
honojs:mainfrom
Baijack-star:fix-ws-public-type-dependency

Conversation

@Baijack-star
Copy link
Copy Markdown

Summary

  • move @types/ws into dependencies because the published root declarations import from ws
  • move @types/node into dependencies because the published declarations also expose Node built-in server/request types
  • update bun.lock accordingly

Verification

  • Reproduced the current published package failure in a clean consumer project with only typescript, hono, and @hono/node-server@2.0.3 installed:
    • npx tsc -p tsconfig.json reports TS2307: Cannot find module 'ws' or its corresponding type declarations, plus missing Node type declarations.
  • Packed this branch locally and installed it into a clean consumer project with only typescript, hono, and the local @hono/node-server tarball installed:
    • npx tsc -p tsconfig.json passes.
  • bun run build passes, including publint.
  • git diff --check passes.

Note: I also tried bun test --run, but the local full suite fails/hangs in unrelated Bun runtime HTTP/WebSocket cases on this machine (for example readWithoutBlocking > should return the body for large text and several abort/WebSocket timeout cases). The packaging/type-surface repro above is scoped to this issue.

I used an AI coding assistant to prepare this patch.

Fixes #353

@alex-kinokon
Copy link
Copy Markdown

Don’t think it’s a great idea to pin the Node.js version in a direct dependency.

@yusukebe
Copy link
Copy Markdown
Member

This PR is not needed since #359 has been merged.

@yusukebe yusukebe closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public declaration files reference undeclared dependency ws

3 participants