From 4540668c1598075f7ae46449bcbcbb70f69fcd8a Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Wed, 7 Jun 2023 13:44:13 -0700 Subject: [PATCH] Move flow-typed definitions to repo root (#37636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37636 Moves `flow-typed/` directory from `packages/react-native/flow-typed/` to the repo root. - This is a more suitable location for `flow-typed` definitions for 3P dependencies to be used across React Native packages. - **Breaking**: We no longer publish these 3P libdefs as part of the `react-native` package (assuming that external use of React Native with Flow is extremely rare, and that these projects can manage their own package libdefs). Changelog: [General][Breaking] Remove included `flow-typed/` directory from the `react-native` package - **Upgrade instructions**: Projects using Flow should install or replicate third party `flow-typed` definitions for React Native dependencies — see https://github.com/facebook/react-native/tree/main/flow-typed and [#37636](https://github.com/facebook/react-native/pull/37636). Reviewed By: hoxyq Differential Revision: D46313482 fbshipit-source-id: 3d97d5408e44dd43132664c4933f3ff1075f90a1 --- .eslintrc.js | 17 ++++++++--------- .flowconfig | 2 +- .flowconfig.android | 2 +- .../npm/base64-js_v1.x.x.js | 0 .../npm/glob_v7.x.x.js | 0 .../npm/pretty-format_v26.x.x.js | 0 .../npm/promise_v8.x.x.js | 0 .../npm/react-dom_v17.x.x.js | 0 .../npm/react-test-renderer_v16.x.x.js | 0 .../npm/stacktrace-parser_v0.1.x.js | 0 .../npm/yargs_v17.x.x.js | 0 packages/react-native/package.json | 1 - 12 files changed, 10 insertions(+), 12 deletions(-) rename {packages/react-native/flow-typed => flow-typed}/npm/base64-js_v1.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/glob_v7.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/pretty-format_v26.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/promise_v8.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/react-dom_v17.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/react-test-renderer_v16.x.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/stacktrace-parser_v0.1.x.js (100%) rename {packages/react-native/flow-typed => flow-typed}/npm/yargs_v17.x.x.js (100%) diff --git a/.eslintrc.js b/.eslintrc.js index 622c41bf0d51c0..6cae9fc20d4125 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,7 +34,14 @@ module.exports = { 'no-undef': 0, }, }, - + { + files: ['flow-typed/**/*.js'], + rules: { + 'lint/valid-flow-typed-signature': 2, + 'no-unused-vars': 0, + quotes: 0, + }, + }, { files: ['packages/react-native/Libraries/**/*.js'], rules: { @@ -46,14 +53,6 @@ module.exports = { 'lint/sort-imports': 1, }, }, - { - files: ['packages/react-native/flow-typed/**/*.js'], - rules: { - 'lint/valid-flow-typed-signature': 2, - 'no-unused-vars': 0, - quotes: 0, - }, - }, { files: [ '**/__fixtures__/**/*.js', diff --git a/.flowconfig b/.flowconfig index c09b7d604226c4..d313861fc746d3 100644 --- a/.flowconfig +++ b/.flowconfig @@ -25,9 +25,9 @@ .*/node_modules/.* [libs] +flow-typed/ packages/react-native/interface.js packages/react-native/flow/ -packages/react-native/flow-typed/ [options] enums=true diff --git a/.flowconfig.android b/.flowconfig.android index e9103ee5a650d2..543e30dc6034b2 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -25,9 +25,9 @@ .*/node_modules/.* [libs] +flow-typed/ packages/react-native/interface.js packages/react-native/flow/ -packages/react-native/flow-typed/ [options] enums=true diff --git a/packages/react-native/flow-typed/npm/base64-js_v1.x.x.js b/flow-typed/npm/base64-js_v1.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/base64-js_v1.x.x.js rename to flow-typed/npm/base64-js_v1.x.x.js diff --git a/packages/react-native/flow-typed/npm/glob_v7.x.x.js b/flow-typed/npm/glob_v7.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/glob_v7.x.x.js rename to flow-typed/npm/glob_v7.x.x.js diff --git a/packages/react-native/flow-typed/npm/pretty-format_v26.x.x.js b/flow-typed/npm/pretty-format_v26.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/pretty-format_v26.x.x.js rename to flow-typed/npm/pretty-format_v26.x.x.js diff --git a/packages/react-native/flow-typed/npm/promise_v8.x.x.js b/flow-typed/npm/promise_v8.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/promise_v8.x.x.js rename to flow-typed/npm/promise_v8.x.x.js diff --git a/packages/react-native/flow-typed/npm/react-dom_v17.x.x.js b/flow-typed/npm/react-dom_v17.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/react-dom_v17.x.x.js rename to flow-typed/npm/react-dom_v17.x.x.js diff --git a/packages/react-native/flow-typed/npm/react-test-renderer_v16.x.x.js b/flow-typed/npm/react-test-renderer_v16.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/react-test-renderer_v16.x.x.js rename to flow-typed/npm/react-test-renderer_v16.x.x.js diff --git a/packages/react-native/flow-typed/npm/stacktrace-parser_v0.1.x.js b/flow-typed/npm/stacktrace-parser_v0.1.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/stacktrace-parser_v0.1.x.js rename to flow-typed/npm/stacktrace-parser_v0.1.x.js diff --git a/packages/react-native/flow-typed/npm/yargs_v17.x.x.js b/flow-typed/npm/yargs_v17.x.x.js similarity index 100% rename from packages/react-native/flow-typed/npm/yargs_v17.x.x.js rename to flow-typed/npm/yargs_v17.x.x.js diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 31ff4085f1175b..67225d5695f41f 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -34,7 +34,6 @@ "build.gradle.kts", "cli.js", "flow", - "flow-typed", "gradle.properties", "index.js", "interface.js",