@rnx-kit/cli 0.16.11 → 0.16.13
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 +21 -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 +2 -2
- 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/coverage/lcov-report/src/test.ts.html +1 -1
- package/lib/bundle/types.d.ts +1 -1
- package/lib/bundle/types.d.ts.map +1 -1
- package/lib/start.d.ts.map +1 -1
- package/lib/start.js +41 -13
- package/lib/start.js.map +1 -1
- package/package.json +5 -5
- package/src/bundle/kit-config.ts +1 -1
- package/src/bundle/types.ts +1 -1
- package/src/start.ts +49 -13
- package/test/bundle/kit-config.test.ts +1 -1
- package/test/copy-assets/assembleAarBundle.test.ts +1 -2
- package/test/copy-assets/copyAssets.test.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Change Log - @rnx-kit/cli
|
|
2
2
|
|
|
3
|
+
## 0.16.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 67525429: Put a fresh coat of paint on CLI's menu/help message
|
|
8
|
+
|
|
9
|
+
## 0.16.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 39deedd8: Bump dependencies to handle `@react-native-community/cli-plugin-metro` -> `@react-native/community-cli-plugin`
|
|
14
|
+
- Updated dependencies [d8f53ed7]
|
|
15
|
+
- Updated dependencies [7f152115]
|
|
16
|
+
- Updated dependencies [1bc772cc]
|
|
17
|
+
- Updated dependencies [11e8e546]
|
|
18
|
+
- Updated dependencies [1c2725b8]
|
|
19
|
+
- @rnx-kit/metro-serializer-esbuild@0.1.28
|
|
20
|
+
- @rnx-kit/tools-react-native@1.3.2
|
|
21
|
+
- @rnx-kit/metro-service@3.1.1
|
|
22
|
+
- @rnx-kit/metro-plugin-typescript@0.4.4
|
|
23
|
+
|
|
3
24
|
## 0.16.11
|
|
4
25
|
|
|
5
26
|
### 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="1692646295053" clover="3.2.0">
|
|
3
|
+
<project timestamp="1692646295053" name="All files">
|
|
4
4
|
<metrics statements="279" coveredstatements="156" conditionals="174" coveredconditionals="91" methods="35" coveredmethods="27" elements="488" coveredelements="274" complexity="0" loc="279" ncloc="279" packages="2" files="7" classes="7"/>
|
|
5
5
|
<package name="src">
|
|
6
6
|
<metrics statements="248" coveredstatements="125" conditionals="151" coveredconditionals="71" methods="27" coveredmethods="19"/>
|
|
@@ -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 Mon Aug 21 2023 19:31:35 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 Mon Aug 21 2023 19:31:35 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 Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -227,8 +227,8 @@
|
|
|
227
227
|
<span class="cline-any cline-neutral"> </span>
|
|
228
228
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
229
229
|
getBundleConfig,
|
|
230
|
-
getPlatformBundleConfig,
|
|
231
230
|
getKitConfig,
|
|
231
|
+
getPlatformBundleConfig,
|
|
232
232
|
} from "@rnx-kit/config";
|
|
233
233
|
import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
|
|
234
234
|
import { getDefaultBundlerPlugins } from "./defaultPlugins";
|
|
@@ -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 Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
317
317
|
</div>
|
|
318
318
|
<script src="../../prettify.js"></script>
|
|
319
319
|
<script>
|
|
@@ -241,7 +241,7 @@ export async function metroBundle(
|
|
|
241
241
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
242
242
|
Code coverage generated by
|
|
243
243
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
244
|
-
at
|
|
244
|
+
at Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
245
245
|
</div>
|
|
246
246
|
<script src="../../prettify.js"></script>
|
|
247
247
|
<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 Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
224
224
|
</div>
|
|
225
225
|
<script src="../../prettify.js"></script>
|
|
226
226
|
<script>
|
|
@@ -1708,7 +1708,7 @@ export const rnxCopyAssetsCommand = {
|
|
|
1708
1708
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1709
1709
|
Code coverage generated by
|
|
1710
1710
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1711
|
-
at
|
|
1711
|
+
at Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
1712
1712
|
</div>
|
|
1713
1713
|
<script src="../prettify.js"></script>
|
|
1714
1714
|
<script>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
132
|
Code coverage generated by
|
|
133
133
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at
|
|
134
|
+
at Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
135
135
|
</div>
|
|
136
136
|
<script src="../prettify.js"></script>
|
|
137
137
|
<script>
|
|
@@ -694,7 +694,7 @@ export function customizeMetroConfig(
|
|
|
694
694
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
695
695
|
Code coverage generated by
|
|
696
696
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
697
|
-
at
|
|
697
|
+
at Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
698
698
|
</div>
|
|
699
699
|
<script src="../prettify.js"></script>
|
|
700
700
|
<script>
|
|
@@ -454,7 +454,7 @@ export const rnxTestCommand = {
|
|
|
454
454
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
455
455
|
Code coverage generated by
|
|
456
456
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
457
|
-
at
|
|
457
|
+
at Mon Aug 21 2023 19:31:35 GMT+0000 (Coordinated Universal Time)
|
|
458
458
|
</div>
|
|
459
459
|
<script src="../prettify.js"></script>
|
|
460
460
|
<script>
|
package/lib/bundle/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TransformProfile } from "metro-babel-transformer";
|
|
2
1
|
import type { BundleParameters } from "@rnx-kit/config";
|
|
3
2
|
import type { BundleArgs } from "@rnx-kit/metro-service";
|
|
4
3
|
import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
|
|
4
|
+
import type { TransformProfile } from "metro-babel-transformer";
|
|
5
5
|
export type CLICommonBundleOptions = {
|
|
6
6
|
id?: string;
|
|
7
7
|
entryFile?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bundle/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bundle/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,gBAAgB,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,QAAQ,CACN,IAAI,CACF,gBAAgB,EACd,WAAW,GACX,cAAc,GACd,0BAA0B,GAC1B,WAAW,GACX,SAAS,CACZ,CACF,GAAG;IACF,wBAAwB,CAAC,EAAE,gBAAgB,CAAC;IAE5C;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC"}
|
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;
|
|
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;AAgC7E,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;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAqEF,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,GAC1B,OAAO,CAAC,IAAI,CAAC,CAiMf"}
|
package/lib/start.js
CHANGED
|
@@ -50,6 +50,46 @@ function friendlyRequire(...modules) {
|
|
|
50
50
|
function hasAttachToServerFunction(devServer) {
|
|
51
51
|
return "attachToServer" in devServer;
|
|
52
52
|
}
|
|
53
|
+
function makeHelp(terminal) {
|
|
54
|
+
const menuItems = [
|
|
55
|
+
["R", "Reload the app"],
|
|
56
|
+
["D", "Open developer menu"],
|
|
57
|
+
["A", "Show bundler address QR code"],
|
|
58
|
+
"",
|
|
59
|
+
["H", "Show this help message"],
|
|
60
|
+
["Ctrl-C", "Quit"],
|
|
61
|
+
];
|
|
62
|
+
const margin = 4;
|
|
63
|
+
const maxColumnWidth = (index) => {
|
|
64
|
+
return (max, item) => {
|
|
65
|
+
if (!item) {
|
|
66
|
+
return max;
|
|
67
|
+
}
|
|
68
|
+
const width = item[index].length;
|
|
69
|
+
return width > max ? width : max;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const keyWidth = menuItems.reduce(maxColumnWidth(0), 0);
|
|
73
|
+
const labelWidth = menuItems.reduce(maxColumnWidth(1), 0);
|
|
74
|
+
const separator = `┠${"─".repeat(labelWidth + keyWidth + margin + 1)}`;
|
|
75
|
+
const dim = chalk_1.default.dim;
|
|
76
|
+
const lines = menuItems.map((item) => {
|
|
77
|
+
if (!item) {
|
|
78
|
+
return separator;
|
|
79
|
+
}
|
|
80
|
+
const [key, label] = item;
|
|
81
|
+
const labelPadding = labelWidth - label.length;
|
|
82
|
+
const keyPadding = keyWidth - key.length;
|
|
83
|
+
const padding = " ".repeat(labelPadding + keyPadding + margin);
|
|
84
|
+
return `┃ ${dim(label)}${padding}${key}`;
|
|
85
|
+
});
|
|
86
|
+
return () => {
|
|
87
|
+
for (const line of lines) {
|
|
88
|
+
terminal.log(line);
|
|
89
|
+
}
|
|
90
|
+
terminal.log("");
|
|
91
|
+
};
|
|
92
|
+
}
|
|
53
93
|
async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
54
94
|
const serverConfig = (0, kit_config_1.getKitServerConfig)(cliOptions);
|
|
55
95
|
const { createDevServerMiddleware, indexPageMiddleware } = friendlyRequire("react-native", "@react-native-community/cli", "@react-native-community/cli-server-api");
|
|
@@ -63,19 +103,7 @@ async function rnxStart(_argv, cliConfig, cliOptions) {
|
|
|
63
103
|
}
|
|
64
104
|
// create a Metro terminal and reporter for writing to the console
|
|
65
105
|
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
|
-
};
|
|
106
|
+
const printHelp = makeHelp(terminal);
|
|
79
107
|
// create a reporter function, to be bound to the Metro configuration.
|
|
80
108
|
// which writes to the Metro terminal and
|
|
81
109
|
// also notifies the `reportEvent` delegate.
|
package/lib/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,0DAIgC;AAChC,kDAA0B;AAM1B,uCAAyB;AACzB,2CAA6B;AAC7B,oDAA4B;AAC5B,wDAAgC;AAChC,iDAAsD;AACtD,mDAAwD;AAgCxD,SAAS,eAAe,CAAI,GAAG,OAAiB;IAC9C,IAAI;QACF,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;YACrD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClB,OAAO,OAAO,CAAC,UAAU,CAAM,CAAC;KACjC;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,uBAAuB,MAAM,iTAAiT,CAC/U,CAAC;KACH;AACH,CAAC;AAED,SAAS,yBAAyB,CAChC,SAAqD;IAErD,OAAO,gBAAgB,IAAI,SAAS,CAAC;AACvC,CAAC;AA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,CAAC,IAAI,CAAC;wBACrC,MAAM,GAAG,GAAG,GAAG,QAAQ,MAAM,IAAI,IAAI,IAAI,eAAe,CAAC;wBACzD,gBAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;4BACtD,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;4BACjB,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;4BACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;wBACnB,CAAC,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;AArMD,4BAqMC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rnx-kit/cli",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.13",
|
|
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",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
"@rnx-kit/console": "^1.0.11",
|
|
25
25
|
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^1.1.1",
|
|
26
26
|
"@rnx-kit/metro-plugin-duplicates-checker": "^2.1.1",
|
|
27
|
-
"@rnx-kit/metro-plugin-typescript": "^0.4.
|
|
27
|
+
"@rnx-kit/metro-plugin-typescript": "^0.4.4",
|
|
28
28
|
"@rnx-kit/metro-serializer": "^1.0.12",
|
|
29
|
-
"@rnx-kit/metro-serializer-esbuild": "^0.1.
|
|
30
|
-
"@rnx-kit/metro-service": "^3.1.
|
|
29
|
+
"@rnx-kit/metro-serializer-esbuild": "^0.1.28",
|
|
30
|
+
"@rnx-kit/metro-service": "^3.1.1",
|
|
31
31
|
"@rnx-kit/third-party-notices": "^1.3.4",
|
|
32
32
|
"@rnx-kit/tools-language": "^2.0.0",
|
|
33
33
|
"@rnx-kit/tools-node": "^2.0.0",
|
|
34
|
-
"@rnx-kit/tools-react-native": "^1.3.
|
|
34
|
+
"@rnx-kit/tools-react-native": "^1.3.2",
|
|
35
35
|
"chalk": "^4.1.0",
|
|
36
36
|
"find-up": "^5.0.0",
|
|
37
37
|
"fs-extra": "^10.0.0",
|
package/src/bundle/kit-config.ts
CHANGED
package/src/bundle/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TransformProfile } from "metro-babel-transformer";
|
|
2
1
|
import type { BundleParameters } from "@rnx-kit/config";
|
|
3
2
|
import type { BundleArgs } from "@rnx-kit/metro-service";
|
|
4
3
|
import type { AllPlatforms } from "@rnx-kit/tools-react-native/platform";
|
|
4
|
+
import type { TransformProfile } from "metro-babel-transformer";
|
|
5
5
|
|
|
6
6
|
export type CLICommonBundleOptions = {
|
|
7
7
|
id?: string;
|
package/src/start.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type CliServerApi from "@react-native-community/cli-server-api";
|
|
2
2
|
import type { Config as CLIConfig } from "@react-native-community/cli-types";
|
|
3
|
+
import type { MetroTerminal } from "@rnx-kit/metro-service";
|
|
3
4
|
import {
|
|
4
5
|
createTerminal,
|
|
5
6
|
loadMetroConfig,
|
|
@@ -68,6 +69,53 @@ function hasAttachToServerFunction(
|
|
|
68
69
|
return "attachToServer" in devServer;
|
|
69
70
|
}
|
|
70
71
|
|
|
72
|
+
function makeHelp(terminal: MetroTerminal["terminal"]): () => void {
|
|
73
|
+
const menuItems: ("" | [string, string])[] = [
|
|
74
|
+
["R", "Reload the app"],
|
|
75
|
+
["D", "Open developer menu"],
|
|
76
|
+
["A", "Show bundler address QR code"],
|
|
77
|
+
"",
|
|
78
|
+
["H", "Show this help message"],
|
|
79
|
+
["Ctrl-C", "Quit"],
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
const margin = 4;
|
|
83
|
+
const maxColumnWidth = (index: number) => {
|
|
84
|
+
return (max: number, item: (typeof menuItems)[number]) => {
|
|
85
|
+
if (!item) {
|
|
86
|
+
return max;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const width = item[index].length;
|
|
90
|
+
return width > max ? width : max;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const keyWidth = menuItems.reduce(maxColumnWidth(0), 0);
|
|
95
|
+
const labelWidth = menuItems.reduce(maxColumnWidth(1), 0);
|
|
96
|
+
const separator = `┠${"─".repeat(labelWidth + keyWidth + margin + 1)}`;
|
|
97
|
+
|
|
98
|
+
const dim = chalk.dim;
|
|
99
|
+
const lines = menuItems.map((item) => {
|
|
100
|
+
if (!item) {
|
|
101
|
+
return separator;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const [key, label] = item;
|
|
105
|
+
const labelPadding = labelWidth - label.length;
|
|
106
|
+
const keyPadding = keyWidth - key.length;
|
|
107
|
+
const padding = " ".repeat(labelPadding + keyPadding + margin);
|
|
108
|
+
return `┃ ${dim(label)}${padding}${key}`;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
return () => {
|
|
112
|
+
for (const line of lines) {
|
|
113
|
+
terminal.log(line);
|
|
114
|
+
}
|
|
115
|
+
terminal.log("");
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
71
119
|
export async function rnxStart(
|
|
72
120
|
_argv: Array<string>,
|
|
73
121
|
cliConfig: CLIConfig,
|
|
@@ -101,19 +149,7 @@ export async function rnxStart(
|
|
|
101
149
|
cliOptions.customLogReporterPath
|
|
102
150
|
);
|
|
103
151
|
|
|
104
|
-
const printHelp = ()
|
|
105
|
-
const dim = chalk.dim;
|
|
106
|
-
const press = dim(" › Press ");
|
|
107
|
-
[
|
|
108
|
-
["r", "reload the app"],
|
|
109
|
-
["d", "open developer menu"],
|
|
110
|
-
["a", "show bundler address QR code"],
|
|
111
|
-
["h", "show this help message"],
|
|
112
|
-
["ctrl-c", "quit"],
|
|
113
|
-
].forEach(([key, description]) => {
|
|
114
|
-
terminal.log(press + key + dim(` to ${description}.`));
|
|
115
|
-
});
|
|
116
|
-
};
|
|
152
|
+
const printHelp = makeHelp(terminal);
|
|
117
153
|
|
|
118
154
|
// create a reporter function, to be bound to the Metro configuration.
|
|
119
155
|
// which writes to the Metro terminal and
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { spawnSync } from "child_process";
|
|
2
1
|
import * as path from "path";
|
|
3
|
-
import { findFiles, mockFiles } from "./helpers";
|
|
4
2
|
import { assembleAarBundle } from "../../src/copy-assets";
|
|
3
|
+
import { findFiles, mockFiles } from "./helpers";
|
|
5
4
|
|
|
6
5
|
jest.mock("child_process");
|
|
7
6
|
jest.mock("fs");
|