I'm making a js library and using git for version control. Say it's located at mylib/lib.js. Inside my library directory, I have a submodule for an example program that I'm developing alongside that library, say mylib/example/example.js. Now, the question is: how should the example program access the library?
If I use a relative path to go up and grab the js file (like ../lib.js), that means that the example isn't standalone; the only way to run it would be to clone the library. Then there's really no point to have it be a submodule at all.
If I copy lib.js into the example directory, then I'm violating DRY and I'd have to copy it every time it gets updated (which is going to be a lot).
Is there a better solution to this problem?