Skip to content

Commit

Permalink
packager: rename node-haste/index to DependencyGraph
Browse files Browse the repository at this point in the history
Summary: I've been confused for a long time by this, and I think it's better late than never. I propose we rename that file to make it more explicit where that class lives, and so that it's consistent with the test file, name `DependencyGraph-test.js`

Reviewed By: davidaurelio

Differential Revision: D5020556

fbshipit-source-id: d54a501c3995f3fea16a5bfc6ca72993f73c4873
  • Loading branch information
Jean Lauliac authored and facebook-github-bot committed May 10, 2017
1 parent a324dfb commit c948ae8
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion local-cli/server/util/attachHMRServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const querystring = require('querystring');
const url = require('url');

const {getInverseDependencies} = require('../../../packager/src//node-haste');
const {getInverseDependencies} = require('../../../packager/src//node-haste/DependencyGraph');

import type HMRBundle from '../../../packager/src/Bundler/HMRBundle';
import type Server from '../../../packager/src/Server';
Expand Down
2 changes: 1 addition & 1 deletion packager/src/AssetServer/__tests__/AssetServer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down
2 changes: 1 addition & 1 deletion packager/src/AssetServer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packager/src/Bundler/__tests__/Bundler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion packager/src/Resolver/__tests__/Resolver-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion packager/src/Resolver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packager/src/Server/__tests__/Server-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion packager/src/Server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions packager/src/node-haste/__tests__/DependencyGraph-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('DependencyGraph', function() {
const realPlatform = process.platform;
beforeEach(function() {
process.platform = 'linux';
DependencyGraph = require('../index');
DependencyGraph = require('../DependencyGraph');
});

afterEach(function() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -2559,7 +2559,7 @@ describe('DependencyGraph', function() {
let DependencyGraph;
beforeEach(function() {
process.platform = 'linux';
DependencyGraph = require('../index');
DependencyGraph = require('../DependencyGraph');
});

afterEach(function() {
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -4503,7 +4503,7 @@ describe('DependencyGraph', function() {

beforeEach(function() {
process.platform = 'linux';
DependencyGraph = require('../index');
DependencyGraph = require('../DependencyGraph');
});

afterEach(function() {
Expand Down Expand Up @@ -5221,7 +5221,7 @@ describe('DependencyGraph', function() {
let DependencyGraph;
beforeEach(function() {
process.platform = 'linux';
DependencyGraph = require('../index');
DependencyGraph = require('../DependencyGraph');
});

afterEach(function() {
Expand Down Expand Up @@ -5393,7 +5393,7 @@ describe('DependencyGraph', function() {
'g.js': makeModule('g'),
},
});
const DependencyGraph = require('../');
const DependencyGraph = require('../DependencyGraph');
return DependencyGraph.load({
...defaults,
roots: ['/root'],
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -5460,7 +5460,7 @@ describe('DependencyGraph', function() {

beforeEach(() => {
moduleRead = Module.prototype.read;
DependencyGraph = require('../index');
DependencyGraph = require('../DependencyGraph');
setMockFileSystem({
'root': {
'index.js': `
Expand Down

0 comments on commit c948ae8

Please sign in to comment.