metro-bundler: upgrade react-native-github to OSS bundler

Reviewed By: cpojer

Differential Revision: D5172542

fbshipit-source-id: 4ca6c9aad8f798ac6b8f1070f98b5d1d2098e726
This commit is contained in:
Jean Lauliac 2017-06-02 11:17:42 -07:00 committed by Facebook Github Bot
parent 859af60e38
commit 07ee04d7bd
10 changed files with 31 additions and 30 deletions

View File

@ -12,18 +12,18 @@
'use strict';
const log = require('../util/log').out('bundle');
const Server = require('../../packager/src/Server');
const Terminal = require('../../packager/src/lib/TerminalClass');
const TerminalReporter = require('../../packager/src/lib/TerminalReporter');
const TransformCaching = require('../../packager/src/lib/TransformCaching');
const Server = require('metro-bundler/build/Server');
const Terminal = require('metro-bundler/build/lib/TerminalClass');
const TerminalReporter = require('metro-bundler/build/lib/TerminalReporter');
const TransformCaching = require('metro-bundler/build/lib/TransformCaching');
const outputBundle = require('../../packager/src/shared/output/bundle');
const outputBundle = require('metro-bundler/build/shared/output/bundle');
const path = require('path');
const saveAssets = require('./saveAssets');
const defaultAssetExts = require('../../packager/src/defaults').assetExts;
const defaultSourceExts = require('../../packager/src/defaults').sourceExts;
const defaultPlatforms = require('../../packager/src/defaults').platforms;
const defaultProvidesModuleNodeModules = require('../../packager/src/defaults').providesModuleNodeModules;
const defaultAssetExts = require('metro-bundler/build/defaults').assetExts;
const defaultSourceExts = require('metro-bundler/build/defaults').sourceExts;
const defaultPlatforms = require('metro-bundler/build/defaults').platforms;
const defaultProvidesModuleNodeModules = require('metro-bundler/build/defaults').providesModuleNodeModules;
import type {RequestOptions, OutputOptions} from './types.flow';
import type {ConfigT} from '../util/Config';

View File

@ -10,7 +10,7 @@
const buildBundle = require('./buildBundle');
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
const outputBundle = require('../../packager/src/shared/output/bundle');
const outputBundle = require('metro-bundler/build/shared/output/bundle');
/**
* Builds the bundle starting to look for dependencies at the given entry path.

View File

@ -10,4 +10,4 @@
*/
'use strict';
export type {OutputOptions, RequestOptions} from '../../packager/src/shared/types.flow';
export type {OutputOptions, RequestOptions} from 'metro-bundler/build/shared/types.flow';

View File

@ -10,7 +10,7 @@
const bundleWithOutput = require('./bundle').withOutput;
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
const outputUnbundle = require('../../packager/src/shared/output/unbundle');
const outputUnbundle = require('metro-bundler/build/shared/output/unbundle');
/**
* Builds the bundle starting to look for dependencies at the given entry path.

View File

@ -9,7 +9,7 @@
'use strict';
require('../../setupBabel')();
const ReactPackager = require('../../packager');
const ReactPackager = require('metro-bundler');
const denodeify = require('denodeify');
const fs = require('fs');

View File

@ -9,7 +9,7 @@
'use strict';
var chalk = require('chalk');
var formatBanner = require('../../packager/src/lib/formatBanner');
var formatBanner = require('metro-bundler/build/lib/formatBanner');
var semver = require('semver');
module.exports = function() {

View File

@ -14,17 +14,17 @@
require('../../setupBabel')();
const InspectorProxy = require('./util/inspectorProxy.js');
const ReactPackager = require('../../packager');
const Terminal = require('../../packager/src/lib/TerminalClass');
const ReactPackager = require('metro-bundler');
const Terminal = require('metro-bundler/build/lib/TerminalClass');
const attachHMRServer = require('./util/attachHMRServer');
const connect = require('connect');
const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware');
const cpuProfilerMiddleware = require('./middleware/cpuProfilerMiddleware');
const defaultAssetExts = require('../../packager/src/defaults').assetExts;
const defaultSourceExts = require('../../packager/src/defaults').sourceExts;
const defaultPlatforms = require('../../packager/src/defaults').platforms;
const defaultProvidesModuleNodeModules = require('../../packager/src/defaults')
const defaultAssetExts = require('metro-bundler/build/defaults').assetExts;
const defaultSourceExts = require('metro-bundler/build/defaults').sourceExts;
const defaultPlatforms = require('metro-bundler/build/defaults').platforms;
const defaultProvidesModuleNodeModules = require('metro-bundler/build/defaults')
.providesModuleNodeModules;
const getDevToolsMiddleware = require('./middleware/getDevToolsMiddleware');
const http = require('http');
@ -39,7 +39,7 @@ const unless = require('./middleware/unless');
const webSocketProxy = require('./util/webSocketProxy.js');
import type {ConfigT} from '../util/Config';
import type {Reporter} from '../../packager/src/lib/reporting';
import type {Reporter} from 'metro-bundler/build/lib/reporting';
export type Args = {|
+assetExts: $ReadOnlyArray<string>,
@ -136,7 +136,7 @@ function getPackagerServer(args, config) {
LogReporter = require(path.resolve(args.customLogReporterPath));
}
} else {
LogReporter = require('../../packager/src/lib/TerminalReporter');
LogReporter = require('metro-bundler/build/lib/TerminalReporter');
}
/* $FlowFixMe: Flow is wrong, Node.js docs specify that process.stdout is an

View File

@ -10,19 +10,19 @@
*/
'use strict';
const blacklist = require('../../packager/src/blacklist');
const blacklist = require('metro-bundler/build/blacklist');
const fs = require('fs');
const invariant = require('fbjs/lib/invariant');
const path = require('path');
const {providesModuleNodeModules} = require('../../packager/src/defaults');
const {providesModuleNodeModules} = require('metro-bundler/build/defaults');
const RN_CLI_CONFIG = 'rn-cli.config.js';
import type {GetTransformOptions, PostMinifyProcess, PostProcessModules} from '../../packager/src/Bundler';
import type {HasteImpl} from '../../packager/src/node-haste/Module';
import type {TransformVariants} from '../../packager/src/ModuleGraph/types.flow';
import type {PostProcessModules as PostProcessModulesForBuck} from '../../packager/src/ModuleGraph/types.flow.js';
import type {GetTransformOptions, PostMinifyProcess, PostProcessModules} from 'metro-bundler/build/Bundler';
import type {HasteImpl} from 'metro-bundler/build/node-haste/Module';
import type {TransformVariants} from 'metro-bundler/build/ModuleGraph/types.flow';
import type {PostProcessModules as PostProcessModulesForBuck} from 'metro-bundler/build/ModuleGraph/types.flow.js';
/**
* Configuration file of the CLI.
@ -129,7 +129,7 @@ const Config = {
getProjectRoots: () => [process.cwd()],
getProvidesModuleNodeModules: () => providesModuleNodeModules.slice(),
getSourceExts: () => [],
getTransformModulePath: () => path.resolve(__dirname, '../../packager/src/transformer.js'),
getTransformModulePath: () => require.resolve('metro-bundler/build/transformer.js'),
getTransformOptions: async () => ({}),
postMinifyProcess: x => x,
postProcessModules: modules => modules,

View File

@ -10,4 +10,4 @@
'use strict';
require('../../setupBabel')();
module.exports = require('../../packager/src/JSTransformer/worker');
module.exports = require('metro-bundler/build/JSTransformer/worker');

View File

@ -182,6 +182,7 @@
"left-pad": "^1.1.3",
"lodash": "^4.16.6",
"merge-stream": "^1.0.1",
"metro-bundler": "^0.7.3",
"mime": "^1.3.4",
"mime-types": "2.1.11",
"minimist": "^1.2.0",