@hot-updater/expo 0.36.16 → 0.36.17

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
@@ -47,6 +47,7 @@ let node_stream_promises = require("node:stream/promises");
47
47
  let node_stream = require("node:stream");
48
48
  let node_buffer = require("node:buffer");
49
49
  let uuidv7 = require("uuidv7");
50
+ let node_module = require("node:module");
50
51
  //#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
51
52
  function isPlainObject(value) {
52
53
  if (typeof value !== "object" || value === null) return false;
@@ -918,7 +919,7 @@ var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
918
919
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
919
920
  var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
920
921
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
921
- const path$9 = require("path");
922
+ const path$10 = require("path");
922
923
  const COLON = isWindows ? ";" : ":";
923
924
  const isexe = require_isexe();
924
925
  const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -948,7 +949,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
948
949
  if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
949
950
  const ppRaw = pathEnv[i];
950
951
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
951
- const pCmd = path$9.join(pathPart, cmd);
952
+ const pCmd = path$10.join(pathPart, cmd);
952
953
  resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
953
954
  });
954
955
  const subStep = (p, i, ii) => new Promise((resolve, reject) => {
@@ -969,7 +970,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
969
970
  for (let i = 0; i < pathEnv.length; i++) {
970
971
  const ppRaw = pathEnv[i];
971
972
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
972
- const pCmd = path$9.join(pathPart, cmd);
973
+ const pCmd = path$10.join(pathPart, cmd);
973
974
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
974
975
  for (let j = 0; j < pathExt.length; j++) {
975
976
  const cur = p + pathExt[j];
@@ -1000,7 +1001,7 @@ var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1000
1001
  //#endregion
1001
1002
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
1002
1003
  var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1003
- const path$8 = require("path");
1004
+ const path$9 = require("path");
1004
1005
  const which = require_which();
1005
1006
  const getPathKey = require_path_key();
1006
1007
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -1015,12 +1016,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) =>
1015
1016
  try {
1016
1017
  resolved = which.sync(parsed.command, {
1017
1018
  path: env[getPathKey({ env })],
1018
- pathExt: withoutPathExt ? path$8.delimiter : void 0
1019
+ pathExt: withoutPathExt ? path$9.delimiter : void 0
1019
1020
  });
1020
1021
  } catch (e) {} finally {
1021
1022
  if (shouldSwitchCwd) process.chdir(cwd);
1022
1023
  }
1023
- if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
1024
+ if (resolved) resolved = path$9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
1024
1025
  return resolved;
1025
1026
  }
1026
1027
  function resolveCommand(parsed) {
@@ -1087,7 +1088,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1087
1088
  //#endregion
1088
1089
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
1089
1090
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1090
- const path$7 = require("path");
1091
+ const path$8 = require("path");
1091
1092
  const resolveCommand = require_resolveCommand();
1092
1093
  const escape = require_escape();
1093
1094
  const readShebang = require_readShebang();
@@ -1110,7 +1111,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1110
1111
  const needsShell = !isExecutableRegExp.test(commandFile);
1111
1112
  if (parsed.options.forceShell || needsShell) {
1112
1113
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
1113
- parsed.command = path$7.normalize(parsed.command);
1114
+ parsed.command = path$8.normalize(parsed.command);
1114
1115
  parsed.command = escape.command(parsed.command);
1115
1116
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1116
1117
  parsed.args = [
@@ -6206,6 +6207,12 @@ createExeca(mapNode);
6206
6207
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
6207
6208
  const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcExport();
6208
6209
  //#endregion
6210
+ //#region src/expoConfig.ts
6211
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
6212
+ const getConfig = async (...args) => {
6213
+ return require$1(require$1.resolve("expo/config", { paths: [node_path.default.resolve(args[0])] })).getConfig(...args);
6214
+ };
6215
+ //#endregion
6209
6216
  //#region src/resolveMain.ts
6210
6217
  /**
6211
6218
  * Attempts to resolve the entry point of a package located at `cwd`.
@@ -6266,23 +6273,16 @@ const runExpoPrebuild = async ({ platform }) => {
6266
6273
  };
6267
6274
  //#endregion
6268
6275
  //#region src/expo.ts
6269
- const isHermesEnabled = (cwd, platform) => {
6270
- try {
6271
- const appJsonPath = path.default.join(cwd, "app.json");
6272
- const { expo } = JSON.parse(fs.default.readFileSync(appJsonPath, "utf-8"));
6273
- const platformJsEngine = expo?.[platform]?.jsEngine;
6274
- const commonJsEngine = expo?.jsEngine;
6275
- if (platformJsEngine !== void 0) return platformJsEngine === "hermes";
6276
- if (commonJsEngine !== void 0) return commonJsEngine === "hermes";
6277
- } catch {}
6278
- return true;
6276
+ const isHermesEnabled = async (cwd, platform) => {
6277
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6278
+ return (exp[platform]?.jsEngine ?? exp.jsEngine ?? "hermes") === "hermes";
6279
6279
  };
6280
6280
  const runBundle = async ({ cwd, platform, buildPath, sourcemap, resetCache }) => {
6281
6281
  const filename = `index.${platform}`;
6282
6282
  const bundleOutput = path.default.join(buildPath, `${filename}.bundle`);
6283
6283
  const entryFile = resolveMain(cwd);
6284
6284
  const bundleId = (0, uuidv7.uuidv7)();
6285
- const enableHermes = isHermesEnabled(cwd, platform);
6285
+ const enableHermes = await isHermesEnabled(cwd, platform);
6286
6286
  const args = [
6287
6287
  "expo",
6288
6288
  "export:embed",
package/dist/index.mjs CHANGED
@@ -6204,6 +6204,12 @@ createExeca(mapNode);
6204
6204
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
6205
6205
  const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcExport();
6206
6206
  //#endregion
6207
+ //#region src/expoConfig.ts
6208
+ const require$1 = createRequire(import.meta.url);
6209
+ const getConfig = async (...args) => {
6210
+ return require$1(require$1.resolve("expo/config", { paths: [path$1.resolve(args[0])] })).getConfig(...args);
6211
+ };
6212
+ //#endregion
6207
6213
  //#region src/resolveMain.ts
6208
6214
  /**
6209
6215
  * Attempts to resolve the entry point of a package located at `cwd`.
@@ -6264,23 +6270,16 @@ const runExpoPrebuild = async ({ platform }) => {
6264
6270
  };
6265
6271
  //#endregion
6266
6272
  //#region src/expo.ts
6267
- const isHermesEnabled = (cwd, platform) => {
6268
- try {
6269
- const appJsonPath = path.join(cwd, "app.json");
6270
- const { expo } = JSON.parse(fs.readFileSync(appJsonPath, "utf-8"));
6271
- const platformJsEngine = expo?.[platform]?.jsEngine;
6272
- const commonJsEngine = expo?.jsEngine;
6273
- if (platformJsEngine !== void 0) return platformJsEngine === "hermes";
6274
- if (commonJsEngine !== void 0) return commonJsEngine === "hermes";
6275
- } catch {}
6276
- return true;
6273
+ const isHermesEnabled = async (cwd, platform) => {
6274
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6275
+ return (exp[platform]?.jsEngine ?? exp.jsEngine ?? "hermes") === "hermes";
6277
6276
  };
6278
6277
  const runBundle = async ({ cwd, platform, buildPath, sourcemap, resetCache }) => {
6279
6278
  const filename = `index.${platform}`;
6280
6279
  const bundleOutput = path.join(buildPath, `${filename}.bundle`);
6281
6280
  const entryFile = resolveMain(cwd);
6282
6281
  const bundleId = uuidv7();
6283
- const enableHermes = isHermesEnabled(cwd, platform);
6282
+ const enableHermes = await isHermesEnabled(cwd, platform);
6284
6283
  const args = [
6285
6284
  "expo",
6286
6285
  "export:embed",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/expo",
3
3
  "type": "module",
4
- "version": "0.36.16",
4
+ "version": "0.36.17",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",
@@ -27,13 +27,14 @@
27
27
  "@babel/core": "7.26.0",
28
28
  "@babel/types": "7.26.0",
29
29
  "uuidv7": "^1.0.2",
30
- "@hot-updater/bare": "0.36.16",
31
- "@hot-updater/cli-tools": "0.36.16",
32
- "@hot-updater/plugin-core": "0.36.16"
30
+ "@hot-updater/bare": "0.36.17",
31
+ "@hot-updater/cli-tools": "0.36.17",
32
+ "@hot-updater/plugin-core": "0.36.17"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20",
36
36
  "execa": "9.5.2",
37
+ "expo": "^50.0.0",
37
38
  "vitest": "4.1.4"
38
39
  },
39
40
  "exports": {