yjs / y-prosemirror

ProseMirror editor binding for Yjs
https://demos.yjs.dev/prosemirror/prosemirror.html
MIT License
345 stars 120 forks source link

Repo has implicit dependencies on lib0/y-protocols #25

Closed tommoor closed 4 years ago

tommoor commented 4 years ago

Describe the bug Repo has implicit dependencies on lib0/y-protocols, it's not clear exactly what the requirements are to work on the repo independently.

To Reproduce Steps to reproduce the behavior:

  1. clone repo
  2. run npm install
  3. run npm run dist or npm run debug
  4. Fails with error
[!] Error: Could not load /Users/tom/projects/y-prosemirror/../lib0/testing.js (imported by test/index.js): ENOENT: no such file or directory, open '/Users/tom/projects/y-prosemirror/../lib0/testing.js'

Expected behavior

The repo should be useable and allow for development without additional repos implicitly required. Or, the development instructions should make it clear what the setup should be to allow for local development.

Screenshots

image

Additional context

Working on a fork to add additional functionality

dmonad commented 4 years ago

Hey @tommoor , I double checked, and I don't think that lib0 is imported using a relative path (anymore?).

I certainly do something like that from time to time when I develop new features, and I might have accidentally committed that change. But the current master branch does not use relative paths to lib0: https://github.com/yjs/y-prosemirror/blob/master/test/index.js

Maybe you are on an old branch?

tommoor commented 4 years ago

image

Branch is uptodate, I cloned yesterday. I'd recommend you give it a quick try in a fresh clone location. I agree that I can't find a reference to the relative path in the codebase 🤔

dmonad commented 4 years ago

So sorry about that -.-

So I wrote this bundler plugin that imports from relative positions. I haven't used it in a while, but it should only work when a environment flag is set. Seems I hastily ported the plugin and forgot to set the environment variable.

It is fixed now!