-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor how symlinks are discovered in local-cli, support scoped modules #15776
Conversation
path.join(getProjectPath(), 'node_modules'), | ||
roots | ||
) | ||
const resolveSymlinksForRoots = roots => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds support for resolving symlinks in multiple roots, rather than just the project path
@@ -0,0 +1,368 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy of the fs mock from metro-bundler. Adds exists
/existsSync
+ readlink
/readlinkSync
support.
@facebook-github-bot label Core Team @facebook-github-bot large-pr Generated by 🚫 dangerJS |
Flow error from Circle is unrelated. Was introduced 2 days ago here: |
@skevy tomorrow we are going to release a new version of |
I'll try to make progress on that today/tomorrow |
This PR refactors the symlink finding logic in order to support nested symlinked modules as well as scoped NPM modules.
9690dad
to
be2ffa9
Compare
Hi @jeanlauliac any updates here? |
@jeanlauliac has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup looks good to me, thank you! I'll try to merge today. Sorry for the delay, I'll try to be more reactive on PRs here.
|
||
console.log( | ||
`Scanning folders for symlinks in ${nodeModuleRoot} (${timeEnd - | ||
timeStart}ms)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we'd want to go through a reporter for any output, not print to the console directly. But I'm okay with shipping it like so and we can improve later :)
@skevy lemme know if that looks all good 😄 |
…ules Summary: This PR refactors the symlink finding logic in local-cli in order to support nested symlinked modules as well as symlinked scoped NPM modules. Run tests, or try project with `npm link`'ed or `yarn link`'ed dependencies. Closes #15776 Reviewed By: cpojer Differential Revision: D5823008 Pulled By: jeanlauliac fbshipit-source-id: f2daeceef37bed2f8a136a0a5918730f9832884c
…ules Summary: This PR refactors the symlink finding logic in local-cli in order to support nested symlinked modules as well as symlinked scoped NPM modules. Run tests, or try project with `npm link`'ed or `yarn link`'ed dependencies. Closes facebook/react-native#15776 Reviewed By: cpojer Differential Revision: D5823008 Pulled By: jeanlauliac fbshipit-source-id: f2daeceef37bed2f8a136a0a5918730f9832884c
This PR refactors the symlink finding logic in local-cli in order to support nested symlinked modules as well as symlinked scoped NPM modules.
Test Plan
Run tests, or try project with
npm link
'ed oryarn link
'ed dependencies.