Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions flow-typed/npm/@react-native-community/cli-tools_v12.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,38 @@
*/

declare module '@react-native-community/cli-tools' {
declare export function addInteractionListener(
callback: (options: {pause: boolean, canEscape?: boolean}) => void,
): void;

declare export class CLIError extends Error {
constructor(msg: string, originalError?: Error | mixed | string): this;
}

declare export function getPidFromPort(port: number): number | null;

declare export function handlePortUnavailable(
initialPort: number,
projectRoot: string,
initialPackager?: boolean,
): Promise<{
port: number,
packager: boolean,
}>;

declare export function hookStdout(callback: Function): () => void;

declare export function isPackagerRunning(
packagerPort: string | number | void,
): Promise<
| {
status: 'running',
root: string,
}
| 'not_running'
| 'unrecognized',
>;

declare export const logger: $ReadOnly<{
success: (...message: Array<string>) => void,
info: (...message: Array<string>) => void,
Expand All @@ -29,6 +55,8 @@ declare module '@react-native-community/cli-tools' {
enable: () => void,
}>;

declare export function logAlreadyRunningBundler(port: number): void;

declare export function resolveNodeModuleDir(
root: string,
packageName: string,
Expand Down
30 changes: 30 additions & 0 deletions flow-typed/npm/@react-native-community/cli-types_v12.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@
*/

declare module '@react-native-community/cli-types' {
declare export type CommandFunction<Args = Object> = (
argv: Array<string>,
ctx: Config,
args: Args,
) => Promise<void> | void;

declare export type OptionValue = string | boolean | number;

declare export type CommandOption<T = (ctx: Config) => OptionValue> = {
name: string,
description?: string,
parse?: (val: string) => any,
default?: OptionValue | T,
};

declare export type Command = {
name: string,
description?: string,
examples?: Array<{
desc: string,
cmd: string,
}>,
pkg?: {
name: string,
version: string,
},
func: CommandFunction<Object>,
options?: Array<CommandOption<(ctx: Config) => OptionValue>>,
};

declare type PlatformConfig = {
npmPackageName: string,
...
Expand Down
104 changes: 104 additions & 0 deletions flow-typed/npm/chalk_v4.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* 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
* @format
* @oncall react_native
*/

declare module 'chalk' {
declare type TemplateStringsArray = $ReadOnlyArray<string>;

declare type Level = $Values<{
None: 0,
Basic: 1,
Ansi256: 2,
TrueColor: 3,
...
}>;

declare type ChalkOptions = {
enabled?: boolean,
level?: Level,
};

declare type ColorSupport = {
level: Level,
hasBasic: boolean,
has256: boolean,
has16m: boolean,
};

declare type Chalk = {
(...text: string[]): string,
(text: TemplateStringsArray, ...placeholders: string[]): string,
Instance(options?: ChalkOptions): Chalk,
level: Level,
rgb(r: number, g: number, b: number): Chalk,
hsl(h: number, s: number, l: number): Chalk,
hsv(h: number, s: number, v: number): Chalk,
hwb(h: number, w: number, b: number): Chalk,
bgHex(color: string): Chalk,
bgKeyword(color: string): Chalk,
bgRgb(r: number, g: number, b: number): Chalk,
bgHsl(h: number, s: number, l: number): Chalk,
bgHsv(h: number, s: number, v: number): Chalk,
bgHwb(h: number, w: number, b: number): Chalk,
hex(color: string): Chalk,
keyword(color: string): Chalk,

+reset: Chalk,
+bold: Chalk,
+dim: Chalk,
+italic: Chalk,
+underline: Chalk,
+inverse: Chalk,
+hidden: Chalk,
+strikethrough: Chalk,

+visible: Chalk,

+black: Chalk,
+red: Chalk,
+green: Chalk,
+yellow: Chalk,
+blue: Chalk,
+magenta: Chalk,
+cyan: Chalk,
+white: Chalk,
+gray: Chalk,
+grey: Chalk,
+blackBright: Chalk,
+redBright: Chalk,
+greenBright: Chalk,
+yellowBright: Chalk,
+blueBright: Chalk,
+magentaBright: Chalk,
+cyanBright: Chalk,
+whiteBright: Chalk,

+bgBlack: Chalk,
+bgRed: Chalk,
+bgGreen: Chalk,
+bgYellow: Chalk,
+bgBlue: Chalk,
+bgMagenta: Chalk,
+bgCyan: Chalk,
+bgWhite: Chalk,
+bgBlackBright: Chalk,
+bgRedBright: Chalk,
+bgGreenBright: Chalk,
+bgYellowBright: Chalk,
+bgBlueBright: Chalk,
+bgMagentaBright: Chalk,
+bgCyanBright: Chalk,
+bgWhiteBrigh: Chalk,

supportsColor: ColorSupport,
};

declare module.exports: Chalk;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
"jest": "^29.2.1",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "0.77.0",
"metro-memory-fs": "0.77.0",
"metro-babel-register": "0.78.0",
"metro-memory-fs": "0.78.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
Expand Down
7 changes: 0 additions & 7 deletions packages/community-cli-plugin/launchPackager.bat

This file was deleted.

10 changes: 0 additions & 10 deletions packages/community-cli-plugin/launchPackager.command

This file was deleted.

18 changes: 9 additions & 9 deletions packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
"./package.json": "./package.json"
},
"files": [
"dist",
"launchPackager.bat",
"launchPackager.command"
"dist"
],
"dependencies": {
"@react-native-community/cli-server-api": "12.0.0-alpha.7",
"@react-native-community/cli-tools": "12.0.0-alpha.7",
"@react-native-community/cli-server-api": "12.0.0-alpha.9",
"@react-native-community/cli-tools": "12.0.0-alpha.9",
"@react-native/metro-babel-transformer": "^0.73.11",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "0.77.0",
"metro-config": "0.77.0",
"metro-core": "0.77.0",
"metro-resolver": "0.77.0",
"metro": "0.78.0",
"metro-config": "0.78.0",
"metro-core": "0.78.0",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "0.78.0"
},
"engines": {
"node": ">=18"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down Expand Up @@ -64,7 +64,7 @@ async function buildBundleWithConfig(
process.env.NODE_ENV = args.dev ? 'development' : 'production';

let sourceMapUrl = args.sourcemapOutput;
if (sourceMapUrl && !args.sourcemapUseAbsolutePath) {
if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {
sourceMapUrl = path.basename(sourceMapUrl);
}

Expand Down
5 changes: 3 additions & 2 deletions packages/community-cli-plugin/src/commands/bundle/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand All @@ -22,7 +22,8 @@ export function bundleWithOutput(
_: Array<string>,
config: Config,
args: CommandLineArgs,
output: any, // untyped metro/src/shared/output/bundle or metro/src/shared/output/RamBundle
// $FlowFixMe[unclear-type] untyped metro/src/shared/output/bundle or metro/src/shared/output/RamBundle
output: any,
): Promise<void> {
return buildBundle(args, config, output);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @flow strict-local
* @format
* @oncall react_native
*/
Expand Down
Loading