yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
497 stars 256 forks source link

Why not add "type": "module" in package.json of y-websocket? #128

Open kapv89 opened 1 year ago

kapv89 commented 1 year ago

Checklist

Describe the bug As seen in this repo - https://github.com/kapv89/yjs-scalable-ws-backend/tree/external_api_persistence ... adding "type": "module" to package.json of y-websocket allows y-websocket to be used in node-environment for unit tests. Not sure why this is not done yet by default on this package.

To Reproduce Steps to reproduce the behavior:

  1. Clone https://github.com/kapv89/yjs-scalable-ws-backend/tree/external_api_persistence (the specific branch)
  2. Follow steps in Usage. See tests working fine
  3. In one run, don't follow step#5 in Usage, complete the steps and see the error caused by y-websocket lacking "type": "module"

Expected behavior It should be trivial to use y-websocket in tests of your y-crdt websocket-backend. It's not right now.

Environment Information