react-native-update-cli 2.21.2 → 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.
@@ -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