diff --git a/packages/metro-bundler/src/Bundler/index.js b/packages/metro-bundler/src/Bundler/index.js index e2d8fc8f..c5119278 100644 --- a/packages/metro-bundler/src/Bundler/index.js +++ b/packages/metro-bundler/src/Bundler/index.js @@ -89,27 +89,26 @@ const assetPropertyBlacklist = new Set([ 'path', ]); -type Options = { - allowBundleUpdates: boolean, - assetExts: Array, - assetServer: AssetServer, - blacklistRE?: RegExp, - cacheVersion: string, - extraNodeModules: {}, - getTransformOptions?: GetTransformOptions, - globalTransformCache: ?GlobalTransformCache, - hasteImpl?: HasteImpl, - moduleFormat: string, - platforms: Array, - polyfillModuleNames: Array, - projectRoots: Array, - providesModuleNodeModules?: Array, - reporter: Reporter, - resetCache: boolean, - transformModulePath?: string, - transformTimeoutInterval: ?number, - watch: boolean, -}; +type Options = {| + +allowBundleUpdates: boolean, + +assetExts: Array, + +assetServer: AssetServer, + +blacklistRE?: RegExp, + +cacheVersion: string, + +extraNodeModules: {}, + +getTransformOptions?: GetTransformOptions, + +globalTransformCache: ?GlobalTransformCache, + +hasteImpl?: HasteImpl, + +platforms: Array, + +polyfillModuleNames: Array, + +projectRoots: Array, + +providesModuleNodeModules?: Array, + +reporter: Reporter, + +resetCache: boolean, + +transformModulePath?: string, + +transformTimeoutInterval: ?number, + +watch: boolean, +|}; class Bundler { @@ -190,7 +189,6 @@ class Bundler { hasteImpl: opts.hasteImpl, maxWorkerCount, minifyCode: this._transformer.minify, - moduleFormat: opts.moduleFormat, platforms: new Set(opts.platforms), polyfillModuleNames: opts.polyfillModuleNames, projectRoots: opts.projectRoots, diff --git a/packages/metro-bundler/src/Resolver/index.js b/packages/metro-bundler/src/Resolver/index.js index 3538524b..58b14622 100644 --- a/packages/metro-bundler/src/Resolver/index.js +++ b/packages/metro-bundler/src/Resolver/index.js @@ -29,25 +29,25 @@ import type {GlobalTransformCache} from '../lib/GlobalTransformCache'; type MinifyCode = (filePath: string, code: string, map: SourceMap) => Promise<{code: string, map: SourceMap}>; -type Options = { - assetExts: Array, - blacklistRE?: RegExp, - cache: Cache, - extraNodeModules: ?{}, - getTransformCacheKey: GetTransformCacheKey, - globalTransformCache: ?GlobalTransformCache, - hasteImpl?: HasteImpl, - maxWorkerCount: number, - minifyCode: MinifyCode, - platforms: Set, - polyfillModuleNames?: Array, - projectRoots: Array, - providesModuleNodeModules: Array, - reporter: Reporter, - resetCache: boolean, - transformCode: TransformCode, - watch: boolean, -}; +type Options = {| + +assetExts: Array, + +blacklistRE?: RegExp, + +cache: Cache, + +extraNodeModules: ?{}, + +getTransformCacheKey: GetTransformCacheKey, + +globalTransformCache: ?GlobalTransformCache, + +hasteImpl?: HasteImpl, + +maxWorkerCount: number, + +minifyCode: MinifyCode, + +platforms: Set, + +polyfillModuleNames?: Array, + +projectRoots: Array, + +providesModuleNodeModules: Array, + +reporter: Reporter, + +resetCache: boolean, + +transformCode: TransformCode, + +watch: boolean, +|}; class Resolver { @@ -70,7 +70,6 @@ class Resolver { return filepath.indexOf('__tests__') !== -1 || (opts.blacklistRE != null && opts.blacklistRE.test(filepath)); }, - maxWorkers: null, moduleOptions: { cacheTransformResults: true, hasteImpl: opts.hasteImpl, diff --git a/packages/metro-bundler/src/node-haste/DependencyGraph/DependencyGraphHelpers.js b/packages/metro-bundler/src/node-haste/DependencyGraph/DependencyGraphHelpers.js index bebfaf62..83af2327 100644 --- a/packages/metro-bundler/src/node-haste/DependencyGraph/DependencyGraphHelpers.js +++ b/packages/metro-bundler/src/node-haste/DependencyGraph/DependencyGraphHelpers.js @@ -21,8 +21,8 @@ class DependencyGraphHelpers { _assetExts: Array; constructor({providesModuleNodeModules, assetExts}: { - providesModuleNodeModules: Array, - assetExts: Array, + +providesModuleNodeModules: Array, + +assetExts: Array, }) { this._providesModuleNodeModules = providesModuleNodeModules; this._assetExts = assetExts; diff --git a/packages/metro-bundler/src/node-haste/index.js b/packages/metro-bundler/src/node-haste/index.js index 66ce8452..cbb67c94 100644 --- a/packages/metro-bundler/src/node-haste/index.js +++ b/packages/metro-bundler/src/node-haste/index.js @@ -49,28 +49,28 @@ import type { } from './Module'; import type {HasteFS} from './types'; -type Options = { - assetDependencies: Array, - assetExts: Array, - cache: Cache, - extensions: Array, - extraNodeModules: ?{}, - forceNodeFilesystemAPI: boolean, - getTransformCacheKey: GetTransformCacheKey, - globalTransformCache: ?GlobalTransformCache, - ignoreFilePath: (filePath: string) => boolean, - maxWorkerCount: number, - moduleOptions: ModuleOptions, - platforms: Set, - preferNativePlatform: boolean, - providesModuleNodeModules: Array, - reporter: Reporter, - resetCache: boolean, - roots: Array, - transformCode: TransformCode, - useWatchman: boolean, - watch: boolean, -}; +type Options = {| + +assetDependencies: Array, + +assetExts: Array, + +cache: Cache, + +extensions: Array, + +extraNodeModules: ?{}, + +forceNodeFilesystemAPI: boolean, + +getTransformCacheKey: GetTransformCacheKey, + +globalTransformCache: ?GlobalTransformCache, + +ignoreFilePath: (filePath: string) => boolean, + +maxWorkerCount: number, + +moduleOptions: ModuleOptions, + +platforms: Set, + +preferNativePlatform: boolean, + +providesModuleNodeModules: Array, + +reporter: Reporter, + +resetCache: boolean, + +roots: Array, + +transformCode: TransformCode, + +useWatchman: boolean, + +watch: boolean, +|}; const JEST_HASTE_MAP_CACHE_BREAKER = 1; @@ -84,12 +84,12 @@ class DependencyGraph extends EventEmitter { _hasteFS: HasteFS; _moduleMap: ModuleMap; - constructor(config: { - opts: Options, - haste: JestHasteMap, - initialHasteFS: HasteFS, - initialModuleMap: ModuleMap, - }) { + constructor(config: {| + +opts: Options, + +haste: JestHasteMap, + +initialHasteFS: HasteFS, + +initialModuleMap: ModuleMap, + |}) { super(); invariant(config.opts.maxWorkerCount >= 1, 'worker count must be greater or equal to 1'); this._opts = config.opts;