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
This commit is contained in:
David Aurelio 2016-12-06 16:48:18 -08:00 committed by Facebook Github Bot
parent c00e669cf5
commit 548733e7e0
3 changed files with 0 additions and 7 deletions

View File

@ -56,7 +56,6 @@ export type FastFS = {
}; };
type HasteMapOptions = {| type HasteMapOptions = {|
allowRelativePaths: boolean,
extensions: Extensions, extensions: Extensions,
files: Array<string>, files: Array<string>,
helpers: DependencyGraphHelpers, helpers: DependencyGraphHelpers,

View File

@ -61,7 +61,6 @@ exports.createResolveFn = function(options: ResolveOptions): ResolveFn {
getTransformedFile, getTransformedFile,
); );
const hasteMap = new HasteMap({ const hasteMap = new HasteMap({
allowRelativePaths: true,
extensions: ['js', 'json'], extensions: ['js', 'json'],
files, files,
helpers, helpers,

View File

@ -20,7 +20,6 @@ const PACKAGE_JSON = path.sep + 'package.json';
class HasteMap extends EventEmitter { class HasteMap extends EventEmitter {
constructor({ constructor({
allowRelativePaths,
extensions, extensions,
files, files,
moduleCache, moduleCache,
@ -29,7 +28,6 @@ class HasteMap extends EventEmitter {
platforms, platforms,
}) { }) {
super(); super();
this._allowRelativePaths = allowRelativePaths;
this._extensions = extensions; this._extensions = extensions;
this._files = files; this._files = files;
this._helpers = helpers; this._helpers = helpers;
@ -128,9 +126,6 @@ class HasteMap extends EventEmitter {
} }
_processHastePackage(file, previousName) { _processHastePackage(file, previousName) {
if (!this._allowRelativePaths) {
file = path.resolve(file);
}
const p = this._moduleCache.getPackage(file); const p = this._moduleCache.getPackage(file);
return p.isHaste() return p.isHaste()
.then(isHaste => isHaste && p.getName() .then(isHaste => isHaste && p.getName()