@hot-updater/expo 1.0.0-rc.2 → 1.0.0-rc.3

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
@@ -46,7 +46,6 @@ let node_fs = require("node:fs");
46
46
  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
- let expo_config_js = require("expo/config.js");
50
49
  let uuidv7 = require("uuidv7");
51
50
  //#region ../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js
52
51
  function isPlainObject(value) {
@@ -6207,6 +6206,23 @@ createExeca(mapNode);
6207
6206
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
6208
6207
  const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcExport();
6209
6208
  //#endregion
6209
+ //#region src/expoConfig.ts
6210
+ const importExpoConfigModule = (specifier) => import(specifier);
6211
+ const isMissingModule = (error, specifier) => error instanceof Error && "code" in error && error.code === "ERR_MODULE_NOT_FOUND" && error.message.includes(specifier);
6212
+ const loadExpoConfig = async () => {
6213
+ try {
6214
+ const module = await importExpoConfigModule("expo/config.js");
6215
+ return module.getConfig ? module : module.default;
6216
+ } catch (error) {
6217
+ if (!isMissingModule(error, "expo/config.js")) throw error;
6218
+ }
6219
+ const module = await importExpoConfigModule("expo/config/index.js");
6220
+ return module.getConfig ? module : module.default;
6221
+ };
6222
+ const getConfig = async (...args) => {
6223
+ return (await loadExpoConfig()).getConfig(...args);
6224
+ };
6225
+ //#endregion
6210
6226
  //#region src/resolveMain.ts
6211
6227
  /**
6212
6228
  * Attempts to resolve the entry point of a package located at `cwd`.
@@ -6273,15 +6289,15 @@ const getHotUpdaterExpoPluginProps = (plugins) => {
6273
6289
  const props = entry[1];
6274
6290
  return typeof props === "object" && props !== null ? props : void 0;
6275
6291
  };
6276
- const getExpoFingerprintExtraSources = (cwd) => {
6277
- const { exp } = (0, expo_config_js.getConfig)(cwd, { skipSDKVersionRequirement: true });
6292
+ const getExpoFingerprintExtraSources = async (cwd) => {
6293
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6278
6294
  const publicKeyPath = getHotUpdaterExpoPluginProps(exp.plugins)?.publicKeyPath;
6279
6295
  if (publicKeyPath === void 0) return [];
6280
6296
  if (typeof publicKeyPath !== "string" || !publicKeyPath.trim()) throw new Error("@hot-updater/expo publicKeyPath must be a non-empty path.");
6281
6297
  return [publicKeyPath];
6282
6298
  };
6283
6299
  const getExpoBundleSigningPublicKey = async (cwd) => {
6284
- const { exp } = (0, expo_config_js.getConfig)(cwd, { skipSDKVersionRequirement: true });
6300
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6285
6301
  const publicKeyPath = getHotUpdaterExpoPluginProps(exp.plugins)?.publicKeyPath;
6286
6302
  if (publicKeyPath === void 0) return null;
6287
6303
  if (typeof publicKeyPath !== "string" || !publicKeyPath.trim()) throw new Error("@hot-updater/expo publicKeyPath must be a non-empty path.");
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BasePluginArgs, BuildPlugin, BuildPluginConfig } from "@hot-updater/plugin-core";
2
2
 
3
3
  //#region src/expo.d.ts
4
- declare const getExpoFingerprintExtraSources: (cwd: string) => string[];
4
+ declare const getExpoFingerprintExtraSources: (cwd: string) => Promise<string[]>;
5
5
  declare const getExpoBundleSigningPublicKey: (cwd: string) => Promise<{
6
6
  readonly publicKey: string;
7
7
  } | null>;
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BasePluginArgs, BuildPlugin, BuildPluginConfig } from "@hot-updater/plugin-core";
2
2
 
3
3
  //#region src/expo.d.ts
4
- declare const getExpoFingerprintExtraSources: (cwd: string) => string[];
4
+ declare const getExpoFingerprintExtraSources: (cwd: string) => Promise<string[]>;
5
5
  declare const getExpoBundleSigningPublicKey: (cwd: string) => Promise<{
6
6
  readonly publicKey: string;
7
7
  } | null>;
package/dist/index.mjs CHANGED
@@ -20,7 +20,6 @@ import { appendFileSync, createReadStream, createWriteStream, readFileSync, stat
20
20
  import { finished } from "node:stream/promises";
21
21
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
22
22
  import { Buffer as Buffer$1 } from "node:buffer";
23
- import { getConfig } from "expo/config.js";
24
23
  import { uuidv7 } from "uuidv7";
25
24
  //#region \0rolldown/runtime.js
26
25
  var __create = Object.create;
@@ -6205,6 +6204,23 @@ createExeca(mapNode);
6205
6204
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
6206
6205
  const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcExport();
6207
6206
  //#endregion
6207
+ //#region src/expoConfig.ts
6208
+ const importExpoConfigModule = (specifier) => import(specifier);
6209
+ const isMissingModule = (error, specifier) => error instanceof Error && "code" in error && error.code === "ERR_MODULE_NOT_FOUND" && error.message.includes(specifier);
6210
+ const loadExpoConfig = async () => {
6211
+ try {
6212
+ const module = await importExpoConfigModule("expo/config.js");
6213
+ return module.getConfig ? module : module.default;
6214
+ } catch (error) {
6215
+ if (!isMissingModule(error, "expo/config.js")) throw error;
6216
+ }
6217
+ const module = await importExpoConfigModule("expo/config/index.js");
6218
+ return module.getConfig ? module : module.default;
6219
+ };
6220
+ const getConfig = async (...args) => {
6221
+ return (await loadExpoConfig()).getConfig(...args);
6222
+ };
6223
+ //#endregion
6208
6224
  //#region src/resolveMain.ts
6209
6225
  /**
6210
6226
  * Attempts to resolve the entry point of a package located at `cwd`.
@@ -6271,15 +6287,15 @@ const getHotUpdaterExpoPluginProps = (plugins) => {
6271
6287
  const props = entry[1];
6272
6288
  return typeof props === "object" && props !== null ? props : void 0;
6273
6289
  };
6274
- const getExpoFingerprintExtraSources = (cwd) => {
6275
- const { exp } = getConfig(cwd, { skipSDKVersionRequirement: true });
6290
+ const getExpoFingerprintExtraSources = async (cwd) => {
6291
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6276
6292
  const publicKeyPath = getHotUpdaterExpoPluginProps(exp.plugins)?.publicKeyPath;
6277
6293
  if (publicKeyPath === void 0) return [];
6278
6294
  if (typeof publicKeyPath !== "string" || !publicKeyPath.trim()) throw new Error("@hot-updater/expo publicKeyPath must be a non-empty path.");
6279
6295
  return [publicKeyPath];
6280
6296
  };
6281
6297
  const getExpoBundleSigningPublicKey = async (cwd) => {
6282
- const { exp } = getConfig(cwd, { skipSDKVersionRequirement: true });
6298
+ const { exp } = await getConfig(cwd, { skipSDKVersionRequirement: true });
6283
6299
  const publicKeyPath = getHotUpdaterExpoPluginProps(exp.plugins)?.publicKeyPath;
6284
6300
  if (publicKeyPath === void 0) return null;
6285
6301
  if (typeof publicKeyPath !== "string" || !publicKeyPath.trim()) throw new Error("@hot-updater/expo publicKeyPath must be a non-empty path.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/expo",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "Hot Updater build and config plugin for Expo",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -28,9 +28,9 @@
28
28
  "@babel/core": "7.26.0",
29
29
  "@babel/types": "7.26.0",
30
30
  "uuidv7": "^1.0.2",
31
- "@hot-updater/cli-tools": "1.0.0-rc.1",
32
31
  "@hot-updater/bare": "1.0.0-rc.1",
33
- "@hot-updater/plugin-core": "1.0.0-rc.1"
32
+ "@hot-updater/plugin-core": "1.0.0-rc.1",
33
+ "@hot-updater/cli-tools": "1.0.0-rc.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20",