From f4fc79ab683c1162e1f9ed396244e8f4bf1dcee1 Mon Sep 17 00:00:00 2001 From: Christoph Pojer Date: Mon, 1 Feb 2016 16:59:28 -0800 Subject: [PATCH] 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 --- .../src/DependencyResolver/DependencyGraph/index.js | 4 ++-- react-packager/src/Resolver/index.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/react-packager/src/DependencyResolver/DependencyGraph/index.js b/react-packager/src/DependencyResolver/DependencyGraph/index.js index 6fda8d93..ed09f91a 100644 --- a/react-packager/src/DependencyResolver/DependencyGraph/index.js +++ b/react-packager/src/DependencyResolver/DependencyGraph/index.js @@ -147,8 +147,8 @@ class DependencyGraph { return this._moduleCache.getModule(entryPath).getDependencies(); } - stat(filePath) { - return this._fastfs.stat(filePath); + getFS() { + return this._fastfs; } /** diff --git a/react-packager/src/Resolver/index.js b/react-packager/src/Resolver/index.js index 4f3444ec..1822eb99 100644 --- a/react-packager/src/Resolver/index.js +++ b/react-packager/src/Resolver/index.js @@ -110,7 +110,7 @@ class Resolver { } stat(filePath) { - return this._depGraph.stat(filePath); + return this._depGraph.getFS().stat(filePath); } getModuleForPath(entryFile) {