packager: runServer: @flow

Summary: This makes it easier to verify correctness when adding new config/args.

Reviewed By: davidaurelio

Differential Revision: D5069537

fbshipit-source-id: 4d8058851900b23163d0f2744e91dd14dfcdd461
This commit is contained in:
Jean Lauliac 2017-05-17 04:55:59 -07:00 committed by Facebook Github Bot
parent 2482fa8956
commit 218cab5e88
7 changed files with 12 additions and 12 deletions

View File

@ -31,7 +31,7 @@ type Options = {
nonPersistent?: boolean,
postProcessModules?: PostProcessModules,
postMinifyProcess?: PostMinifyProcess,
projectRoots: Array<string>,
projectRoots: $ReadOnlyArray<string>,
reporter?: Reporter,
+sourceExts: ?Array<string>,
+transformModulePath: string,

View File

@ -128,7 +128,7 @@ type Options = {|
+polyfillModuleNames: Array<string>,
+postProcessModules?: PostProcessModules,
+postMinifyProcess: PostMinifyProcess,
+projectRoots: Array<string>,
+projectRoots: $ReadOnlyArray<string>,
+providesModuleNodeModules?: Array<string>,
+reporter: Reporter,
+resetCache: boolean,
@ -146,7 +146,7 @@ class Bundler {
_getModuleId: (opts: Module) => number;
_transformer: Transformer;
_resolverPromise: Promise<Resolver>;
_projectRoots: Array<string>;
_projectRoots: $ReadOnlyArray<string>;
_assetServer: AssetServer;
_getTransformOptions: void | GetTransformOptions;
@ -785,7 +785,7 @@ class Bundler {
hot: boolean,
minify: boolean,
platform: ?string,
projectRoots: Array<string>,
projectRoots: $ReadOnlyArray<string>,
|},
): Promise<BundlingOptions> {
const getDependencies = (entryFile: string) =>

View File

@ -42,7 +42,7 @@ type Options = {|
+postMinifyProcess: PostMinifyProcess,
+platforms: Set<string>,
+polyfillModuleNames?: Array<string>,
+projectRoots: Array<string>,
+projectRoots: $ReadOnlyArray<string>,
+providesModuleNodeModules: Array<string>,
+reporter: Reporter,
+resetCache: boolean,

View File

@ -69,7 +69,7 @@ type Options = {
polyfillModuleNames?: Array<string>,
postProcessModules?: PostProcessModules,
postMinifyProcess: PostMinifyProcess,
projectRoots: Array<string>,
projectRoots: $ReadOnlyArray<string>,
providesModuleNodeModules?: Array<string>,
reporter: Reporter,
resetCache?: boolean,
@ -125,7 +125,7 @@ class Server {
polyfillModuleNames: Array<string>,
postProcessModules?: PostProcessModules,
postMinifyProcess: PostMinifyProcess,
projectRoots: Array<string>,
projectRoots: $ReadOnlyArray<string>,
providesModuleNodeModules?: Array<string>,
reporter: Reporter,
resetCache: boolean,
@ -135,7 +135,7 @@ class Server {
transformTimeoutInterval: ?number,
watch: boolean,
};
_projectRoots: Array<string>;
_projectRoots: $ReadOnlyArray<string>;
_bundles: {};
_changeWatchers: Array<{
req: IncomingMessage,

View File

@ -60,7 +60,7 @@ type Options = {|
+providesModuleNodeModules: Array<string>,
+reporter: Reporter,
+resetCache: boolean,
+roots: Array<string>,
+roots: $ReadOnlyArray<string>,
+sourceExts: Array<string>,
+transformCode: TransformCode,
+useWatchman: boolean,

View File

@ -41,7 +41,7 @@ class ModuleCache {
_platforms: Set<string>;
_transformCode: TransformCode;
_reporter: Reporter;
_roots: Array<string>;
_roots: $ReadOnlyArray<string>;
constructor(
{
@ -62,7 +62,7 @@ class ModuleCache {
getTransformCacheKey: GetTransformCacheKey,
globalTransformCache: ?GlobalTransformCache,
moduleOptions: ModuleOptions,
roots: Array<string>,
roots: $ReadOnlyArray<string>,
reporter: Reporter,
transformCode: TransformCode,
|},

View File

@ -18,7 +18,7 @@ export type LocalPath = OpaqueLocalPath & string;
// FIXME: This function has the shortcoming of potentially returning identical
// paths for two files in different roots.
function toLocalPath(roots: Array<string>, absolutePath: string): LocalPath {
function toLocalPath(roots: $ReadOnlyArray<string>, absolutePath: string): LocalPath {
for (let i = 0; i < roots.length; i++) {
const localPath = relative(roots[i], absolutePath);
if (localPath[0] !== '.') {