@rnx-kit/cli 0.16.1 → 0.16.3
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.
- package/CHANGELOG.md +14 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/src/bundle/defaultPlugins.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/index.html +1 -1
- package/coverage/lcov-report/src/bundle/kit-config.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/metro.ts.html +1 -1
- package/coverage/lcov-report/src/bundle/overrides.ts.html +1 -1
- package/coverage/lcov-report/src/copy-assets.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/metro-config.ts.html +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +27 -13
- package/lib/start.js.map +1 -1
- package/package.json +15 -4
- package/src/start.ts +34 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log - @rnx-kit/cli
|
|
2
2
|
|
|
3
|
+
## 0.16.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 172a7b7f: Add help support and enter for newlines to rnx-start
|
|
8
|
+
- Updated dependencies [d4059e0b]
|
|
9
|
+
- @rnx-kit/align-deps@2.1.4
|
|
10
|
+
|
|
11
|
+
## 0.16.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 341d2847: Resolve `@react-native-community/cli-server-api` starting from `react-native` to avoid relying on hoisting
|
|
16
|
+
|
|
3
17
|
## 0.16.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/coverage/clover.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="
|
|
3
|
-
<project timestamp="
|
|
2
|
+
<coverage generated="1676977409271" clover="3.2.0">
|
|
3
|
+
<project timestamp="1676977409271" name="All files">
|
|
4
4
|
<metrics statements="244" coveredstatements="145" conditionals="158" coveredconditionals="86" methods="30" coveredmethods="24" elements="432" coveredelements="255" complexity="0" loc="244" ncloc="244" packages="2" files="6" classes="6"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="216" coveredstatements="117" conditionals="135" coveredconditionals="64" methods="23" coveredmethods="17"/>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at
|
|
119
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
120
120
|
</div>
|
|
121
121
|
<script src="prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -118,7 +118,7 @@ export function getDefaultBundlerPlugins(): DefaultPlugins {
|
|
|
118
118
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
119
119
|
Code coverage generated by
|
|
120
120
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
121
|
-
at
|
|
121
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
122
122
|
</div>
|
|
123
123
|
<script src="../../prettify.js"></script>
|
|
124
124
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at
|
|
149
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -313,7 +313,7 @@ export function getCliPlatformBundleConfigs(
|
|
|
313
313
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
314
314
|
Code coverage generated by
|
|
315
315
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
316
|
-
at
|
|
316
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
317
317
|
</div>
|
|
318
318
|
<script src="../../prettify.js"></script>
|
|
319
319
|
<script>
|
|
@@ -220,7 +220,7 @@ export async function metroBundle(
|
|
|
220
220
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
221
221
|
Code coverage generated by
|
|
222
222
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
223
|
-
at
|
|
223
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -220,7 +220,7 @@ export function applyBundleConfigOverrides(
|
|
|
220
220
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
221
221
|
Code coverage generated by
|
|
222
222
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
223
|
-
at
|
|
223
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -1762,7 +1762,7 @@ export const rnxCopyAssetsCommand = {
|
|
|
1762
1762
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1763
1763
|
Code coverage generated by
|
|
1764
1764
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1765
|
-
at
|
|
1765
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
1766
1766
|
</div>
|
|
1767
1767
|
<script src="../prettify.js"></script>
|
|
1768
1768
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at
|
|
119
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -661,7 +661,7 @@ export function customizeMetroConfig(
|
|
|
661
661
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
662
662
|
Code coverage generated by
|
|
663
663
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
664
|
-
at
|
|
664
|
+
at Tue Feb 21 2023 11:03:29 GMT+0000 (Coordinated Universal Time)
|
|
665
665
|
</div>
|
|
666
666
|
<script src="../prettify.js"></script>
|
|
667
667
|
<script>
|
package/lib/start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AA+B7E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,mCAAmC,CAAC;AA+B7E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAsBF,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC,IAAI,CAAC,CA6Mf"}
|
package/lib/start.js
CHANGED
|
@@ -35,11 +35,15 @@ const qrcode_1 = __importDefault(require("qrcode"));
|
|
|
35
35
|
const readline_1 = __importDefault(require("readline"));
|
|
36
36
|
const metro_config_1 = require("./metro-config");
|
|
37
37
|
const kit_config_1 = require("./serve/kit-config");
|
|
38
|
-
function friendlyRequire(
|
|
38
|
+
function friendlyRequire(...modules) {
|
|
39
39
|
try {
|
|
40
|
-
|
|
40
|
+
const modulePath = modules.reduce((startDir, module) => {
|
|
41
|
+
return require.resolve(module, { paths: [startDir] });
|
|
42
|
+
}, process.cwd());
|
|
43
|
+
return require(modulePath);
|
|
41
44
|
}
|
|
42
45
|
catch (_) {
|
|
46
|
+
const module = modules[modules.length - 1];
|
|
43
47
|
throw new Error(`Cannot find module '${module}'. This probably means that '@rnx-kit/cli' is not compatible with the version of '@react-native-community/cli' that you are currently using. Please update to the latest version and try again. If the issue still persists after the update, please file a bug at https://github.com/microsoft/rnx-kit/issues.`);
|
|
44
48
|
}
|
|
45
49
|
}
|
|
@@ -48,7 +52,7 @@ function hasAttachToServerFunction(devServer) {
|
|
|
48
52
|
}
|
|
49
53
|
async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
50
54
|
const serverConfig = (0, kit_config_1.getKitServerConfig)(cliOptions);
|
|
51
|
-
const { createDevServerMiddleware, indexPageMiddleware } = friendlyRequire("@react-native-community/cli-server-api");
|
|
55
|
+
const { createDevServerMiddleware, indexPageMiddleware } = friendlyRequire("react-native", "@react-native-community/cli", "@react-native-community/cli-server-api");
|
|
52
56
|
// interactive mode requires raw access to stdin
|
|
53
57
|
let interactive = cliOptions.interactive;
|
|
54
58
|
if (interactive) {
|
|
@@ -59,6 +63,19 @@ async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
|
59
63
|
}
|
|
60
64
|
// create a Metro terminal and reporter for writing to the console
|
|
61
65
|
const { terminal, reporter: terminalReporter } = (0, metro_service_1.createTerminal)(cliOptions.customLogReporterPath);
|
|
66
|
+
const printHelp = () => {
|
|
67
|
+
const dim = chalk_1.default.dim;
|
|
68
|
+
const press = dim(" › Press ");
|
|
69
|
+
[
|
|
70
|
+
["r", "reload the app"],
|
|
71
|
+
["d", "open developer menu"],
|
|
72
|
+
["a", "show bundler address QR code"],
|
|
73
|
+
["h", "show this help message"],
|
|
74
|
+
["ctrl-c", "quit"],
|
|
75
|
+
].forEach(([key, description]) => {
|
|
76
|
+
terminal.log(press + key + dim(` to ${description}.`));
|
|
77
|
+
});
|
|
78
|
+
};
|
|
62
79
|
// create a reporter function, to be bound to the Metro configuration.
|
|
63
80
|
// which writes to the Metro terminal and
|
|
64
81
|
// also notifies the `reportEvent` delegate.
|
|
@@ -70,16 +87,7 @@ async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
|
70
87
|
reportEventDelegate(event);
|
|
71
88
|
}
|
|
72
89
|
if (interactive && event.type === "dep_graph_loading") {
|
|
73
|
-
|
|
74
|
-
const press = dim(" › Press ");
|
|
75
|
-
[
|
|
76
|
-
["r", "reload the app"],
|
|
77
|
-
["d", "open developer menu"],
|
|
78
|
-
["a", "show bundler address QR code"],
|
|
79
|
-
["ctrl-c", "quit"],
|
|
80
|
-
].forEach(([key, description]) => {
|
|
81
|
-
terminal.log(press + key + dim(` to ${description}.`));
|
|
82
|
-
});
|
|
90
|
+
printHelp();
|
|
83
91
|
}
|
|
84
92
|
},
|
|
85
93
|
};
|
|
@@ -192,10 +200,16 @@ async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
|
192
200
|
terminal.log(chalk_1.default.green("Opening developer menu..."));
|
|
193
201
|
messageSocketEndpoint.broadcast("devMenu", undefined);
|
|
194
202
|
break;
|
|
203
|
+
case "h":
|
|
204
|
+
printHelp();
|
|
205
|
+
break;
|
|
195
206
|
case "r":
|
|
196
207
|
terminal.log(chalk_1.default.green("Reloading app..."));
|
|
197
208
|
messageSocketEndpoint.broadcast("reload", undefined);
|
|
198
209
|
break;
|
|
210
|
+
case "return":
|
|
211
|
+
terminal.log("");
|
|
212
|
+
break;
|
|
199
213
|
}
|
|
200
214
|
}
|
|
201
215
|
});
|
package/lib/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0DAIgC;AAChC,kDAA0B;AAM1B,uCAAyB;AACzB,2CAA6B;AAC7B,oDAA4B;AAC5B,wDAAgC;AAChC,iDAAsD;AACtD,mDAAwD;AA+BxD,SAAS,eAAe,C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AAC,CAAC,CAAC;wBACH,MAAM;qBACP;oBAED,KAAK,GAAG;wBACN,QAAQ,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;wBACvD,qBAAqB,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;wBACtD,MAAM;oBAER,KAAK,GAAG;wBACN,SAAS,EAAE,CAAC;wBACZ,MAAM;oBAER,KAAK,GAAG;wBACN,QAAQ,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;wBAC9C,qBAAqB,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;wBACrD,MAAM;oBAER,KAAK,QAAQ;wBACX,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;wBACjB,MAAM;iBACT;aACF;QACH,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAjND,4BAiNC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnx-kit/cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "Command-line interface for working with kit packages in your repo",
|
|
5
5
|
"homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/cli",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "rnx-kit-scripts test"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@rnx-kit/align-deps": "^2.
|
|
22
|
+
"@rnx-kit/align-deps": "^2.1.4",
|
|
23
23
|
"@rnx-kit/config": "^0.6.0",
|
|
24
24
|
"@rnx-kit/console": "^1.0.11",
|
|
25
25
|
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^1.1.0",
|
|
@@ -40,15 +40,23 @@
|
|
|
40
40
|
"readline": "^1.3.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
+
"@react-native-community/cli": ">=5.0.1",
|
|
43
44
|
"@react-native-community/cli-server-api": ">=5.0.1",
|
|
44
|
-
"jest-cli": "^26.0 || ^27.0"
|
|
45
|
+
"jest-cli": "^26.0 || ^27.0",
|
|
46
|
+
"react-native": ">=0.64"
|
|
45
47
|
},
|
|
46
48
|
"peerDependenciesMeta": {
|
|
49
|
+
"@react-native-community/cli": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
47
52
|
"@react-native-community/cli-server-api": {
|
|
48
53
|
"optional": true
|
|
49
54
|
},
|
|
50
55
|
"jest-cli": {
|
|
51
56
|
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"react-native": {
|
|
59
|
+
"optional": true
|
|
52
60
|
}
|
|
53
61
|
},
|
|
54
62
|
"devDependencies": {
|
|
@@ -58,9 +66,12 @@
|
|
|
58
66
|
"@types/metro-babel-transformer": "^0.66.0",
|
|
59
67
|
"@types/metro-config": "^0.66.0",
|
|
60
68
|
"@types/qrcode": "^1.4.2",
|
|
69
|
+
"eslint": "^8.0.0",
|
|
61
70
|
"jest": "^27.0.0",
|
|
62
71
|
"memfs": "^3.4.1",
|
|
63
|
-
"metro-config": "^0.67.0"
|
|
72
|
+
"metro-config": "^0.67.0",
|
|
73
|
+
"prettier": "^2.8.0",
|
|
74
|
+
"typescript": "^4.0.0"
|
|
64
75
|
},
|
|
65
76
|
"depcheck": {
|
|
66
77
|
"ignoreMatches": [
|
package/src/start.ts
CHANGED
|
@@ -47,10 +47,14 @@ export type CLIStartOptions = {
|
|
|
47
47
|
interactive: boolean;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
function friendlyRequire<T>(
|
|
50
|
+
function friendlyRequire<T>(...modules: string[]): T {
|
|
51
51
|
try {
|
|
52
|
-
|
|
52
|
+
const modulePath = modules.reduce((startDir, module) => {
|
|
53
|
+
return require.resolve(module, { paths: [startDir] });
|
|
54
|
+
}, process.cwd());
|
|
55
|
+
return require(modulePath) as T;
|
|
53
56
|
} catch (_) {
|
|
57
|
+
const module = modules[modules.length - 1];
|
|
54
58
|
throw new Error(
|
|
55
59
|
`Cannot find module '${module}'. This probably means that '@rnx-kit/cli' is not compatible with the version of '@react-native-community/cli' that you are currently using. Please update to the latest version and try again. If the issue still persists after the update, please file a bug at https://github.com/microsoft/rnx-kit/issues.`
|
|
56
60
|
);
|
|
@@ -72,7 +76,11 @@ export async function rnxStart(
|
|
|
72
76
|
|
|
73
77
|
const { createDevServerMiddleware, indexPageMiddleware } = friendlyRequire<
|
|
74
78
|
typeof CliServerApi
|
|
75
|
-
>(
|
|
79
|
+
>(
|
|
80
|
+
"react-native",
|
|
81
|
+
"@react-native-community/cli",
|
|
82
|
+
"@react-native-community/cli-server-api"
|
|
83
|
+
);
|
|
76
84
|
|
|
77
85
|
// interactive mode requires raw access to stdin
|
|
78
86
|
let interactive = cliOptions.interactive;
|
|
@@ -92,6 +100,20 @@ export async function rnxStart(
|
|
|
92
100
|
cliOptions.customLogReporterPath
|
|
93
101
|
);
|
|
94
102
|
|
|
103
|
+
const printHelp = () => {
|
|
104
|
+
const dim = chalk.dim;
|
|
105
|
+
const press = dim(" › Press ");
|
|
106
|
+
[
|
|
107
|
+
["r", "reload the app"],
|
|
108
|
+
["d", "open developer menu"],
|
|
109
|
+
["a", "show bundler address QR code"],
|
|
110
|
+
["h", "show this help message"],
|
|
111
|
+
["ctrl-c", "quit"],
|
|
112
|
+
].forEach(([key, description]) => {
|
|
113
|
+
terminal.log(press + key + dim(` to ${description}.`));
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
95
117
|
// create a reporter function, to be bound to the Metro configuration.
|
|
96
118
|
// which writes to the Metro terminal and
|
|
97
119
|
// also notifies the `reportEvent` delegate.
|
|
@@ -103,16 +125,7 @@ export async function rnxStart(
|
|
|
103
125
|
reportEventDelegate(event);
|
|
104
126
|
}
|
|
105
127
|
if (interactive && event.type === "dep_graph_loading") {
|
|
106
|
-
|
|
107
|
-
const press = dim(" › Press ");
|
|
108
|
-
[
|
|
109
|
-
["r", "reload the app"],
|
|
110
|
-
["d", "open developer menu"],
|
|
111
|
-
["a", "show bundler address QR code"],
|
|
112
|
-
["ctrl-c", "quit"],
|
|
113
|
-
].forEach(([key, description]) => {
|
|
114
|
-
terminal.log(press + key + dim(` to ${description}.`));
|
|
115
|
-
});
|
|
128
|
+
printHelp();
|
|
116
129
|
}
|
|
117
130
|
},
|
|
118
131
|
};
|
|
@@ -247,10 +260,18 @@ export async function rnxStart(
|
|
|
247
260
|
messageSocketEndpoint.broadcast("devMenu", undefined);
|
|
248
261
|
break;
|
|
249
262
|
|
|
263
|
+
case "h":
|
|
264
|
+
printHelp();
|
|
265
|
+
break;
|
|
266
|
+
|
|
250
267
|
case "r":
|
|
251
268
|
terminal.log(chalk.green("Reloading app..."));
|
|
252
269
|
messageSocketEndpoint.broadcast("reload", undefined);
|
|
253
270
|
break;
|
|
271
|
+
|
|
272
|
+
case "return":
|
|
273
|
+
terminal.log("");
|
|
274
|
+
break;
|
|
254
275
|
}
|
|
255
276
|
}
|
|
256
277
|
});
|