react-native-update-cli 2.21.1 → 2.22.0
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/README.md +15 -7
- package/README.zh-CN.md +15 -7
- package/cli.json +18 -0
- package/lib/api.d.ts +7 -0
- package/lib/api.js +22 -0
- package/lib/bin.js +2 -0
- package/lib/bundle-runner.d.ts +26 -1
- package/lib/bundle-runner.js +137 -14
- package/lib/bundle.d.ts +3 -0
- package/lib/bundle.js +38 -2
- package/lib/cache.d.ts +5 -0
- package/lib/cache.js +20 -0
- package/lib/diff.js +9 -8
- package/lib/locales/en.d.ts +9 -0
- package/lib/locales/en.js +9 -0
- package/lib/locales/zh.d.ts +9 -0
- package/lib/locales/zh.js +9 -0
- package/lib/package.js +7 -0
- package/lib/provider.js +2 -0
- package/lib/types.d.ts +4 -0
- package/lib/utils/hermes-base.d.ts +109 -0
- package/lib/utils/hermes-base.js +629 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +3 -0
- package/lib/versions.d.ts +3 -0
- package/lib/versions.js +28 -0
- package/package.json +1 -1
- package/src/api.ts +28 -0
- package/src/bin.ts +2 -0
- package/src/bundle-runner.ts +185 -21
- package/src/bundle.ts +56 -3
- package/src/cache.ts +20 -0
- package/src/diff.ts +9 -8
- package/src/locales/en.ts +14 -0
- package/src/locales/zh.ts +12 -0
- package/src/package.ts +7 -0
- package/src/provider.ts +2 -0
- package/src/types.ts +4 -0
- package/src/utils/hermes-base.ts +718 -0
- package/src/utils/index.ts +3 -0
- package/src/versions.ts +38 -0
package/src/utils/index.ts
CHANGED
|
@@ -202,6 +202,7 @@ export async function getApkInfo(fn: string) {
|
|
|
202
202
|
versionName,
|
|
203
203
|
buildTime,
|
|
204
204
|
bundleHash: await sha256(bundleFile),
|
|
205
|
+
bundleFile,
|
|
205
206
|
...appCredential,
|
|
206
207
|
};
|
|
207
208
|
}
|
|
@@ -243,6 +244,7 @@ export async function getAppInfo(fn: string) {
|
|
|
243
244
|
versionName,
|
|
244
245
|
buildTime,
|
|
245
246
|
bundleHash: await sha256(bundleFile),
|
|
247
|
+
bundleFile,
|
|
246
248
|
...appCredential,
|
|
247
249
|
};
|
|
248
250
|
}
|
|
@@ -292,6 +294,7 @@ export async function getIpaInfo(fn: string) {
|
|
|
292
294
|
versionName,
|
|
293
295
|
buildTime,
|
|
294
296
|
bundleHash: await sha256(bundleFile),
|
|
297
|
+
bundleFile,
|
|
295
298
|
...appCredential,
|
|
296
299
|
};
|
|
297
300
|
}
|
package/src/versions.ts
CHANGED
|
@@ -8,6 +8,13 @@ import type { Package, Platform, Version } from './types';
|
|
|
8
8
|
import { isNonInteractive, question } from './utils';
|
|
9
9
|
import { depVersions } from './utils/dep-versions';
|
|
10
10
|
import { getCommitInfo } from './utils/git';
|
|
11
|
+
import { getHbcVersion } from './utils/hbcTransform';
|
|
12
|
+
import {
|
|
13
|
+
cachePut,
|
|
14
|
+
extractBundleFromArchive,
|
|
15
|
+
type HermesBaseMeta,
|
|
16
|
+
sha256Hex,
|
|
17
|
+
} from './utils/hermes-base';
|
|
11
18
|
import { t } from './utils/i18n';
|
|
12
19
|
import { getBooleanOption, getStringListOption } from './utils/options';
|
|
13
20
|
|
|
@@ -31,6 +38,8 @@ interface VersionCommandOptions {
|
|
|
31
38
|
dryRun?: boolean;
|
|
32
39
|
versionDeps?: Record<string, string>;
|
|
33
40
|
warnDepsChanges?: boolean;
|
|
41
|
+
/** internal: chain metadata from the bundle step (not a CLI flag) */
|
|
42
|
+
hermesBase?: HermesBaseMeta;
|
|
34
43
|
'no-interactive'?: boolean | string;
|
|
35
44
|
}
|
|
36
45
|
|
|
@@ -450,6 +459,32 @@ export const bindVersionToPackages = async ({
|
|
|
450
459
|
console.log(t('operationComplete', { count: pkgs.length }));
|
|
451
460
|
};
|
|
452
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Content identity of the ppk's bundle for the server (bundleHash, HBC version)
|
|
464
|
+
* plus the base used to compile it, and a copy of the bundle in the local
|
|
465
|
+
* cache so it can serve as a future base without a download.
|
|
466
|
+
*/
|
|
467
|
+
async function describePpkBundle(
|
|
468
|
+
ppkPath: string,
|
|
469
|
+
base?: HermesBaseMeta,
|
|
470
|
+
): Promise<Record<string, unknown>> {
|
|
471
|
+
const meta: Record<string, unknown> = {};
|
|
472
|
+
try {
|
|
473
|
+
const bundle = await extractBundleFromArchive(ppkPath);
|
|
474
|
+
if (bundle) {
|
|
475
|
+
meta.bundleHash = sha256Hex(bundle);
|
|
476
|
+
const hbcVersion = getHbcVersion(bundle);
|
|
477
|
+
meta.bytecodeVersion = hbcVersion ?? base?.bytecodeVersion ?? null;
|
|
478
|
+
await cachePut(bundle).catch(() => {});
|
|
479
|
+
}
|
|
480
|
+
} catch {
|
|
481
|
+
// best effort: metadata never blocks a publish
|
|
482
|
+
}
|
|
483
|
+
meta.baseVersionId = base?.baseVersionId ?? null;
|
|
484
|
+
meta.baseHash = base?.baseHash ?? null;
|
|
485
|
+
return meta;
|
|
486
|
+
}
|
|
487
|
+
|
|
453
488
|
export const versionCommands = {
|
|
454
489
|
publish: async ({
|
|
455
490
|
args,
|
|
@@ -476,6 +511,7 @@ export const versionCommands = {
|
|
|
476
511
|
getBooleanOption(options, 'no-interactive', false) || isNonInteractive();
|
|
477
512
|
|
|
478
513
|
const { hash } = await uploadFile(fn, undefined, appId);
|
|
514
|
+
const bundleMeta = await describePpkBundle(fn, options.hermesBase);
|
|
479
515
|
|
|
480
516
|
const versionName =
|
|
481
517
|
name ||
|
|
@@ -492,6 +528,8 @@ export const versionCommands = {
|
|
|
492
528
|
(nonInteractive ? '' : await question(t('versionMetaInfoQuestion'))),
|
|
493
529
|
deps: depVersions,
|
|
494
530
|
commit: await getCommitInfo(),
|
|
531
|
+
// Hermes delta-mode chain metadata (old servers drop unknown fields)
|
|
532
|
+
...bundleMeta,
|
|
495
533
|
});
|
|
496
534
|
console.log(t('packageUploadSuccess', { id }));
|
|
497
535
|
|