From 02f35ead1a109dda273f57a1b58dd08fadce106c Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 13 Dec 2017 14:49:34 -0800 Subject: [PATCH 1/5] Fix Flow failure due to unexported Metro flow types --- .flowconfig | 3 +++ flow/metro.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 flow/metro.js diff --git a/.flowconfig b/.flowconfig index 0cac4b51657b4e..3fc10485b3ade6 100644 --- a/.flowconfig +++ b/.flowconfig @@ -22,6 +22,9 @@ ; Ignore polyfills .*/Libraries/polyfills/.* +; Ignore metro +.*/node_modules/metro/.* + [include] [libs] diff --git a/flow/metro.js b/flow/metro.js new file mode 100644 index 00000000000000..97a331ac5272e5 --- /dev/null +++ b/flow/metro.js @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow + */ + +declare module 'metro' { + declare module.exports: any; +} + +declare module 'metro/src/lib/TerminalReporter' { + declare module.exports: any; +} \ No newline at end of file From 170599eb233f310d24835801e9a5ee3287a5fc82 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 13 Dec 2017 15:12:58 -0800 Subject: [PATCH 2/5] Create OSS-specific directory for flow --- .flowconfig | 1 + flow/metro.js | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 flow/metro.js diff --git a/.flowconfig b/.flowconfig index 3fc10485b3ade6..d3abd009065359 100644 --- a/.flowconfig +++ b/.flowconfig @@ -29,6 +29,7 @@ [libs] Libraries/react-native/react-native-interface.js +flow-github/ flow/ [options] diff --git a/flow/metro.js b/flow/metro.js deleted file mode 100644 index 97a331ac5272e5..00000000000000 --- a/flow/metro.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow - */ - -declare module 'metro' { - declare module.exports: any; -} - -declare module 'metro/src/lib/TerminalReporter' { - declare module.exports: any; -} \ No newline at end of file From 1f4c830ba7e73bf29e37556f0536f2965a9cf0a4 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 13 Dec 2017 16:03:23 -0800 Subject: [PATCH 3/5] Add missing file --- flow-github/metro.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 flow-github/metro.js diff --git a/flow-github/metro.js b/flow-github/metro.js new file mode 100644 index 00000000000000..8c81bc32a9562c --- /dev/null +++ b/flow-github/metro.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @flow + */ + +declare module 'metro' { + declare module.exports: any; +} + +declare module 'metro/src/lib/TerminalReporter' { + declare module.exports: any; +} + +declare module 'metro/src/HmrServer' { + declare module.exports: any; +} \ No newline at end of file From 38aa0188c10470e862789be563b95567ca5125c7 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 13 Dec 2017 16:14:48 -0800 Subject: [PATCH 4/5] Update flowconfig used by the default local-cli template --- .flowconfig | 2 +- local-cli/templates/HelloWorld/_flowconfig | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.flowconfig b/.flowconfig index d3abd009065359..f63fddf53a8f7a 100644 --- a/.flowconfig +++ b/.flowconfig @@ -29,8 +29,8 @@ [libs] Libraries/react-native/react-native-interface.js -flow-github/ flow/ +flow-github/ [options] emoji=true diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index c3c02e7d8aa406..0c3f8396d2a7a9 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -21,6 +21,7 @@ [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js node_modules/react-native/flow/ +node_modules/react-native/flow-github/ [options] emoji=true From 259068b0a04f924f8c54fb69d48aa735fca81684 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Thu, 14 Dec 2017 10:08:52 -0800 Subject: [PATCH 5/5] Ignore metro in cli template --- local-cli/templates/HelloWorld/_flowconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 0c3f8396d2a7a9..7d608958e5ffa8 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -16,6 +16,9 @@ ; Ignore polyfills .*/Libraries/polyfills/.* +; Ignore metro +.*/node_modules/metro/.* + [include] [libs]