@hot-updater/expo 1.2.0-rc.2 → 1.2.0-rc.20

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/dist/index.cjs CHANGED
@@ -6345,18 +6345,17 @@ function resolveMain(cwd) {
6345
6345
  const runExpoPrebuild = async ({ platform }) => {
6346
6346
  const spinner = _hot_updater_cli_tools.p.spinner();
6347
6347
  try {
6348
- spinner.start("Run expo prebuild");
6349
- const args = [
6348
+ spinner.start("Running expo prebuild");
6349
+ await execa("npx", [
6350
6350
  "expo",
6351
6351
  "prebuild",
6352
6352
  "--platform",
6353
6353
  platform,
6354
6354
  "--no-install"
6355
- ];
6355
+ ]);
6356
6356
  spinner.stop("Expo prebuild done");
6357
- await execa("npx", args);
6358
6357
  } catch (e) {
6359
- spinner.stop("Expo prebuild failed");
6358
+ spinner.error("Expo prebuild failed");
6360
6359
  if (e instanceof ExecaError) _hot_updater_cli_tools.p.log.error(e.stderr || e.stdout || e.message);
6361
6360
  else if (e instanceof Error) _hot_updater_cli_tools.p.log.error(e.message);
6362
6361
  process.exit(1);
@@ -6374,17 +6373,21 @@ const getHotUpdaterExpoPluginProps = (plugins) => {
6374
6373
  /**
6375
6374
  * What `expo prebuild` would write into a platform's native project, from
6376
6375
  * the Expo config and with the project's own config plugins, without
6377
- * writing it: the version Expo's version plugin writes, and the channel the
6378
- * `@hot-updater/expo` config plugin writes when the config lists it.
6376
+ * writing it: the version Expo's version plugin writes, and the channel and
6377
+ * the trust-anchor file the `@hot-updater/expo` config plugin writes when the
6378
+ * config lists it.
6379
6379
  */
6380
6380
  const getExpoNativeProjectValues = async (cwd, platform) => {
6381
6381
  const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6382
6382
  const { AndroidConfig, IOSConfig } = getConfigPlugins(cwd);
6383
6383
  const appVersion = platform === "ios" ? IOSConfig.Version.getVersion(exp) : AndroidConfig.Version.getVersionName(exp);
6384
6384
  const listsPlugin = (exp.plugins ?? []).some((plugin) => isHotUpdaterExpoPlugin(Array.isArray(plugin) ? plugin[0] : plugin));
6385
+ const props = getHotUpdaterExpoPluginProps(exp.plugins);
6386
+ const publicKeyPath = props?.publicKeyPath;
6385
6387
  return {
6386
6388
  ...appVersion ? { appVersion } : {},
6387
- ...listsPlugin ? { channel: getHotUpdaterExpoPluginProps(exp.plugins)?.channel || "production" } : {}
6389
+ ...listsPlugin ? { channel: props?.channel || "production" } : {},
6390
+ ...typeof publicKeyPath === "string" && publicKeyPath.trim() ? { publicKeyPath } : {}
6388
6391
  };
6389
6392
  };
6390
6393
  const getExpoFingerprintExtraSources = async (cwd) => {
@@ -6471,6 +6474,7 @@ const expo = (config = {
6471
6474
  }
6472
6475
  },
6473
6476
  build: async ({ platform }) => {
6477
+ (0, _hot_updater_cli_tools.assertSupportedExpoSdk)(cwd);
6474
6478
  const buildPath = path.default.join(cwd, outDir);
6475
6479
  await fs.default.promises.rm(buildPath, {
6476
6480
  recursive: true,
package/dist/index.d.cts CHANGED
@@ -3,12 +3,14 @@ import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, NativeFingerprintOp
3
3
  /**
4
4
  * What `expo prebuild` would write into a platform's native project, from
5
5
  * the Expo config and with the project's own config plugins, without
6
- * writing it: the version Expo's version plugin writes, and the channel the
7
- * `@hot-updater/expo` config plugin writes when the config lists it.
6
+ * writing it: the version Expo's version plugin writes, and the channel and
7
+ * the trust-anchor file the `@hot-updater/expo` config plugin writes when the
8
+ * config lists it.
8
9
  */
9
10
  declare const getExpoNativeProjectValues: (cwd: string, platform: Platform) => Promise<{
10
11
  appVersion?: string;
11
12
  channel?: string;
13
+ publicKeyPath?: string;
12
14
  }>;
13
15
  declare const getExpoFingerprintExtraSources: (cwd: string) => Promise<string[]>;
14
16
  declare const getExpoBundleSigningPublicKey: (cwd: string) => Promise<{
package/dist/index.d.mts CHANGED
@@ -3,12 +3,14 @@ import { BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, NativeFingerprintOp
3
3
  /**
4
4
  * What `expo prebuild` would write into a platform's native project, from
5
5
  * the Expo config and with the project's own config plugins, without
6
- * writing it: the version Expo's version plugin writes, and the channel the
7
- * `@hot-updater/expo` config plugin writes when the config lists it.
6
+ * writing it: the version Expo's version plugin writes, and the channel and
7
+ * the trust-anchor file the `@hot-updater/expo` config plugin writes when the
8
+ * config lists it.
8
9
  */
9
10
  declare const getExpoNativeProjectValues: (cwd: string, platform: Platform) => Promise<{
10
11
  appVersion?: string;
11
12
  channel?: string;
13
+ publicKeyPath?: string;
12
14
  }>;
13
15
  declare const getExpoFingerprintExtraSources: (cwd: string) => Promise<string[]>;
14
16
  declare const getExpoBundleSigningPublicKey: (cwd: string) => Promise<{
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import fs from "fs";
4
4
  import * as path$2 from "path";
5
5
  import path from "path";
6
6
  import { compileHermes } from "@hot-updater/bare";
7
- import { createInterfaceFingerprint, log, p, reactNativeConfigCommand, readBundleSigningPublicKeyFile, readReactNativeInterface } from "@hot-updater/cli-tools";
7
+ import { assertSupportedExpoSdk, createInterfaceFingerprint, log, p, reactNativeConfigCommand, readBundleSigningPublicKeyFile, readReactNativeInterface } from "@hot-updater/cli-tools";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
10
10
  import { StringDecoder } from "node:string_decoder";
@@ -6341,18 +6341,17 @@ function resolveMain(cwd) {
6341
6341
  const runExpoPrebuild = async ({ platform }) => {
6342
6342
  const spinner = p.spinner();
6343
6343
  try {
6344
- spinner.start("Run expo prebuild");
6345
- const args = [
6344
+ spinner.start("Running expo prebuild");
6345
+ await execa("npx", [
6346
6346
  "expo",
6347
6347
  "prebuild",
6348
6348
  "--platform",
6349
6349
  platform,
6350
6350
  "--no-install"
6351
- ];
6351
+ ]);
6352
6352
  spinner.stop("Expo prebuild done");
6353
- await execa("npx", args);
6354
6353
  } catch (e) {
6355
- spinner.stop("Expo prebuild failed");
6354
+ spinner.error("Expo prebuild failed");
6356
6355
  if (e instanceof ExecaError) p.log.error(e.stderr || e.stdout || e.message);
6357
6356
  else if (e instanceof Error) p.log.error(e.message);
6358
6357
  process.exit(1);
@@ -6370,17 +6369,21 @@ const getHotUpdaterExpoPluginProps = (plugins) => {
6370
6369
  /**
6371
6370
  * What `expo prebuild` would write into a platform's native project, from
6372
6371
  * the Expo config and with the project's own config plugins, without
6373
- * writing it: the version Expo's version plugin writes, and the channel the
6374
- * `@hot-updater/expo` config plugin writes when the config lists it.
6372
+ * writing it: the version Expo's version plugin writes, and the channel and
6373
+ * the trust-anchor file the `@hot-updater/expo` config plugin writes when the
6374
+ * config lists it.
6375
6375
  */
6376
6376
  const getExpoNativeProjectValues = async (cwd, platform) => {
6377
6377
  const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6378
6378
  const { AndroidConfig, IOSConfig } = getConfigPlugins(cwd);
6379
6379
  const appVersion = platform === "ios" ? IOSConfig.Version.getVersion(exp) : AndroidConfig.Version.getVersionName(exp);
6380
6380
  const listsPlugin = (exp.plugins ?? []).some((plugin) => isHotUpdaterExpoPlugin(Array.isArray(plugin) ? plugin[0] : plugin));
6381
+ const props = getHotUpdaterExpoPluginProps(exp.plugins);
6382
+ const publicKeyPath = props?.publicKeyPath;
6381
6383
  return {
6382
6384
  ...appVersion ? { appVersion } : {},
6383
- ...listsPlugin ? { channel: getHotUpdaterExpoPluginProps(exp.plugins)?.channel || "production" } : {}
6385
+ ...listsPlugin ? { channel: props?.channel || "production" } : {},
6386
+ ...typeof publicKeyPath === "string" && publicKeyPath.trim() ? { publicKeyPath } : {}
6384
6387
  };
6385
6388
  };
6386
6389
  const getExpoFingerprintExtraSources = async (cwd) => {
@@ -6467,6 +6470,7 @@ const expo = (config = {
6467
6470
  }
6468
6471
  },
6469
6472
  build: async ({ platform }) => {
6473
+ assertSupportedExpoSdk(cwd);
6470
6474
  const buildPath = path.join(cwd, outDir);
6471
6475
  await fs.promises.rm(buildPath, {
6472
6476
  recursive: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/expo",
3
- "version": "1.2.0-rc.2",
3
+ "version": "1.2.0-rc.20",
4
4
  "description": "Hot Updater build and config plugin for Expo",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -28,16 +28,16 @@
28
28
  "@babel/core": "7.26.0",
29
29
  "@babel/types": "7.26.0",
30
30
  "uuidv7": "^1.0.2",
31
- "@hot-updater/bare": "1.2.0-rc.2",
32
- "@hot-updater/cli-tools": "1.2.0-rc.2",
33
- "@hot-updater/plugin-core": "1.2.0-rc.2"
31
+ "@hot-updater/bare": "1.2.0-rc.20",
32
+ "@hot-updater/cli-tools": "1.2.0-rc.20",
33
+ "@hot-updater/plugin-core": "1.2.0-rc.20"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20",
37
- "expo": "^50.0.0",
37
+ "expo": "^55.0.0",
38
38
  "execa": "9.5.2",
39
39
  "vitest": "4.1.4",
40
- "hot-updater": "1.2.0-rc.2"
40
+ "hot-updater": "1.2.0-rc.20"
41
41
  },
42
42
  "exports": {
43
43
  ".": {
@@ -52,7 +52,7 @@
52
52
  "./package.json": "./package.json"
53
53
  },
54
54
  "peerDependencies": {
55
- "expo": ">=50.0.0",
55
+ "expo": ">=55.0.0",
56
56
  "hot-updater": "*"
57
57
  },
58
58
  "peerDependenciesMeta": {
@@ -127,6 +127,7 @@ const withHotUpdaterConfigAsync = (props) => (config) => {
127
127
  };
128
128
  // === iOS: Add channel to Info.plist ===
129
129
  modifiedConfig = (0, config_plugins_1.withInfoPlist)(modifiedConfig, async (cfg) => {
130
+ (await loadCliTools()).assertSupportedExpoSdk(cfg.modRequest.projectRoot);
130
131
  await writeFingerprintJson(cfg.modRequest.projectRoot);
131
132
  // Load public key if signing is enabled
132
133
  const publicKey = await getPublicKey(cfg.modRequest.projectRoot);
@@ -142,6 +143,7 @@ const withHotUpdaterConfigAsync = (props) => (config) => {
142
143
  });
143
144
  // === Android: Add channel to AndroidManifest.xml ===
144
145
  modifiedConfig = (0, config_plugins_1.withAndroidManifest)(modifiedConfig, async (cfg) => {
146
+ (await loadCliTools()).assertSupportedExpoSdk(cfg.modRequest.projectRoot);
145
147
  await writeFingerprintJson(cfg.modRequest.projectRoot);
146
148
  // Load public key if signing is enabled
147
149
  const publicKey = await getPublicKey(cfg.modRequest.projectRoot);