From 03bf2a93c7b99d08ccad1a86ace4c99555f83017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 29 Jan 2018 19:07:03 +0100 Subject: [PATCH] chore: Use Flow 0.64.0 (#5419) --- .flowconfig | 3 ++- package.json | 2 +- packages/jest-cli/src/reporters/Status.js | 2 +- packages/jest-haste-map/src/index.js | 12 ++++++------ yarn.lock | 19 ++++++++++++++----- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.flowconfig b/.flowconfig index 192e541e099e..18facbe37888 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,5 +1,6 @@ [ignore] .*/examples/.* +.*/node_modules/metro-bundler/.* [options] module.name_mapper='^pretty-format$' -> '/packages/pretty-format/src/index.js' @@ -9,4 +10,4 @@ include_warnings=true emoji=true [version] -^0.61.0 +^0.64.0 diff --git a/package.json b/package.json index 647f7cd16eb5..f3c86f30b72c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "eslint-plugin-react": "^7.1.0", "eslint-plugin-relay": "~0.0.19", "eslint-plugin-unicorn": "^3.0.0", - "flow-bin": "^0.61.0", + "flow-bin": "^0.64.0", "glob": "^7.1.1", "graceful-fs": "^4.1.11", "immutable": "^4.0.0-rc.7", diff --git a/packages/jest-cli/src/reporters/Status.js b/packages/jest-cli/src/reporters/Status.js index b30f57696f40..d3b7d9798c15 100644 --- a/packages/jest-cli/src/reporters/Status.js +++ b/packages/jest-cli/src/reporters/Status.js @@ -70,7 +70,7 @@ export default class Status { _emitScheduled: boolean; _estimatedTime: number; _height: number; - _interval: number; + _interval: IntervalID; _aggregatedResults: AggregatedResult; _lastUpdated: number; _showStatus: boolean; diff --git a/packages/jest-haste-map/src/index.js b/packages/jest-haste-map/src/index.js index 8da5e1b39868..c2f19e1d9e3c 100644 --- a/packages/jest-haste-map/src/index.js +++ b/packages/jest-haste-map/src/index.js @@ -18,7 +18,7 @@ import type { MockData, } from 'types/HasteMap'; -import typeof {worker} from './worker'; +import {worker} from './worker'; // eslint-disable-next-line import/no-duplicates import typeof HType from './constants'; @@ -87,7 +87,7 @@ type Watcher = { close(callback: () => void): void, }; -type WorkerInterface = {worker: worker}; +type WorkerInterface = {worker: typeof worker}; export type ModuleMap = HasteModuleMap; export type FS = HasteFS; @@ -199,7 +199,7 @@ const getWhiteList = (list: ?Array): ?RegExp => { class HasteMap extends EventEmitter { _buildPromise: ?Promise; _cachePath: Path; - _changeInterval: number; + _changeInterval: IntervalID; _console: Console; _options: InternalOptions; _watchers: Array; @@ -519,14 +519,14 @@ class HasteMap extends EventEmitter { _getWorker(options: ?{forceInBand: boolean}): WorkerInterface { if (!this._worker) { if ((options && options.forceInBand) || this._options.maxWorkers <= 1) { - this._worker = require('./worker'); + this._worker = {worker}; } else { // $FlowFixMe: assignment of a worker with custom properties. - this._worker = new Worker(require.resolve('./worker'), { + this._worker = (new Worker(require.resolve('./worker'), { exposedMethods: ['worker'], maxRetries: 3, numWorkers: this._options.maxWorkers, - }); + }): {worker: typeof worker}); } } diff --git a/yarn.lock b/yarn.lock index 70019f611eda..83e4ab38123d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3325,9 +3325,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.61.0: - version "0.61.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35" +flow-bin@^0.64.0: + version "0.64.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.64.0.tgz#ddd3fb3b183ab1ab35a5d5dec9caf5ebbcded167" flow-remove-types@^1.1.0: version "1.2.3" @@ -5598,6 +5598,15 @@ node-notifier@^5.1.2: shellwords "^0.1.0" which "^1.2.12" +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + node-pre-gyp@^0.6.39: version "0.6.39" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" @@ -7222,7 +7231,7 @@ shelljs@^0.7.8: interpret "^1.0.0" rechoir "^0.6.2" -shellwords@^0.1.0: +shellwords@^0.1.0, shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -8196,7 +8205,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.2.1, which@^1.2.12, which@^1.2.14, which@^1.2.9: +which@^1.2.1, which@^1.2.12, which@^1.2.14, which@^1.2.9, which@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: