Expose fastfs on the DepencenyGraph instance.
Summary: The FS as seen by an instance of a dependency graph is useful for clients of node-haste. This provides an accessor to fastfs so that the partial view of the filesystem can be queried. I was thinking of splitting out the fastfs creation to outside the constructor but the necessary refactoring doesn't seem worth it. The fastfs is intrinsically tied to the dependency graph and the `DependencyGraph` instance is meant to be a base-class for clients anyway. Both in react-packager and jest we are wrapping it with higher-level client specific containers, Resolver and HasteResolver respectively. public Reviewed By: davidaurelio Differential Revision: D2885217 fb-gh-sync-id: 47a408b2682516bee9d6a4e6c61b9063817aaf22
This commit is contained in:
parent
9506e5afc7
commit
700b848826
|
@ -147,8 +147,8 @@ class DependencyGraph {
|
|||
return this._moduleCache.getModule(entryPath).getDependencies();
|
||||
}
|
||||
|
||||
stat(filePath) {
|
||||
return this._fastfs.stat(filePath);
|
||||
getFS() {
|
||||
return this._fastfs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ class Resolver {
|
|||
}
|
||||
|
||||
stat(filePath) {
|
||||
return this._depGraph.stat(filePath);
|
||||
return this._depGraph.getFS().stat(filePath);
|
||||
}
|
||||
|
||||
getModuleForPath(entryFile) {
|
||||
|
|
Loading…
Reference in New Issue