Clean buildBundle.js, index.js and Flow types

Reviewed By: davidaurelio

Differential Revision: D7628725

fbshipit-source-id: 3873e5c7a0c9b988335dcf9b8a11fcf0598a9f50
This commit is contained in:
Miguel Jimenez Esun 2018-04-20 07:24:20 -07:00 committed by Facebook Github Bot
parent 910a71ba1a
commit 084ac30863
3 changed files with 1 additions and 13 deletions

View File

@ -23,8 +23,7 @@ jest
.mock('metro-core/src/Logger')
.mock('../../lib/getAbsolutePath')
.mock('../../lib/getPrependedScripts')
.mock('../../lib/transformHelpers')
.mock('../../lib/GlobalTransformCache');
.mock('../../lib/transformHelpers');
const NativeDate = global.Date;

View File

@ -14,7 +14,6 @@ const Config = require('./Config');
const MetroHmrServer = require('./HmrServer');
const MetroServer = require('./Server');
const TerminalReporter = require('./lib/TerminalReporter');
const TransformCaching = require('./lib/TransformCaching');
const attachWebsocketServer = require('./lib/attachWebsocketServer');
const defaults = require('./defaults');
@ -33,8 +32,6 @@ const {Terminal} = require('metro-core');
import type {ConfigT} from './Config';
import type {Graph} from './DeltaBundler';
import type {GlobalTransformCache} from './lib/GlobalTransformCache';
import type {TransformCache} from './lib/TransformCaching';
import type {Reporter} from './lib/reporting';
import type {RequestOptions, OutputOptions} from './shared/types.flow.js';
import type {Options as ServerOptions} from './shared/types.flow';
@ -51,12 +48,10 @@ type DeprecatedMetroOptions = {|
type PublicMetroOptions = {|
...DeprecatedMetroOptions,
config?: ConfigT,
globalTransformCache?: ?GlobalTransformCache,
maxWorkers?: number,
minifierPath?: string,
port?: ?number,
reporter?: Reporter,
transformCache?: TransformCache,
|};
type PrivateMetroOptions = {|
@ -81,14 +76,12 @@ async function asyncRealpath(path): Promise<string> {
async function runMetro({
config,
globalTransformCache,
resetCache = false,
maxWorkers = getMaxWorkers(),
minifierPath,
// $FlowFixMe TODO t0 https://github.com/facebook/flow/issues/183
port = null,
reporter = new TerminalReporter(new Terminal(process.stdout)),
transformCache = TransformCaching.useTempDir(),
watch = false,
}: PrivateMetroOptions): Promise<MetroServer> {
const normalizedConfig = config ? Config.normalize(config) : Config.DEFAULT;
@ -131,7 +124,6 @@ async function runMetro({
normalizedConfig.getModulesRunBeforeMainModule,
getRunModuleStatement: normalizedConfig.getRunModuleStatement,
getTransformOptions: normalizedConfig.getTransformOptions,
globalTransformCache,
hasteImplModulePath: normalizedConfig.hasteImplModulePath,
maxWorkers,
minifierPath,
@ -145,7 +137,6 @@ async function runMetro({
sourceExts: normalizedConfig.assetTransforms
? sourceExts.concat(assetExts)
: sourceExts,
transformCache,
transformModulePath: normalizedConfig.getTransformModulePath(),
watch,
workerPath:

View File

@ -19,7 +19,6 @@ import type {
TransformedCode,
} from '../JSTransformer/worker';
import type {DynamicRequiresBehavior} from '../ModuleGraph/worker/collectDependencies';
import type {GlobalTransformCache} from '../lib/GlobalTransformCache';
import type {TransformCache} from '../lib/TransformCaching';
import type {Reporter} from '../lib/reporting';
import type {CacheStore} from 'metro-cache';
@ -91,7 +90,6 @@ export type Options = {|
getPolyfills: ({platform: ?string}) => $ReadOnlyArray<string>,
+getRunModuleStatement: (number | string) => string,
getTransformOptions?: GetTransformOptions,
globalTransformCache?: ?GlobalTransformCache,
hasteImplModulePath?: string,
maxWorkers?: number,
minifierPath?: string,