Refactors to simplify the FS proxy implementation #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes two major bugs in the prior implementation:
CWD "bleed through"
Prior to these changes the various FS APIs that are wrapped do not properly scope requests to the input source directories.
For example, given this directory structure:
If the current working directory is the directory above, the following returns the incorrect result:
If ran from a working directory that did not have a
foo/
folder, it would return the correct result.References:
broccoli-funnel
operation broccoli-funnel#136Broken "last one wins" semantics
Prior to these changes when using
existsSync
,lstatSync
, orstatSync
would only work if the first argument tonew FSMerger()
contained the file in question. Breaking both the fundamental purpose of this library and the "last one wins" semantics.TODO:
fullPath = relativePath
inhandleFSOperation
(this will "Fix" the bleed through issue, but causes knock on failures)