diff --git a/packages/community-cli-plugin/README.md b/packages/community-cli-plugin/README.md index 2f39b8770ecf64..423512ee9ceb32 100644 --- a/packages/community-cli-plugin/README.md +++ b/packages/community-cli-plugin/README.md @@ -15,7 +15,7 @@ Start the React Native development server. #### Usage ```sh -react-native start [options] +npx react-native start [options] ``` #### Options @@ -45,7 +45,7 @@ Build the bundle for the provided JavaScript entry file. #### Usage ```sh -react-native bundle --entry-file [options] +npx react-native bundle --entry-file [options] ``` #### Options @@ -75,7 +75,7 @@ Build the [RAM bundle](https://reactnative.dev/docs/ram-bundles-inline-requires) #### Usage ```sh -react-native ram-bundle --entry-file [options] +npx react-native ram-bundle --entry-file [options] ``` #### Options diff --git a/packages/community-cli-plugin/package.json b/packages/community-cli-plugin/package.json index 881a5bc68fba0a..ed13c21b34ac6e 100644 --- a/packages/community-cli-plugin/package.json +++ b/packages/community-cli-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@react-native/community-cli-plugin", - "version": "0.73.0", + "version": "0.73.1", "description": "Core CLI commands for React Native", "keywords": [ "react-native", diff --git a/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js b/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js index 4ccb4ba0f66ba4..31bb21800b440b 100644 --- a/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js +++ b/packages/community-cli-plugin/src/commands/start/attachKeyHandlers.js @@ -39,7 +39,11 @@ export default function attachKeyHandlers( // $FlowIgnore[prop-missing] process.stdin.setRawMode(true); - const onPressAsync = async (key: string) => { + const execaOptions = { + env: {FORCE_COLOR: chalk.supportsColor ? 'true' : 'false'}, + }; + + const onPress = async (key: string) => { switch (key) { case 'r': messageSocket.broadcast('reload', null); @@ -51,19 +55,27 @@ export default function attachKeyHandlers( break; case 'i': logger.info('Opening app on iOS...'); - execa('npx', [ - 'react-native', - 'run-ios', - ...(cliConfig.project.ios?.watchModeCommandParams ?? []), - ]).stdout?.pipe(process.stdout); + execa( + 'npx', + [ + 'react-native', + 'run-ios', + ...(cliConfig.project.ios?.watchModeCommandParams ?? []), + ], + execaOptions, + ).stdout?.pipe(process.stdout); break; case 'a': logger.info('Opening app on Android...'); - execa('npx', [ - 'react-native', - 'run-android', - ...(cliConfig.project.android?.watchModeCommandParams ?? []), - ]).stdout?.pipe(process.stdout); + execa( + 'npx', + [ + 'react-native', + 'run-android', + ...(cliConfig.project.android?.watchModeCommandParams ?? []), + ], + execaOptions, + ).stdout?.pipe(process.stdout); break; case CTRL_Z: process.emit('SIGTSTP', 'SIGTSTP'); @@ -73,7 +85,7 @@ export default function attachKeyHandlers( } }; - const keyPressHandler = new KeyPressHandler(onPressAsync); + const keyPressHandler = new KeyPressHandler(onPress); const listener = keyPressHandler.createInteractionListener(); addInteractionListener(listener); keyPressHandler.startInterceptingKeyStrokes(); diff --git a/packages/dev-middleware/package.json b/packages/dev-middleware/package.json index f32f164ebb67ff..4dae54297bb4fe 100644 --- a/packages/dev-middleware/package.json +++ b/packages/dev-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@react-native/dev-middleware", - "version": "0.73.0", + "version": "0.73.1", "description": "Dev server middleware for React Native", "keywords": [ "react-native",