diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 000000000..876e701fa --- /dev/null +++ b/.flowconfig @@ -0,0 +1,44 @@ +[ignore] +; We fork some components by platform +.*/*[.]android.js + +; Ignore "BUCK" generated dirs +/\.buckd/ + +; Ignore unexpected extra "@providesModule" +.*/node_modules/.*/node_modules/fbjs/.* + +; Ignore duplicate module providers +; For RN Apps installed via npm, "Libraries" folder is inside +; "node_modules/react-native" but in the source repo it is in the root +.*/Libraries/react-native/React.js +.*/Libraries/react-native/ReactNative.js + +[include] + +[libs] +node_modules/react-native/Libraries/react-native/react-native-interface.js +node_modules/react-native/flow +flow/ + +[options] +module.system=haste + +experimental.strict_type_args=true + +munge_underscores=true + +module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' + +suppress_type=$FlowIssue +suppress_type=$FlowFixMe +suppress_type=$FixMe + +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy + +unsafe.enable_getters_and_setters=true + +[version] +^0.36.0 diff --git a/package.json b/package.json index 9c9e4b394..e6568430b 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "babel-core": "^6.18.0", "babel-eslint": "^7.1.1", "babel-loader": "^6.2.10", + "babel-plugin-transform-flow-strip-types": "^6.18.0", "babel-polyfill": "*", "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.16.0", @@ -65,6 +66,7 @@ "eslint-plugin-react-native": "^2.2.1", "expose-loader": "*", "file-loader": "*", + "flow-bin": "^0.36.0", "haste-resolver-webpack-plugin": "^0.2.2", "imports-loader": "*", "jshint": "2.9.4", diff --git a/webpack.config.js b/webpack.config.js index 8cfe0b1f3..249474c05 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -58,6 +58,10 @@ var config = { exclude: node_modules, loader: 'babel', query: { + plugins: [ + 'transform-flow-strip-types' + ], + // XXX The require.resolve bellow solves failures to locate the // presets when lib-jitsi-meet, for example, is npm linked in // jitsi-meet. The require.resolve, of course, mandates the use