mirror of
https://github.com/status-im/react-native.git
synced 2025-01-12 10:34:57 +00:00
packager: rename node-haste/index to DependencyGraph
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
This commit is contained in:
parent
a324dfbd51
commit
c948ae8168
@ -14,7 +14,7 @@
|
|||||||
const querystring = require('querystring');
|
const querystring = require('querystring');
|
||||||
const url = require('url');
|
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 HMRBundle from '../../../packager/src/Bundler/HMRBundle';
|
||||||
import type Server from '../../../packager/src/Server';
|
import type Server from '../../../packager/src/Server';
|
||||||
|
@ -21,7 +21,7 @@ const {objectContaining} = jasmine;
|
|||||||
|
|
||||||
describe('AssetServer', () => {
|
describe('AssetServer', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const NodeHaste = require('../../node-haste');
|
const NodeHaste = require('../../node-haste/DependencyGraph');
|
||||||
NodeHaste.getAssetDataFromName =
|
NodeHaste.getAssetDataFromName =
|
||||||
require.requireActual('../../node-haste/lib/getAssetDataFromName');
|
require.requireActual('../../node-haste/lib/getAssetDataFromName');
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const denodeify = require('denodeify');
|
const denodeify = require('denodeify');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const getAssetDataFromName = require('../node-haste').getAssetDataFromName;
|
const getAssetDataFromName = require('../node-haste/DependencyGraph').getAssetDataFromName;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
import type {AssetData} from '../node-haste/lib/getAssetDataFromName';
|
import type {AssetData} from '../node-haste/lib/getAssetDataFromName';
|
||||||
|
@ -19,7 +19,7 @@ jest
|
|||||||
.mock('os')
|
.mock('os')
|
||||||
.mock('assert')
|
.mock('assert')
|
||||||
.mock('progress')
|
.mock('progress')
|
||||||
.mock('../../node-haste')
|
.mock('../../node-haste/DependencyGraph')
|
||||||
.mock('../../JSTransformer')
|
.mock('../../JSTransformer')
|
||||||
.mock('../../lib/declareOpts')
|
.mock('../../lib/declareOpts')
|
||||||
.mock('../../Resolver')
|
.mock('../../Resolver')
|
||||||
|
@ -16,7 +16,7 @@ jest.mock('path');
|
|||||||
|
|
||||||
const {join: pathJoin} = require.requireActual('path');
|
const {join: pathJoin} = require.requireActual('path');
|
||||||
const DependencyGraph = jest.fn();
|
const DependencyGraph = jest.fn();
|
||||||
jest.setMock('../../node-haste', DependencyGraph);
|
jest.setMock('../../node-haste/DependencyGraph', DependencyGraph);
|
||||||
let Module;
|
let Module;
|
||||||
let Polyfill;
|
let Polyfill;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const DependencyGraph = require('../node-haste');
|
const DependencyGraph = require('../node-haste/DependencyGraph');
|
||||||
|
|
||||||
const defaults = require('../../defaults');
|
const defaults = require('../../defaults');
|
||||||
const pathJoin = require('path').join;
|
const pathJoin = require('path').join;
|
||||||
|
@ -23,7 +23,7 @@ jest.mock('../../worker-farm', () => () => () => {})
|
|||||||
.mock('../../Bundler')
|
.mock('../../Bundler')
|
||||||
.mock('../../AssetServer')
|
.mock('../../AssetServer')
|
||||||
.mock('../../lib/declareOpts')
|
.mock('../../lib/declareOpts')
|
||||||
.mock('../../node-haste')
|
.mock('../../node-haste/DependencyGraph')
|
||||||
.mock('../../Logger')
|
.mock('../../Logger')
|
||||||
.mock('../../lib/GlobalTransformCache');
|
.mock('../../lib/GlobalTransformCache');
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const AssetServer = require('../AssetServer');
|
const AssetServer = require('../AssetServer');
|
||||||
const getPlatformExtension = require('../node-haste').getPlatformExtension;
|
const getPlatformExtension = require('../node-haste/DependencyGraph').getPlatformExtension;
|
||||||
const Bundler = require('../Bundler');
|
const Bundler = require('../Bundler');
|
||||||
const MultipartResponse = require('./MultipartResponse');
|
const MultipartResponse = require('./MultipartResponse');
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ describe('DependencyGraph', function() {
|
|||||||
const realPlatform = process.platform;
|
const realPlatform = process.platform;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
process.platform = 'linux';
|
process.platform = 'linux';
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
@ -2368,7 +2368,7 @@ describe('DependencyGraph', function() {
|
|||||||
// reload path module
|
// reload path module
|
||||||
jest.resetModules();
|
jest.resetModules();
|
||||||
jest.mock('path', () => path.win32);
|
jest.mock('path', () => path.win32);
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
@ -2559,7 +2559,7 @@ describe('DependencyGraph', function() {
|
|||||||
let DependencyGraph;
|
let DependencyGraph;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
process.platform = 'linux';
|
process.platform = 'linux';
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
@ -3539,7 +3539,7 @@ describe('DependencyGraph', function() {
|
|||||||
// due to the drive letter expectation
|
// due to the drive letter expectation
|
||||||
if (realPlatform !== 'win32') { return; }
|
if (realPlatform !== 'win32') { return; }
|
||||||
|
|
||||||
const DependencyGraph = require('../index');
|
const DependencyGraph = require('../DependencyGraph');
|
||||||
|
|
||||||
it('should work with nested node_modules', function() {
|
it('should work with nested node_modules', function() {
|
||||||
var root = '/root';
|
var root = '/root';
|
||||||
@ -4503,7 +4503,7 @@ describe('DependencyGraph', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
process.platform = 'linux';
|
process.platform = 'linux';
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
@ -5221,7 +5221,7 @@ describe('DependencyGraph', function() {
|
|||||||
let DependencyGraph;
|
let DependencyGraph;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
process.platform = 'linux';
|
process.platform = 'linux';
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
@ -5393,7 +5393,7 @@ describe('DependencyGraph', function() {
|
|||||||
'g.js': makeModule('g'),
|
'g.js': makeModule('g'),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const DependencyGraph = require('../');
|
const DependencyGraph = require('../DependencyGraph');
|
||||||
return DependencyGraph.load({
|
return DependencyGraph.load({
|
||||||
...defaults,
|
...defaults,
|
||||||
roots: ['/root'],
|
roots: ['/root'],
|
||||||
@ -5424,7 +5424,7 @@ describe('DependencyGraph', function() {
|
|||||||
describe('Asset module dependencies', () => {
|
describe('Asset module dependencies', () => {
|
||||||
let DependencyGraph;
|
let DependencyGraph;
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('allows setting dependencies for asset modules', () => {
|
it('allows setting dependencies for asset modules', () => {
|
||||||
@ -5460,7 +5460,7 @@ describe('DependencyGraph', function() {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
moduleRead = Module.prototype.read;
|
moduleRead = Module.prototype.read;
|
||||||
DependencyGraph = require('../index');
|
DependencyGraph = require('../DependencyGraph');
|
||||||
setMockFileSystem({
|
setMockFileSystem({
|
||||||
'root': {
|
'root': {
|
||||||
'index.js': `
|
'index.js': `
|
||||||
|
Loading…
x
Reference in New Issue
Block a user