Skip to content

feat: add ws entry points and package consumer checks #562

Done

Description

@electrohyun

Problem

#555 defines ws usage and public types. Generated declarations and the actual smocket/ws entry points still need validation outside the repository.

Proposed API

import WebSocket, { WebSocketServer } from 'smocket/ws';
const WebSocket = require('smocket/ws').default;
const { WebSocketServer } = require('smocket/ws');

Generate declarations from the agreed types and connect the ESM/CJS entry points. Verify one packed artifact in independent NodeNext ESM/CJS and Bundler TypeScript consumers, using TS 5.0.2 and TS 6, with and without Node types. Include Buffer assignments and method access. CommonJS intentionally uses .default rather than ws's direct constructor export.

This follows #567 and belongs to #538. Reuse its consumer checks against the actual packed implementation once the required ws constructors are available. ws connection and messaging behavior remain in the implementation issues.

Socket.IO behavior

Keep existing Socket.IO entry points and the root package's dependency policy unchanged. Use real ws as the reference for supported constructor calls and type usage, with the explicit CommonJS export difference above.

Scope check

  • This is not reconnection, transport fallback, heartbeat, Redis multi-server, or binary encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions