Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Configurable symbolic link following. #19

Closed
wants to merge 1 commit into from

Conversation

jacobstr
Copy link

Adds a followSymlink option to the FileFinder. Potentially useful when traversing
node_modules folders contain symbolic links - e.g. due to npm link.

My personal use case is a bit messy to explain, see:

https://github.com/mover-io/jestsymlink

This might not be the best way to address the issue. It allows jest to traverse inside of a node_modules/symlinked_folder to populate the ResourceMap it while generating it's normalized id's.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

@jacobstr
Copy link
Author

This is a large api change unfortunately. Adding another parameter to find and findNative would require
I put effort into keeping this backwards compatible. The find / findNative methods are are exposed directly and those have been wrapped up to make them behave as before.

this.extensions = options && options.extensions || ['.js'];
this.ignore = options && options.ignore || null;
this.useNative = options && options.useNative || false;
this.followSymlinks = options && options.followSymlinks || true;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should default to false for backwards compatibility. Was testing this alongside jest.

@jacobstr
Copy link
Author

Related: jestjs/jest#219

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@jacobstr jacobstr force-pushed the master branch 2 times, most recently from 354c08d to 05c7628 Compare January 23, 2015 20:08
Adds a followSymlink option to the FileFinder. Potentially useful when traversing
node_module folders that contain symbolic links - e.g. due to `npm link`.
@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@cpojer
Copy link

cpojer commented Nov 16, 2015

We rewrote node-haste with a new implementation. Please feel free to reopen this pull request with a version against the new node-haste if you believe this issue still persists.

jest 0.8.0 will be launched with the new implementation of node-haste towards the end of the year. The integration work can be tracked in jestjs/jest#599

@cpojer cpojer closed this Nov 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants