MrLoh/metro-with-symlinks

Doesn't seem to work with scoped packages

Closed this issue · 4 comments

I have several scoped symlinked packages and this doesn't recognize them.

MrLoh commented

Sorry, I'm not very familiar with scoped packages. I'd welcome a PR or at least a reproducible example how to setup a scoped package to test this with. In the issue facebook/metro#1 (comment) there was some indication in the discussion, that scoped packages might not work yet in general until some coming update.

Scoped packages are essentially just subfolders in node_modules. The library currently reads the contents of node_modules and then just checks to see if any of the directories are symlinks.

I'm thinking to make this change, the library should instead load a package.json from the directory the command is being run in. It should pull the dependencies section from the json, get the keys, and then check to see if node_modules/{{dependencyName}} is a symlink, just like it does now.

Implemented in #6. idk how to test it though, advice?

MrLoh commented

Implemented in #6