Skip to content

Commit

Permalink
Bump community-cli-plugin and dev-middleware, sync changes (facebook#…
Browse files Browse the repository at this point in the history
…39074)

Summary:
Pull Request resolved: facebook#39074

Changelog: [Internal]

Publish new versions of `react-native/community-cli-plugin` and `react-native/dev-middleware` (which are now in a minimum viable state) for early integrators.

Also syncs final upstream changes from CLI:
- react-native-community/cli#2035
- react-native-community/cli#2052

#publish-packages-to-npm
bypass-github-export-checks

Reviewed By: motiz88

Differential Revision: D48465522

fbshipit-source-id: fbaadec847667cd7153f455a6f40107bc9377d17
  • Loading branch information
huntie authored and facebook-github-bot committed Aug 21, 2023
1 parent a7365cb commit 00e9c30
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
6 changes: 3 additions & 3 deletions packages/community-cli-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Start the React Native development server.
#### Usage

```sh
react-native start [options]
npx react-native start [options]
```

#### Options
Expand Down Expand Up @@ -45,7 +45,7 @@ Build the bundle for the provided JavaScript entry file.
#### Usage

```sh
react-native bundle --entry-file <path> [options]
npx react-native bundle --entry-file <path> [options]
```

#### Options
Expand Down Expand Up @@ -75,7 +75,7 @@ Build the [RAM bundle](https://reactnative.dev/docs/ram-bundles-inline-requires)
#### Usage

```sh
react-native ram-bundle --entry-file <path> [options]
npx react-native ram-bundle --entry-file <path> [options]
```

#### Options
Expand Down
2 changes: 1 addition & 1 deletion packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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);
Expand All @@ -50,19 +54,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');
Expand All @@ -72,7 +84,7 @@ export default function attachKeyHandlers(
}
};

const keyPressHandler = new KeyPressHandler(onPressAsync);
const keyPressHandler = new KeyPressHandler(onPress);
const listener = keyPressHandler.createInteractionListener();
addInteractionListener(listener);
keyPressHandler.startInterceptingKeyStrokes();
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-middleware/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 00e9c30

Please sign in to comment.