From cf3ae6c32a358729c0eb303d20df0293e9b1c1e2 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 6 Dec 2016 16:48:18 -0800 Subject: [PATCH] Use absolute paths from repo root Summary: Rather than using relative paths from the build root, this switches all paths to absolute paths from the build root. This makes integration with a lot of tooling easier. Reviewed By: jeanlauliac Differential Revision: D4285474 fbshipit-source-id: 80d20e0f6dc61a310e72112b9654628bff81a4f0 --- .../src/ModuleGraph/node-haste/node-haste.flow.js | 1 - .../react-packager/src/ModuleGraph/node-haste/node-haste.js | 1 - .../src/node-haste/DependencyGraph/HasteMap.js | 5 ----- 3 files changed, 7 deletions(-) diff --git a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js index 1209bd268..a420bf6bf 100644 --- a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js +++ b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.flow.js @@ -56,7 +56,6 @@ export type FastFS = { }; type HasteMapOptions = {| - allowRelativePaths: boolean, extensions: Extensions, files: Array, helpers: DependencyGraphHelpers, diff --git a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js index 1c41fed9e..d0c3eb151 100644 --- a/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js +++ b/packager/react-packager/src/ModuleGraph/node-haste/node-haste.js @@ -61,7 +61,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn { getTransformedFile, ); const hasteMap = new HasteMap({ - allowRelativePaths: true, extensions: ['js', 'json'], files, helpers, diff --git a/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js b/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js index 0ca654a2c..975cd305a 100644 --- a/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js +++ b/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js @@ -20,7 +20,6 @@ const PACKAGE_JSON = path.sep + 'package.json'; class HasteMap extends EventEmitter { constructor({ - allowRelativePaths, extensions, files, moduleCache, @@ -29,7 +28,6 @@ class HasteMap extends EventEmitter { platforms, }) { super(); - this._allowRelativePaths = allowRelativePaths; this._extensions = extensions; this._files = files; this._helpers = helpers; @@ -128,9 +126,6 @@ class HasteMap extends EventEmitter { } _processHastePackage(file, previousName) { - if (!this._allowRelativePaths) { - file = path.resolve(file); - } const p = this._moduleCache.getPackage(file); return p.isHaste() .then(isHaste => isHaste && p.getName()