react-native-update-cli 2.30.0 → 2.30.1
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/lib/bundle.d.ts +2 -1
- package/lib/bundle.js +8 -1
- package/lib/provider.js +2 -1
- package/lib/utils/index.d.ts +4 -3
- package/lib/utils/index.js +14 -4
- package/package.json +1 -1
package/lib/bundle.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ type NormalizedBundleOptions = {
|
|
|
8
8
|
taro: boolean;
|
|
9
9
|
expo: boolean;
|
|
10
10
|
rncli: boolean;
|
|
11
|
-
|
|
11
|
+
/** undefined = platform default (harmony compiles Hermes, others detect) */
|
|
12
|
+
hermes?: boolean;
|
|
12
13
|
hermesBase: string;
|
|
13
14
|
verifyHermesBase: boolean;
|
|
14
15
|
resetCache: boolean;
|
package/lib/bundle.js
CHANGED
|
@@ -55,7 +55,14 @@ function normalizeBundleOptions(translatedOptions, platform) {
|
|
|
55
55
|
taro: (0, options_1.getBooleanOption)(translatedOptions, 'taro', false),
|
|
56
56
|
expo: (0, options_1.getBooleanOption)(translatedOptions, 'expo', false),
|
|
57
57
|
rncli: (0, options_1.getBooleanOption)(translatedOptions, 'rncli', false),
|
|
58
|
-
|
|
58
|
+
// Keep "not given" distinct from false: harmony compiles Hermes unless
|
|
59
|
+
// the user opts out with `--no-hermes`, see
|
|
60
|
+
// runReactNativeBundleCommand.
|
|
61
|
+
hermes: isClearedFlag(translatedOptions, 'hermes')
|
|
62
|
+
? false
|
|
63
|
+
: translatedOptions.hermes === undefined
|
|
64
|
+
? undefined
|
|
65
|
+
: (0, options_1.getBooleanOption)(translatedOptions, 'hermes', false),
|
|
59
66
|
hermesBase: (0, options_1.getStringOption)(translatedOptions, 'hermesBase', 'auto'),
|
|
60
67
|
verifyHermesBase: (0, options_1.getBooleanOption)(translatedOptions, 'verifyHermesBase', true),
|
|
61
68
|
resetCache: (0, options_1.getBooleanOption)(translatedOptions, 'resetCache', true),
|
package/lib/provider.js
CHANGED
|
@@ -87,7 +87,8 @@ class CLIProviderImpl {
|
|
|
87
87
|
taro: options.taro || false,
|
|
88
88
|
expo: options.expo || false,
|
|
89
89
|
rncli: options.rncli || false,
|
|
90
|
-
|
|
90
|
+
// omitted when unset: a present-but-undefined key reads as --no-hermes
|
|
91
|
+
...(options.hermes !== undefined && { hermes: options.hermes }),
|
|
91
92
|
hermesBase: options.hermesBase || 'auto',
|
|
92
93
|
verifyHermesBase: options.verifyHermesBase ?? true,
|
|
93
94
|
resetCache: options.resetCache ?? true,
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -39,9 +39,10 @@ export interface VersionCheck {
|
|
|
39
39
|
* network.
|
|
40
40
|
*
|
|
41
41
|
* With `wait: true` (the `-v`/`version` command) the registry is queried
|
|
42
|
-
* first and the latest versions are printed inline. Otherwise
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* first and the latest versions are printed inline. Otherwise a fresh cached
|
|
43
|
+
* answer is printed inline too; without one the registry check runs in the
|
|
44
|
+
* background and the returned `printHints` shows what is newer once the
|
|
45
|
+
* command is done — the command itself is never delayed by it.
|
|
45
46
|
*/
|
|
46
47
|
export declare function printVersionCommand({ wait, }?: {
|
|
47
48
|
wait?: boolean;
|
package/lib/utils/index.js
CHANGED
|
@@ -355,9 +355,10 @@ function latestTag(version) {
|
|
|
355
355
|
* network.
|
|
356
356
|
*
|
|
357
357
|
* With `wait: true` (the `-v`/`version` command) the registry is queried
|
|
358
|
-
* first and the latest versions are printed inline. Otherwise
|
|
359
|
-
*
|
|
360
|
-
*
|
|
358
|
+
* first and the latest versions are printed inline. Otherwise a fresh cached
|
|
359
|
+
* answer is printed inline too; without one the registry check runs in the
|
|
360
|
+
* background and the returned `printHints` shows what is newer once the
|
|
361
|
+
* command is done — the command itself is never delayed by it.
|
|
361
362
|
*/
|
|
362
363
|
async function printVersionCommand({ wait = true, } = {}) {
|
|
363
364
|
// one dependency, not the whole map: this runs before every command
|
|
@@ -369,6 +370,15 @@ async function printVersionCommand({ wait = true, } = {}) {
|
|
|
369
370
|
if (wait) {
|
|
370
371
|
await check;
|
|
371
372
|
}
|
|
373
|
+
else {
|
|
374
|
+
// A fresh cache answers synchronously (only promise ticks), so yield one
|
|
375
|
+
// macrotask: on a cache hit the latest versions go on the startup lines
|
|
376
|
+
// and no second hint is printed at the end; a cold cache never waits here.
|
|
377
|
+
await Promise.race([
|
|
378
|
+
check,
|
|
379
|
+
new Promise((resolve) => setImmediate(resolve)),
|
|
380
|
+
]);
|
|
381
|
+
}
|
|
372
382
|
const [latestCliVersion, latestRnuVersion] = latest ?? [];
|
|
373
383
|
console.log(`react-native-update-cli: ${package_json_1.default.version}${latestTag(latestCliVersion)}`);
|
|
374
384
|
try {
|
|
@@ -414,7 +424,7 @@ async function printVersionCommand({ wait = true, } = {}) {
|
|
|
414
424
|
else {
|
|
415
425
|
console.log((0, i18n_1.t)('rnuVersionNotFound'));
|
|
416
426
|
}
|
|
417
|
-
let hinted =
|
|
427
|
+
let hinted = latest !== undefined; // inline tags already shown
|
|
418
428
|
const printHints = () => {
|
|
419
429
|
if (hinted || !latest) {
|
|
420
430
|
return;
|
package/package.json
CHANGED