Skip to content

Commit

Permalink
Fix flow types
Browse files Browse the repository at this point in the history
Summary:
This diff ignores the `react-native-local-cli` from being used internally.

Unfortunately, since `react-native-local-cli` has its own dependency on Metro, and using `yarn` selective resolutions causes some issues with `flow` rechecks that have not been resolved (https://fb.facebook.com/groups/flow/permalink/2220467474668522/), the easiest way to move forward is to just not install the `react-native-local-cli` package internally (we don't need it since we have our own cli).

Reviewed By: pvdz

Differential Revision: D13377495

fbshipit-source-id: 6d6edbd947104e050ad1c31a657fc21fe6848692
  • Loading branch information
rafeca authored and facebook-github-bot committed Dec 10, 2018
1 parent 167d786 commit c8047bf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions jest/hasteImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'use strict';

const path = require('path');
const findPlugins = require('react-native-local-cli/core/findPlugins');

const REACT_NATIVE_CI = process.cwd() === path.resolve(__dirname, '..');

Expand All @@ -23,7 +22,22 @@ if (REACT_NATIVE_CI) {
pluginsPath = '../../../';
}

const plugins = findPlugins([path.resolve(__dirname, pluginsPath)]);
function getPlugins() {
try {
const findPlugins = require('react-native-local-cli/core/findPlugins');

return findPlugins([path.resolve(__dirname, pluginsPath)]);
} catch (_) {
return {
haste: {
providesModuleNodeModules: [],
platforms: [],
},
};
}
}

const plugins = getPlugins();

// Detect out-of-tree platforms and add them to the whitelists
const pluginRoots /*: Array<
Expand Down

0 comments on commit c8047bf

Please sign in to comment.