From ab9f501c24ba778a2f9a79bbad49634fc3b343ec Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 6 Mar 2025 10:29:27 -0800 Subject: [PATCH] Update Community CLI Flow types (#49866) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49866 Scope down type definitions to the subset of CLI we are currently explicitly referencing. Rename/bump to `19.x`. Related to: - https://github.com/facebook/react-native/pull/45380 - https://github.com/react-native-community/cli/pull/2584 - (others) Changelog: [Internal] Reviewed By: rshest Differential Revision: D70699083 fbshipit-source-id: 43af1b529d9b95f3d8ba955588af6a09367cdcea --- ...i_v12.x.x.js => cli-server-api_v19.x.x.js} | 2 -- .../cli-tools_v12.x.x.js | 29 ------------------- ...-types_v12.x.x.js => cli-types_v19.x.x.js} | 6 ++-- 3 files changed, 3 insertions(+), 34 deletions(-) rename flow-typed/npm/@react-native-community/{cli-server-api_v12.x.x.js => cli-server-api_v19.x.x.js} (94%) delete mode 100644 flow-typed/npm/@react-native-community/cli-tools_v12.x.x.js rename flow-typed/npm/@react-native-community/{cli-types_v12.x.x.js => cli-types_v19.x.x.js} (85%) diff --git a/flow-typed/npm/@react-native-community/cli-server-api_v12.x.x.js b/flow-typed/npm/@react-native-community/cli-server-api_v19.x.x.js similarity index 94% rename from flow-typed/npm/@react-native-community/cli-server-api_v12.x.x.js rename to flow-typed/npm/@react-native-community/cli-server-api_v19.x.x.js index bdaa66e863e903..6c71e6767890c2 100644 --- a/flow-typed/npm/@react-native-community/cli-server-api_v12.x.x.js +++ b/flow-typed/npm/@react-native-community/cli-server-api_v19.x.x.js @@ -42,6 +42,4 @@ declare module '@react-native-community/cli-server-api' { }, ... }; - - declare export const indexPageMiddleware: NextHandleFunction; } diff --git a/flow-typed/npm/@react-native-community/cli-tools_v12.x.x.js b/flow-typed/npm/@react-native-community/cli-tools_v12.x.x.js deleted file mode 100644 index 94a647ae4961ec..00000000000000 --- a/flow-typed/npm/@react-native-community/cli-tools_v12.x.x.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict - * @format - * @oncall react_native - */ - -declare module '@react-native-community/cli-tools' { - declare export class CLIError extends Error { - constructor(msg: string, originalError?: Error | mixed | string): this; - } - - declare export const logger: $ReadOnly<{ - debug: (...message: Array) => void, - error: (...message: Array) => void, - log: (...message: Array) => void, - info: (...message: Array) => void, - warn: (...message: Array) => void, - ... - }>; - - declare export const version: $ReadOnly<{ - logIfUpdateAvailable: (projectRoot: string) => Promise, - }>; -} diff --git a/flow-typed/npm/@react-native-community/cli-types_v12.x.x.js b/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js similarity index 85% rename from flow-typed/npm/@react-native-community/cli-types_v12.x.x.js rename to flow-typed/npm/@react-native-community/cli-types_v19.x.x.js index a8057dac890f1d..18590378349da8 100644 --- a/flow-typed/npm/@react-native-community/cli-types_v12.x.x.js +++ b/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js @@ -10,15 +10,15 @@ */ declare module '@react-native-community/cli-types' { - declare export type CommandFunction = ( + declare type CommandFunction = ( argv: Array, ctx: Config, args: Args, ) => Promise | void; - declare export type OptionValue = string | boolean | number; + declare type OptionValue = string | boolean | number; - declare export type CommandOption OptionValue> = { + declare type CommandOption OptionValue> = { name: string, description?: string, parse?: (val: string) => any,