@react-native/community-cli-plugin 0.73.5 → 0.73.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,6 @@ var _cliTools = require("@react-native-community/cli-tools");
|
|
|
8
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
9
|
var _execa = _interopRequireDefault(require("execa"));
|
|
10
10
|
var _nodeFetch = _interopRequireDefault(require("node-fetch"));
|
|
11
|
-
var _readline = _interopRequireDefault(require("readline"));
|
|
12
11
|
var _KeyPressHandler = require("../../utils/KeyPressHandler");
|
|
13
12
|
function _interopRequireDefault(obj) {
|
|
14
13
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
@@ -28,9 +27,9 @@ const CTRL_C = "\u0003";
|
|
|
28
27
|
const CTRL_D = "\u0004";
|
|
29
28
|
function attachKeyHandlers({
|
|
30
29
|
cliConfig,
|
|
31
|
-
serverInstance,
|
|
32
30
|
devServerUrl,
|
|
33
31
|
messageSocket,
|
|
32
|
+
experimentalDebuggerFrontend,
|
|
34
33
|
}) {
|
|
35
34
|
if (process.stdin.isTTY !== true) {
|
|
36
35
|
_cliTools.logger.debug(
|
|
@@ -38,9 +37,6 @@ function attachKeyHandlers({
|
|
|
38
37
|
);
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
_readline.default.emitKeypressEvents(process.stdin);
|
|
42
|
-
// $FlowIgnore[prop-missing]
|
|
43
|
-
process.stdin.setRawMode(true);
|
|
44
40
|
const execaOptions = {
|
|
45
41
|
env: {
|
|
46
42
|
FORCE_COLOR: _chalk.default.supportsColor ? "true" : "false",
|
|
@@ -81,6 +77,9 @@ function attachKeyHandlers({
|
|
|
81
77
|
).stdout?.pipe(process.stdout);
|
|
82
78
|
break;
|
|
83
79
|
case "j":
|
|
80
|
+
if (!experimentalDebuggerFrontend) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
84
83
|
await (0, _nodeFetch.default)(devServerUrl + "/open-debugger", {
|
|
85
84
|
method: "POST",
|
|
86
85
|
});
|
|
@@ -88,22 +87,28 @@ function attachKeyHandlers({
|
|
|
88
87
|
case CTRL_C:
|
|
89
88
|
case CTRL_D:
|
|
90
89
|
_cliTools.logger.info("Stopping server");
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
serverInstance.close(() => {
|
|
95
|
-
process.emit("SIGINT");
|
|
96
|
-
process.exit();
|
|
97
|
-
});
|
|
90
|
+
keyPressHandler.stopInterceptingKeyStrokes();
|
|
91
|
+
process.emit("SIGINT");
|
|
92
|
+
process.exit();
|
|
98
93
|
}
|
|
99
94
|
});
|
|
100
|
-
|
|
95
|
+
keyPressHandler.createInteractionListener();
|
|
101
96
|
keyPressHandler.startInterceptingKeyStrokes();
|
|
102
|
-
_cliTools.logger.log(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
97
|
+
_cliTools.logger.log(
|
|
98
|
+
[
|
|
99
|
+
"",
|
|
100
|
+
`${_chalk.default.bold("i")} - run on iOS`,
|
|
101
|
+
`${_chalk.default.bold("a")} - run on Android`,
|
|
102
|
+
`${_chalk.default.bold("d")} - open Dev Menu`,
|
|
103
|
+
...(experimentalDebuggerFrontend
|
|
104
|
+
? [
|
|
105
|
+
`${_chalk.default.bold(
|
|
106
|
+
"j"
|
|
107
|
+
)} - open debugger (experimental, Hermes only)`,
|
|
108
|
+
]
|
|
109
|
+
: []),
|
|
110
|
+
`${_chalk.default.bold("r")} - reload app`,
|
|
111
|
+
"",
|
|
112
|
+
].join("\n")
|
|
113
|
+
);
|
|
109
114
|
}
|
|
@@ -14,9 +14,9 @@ import type { Config } from "@react-native-community/cli-types";
|
|
|
14
14
|
declare export default function attachKeyHandlers({
|
|
15
15
|
cliConfig: Config,
|
|
16
16
|
devServerUrl: string,
|
|
17
|
-
serverInstance: http$Server | https$Server,
|
|
18
17
|
messageSocket: $ReadOnly<{
|
|
19
18
|
broadcast: (type: string, params?: Record<string, mixed> | null) => void,
|
|
20
19
|
...
|
|
21
20
|
}>,
|
|
21
|
+
experimentalDebuggerFrontend: boolean,
|
|
22
22
|
}): void;
|
|
@@ -99,6 +99,13 @@ const startCommand = {
|
|
|
99
99
|
name: "--no-interactive",
|
|
100
100
|
description: "Disables interactive mode",
|
|
101
101
|
},
|
|
102
|
+
{
|
|
103
|
+
name: "--experimental-debugger",
|
|
104
|
+
description:
|
|
105
|
+
"[Experimental] Enable the new debugger experience and 'j' to " +
|
|
106
|
+
"debug. This enables the new frontend experience only: connection " +
|
|
107
|
+
"reliability and some basic features are unstable in this release.",
|
|
108
|
+
},
|
|
102
109
|
],
|
|
103
110
|
};
|
|
104
111
|
var _default = startCommand;
|
|
@@ -95,7 +95,7 @@ async function runServer(_argv, ctx, args) {
|
|
|
95
95
|
logger: _cliTools.logger,
|
|
96
96
|
unstable_experiments: {
|
|
97
97
|
// NOTE: Only affects the /open-debugger endpoint
|
|
98
|
-
|
|
98
|
+
enableNewDebugger: args.experimentalDebugger,
|
|
99
99
|
},
|
|
100
100
|
});
|
|
101
101
|
let reportEvent;
|
|
@@ -114,8 +114,8 @@ async function runServer(_argv, ctx, args) {
|
|
|
114
114
|
(0, _attachKeyHandlers.default)({
|
|
115
115
|
cliConfig: ctx,
|
|
116
116
|
devServerUrl,
|
|
117
|
-
serverInstance,
|
|
118
117
|
messageSocket: messageSocketEndpoint,
|
|
118
|
+
experimentalDebuggerFrontend: args.experimentalDebugger,
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native/community-cli-plugin",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.7",
|
|
4
4
|
"description": "Core CLI commands for React Native",
|
|
5
5
|
"keywords": ["react-native", "tools"],
|
|
6
6
|
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/buid-scripts#readme",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"exports": { ".": "./dist/index.js", "./package.json": "./package.json" },
|
|
15
15
|
"files": ["dist"],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@react-native/dev-middleware": "^0.73.
|
|
17
|
+
"@react-native/dev-middleware": "^0.73.4",
|
|
18
18
|
"@react-native-community/cli-server-api": "12.0.0-alpha.17",
|
|
19
19
|
"@react-native-community/cli-tools": "12.0.0-alpha.17",
|
|
20
20
|
"@react-native/metro-babel-transformer": "^0.73.12",
|