-
Notifications
You must be signed in to change notification settings - Fork 193
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
#172 - Support alternative fs implementations. #173
Conversation
Codecov Report
@@ Coverage Diff @@
## master #173 +/- ##
==========================================
+ Coverage 92.98% 92.99% +0.01%
==========================================
Files 32 32
Lines 1140 1142 +2
Branches 262 263 +1
==========================================
+ Hits 1060 1062 +2
Misses 80 80
Continue to review full report at Codecov.
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Need add tests |
I'm typically a dotnet developer, node environment is failry new to me. I can run tests via mocha etc. In terms of adding a new test, any guidance as to where I should add it? Do I create a new file for this issue under the tests directoy? Or should I append a new test to an existing file somewhere? Thanks |
Create new file (example of test https://github.com/webpack/enhanced-resolve/blob/master/test/CachedInputFileSystem.js), test existing method with and without own fs |
I am seeing a lot of test failures on windows, i'll log under a seperate issue. |
@dazinator yep, we need fix their in separate issue, anyway feel free to send a PR with fixes too, a lot of developers work under linux so tests can be broken in some cases |
Have added some tests. |
I think this should meet the quality bar now but let me know if you need me to do anything further! |
test/NodeJsInputFileSystem.js
Outdated
beforeEach(function() {}); | ||
afterEach(function() { | ||
//fs.purge(); | ||
}); |
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.
Need remove this
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.
All good, one note
@dazinator Thanks for your update. I labeled the Pull Request so reviewers will review it again. @evilebottnawi Please review the new changes. |
@evilebottnawi Have made change requested. |
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.
I don't see why this change is needed. You can just write your own InputFileSystem
class for your alternative filesystem. There is no major logic in NodeJsInputFileSystem
.
@sokra I did consider that. I guess it comes down to a choice. If this class is changed to allow the 'fs' it works with to be injected, then it saves having to create essentially a duplicate. I thought that creating a custom input file system could then be reserved for when:
I guess my thinking is that I wanted to save a consumer from having to create a custom input file system when neither of the above were true.. Essentially widening the responsibility of the class from: "This class is responsible for working with node's fs for file access' to: 'This class is responsible for working with an fs for file access" |
Any further action required from me here or is this awaiting a decision |
The name is NodeJsFileSystem. It doesn't have a lot of logic. I don't think it makes sense to change this. sorry, but thanks for the PR anyway. |
Ok thanks for considering. I'll create a duplicate class. |
@sokra |
Allow an alternative fs implementation to be used, overriding the default based on
graceful-fs