From b03f7413cc4740b05333ef49dfcf3e9a12fd5c44 Mon Sep 17 00:00:00 2001 From: Kacper Wiszczuk Date: Fri, 17 May 2019 22:32:54 +0200 Subject: [PATCH] chore: migrate `tools` to TypeScript (#296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Migrate tools package to Typescript * Prebuild ts * Improve yarn build-clean * Remove unnecessary statements * Fix linting * Fix eslint * Update packages/tools/src/isPackagerRunning.ts Co-Authored-By: Michał Pierzchała * adjust package.json * add vscode helper settings * remove dead node-fetch references --- .eslintrc.js | 4 +- .gitignore | 1 + .vscode/extensions.json | 10 + .vscode/settings.json | 24 +++ babel.config.js | 11 +- jest.config.js | 2 +- package.json | 15 +- packages/cli/package.json | 1 - packages/platform-android/package.json | 1 - packages/tools/package.json | 8 +- .../src/__mocks__/{logger.js => logger.ts} | 1 - ...yType-test.js => groupFilesByType.test.ts} | 2 - packages/tools/src/{errors.js => errors.ts} | 3 +- ...rTerminal.js => getDefaultUserTerminal.ts} | 2 +- ...roupFilesByType.js => groupFilesByType.ts} | 13 +- packages/tools/src/{index.js => index.ts} | 3 - ...ackagerRunning.js => isPackagerRunning.ts} | 19 +- packages/tools/src/{logger.js => logger.ts} | 3 - packages/tools/tsconfig.json | 7 + scripts/build.js | 31 ++- scripts/buildTs.js | 47 +++++ scripts/helpers.js | 27 +++ tsconfig.json | 25 +++ yarn.lock | 177 +++++++++++++++++- 24 files changed, 367 insertions(+), 70 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json rename packages/tools/src/__mocks__/{logger.js => logger.ts} (96%) rename packages/tools/src/__tests__/{groupFilesByType-test.js => groupFilesByType.test.ts} (92%) rename packages/tools/src/{errors.js => errors.ts} (93%) rename packages/tools/src/{getDefaultUserTerminal.js => getDefaultUserTerminal.ts} (63%) rename packages/tools/src/{groupFilesByType.js => groupFilesByType.ts} (69%) rename packages/tools/src/{index.js => index.ts} (94%) rename packages/tools/src/{isPackagerRunning.js => isPackagerRunning.ts} (72%) rename packages/tools/src/{logger.js => logger.ts} (98%) create mode 100644 packages/tools/tsconfig.json create mode 100644 scripts/buildTs.js create mode 100644 tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index 602287973..494825ac6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,7 +7,7 @@ module.exports = { 'prettier/prettier': [2, 'fb'], }, // @todo: remove once we cover whole codebase with types - plugins: ['eslint-plugin-import'], + plugins: ['import'], settings: { react: { version: 'latest', @@ -16,6 +16,8 @@ module.exports = { alias: { map: [['types', './types/index.js']], }, + // Use /tsconfig.json for typescript resolution + typescript: {}, }, }, overrides: [ diff --git a/.gitignore b/.gitignore index a0031dbb3..71440e6ef 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ package-lock.json build/ .eslintcache !packages/cli/src/commands/init/__fixtures__/editTemplate/node_modules +*.tsbuildinfo diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..961c02482 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "dbaeumer.vscode-eslint", + "redhat.vscode-yaml", + "flowtype.flow-for-vscode", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..029ba7597 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,24 @@ +{ + "editor.rulers": [80], + "files.exclude": { + "**/.git": true, + "**/node_modules": true, + "**/build": true + }, + "editor.formatOnSave": true, + "flow.useNPMPackagedFlow": true, + "javascript.validate.enable": false, + "prettier.eslintIntegration": true, + "eslint.validate": [ + "javascript", + "javascriptreact", + { + "language": "typescript", + "autoFix": true + }, + { + "language": "typescriptreact", + "autoFix": true + } + ] +} diff --git a/babel.config.js b/babel.config.js index bf19c198a..f7a77eb48 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,15 @@ module.exports = { babelrcRoots: ['packages/*'], + overrides: [ + { + presets: ['@babel/preset-flow'], + test: '**/*.js', + }, + { + presets: ['@babel/preset-typescript'], + test: '**/*.ts', + }, + ], presets: [ [ require.resolve('@babel/preset-env'), @@ -8,7 +18,6 @@ module.exports = { useBuiltIns: 'entry', }, ], - require.resolve('@babel/preset-flow'), ], plugins: [ require.resolve('@babel/plugin-transform-strict-mode'), diff --git a/jest.config.js b/jest.config.js index eb479491c..e98503396 100644 --- a/jest.config.js +++ b/jest.config.js @@ -12,7 +12,7 @@ module.exports = { ...common, displayName: 'unit', setupFiles: ['/jest/setupUnitTests.js'], - testMatch: ['/**/__tests__/*{.,-}test.js'], + testMatch: ['/**/__tests__/*{.,-}test.[jt]s'], }, ], }; diff --git a/package.json b/package.json index 4993f4365..b698bf2c2 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,16 @@ "packages/*" ], "scripts": { + "prebuild": "yarn build:ts", "build": "node ./scripts/build.js", - "build-clean": "rm -rf ./packages/*/build", + "build:ts": "node ./scripts/buildTs.js", + "build-clean": "rm -rf ./packages/*/build ./packages/*/tsconfig.tsbuildinfo", "watch": "node ./scripts/watch.js", "test": "jest", "test:ci:unit": "jest packages --ci --coverage", "test:ci:e2e": "jest e2e --ci -i", + "lint": "eslint --ext .js,.ts . --cache --report-unused-disable-directives", "test:ci:cocoapods": "ruby packages/platform-ios/native_modules.rb", - "lint": "eslint . --cache --report-unused-disable-directives", "flow-check": "flow check", "postinstall": "yarn build", "publish": "yarn build-clean && yarn build && lerna publish" @@ -22,12 +24,16 @@ "@babel/plugin-transform-strict-mode": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-flow": "^7.0.0", - "@react-native-community/eslint-config": "^0.0.3", + "@babel/preset-typescript": "^7.3.3", + "@react-native-community/eslint-config": "^0.0.5", + "@types/jest": "^24.0.11", + "@types/node": "^11.13.0", "babel-jest": "^24.6.0", "babel-plugin-module-resolver": "^3.2.0", "chalk": "^2.4.2", "eslint": "^5.10.0", "eslint-import-resolver-alias": "^1.1.2", + "eslint-import-resolver-typescript": "^1.1.1", "eslint-plugin-import": "^2.17.0", "execa": "^1.0.0", "flow-bin": "^0.97.0", @@ -38,6 +44,7 @@ "metro-memory-fs": "^0.53.1", "micromatch": "^3.1.10", "mkdirp": "^0.5.1", - "string-length": "^2.0.0" + "string-length": "^2.0.0", + "typescript": "^3.4.5" } } diff --git a/packages/cli/package.json b/packages/cli/package.json index 258cdb597..21c27e401 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -49,7 +49,6 @@ "minimist": "^1.2.0", "mkdirp": "^0.5.1", "morgan": "^1.9.0", - "node-fetch": "^2.2.0", "node-notifier": "^5.2.1", "open": "^6.2.0", "ora": "^3.4.0", diff --git a/packages/platform-android/package.json b/packages/platform-android/package.json index 06b977ff5..038c318c2 100644 --- a/packages/platform-android/package.json +++ b/packages/platform-android/package.json @@ -5,7 +5,6 @@ "dependencies": { "@react-native-community/cli-tools": "^2.0.0-alpha.20", "logkitty": "^0.4.0", - "node-fetch": "^2.2.0", "slash": "^2.0.0", "xmldoc": "^0.4.0" }, diff --git a/packages/tools/package.json b/packages/tools/package.json index 8bf2aace3..df57dd382 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -5,7 +5,13 @@ "dependencies": { "chalk": "^1.1.1", "lodash": "^4.17.5", - "mime": "^1.3.4" + "mime": "^2.4.1", + "node-fetch": "^2.5.0" + }, + "devDependencies": { + "@types/lodash": "^4.14.123", + "@types/mime": "^2.0.1", + "@types/node-fetch": "^2.3.3" }, "files": [ "build" diff --git a/packages/tools/src/__mocks__/logger.js b/packages/tools/src/__mocks__/logger.ts similarity index 96% rename from packages/tools/src/__mocks__/logger.js rename to packages/tools/src/__mocks__/logger.ts index 33dbe25a2..8cc725657 100644 --- a/packages/tools/src/__mocks__/logger.js +++ b/packages/tools/src/__mocks__/logger.ts @@ -4,7 +4,6 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format */ module.exports.out = () => jest.fn(); diff --git a/packages/tools/src/__tests__/groupFilesByType-test.js b/packages/tools/src/__tests__/groupFilesByType.test.ts similarity index 92% rename from packages/tools/src/__tests__/groupFilesByType-test.js rename to packages/tools/src/__tests__/groupFilesByType.test.ts index 17f02ed59..e15a985cc 100644 --- a/packages/tools/src/__tests__/groupFilesByType-test.js +++ b/packages/tools/src/__tests__/groupFilesByType.test.ts @@ -4,8 +4,6 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format - * @emails oncall+javascript_foundation */ import groupFilesByType from '../groupFilesByType'; diff --git a/packages/tools/src/errors.js b/packages/tools/src/errors.ts similarity index 93% rename from packages/tools/src/errors.js rename to packages/tools/src/errors.ts index 6cb5de299..5c59f26b3 100644 --- a/packages/tools/src/errors.js +++ b/packages/tools/src/errors.ts @@ -16,7 +16,8 @@ export class CLIError extends Error { this.stack = typeof originError === 'string' ? originError - : originError.stack + : originError.stack || + '' .split('\n') .slice(0, 2) .join('\n'); diff --git a/packages/tools/src/getDefaultUserTerminal.js b/packages/tools/src/getDefaultUserTerminal.ts similarity index 63% rename from packages/tools/src/getDefaultUserTerminal.js rename to packages/tools/src/getDefaultUserTerminal.ts index 48550b61b..a5bf91914 100644 --- a/packages/tools/src/getDefaultUserTerminal.js +++ b/packages/tools/src/getDefaultUserTerminal.ts @@ -1,4 +1,4 @@ -const getDefaultUserTerminal = (): ?string => +const getDefaultUserTerminal = (): string | undefined => process.env.REACT_TERMINAL || process.env.TERM_PROGRAM; export default getDefaultUserTerminal; diff --git a/packages/tools/src/groupFilesByType.js b/packages/tools/src/groupFilesByType.ts similarity index 69% rename from packages/tools/src/groupFilesByType.js rename to packages/tools/src/groupFilesByType.ts index cc9a723e8..c42215252 100644 --- a/packages/tools/src/groupFilesByType.js +++ b/packages/tools/src/groupFilesByType.ts @@ -4,22 +4,11 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow */ import {groupBy} from 'lodash'; import mime from 'mime'; -/** - * Since there are no officially registered MIME types - * for ttf/otf yet http://www.iana.org/assignments/media-types/media-types.xhtml, - * we define two non-standard ones for the sake of parsing - */ -mime.define({ - 'font/opentype': ['otf'], - 'font/truetype': ['ttf'], -}); - /** * Given an array of files, it groups it by it's type. * Type of the file is inferred from it's mimetype based on the extension @@ -32,5 +21,5 @@ mime.define({ * the returned object will be: {font: ['fonts/a.ttf'], image: ['images/b.jpg']} */ export default function groupFilesByType(assets: Array) { - return groupBy(assets, type => mime.lookup(type).split('/')[0]); + return groupBy(assets, type => (mime.getType(type) || '').split('/')[0]); } diff --git a/packages/tools/src/index.js b/packages/tools/src/index.ts similarity index 94% rename from packages/tools/src/index.js rename to packages/tools/src/index.ts index 08c20616d..d99e20bf0 100644 --- a/packages/tools/src/index.js +++ b/packages/tools/src/index.ts @@ -1,6 +1,3 @@ -/** - * @flow - */ export {default as logger} from './logger'; export {default as groupFilesByType} from './groupFilesByType'; export {default as isPackagerRunning} from './isPackagerRunning'; diff --git a/packages/tools/src/isPackagerRunning.js b/packages/tools/src/isPackagerRunning.ts similarity index 72% rename from packages/tools/src/isPackagerRunning.js rename to packages/tools/src/isPackagerRunning.ts index 393fdf817..ff9273346 100644 --- a/packages/tools/src/isPackagerRunning.js +++ b/packages/tools/src/isPackagerRunning.ts @@ -16,18 +16,17 @@ import fetch from 'node-fetch'; * - `not_running`: the packager nor any process is running on the expected port. * - `unrecognized`: one other process is running on the port we expect the packager to be running. */ -function isPackagerRunning( +async function isPackagerRunning( packagerPort: string = process.env.RCT_METRO_PORT || '8081', ): Promise<'running' | 'not_running' | 'unrecognized'> { - return fetch(`http://localhost:${packagerPort}/status`).then( - res => - res - .text() - .then(body => - body === 'packager-status:running' ? 'running' : 'unrecognized', - ), - () => 'not_running', - ); + try { + const result = await fetch(`http://localhost:${packagerPort}/status`); + const body = await result.text(); + + return body === 'packager-status:running' ? 'running' : 'unrecognized'; + } catch (_error) { + return 'not_running'; + } } export default isPackagerRunning; diff --git a/packages/tools/src/logger.js b/packages/tools/src/logger.ts similarity index 98% rename from packages/tools/src/logger.js rename to packages/tools/src/logger.ts index 8bb9cbddd..77cc37138 100644 --- a/packages/tools/src/logger.js +++ b/packages/tools/src/logger.ts @@ -1,6 +1,3 @@ -/** - * @flow - */ import chalk from 'chalk'; const SEPARATOR = ', '; diff --git a/packages/tools/tsconfig.json b/packages/tools/tsconfig.json new file mode 100644 index 000000000..7bb06bce6 --- /dev/null +++ b/packages/tools/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build" + } +} diff --git a/scripts/build.js b/scripts/build.js index cceda31af..b0c10568d 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -25,31 +25,21 @@ const mkdirp = require('mkdirp'); const babel = require('@babel/core'); const chalk = require('chalk'); const micromatch = require('micromatch'); -const stringLength = require('string-length'); -const {PACKAGES_DIR, getPackages} = require('./helpers'); +const { + PACKAGES_DIR, + getPackages, + OK, + adjustToTerminalWidth, +} = require('./helpers'); -const OK = chalk.reset.inverse.bold.green(' DONE '); const SRC_DIR = 'src'; const BUILD_DIR = 'build'; const JS_FILES_PATTERN = '**/*.js'; +const TS_FILE_PATTERN = '**/*.ts'; const IGNORE_PATTERN = '**/__{tests,mocks,fixtures}__/**'; const transformOptions = require('../babel.config.js'); -const adjustToTerminalWidth = str => { - const columns = process.stdout.columns || 80; - const WIDTH = columns - stringLength(OK) + 1; - const strs = str.match(new RegExp(`(.{1,${WIDTH}})`, 'g')); - let lastString = strs[strs.length - 1]; - if (lastString.length < WIDTH) { - lastString += Array(WIDTH - lastString.length).join(chalk.dim('.')); - } - return strs - .slice(0, -1) - .concat(lastString) - .join('\n'); -}; - function getPackageName(file) { return path.relative(PACKAGES_DIR, file).split(path.sep)[0]; } @@ -59,7 +49,7 @@ function getBuildPath(file, buildFolder) { const pkgSrcPath = path.resolve(PACKAGES_DIR, pkgName, SRC_DIR); const pkgBuildPath = path.resolve(PACKAGES_DIR, pkgName, buildFolder); const relativeToSrcPath = path.relative(pkgSrcPath, file); - return path.resolve(pkgBuildPath, relativeToSrcPath); + return path.resolve(pkgBuildPath, relativeToSrcPath).replace(/\.ts$/, '.js'); } function buildNodePackage(p) { @@ -89,7 +79,10 @@ function buildFile(file, silent) { mkdirp.sync(path.dirname(destPath), '777'); - if (!micromatch.isMatch(file, JS_FILES_PATTERN)) { + if ( + !micromatch.isMatch(file, JS_FILES_PATTERN) && + !micromatch.isMatch(file, TS_FILE_PATTERN) + ) { fs.createReadStream(file).pipe(fs.createWriteStream(destPath)); silent || process.stdout.write( diff --git a/scripts/buildTs.js b/scripts/buildTs.js new file mode 100644 index 000000000..5ab6c6c8f --- /dev/null +++ b/scripts/buildTs.js @@ -0,0 +1,47 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const fs = require('fs'); +const path = require('path'); + +const chalk = require('chalk'); +const execa = require('execa'); +const {getPackages, adjustToTerminalWidth, OK} = require('./helpers'); + +const packages = getPackages(); + +const packagesWithTs = packages.filter(p => + fs.existsSync(path.resolve(p, 'tsconfig.json')), +); + +const args = [ + path.resolve( + require.resolve('typescript/package.json'), + '..', + require('typescript/package.json').bin.tsc, + ), + '-b', + ...packagesWithTs, + ...process.argv.slice(2), +]; + +console.log(chalk.inverse('Building TypeScript definition files')); +process.stdout.write(adjustToTerminalWidth('Building\n')); + +try { + execa.sync('node', args, {stdio: 'inherit'}); + process.stdout.write(`${OK}\n`); +} catch (e) { + process.stdout.write('\n'); + console.error( + chalk.inverse.red('Unable to build TypeScript definition files'), + ); + console.error(e.stack); + process.exitCode = 1; +} diff --git a/scripts/helpers.js b/scripts/helpers.js index 3dfdf7f3c..97c108ba1 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -1,8 +1,19 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + const fs = require('fs'); const path = require('path'); +const chalk = require('chalk'); +const stringLength = require('string-length'); const PACKAGES_DIR = path.resolve(__dirname, '../packages'); +const OK = chalk.reset.inverse.bold.green(' DONE '); + function getPackages() { return fs .readdirSync(PACKAGES_DIR) @@ -10,7 +21,23 @@ function getPackages() { .filter(f => fs.lstatSync(path.resolve(f)).isDirectory()); } +function adjustToTerminalWidth(str) { + const columns = process.stdout.columns || 80; + const WIDTH = columns - stringLength(OK) + 1; + const strs = str.match(new RegExp(`(.{1,${WIDTH}})`, 'g')); + let lastString = strs[strs.length - 1]; + if (lastString.length < WIDTH) { + lastString += Array(WIDTH - lastString.length).join(chalk.dim('.')); + } + return strs + .slice(0, -1) + .concat(lastString) + .join('\n'); +} + module.exports = { getPackages, PACKAGES_DIR, + adjustToTerminalWidth, + OK, }; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..bc0c60880 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es2017", + "module": "commonjs", + "lib": ["es2017"], + "declaration": true, + "declarationMap": true, + "composite": true, + "emitDeclarationOnly": true, + + "strict": true, + + /* Additional Checks */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + + /* Module Resolution Options */ + "moduleResolution": "node", + "esModuleInterop": true, + "resolveJsonModule": true + }, + "exclude": ["**/__tests__/**/*", "**/build/**/*"] +} diff --git a/yarn.lock b/yarn.lock index 42ac30ffd..a72c5c0fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -430,6 +430,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-typescript@^7.2.0": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" + integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-arrow-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" @@ -831,6 +838,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-typescript" "^7.0.0" +"@babel/plugin-transform-typescript@^7.3.2": + version "7.4.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.0.tgz#0389ec53a34e80f99f708c4ca311181449a68eb1" + integrity sha512-U7/+zKnRZg04ggM/Bm+xmu2B/PrwyDQTT/V89FXWYWNMxBDwSx56u6jtk9SEbfLFbZaEI72L+5LPvQjeZgFCrQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-typescript" "^7.2.0" + "@babel/plugin-transform-unicode-regex@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" @@ -902,6 +917,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.0.0" +"@babel/preset-typescript@^7.3.3": + version "7.3.3" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a" + integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-typescript" "^7.3.2" + "@babel/register@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0.tgz#fa634bae1bfa429f60615b754fc1f1d745edd827" @@ -1863,11 +1886,13 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" -"@react-native-community/eslint-config@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@react-native-community/eslint-config/-/eslint-config-0.0.3.tgz#bf9be8434caa18f85b570cf4e28366f2a7f1ea91" - integrity sha512-YmCiqoiqgSW8YpWYWLwG4WYwVIwvkhfH97COxbin71CuCr5muZPlmhHOFwo2gIQzUvt1ewFb1shtUi1X8TAVhA== +"@react-native-community/eslint-config@^0.0.5": + version "0.0.5" + resolved "https://registry.yarnpkg.com/@react-native-community/eslint-config/-/eslint-config-0.0.5.tgz#584f6493258202a57efc22e7be66966e43832795" + integrity sha512-jwO2tnKaTPTLX5XYXMHGEnFdf543SU7jz98/OF5mDH3b7lP+BOaCD+jVfqqHoDRkcqyPlYiR1CgwVGWpi0vMWg== dependencies: + "@typescript-eslint/eslint-plugin" "^1.5.0" + "@typescript-eslint/parser" "^1.5.0" babel-eslint "10.0.1" eslint-plugin-eslint-comments "^3.1.1" eslint-plugin-flowtype "2.50.3" @@ -1916,6 +1941,50 @@ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.0.tgz#1eb8c033e98cf4e1a4cedcaf8bcafe8cb7591e85" integrity sha512-eAtOAFZefEnfJiRFQBGw1eYqa5GTLCZ1y86N0XSI/D6EB+E8z6VPV/UL7Gi5UEclFqoQk+6NRqEDsfmDLXn8sg== +"@types/jest-diff@*": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89" + integrity sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA== + +"@types/jest@^24.0.11": + version "24.0.11" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.11.tgz#1f099bea332c228ea6505a88159bfa86a5858340" + integrity sha512-2kLuPC5FDnWIDvaJBzsGTBQaBbnDweznicvK7UGYzlIJP4RJR2a4A/ByLUXEyEgag6jz8eHdlWExGDtH3EYUXQ== + dependencies: + "@types/jest-diff" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= + +"@types/lodash@^4.14.123": + version "4.14.123" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d" + integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q== + +"@types/mime@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" + integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw== + +"@types/node-fetch@^2.3.3": + version "2.3.3" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.3.3.tgz#eb9c2a0ce8e9424ebe0c0cbe6f1e8ea7576c1310" + integrity sha512-MIplfRxrDTsIbOLGyFqNWTmxho5Fs710Kul35tEcaqkx9He86mGbSCDvILL0LCMfmm+oJ8tDg51crE9+pJGgiQ== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "12.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.0.tgz#d11813b9c0ff8aaca29f04cbc12817f4c7d656e5" + integrity sha512-Jrb/x3HT4PTJp6a4avhmJCDEVrPdqLfl3e8GGMbpkGGdwAV5UGlIs4vVEfsHHfylZVOKZWpOqmqFH8CbfOZ6kg== + +"@types/node@^11.13.0": + version "11.13.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1" + integrity sha512-rx29MMkRdVmzunmiA4lzBYJNnXsW/PhG4kMBy2ATsYaDjGGR75dCFEVVROKpNwlVdcUX3xxlghKQOeDPBJobng== + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -1926,6 +1995,33 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== +"@typescript-eslint/eslint-plugin@^1.5.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.6.0.tgz#a5ff3128c692393fb16efa403ec7c8a5593dab0f" + integrity sha512-U224c29E2lo861TQZs6GSmyC0OYeRNg6bE9UVIiFBxN2MlA0nq2dCrgIVyyRbC05UOcrgf2Wk/CF2gGOPQKUSQ== + dependencies: + "@typescript-eslint/parser" "1.6.0" + "@typescript-eslint/typescript-estree" "1.6.0" + requireindex "^1.2.0" + tsutils "^3.7.0" + +"@typescript-eslint/parser@1.6.0", "@typescript-eslint/parser@^1.5.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804" + integrity sha512-VB9xmSbfafI+/kI4gUK3PfrkGmrJQfh0N4EScT1gZXSZyUxpsBirPL99EWZg9MmPG0pzq/gMtgkk7/rAHj4aQw== + dependencies: + "@typescript-eslint/typescript-estree" "1.6.0" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0" + integrity sha512-A4CanUwfaG4oXobD5y7EXbsOHjCwn8tj1RDd820etpPAjH+Icjc2K9e/DQM1Hac5zH2BSy+u6bjvvF2wwREvYA== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -3250,6 +3346,11 @@ deepmerge@3.2.0, deepmerge@^3.2.0: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== +deepmerge@^2.0.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" + integrity sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA== + default-require-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" @@ -3564,6 +3665,15 @@ eslint-import-resolver-node@^0.3.2: debug "^2.6.9" resolve "^1.5.0" +eslint-import-resolver-typescript@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-1.1.1.tgz#e6d42172b95144ef16610fe104ef38340edea591" + integrity sha512-jqSfumQ+H5y3FUJ6NjRkbOQSUOlbBucGTN3ELymOtcDBbPjVdm/luvJuCfCaIXGh8sEF26ma1qVdtDgl9ndhUg== + dependencies: + debug "^4.0.1" + resolve "^1.4.0" + tsconfig-paths "^3.6.0" + eslint-module-utils@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49" @@ -5628,6 +5738,13 @@ json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + json5@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" @@ -5886,6 +6003,11 @@ lodash.throttle@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -6351,9 +6473,10 @@ mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mime@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.1.tgz#19eb7357bebbda37df585b14038347721558c715" + integrity sha512-VRUfmQO0rCd3hKwBymAn3kxYzBHr3I/wdVMywgG3HhXOwrCQgN84ZagpdTm2tZ4TNtwsSmyJWYO88mb5XvzGqQ== mimic-fn@^1.0.0: version "1.2.0" @@ -6574,6 +6697,11 @@ node-fetch@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.2.1.tgz#1fe551e0ded6c45b3b3b937d0fb46f76df718d1e" +node-fetch@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.5.0.tgz#8028c49fc1191bba56a07adc6e2a954644a48501" + integrity sha512-YuZKluhWGJwCcUu4RlZstdAxr8bFfOVHakc1mplwHkk8J+tqM1Y5yraYvIUpeX8aY7+crCwiELJq7Vl0o0LWXw== + node-gyp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-4.0.0.tgz#972654af4e5dd0cd2a19081b4b46fe0442ba6f45" @@ -7819,6 +7947,11 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + reselect@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/reselect/-/reselect-3.0.1.tgz#efdaa98ea7451324d092b2b2163a6a1d7a9a2147" @@ -8016,6 +8149,11 @@ sax@~1.1.1: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" +semver@5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -8718,10 +8856,28 @@ trim-right@^1.0.1: resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= -tslib@^1.9.0: +tsconfig-paths@^3.6.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.8.0.tgz#4e34202d5b41958f269cf56b01ed95b853d59f72" + integrity sha512-zZEYFo4sjORK8W58ENkRn9s+HmQFkkwydDG7My5s/fnfr2YYCaiyXe/HBUcIgU8epEKOXwiahOO+KZYjiXlWyQ== + dependencies: + "@types/json5" "^0.0.29" + deepmerge "^2.0.1" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tslib@^1.8.1, tslib@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" +tsutils@^3.7.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.10.0.tgz#6f1c95c94606e098592b0dff06590cf9659227d6" + integrity sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8745,6 +8901,11 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +typescript@^3.4.5: + version "3.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" + integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw== + ua-parser-js@^0.7.18: version "0.7.19" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"