diff --git a/packages/metro-bundler/src/AssetServer/__tests__/AssetServer-test.js b/packages/metro-bundler/src/AssetServer/__tests__/AssetServer-test.js index d03cbd1f..5b9ca19f 100644 --- a/packages/metro-bundler/src/AssetServer/__tests__/AssetServer-test.js +++ b/packages/metro-bundler/src/AssetServer/__tests__/AssetServer-test.js @@ -21,7 +21,7 @@ const {objectContaining} = jasmine; describe('AssetServer', () => { beforeEach(() => { - const NodeHaste = require('../../node-haste'); + const NodeHaste = require('../../node-haste/DependencyGraph'); NodeHaste.getAssetDataFromName = require.requireActual('../../node-haste/lib/getAssetDataFromName'); }); diff --git a/packages/metro-bundler/src/AssetServer/index.js b/packages/metro-bundler/src/AssetServer/index.js index c18caa3a..e2ffd01c 100644 --- a/packages/metro-bundler/src/AssetServer/index.js +++ b/packages/metro-bundler/src/AssetServer/index.js @@ -14,7 +14,7 @@ const crypto = require('crypto'); const denodeify = require('denodeify'); const fs = require('fs'); -const getAssetDataFromName = require('../node-haste').getAssetDataFromName; +const getAssetDataFromName = require('../node-haste/DependencyGraph').getAssetDataFromName; const path = require('path'); import type {AssetData} from '../node-haste/lib/getAssetDataFromName'; diff --git a/packages/metro-bundler/src/Bundler/__tests__/Bundler-test.js b/packages/metro-bundler/src/Bundler/__tests__/Bundler-test.js index dcea0d6e..a8924a4f 100644 --- a/packages/metro-bundler/src/Bundler/__tests__/Bundler-test.js +++ b/packages/metro-bundler/src/Bundler/__tests__/Bundler-test.js @@ -19,7 +19,7 @@ jest .mock('os') .mock('assert') .mock('progress') - .mock('../../node-haste') + .mock('../../node-haste/DependencyGraph') .mock('../../JSTransformer') .mock('../../lib/declareOpts') .mock('../../Resolver') diff --git a/packages/metro-bundler/src/Resolver/__tests__/Resolver-test.js b/packages/metro-bundler/src/Resolver/__tests__/Resolver-test.js index dce69acf..67ec8ab8 100644 --- a/packages/metro-bundler/src/Resolver/__tests__/Resolver-test.js +++ b/packages/metro-bundler/src/Resolver/__tests__/Resolver-test.js @@ -16,7 +16,7 @@ jest.mock('path'); const {join: pathJoin} = require.requireActual('path'); const DependencyGraph = jest.fn(); -jest.setMock('../../node-haste', DependencyGraph); +jest.setMock('../../node-haste/DependencyGraph', DependencyGraph); let Module; let Polyfill; diff --git a/packages/metro-bundler/src/Resolver/index.js b/packages/metro-bundler/src/Resolver/index.js index ea2bd23c..77c8f0b8 100644 --- a/packages/metro-bundler/src/Resolver/index.js +++ b/packages/metro-bundler/src/Resolver/index.js @@ -11,7 +11,7 @@ 'use strict'; -const DependencyGraph = require('../node-haste'); +const DependencyGraph = require('../node-haste/DependencyGraph'); const defaults = require('../../defaults'); const pathJoin = require('path').join; diff --git a/packages/metro-bundler/src/Server/__tests__/Server-test.js b/packages/metro-bundler/src/Server/__tests__/Server-test.js index ce21478f..d9807288 100644 --- a/packages/metro-bundler/src/Server/__tests__/Server-test.js +++ b/packages/metro-bundler/src/Server/__tests__/Server-test.js @@ -23,7 +23,7 @@ jest.mock('../../worker-farm', () => () => () => {}) .mock('../../Bundler') .mock('../../AssetServer') .mock('../../lib/declareOpts') - .mock('../../node-haste') + .mock('../../node-haste/DependencyGraph') .mock('../../Logger') .mock('../../lib/GlobalTransformCache'); diff --git a/packages/metro-bundler/src/Server/index.js b/packages/metro-bundler/src/Server/index.js index 4344cd28..9fb3fe80 100644 --- a/packages/metro-bundler/src/Server/index.js +++ b/packages/metro-bundler/src/Server/index.js @@ -12,7 +12,7 @@ 'use strict'; const AssetServer = require('../AssetServer'); -const getPlatformExtension = require('../node-haste').getPlatformExtension; +const getPlatformExtension = require('../node-haste/DependencyGraph').getPlatformExtension; const Bundler = require('../Bundler'); const MultipartResponse = require('./MultipartResponse'); diff --git a/packages/metro-bundler/src/node-haste/index.js b/packages/metro-bundler/src/node-haste/DependencyGraph.js similarity index 100% rename from packages/metro-bundler/src/node-haste/index.js rename to packages/metro-bundler/src/node-haste/DependencyGraph.js diff --git a/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js b/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js index 857849ec..7b6c536a 100644 --- a/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js +++ b/packages/metro-bundler/src/node-haste/__tests__/DependencyGraph-test.js @@ -106,7 +106,7 @@ describe('DependencyGraph', function() { const realPlatform = process.platform; beforeEach(function() { process.platform = 'linux'; - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); afterEach(function() { @@ -2368,7 +2368,7 @@ describe('DependencyGraph', function() { // reload path module jest.resetModules(); jest.mock('path', () => path.win32); - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); afterEach(function() { @@ -2559,7 +2559,7 @@ describe('DependencyGraph', function() { let DependencyGraph; beforeEach(function() { process.platform = 'linux'; - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); afterEach(function() { @@ -3539,7 +3539,7 @@ describe('DependencyGraph', function() { // due to the drive letter expectation if (realPlatform !== 'win32') { return; } - const DependencyGraph = require('../index'); + const DependencyGraph = require('../DependencyGraph'); it('should work with nested node_modules', function() { var root = '/root'; @@ -4503,7 +4503,7 @@ describe('DependencyGraph', function() { beforeEach(function() { process.platform = 'linux'; - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); afterEach(function() { @@ -5221,7 +5221,7 @@ describe('DependencyGraph', function() { let DependencyGraph; beforeEach(function() { process.platform = 'linux'; - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); afterEach(function() { @@ -5393,7 +5393,7 @@ describe('DependencyGraph', function() { 'g.js': makeModule('g'), }, }); - const DependencyGraph = require('../'); + const DependencyGraph = require('../DependencyGraph'); return DependencyGraph.load({ ...defaults, roots: ['/root'], @@ -5424,7 +5424,7 @@ describe('DependencyGraph', function() { describe('Asset module dependencies', () => { let DependencyGraph; beforeEach(() => { - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); }); it('allows setting dependencies for asset modules', () => { @@ -5460,7 +5460,7 @@ describe('DependencyGraph', function() { beforeEach(() => { moduleRead = Module.prototype.read; - DependencyGraph = require('../index'); + DependencyGraph = require('../DependencyGraph'); setMockFileSystem({ 'root': { 'index.js': `