hot-updater 0.24.4 → 0.24.6

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.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { _ as require_base64_js, a as createAndInjectFingerprintFiles, b as __require, c as generateFingerprints, d as getFingerprintDiff, f as showFingerprintDiff, g as require_plist, h as IosConfigParser, i as saveKeyPair, l as nativeFingerprint, m as require_out, n as getPublicKeyFromPrivate, p as isFingerprintEquals, r as loadPrivateKey, t as generateKeyPair, u as readLocalFingerprint, v as AndroidConfigParser, x as __toESM, y as __commonJS } from "./keyGeneration-D_2zTEmt.js";
2
+ import { S as __toESM, _ as require_plist, a as createAndInjectFingerprintFiles, b as __commonJS, c as generateFingerprints, d as getFingerprintDiff, f as showFingerprintDiff, g as IosConfigParser, h as warnIfExpoCNG, i as saveKeyPair, l as nativeFingerprint, m as require_out, n as getPublicKeyFromPrivate, p as isFingerprintEquals, r as loadPrivateKey, t as generateKeyPair, u as readLocalFingerprint, v as require_base64_js, x as __require, y as AndroidConfigParser } from "./keyGeneration-wtEOsvvG.js";
3
3
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
4
4
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
5
5
  import path from "node:path";
6
6
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
7
7
  import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
8
- import { banner, colors, createTarBrTargetFiles, createTarGzTargetFiles, createZipTargetFiles, getCwd, loadConfig, log, p, printBanner } from "@hot-updater/cli-tools";
8
+ import { banner, colors, createTarBrTargetFiles, createTarGzTargetFiles, createZipTargetFiles, ensureInstallPackages, getCwd, loadConfig, log, p, printBanner } from "@hot-updater/cli-tools";
9
9
  import { fileURLToPath } from "node:url";
10
10
  import { StringDecoder } from "node:string_decoder";
11
11
  import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
@@ -35853,72 +35853,14 @@ const deploy = async (options) => {
35853
35853
  }
35854
35854
  };
35855
35855
 
35856
- //#endregion
35857
- //#region src/utils/getPackageManager.ts
35858
- const getPackageManager = () => {
35859
- const [packageManagerWithVersion] = process.env["npm_config_user_agent"]?.split(" ") ?? [];
35860
- if (!packageManagerWithVersion) return "npm";
35861
- const [packageManager] = packageManagerWithVersion.split("/");
35862
- if (!packageManager) return "npm";
35863
- return packageManager;
35864
- };
35865
-
35866
35856
  //#endregion
35867
35857
  //#region src/utils/ensureInstallPackages.ts
35868
35858
  const ensurePackageVersion = (pkg) => {
35869
35859
  if (pkg === "hot-updater" || pkg.startsWith("@hot-updater/")) return `${pkg}@${version}`;
35870
35860
  return pkg;
35871
35861
  };
35872
- const ensureInstallPackages = async (buildPluginPackages) => {
35873
- const packages = await readPackageUp({ cwd: getCwd() });
35874
- const dependenciesToInstall = buildPluginPackages.dependencies.filter((pkg) => {
35875
- return !packages?.packageJson?.dependencies?.[pkg];
35876
- });
35877
- const devDependenciesToInstall = buildPluginPackages.devDependencies.filter((pkg) => {
35878
- return !packages?.packageJson?.devDependencies?.[pkg];
35879
- });
35880
- const packageManager = getPackageManager();
35881
- await p.tasks([{
35882
- enabled: dependenciesToInstall.length > 0,
35883
- title: "Checking packages",
35884
- task: async (message) => {
35885
- message(`Installing ${dependenciesToInstall.join(", ")}...`);
35886
- try {
35887
- const result = await execa(packageManager, [packageManager === "yarn" ? "add" : "install", ...dependenciesToInstall.map(ensurePackageVersion)]);
35888
- if (result.exitCode !== 0 && result.stderr) {
35889
- p.log.error(result.stderr);
35890
- process.exit(1);
35891
- }
35892
- return `Installed ${dependenciesToInstall.join(", ")}`;
35893
- } catch (e) {
35894
- if (e instanceof ExecaError) p.log.error(e.stderr || e.stdout || e.message);
35895
- else if (e instanceof Error) p.log.error(e.message);
35896
- process.exit(1);
35897
- }
35898
- }
35899
- }, {
35900
- enabled: devDependenciesToInstall.length > 0,
35901
- title: "Installing dev dependencies",
35902
- task: async (message) => {
35903
- message(`Installing ${devDependenciesToInstall.join(", ")}...`);
35904
- try {
35905
- const result = await execa(packageManager, [
35906
- packageManager === "yarn" ? "add" : "install",
35907
- ...devDependenciesToInstall.map(ensurePackageVersion),
35908
- packageManager === "yarn" ? "--dev" : "--save-dev"
35909
- ]);
35910
- if (result.exitCode !== 0 && result.stderr) {
35911
- p.log.error(result.stderr);
35912
- process.exit(1);
35913
- }
35914
- return `Installed ${devDependenciesToInstall.join(", ")}`;
35915
- } catch (e) {
35916
- if (e instanceof ExecaError) p.log.error(e.stderr || e.stdout || e.message);
35917
- else if (e instanceof Error) p.log.error(e.message);
35918
- process.exit(1);
35919
- }
35920
- }
35921
- }]);
35862
+ const ensureInstallPackages$1 = async (buildPluginPackages) => {
35863
+ await ensureInstallPackages(buildPluginPackages, { versionResolver: ensurePackageVersion });
35922
35864
  };
35923
35865
 
35924
35866
  //#endregion
@@ -36006,7 +35948,7 @@ const init = async () => {
36006
35948
  });
36007
35949
  if (p.isCancel(provider)) process.exit(0);
36008
35950
  try {
36009
- await ensureInstallPackages({
35951
+ await ensureInstallPackages$1({
36010
35952
  dependencies: [
36011
35953
  ...buildPluginPackage.dependencies,
36012
35954
  ...REQUIRED_PACKAGES.dependencies,
@@ -36116,6 +36058,7 @@ const handleChannel = async () => {
36116
36058
  p.log.info(` from: ${colors.blue(iosChannel.paths[0])}`);
36117
36059
  };
36118
36060
  const handleSetChannel = async (channel) => {
36061
+ warnIfExpoCNG();
36119
36062
  const { paths: androidPaths } = await setChannel("android", channel);
36120
36063
  p.log.success(`Set Android channel to: ${colors.green(channel)}`);
36121
36064
  if (androidPaths.length > 0) {
@@ -36893,6 +36836,7 @@ const handleFingerprint = async () => {
36893
36836
  p.log.success("Fingerprint matched");
36894
36837
  };
36895
36838
  const handleCreateFingerprint = async () => {
36839
+ warnIfExpoCNG();
36896
36840
  let diffChanged = false;
36897
36841
  let localFingerprint = null;
36898
36842
  let result = null;
@@ -37569,6 +37513,7 @@ function printPublicKeyInstructions(publicKeyPEM) {
37569
37513
  * Usage: npx hot-updater keys export-public [--input ./keys/private-key.pem] [--print-only] [--yes]
37570
37514
  */
37571
37515
  const keysExportPublic = async (options = {}) => {
37516
+ warnIfExpoCNG();
37572
37517
  const cwd = getCwd();
37573
37518
  const config = await loadConfig(null);
37574
37519
  const configPrivateKeyPath = config.signing?.privateKeyPath;
@@ -1461,7 +1461,7 @@ var AndroidConfigParser = class {
1461
1461
  parser;
1462
1462
  builder;
1463
1463
  constructor(customPaths) {
1464
- this.stringsXmlPaths = (customPaths || []).map((p$2) => path.default.isAbsolute(p$2) ? p$2 : path.default.join((0, __hot_updater_cli_tools.getCwd)(), p$2));
1464
+ this.stringsXmlPaths = (customPaths || []).map((p$3) => path.default.isAbsolute(p$3) ? p$3 : path.default.join((0, __hot_updater_cli_tools.getCwd)(), p$3));
1465
1465
  const options = {
1466
1466
  ignoreAttributes: false,
1467
1467
  attributeNamePrefix: "@_",
@@ -1480,10 +1480,10 @@ var AndroidConfigParser = class {
1480
1480
  });
1481
1481
  }
1482
1482
  async exists() {
1483
- return this.stringsXmlPaths.some((path$16) => fs.default.existsSync(path$16));
1483
+ return this.stringsXmlPaths.some((path$17) => fs.default.existsSync(path$17));
1484
1484
  }
1485
1485
  getExistingPaths() {
1486
- return this.stringsXmlPaths.filter((path$16) => fs.default.existsSync(path$16));
1486
+ return this.stringsXmlPaths.filter((path$17) => fs.default.existsSync(path$17));
1487
1487
  }
1488
1488
  async get(key) {
1489
1489
  const existingPaths = this.getExistingPaths();
@@ -1725,7 +1725,7 @@ var require_dom = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
1725
1725
  };
1726
1726
  }
1727
1727
  function copy(src, dest) {
1728
- for (var p$2 in src) if (Object.prototype.hasOwnProperty.call(src, p$2)) dest[p$2] = src[p$2];
1728
+ for (var p$3 in src) if (Object.prototype.hasOwnProperty.call(src, p$3)) dest[p$3] = src[p$3];
1729
1729
  }
1730
1730
  /**
1731
1731
  ^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
@@ -5172,13 +5172,13 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5172
5172
  start = end$1;
5173
5173
  }
5174
5174
  }
5175
- function position$1(p$2, m) {
5176
- while (p$2 >= lineEnd && (m = linePattern.exec(source))) {
5175
+ function position$1(p$3, m) {
5176
+ while (p$3 >= lineEnd && (m = linePattern.exec(source))) {
5177
5177
  lineStart = m.index;
5178
5178
  lineEnd = lineStart + m[0].length;
5179
5179
  locator.lineNumber++;
5180
5180
  }
5181
- locator.columnNumber = p$2 - lineStart + 1;
5181
+ locator.columnNumber = p$3 - lineStart + 1;
5182
5182
  }
5183
5183
  var lineStart = 0;
5184
5184
  var lineEnd = 0;
@@ -5287,14 +5287,14 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5287
5287
  }
5288
5288
  var attrName;
5289
5289
  var value;
5290
- var p$2 = ++start;
5290
+ var p$3 = ++start;
5291
5291
  var s = S_TAG;
5292
5292
  while (true) {
5293
- var c = source.charAt(p$2);
5293
+ var c = source.charAt(p$3);
5294
5294
  switch (c) {
5295
5295
  case "=":
5296
5296
  if (s === S_ATTR) {
5297
- attrName = source.slice(start, p$2);
5297
+ attrName = source.slice(start, p$3);
5298
5298
  s = S_EQ;
5299
5299
  } else if (s === S_ATTR_SPACE) s = S_EQ;
5300
5300
  else throw new Error("attribute equal must after attrName");
@@ -5304,26 +5304,26 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5304
5304
  if (s === S_EQ || s === S_ATTR) {
5305
5305
  if (s === S_ATTR) {
5306
5306
  errorHandler.warning("attribute value must after \"=\"");
5307
- attrName = source.slice(start, p$2);
5307
+ attrName = source.slice(start, p$3);
5308
5308
  }
5309
- start = p$2 + 1;
5310
- p$2 = source.indexOf(c, start);
5311
- if (p$2 > 0) {
5312
- value = source.slice(start, p$2);
5309
+ start = p$3 + 1;
5310
+ p$3 = source.indexOf(c, start);
5311
+ if (p$3 > 0) {
5312
+ value = source.slice(start, p$3);
5313
5313
  addAttribute(attrName, value, start - 1);
5314
5314
  s = S_ATTR_END;
5315
5315
  } else throw new Error("attribute value no end '" + c + "' match");
5316
5316
  } else if (s == S_ATTR_NOQUOT_VALUE) {
5317
- value = source.slice(start, p$2);
5317
+ value = source.slice(start, p$3);
5318
5318
  addAttribute(attrName, value, start);
5319
5319
  errorHandler.warning("attribute \"" + attrName + "\" missed start quot(" + c + ")!!");
5320
- start = p$2 + 1;
5320
+ start = p$3 + 1;
5321
5321
  s = S_ATTR_END;
5322
5322
  } else throw new Error("attribute value must after \"=\"");
5323
5323
  break;
5324
5324
  case "/":
5325
5325
  switch (s) {
5326
- case S_TAG: el.setTagName(source.slice(start, p$2));
5326
+ case S_TAG: el.setTagName(source.slice(start, p$3));
5327
5327
  case S_ATTR_END:
5328
5328
  case S_TAG_SPACE:
5329
5329
  case S_TAG_CLOSE:
@@ -5339,17 +5339,17 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5339
5339
  break;
5340
5340
  case "":
5341
5341
  errorHandler.error("unexpected end of input");
5342
- if (s == S_TAG) el.setTagName(source.slice(start, p$2));
5343
- return p$2;
5342
+ if (s == S_TAG) el.setTagName(source.slice(start, p$3));
5343
+ return p$3;
5344
5344
  case ">":
5345
5345
  switch (s) {
5346
- case S_TAG: el.setTagName(source.slice(start, p$2));
5346
+ case S_TAG: el.setTagName(source.slice(start, p$3));
5347
5347
  case S_ATTR_END:
5348
5348
  case S_TAG_SPACE:
5349
5349
  case S_TAG_CLOSE: break;
5350
5350
  case S_ATTR_NOQUOT_VALUE:
5351
5351
  case S_ATTR:
5352
- value = source.slice(start, p$2);
5352
+ value = source.slice(start, p$3);
5353
5353
  if (value.slice(-1) === "/") {
5354
5354
  el.closed = true;
5355
5355
  value = value.slice(0, -1);
@@ -5366,19 +5366,19 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5366
5366
  break;
5367
5367
  case S_EQ: throw new Error("attribute value missed!!");
5368
5368
  }
5369
- return p$2;
5369
+ return p$3;
5370
5370
  case "€": c = " ";
5371
5371
  default: if (c <= " ") switch (s) {
5372
5372
  case S_TAG:
5373
- el.setTagName(source.slice(start, p$2));
5373
+ el.setTagName(source.slice(start, p$3));
5374
5374
  s = S_TAG_SPACE;
5375
5375
  break;
5376
5376
  case S_ATTR:
5377
- attrName = source.slice(start, p$2);
5377
+ attrName = source.slice(start, p$3);
5378
5378
  s = S_ATTR_SPACE;
5379
5379
  break;
5380
5380
  case S_ATTR_NOQUOT_VALUE:
5381
- var value = source.slice(start, p$2);
5381
+ var value = source.slice(start, p$3);
5382
5382
  errorHandler.warning("attribute \"" + value + "\" missed quot(\")!!");
5383
5383
  addAttribute(attrName, value, start);
5384
5384
  case S_ATTR_END:
@@ -5390,22 +5390,22 @@ var require_sax = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules
5390
5390
  el.tagName;
5391
5391
  if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) errorHandler.warning("attribute \"" + attrName + "\" missed value!! \"" + attrName + "\" instead2!!");
5392
5392
  addAttribute(attrName, attrName, start);
5393
- start = p$2;
5393
+ start = p$3;
5394
5394
  s = S_ATTR;
5395
5395
  break;
5396
5396
  case S_ATTR_END: errorHandler.warning("attribute space is required\"" + attrName + "\"!!");
5397
5397
  case S_TAG_SPACE:
5398
5398
  s = S_ATTR;
5399
- start = p$2;
5399
+ start = p$3;
5400
5400
  break;
5401
5401
  case S_EQ:
5402
5402
  s = S_ATTR_NOQUOT_VALUE;
5403
- start = p$2;
5403
+ start = p$3;
5404
5404
  break;
5405
5405
  case S_TAG_CLOSE: throw new Error("elements closed character '/' and '>' must be connected to");
5406
5406
  }
5407
5407
  }
5408
- p$2++;
5408
+ p$3++;
5409
5409
  }
5410
5410
  }
5411
5411
  /**
@@ -9081,7 +9081,7 @@ var IosConfigParser = class {
9081
9081
  this.plistPaths = customPaths || [];
9082
9082
  }
9083
9083
  getPlistPaths() {
9084
- return this.plistPaths.map((p$2) => path.default.isAbsolute(p$2) ? p$2 : path.default.join((0, __hot_updater_cli_tools.getCwd)(), p$2)).filter((p$2) => fs.default.existsSync(p$2));
9084
+ return this.plistPaths.map((p$3) => path.default.isAbsolute(p$3) ? p$3 : path.default.join((0, __hot_updater_cli_tools.getCwd)(), p$3)).filter((p$3) => fs.default.existsSync(p$3));
9085
9085
  }
9086
9086
  async exists() {
9087
9087
  return this.getPlistPaths().length > 0;
@@ -9181,6 +9181,58 @@ const setFingerprintHash = async (platform, hash) => {
9181
9181
  }
9182
9182
  };
9183
9183
 
9184
+ //#endregion
9185
+ //#region src/utils/expoDetection.ts
9186
+ /**
9187
+ * Checks if the project is using Expo CNG (Continuous Native Generation).
9188
+ * Returns true if expo package is installed and app.json or app.config.{js,mjs,ts,mts,cjs,cts} file exists.
9189
+ */
9190
+ function isExpoCNG() {
9191
+ try {
9192
+ require.resolve("expo/package.json");
9193
+ } catch {
9194
+ return false;
9195
+ }
9196
+ const cwd = (0, __hot_updater_cli_tools.getCwd)();
9197
+ const appJsonPath = path.default.join(cwd, "app.json");
9198
+ if (fs.default.existsSync(appJsonPath)) try {
9199
+ const appJsonContent = fs.default.readFileSync(appJsonPath, "utf-8");
9200
+ if (JSON.parse(appJsonContent).expo) return true;
9201
+ } catch {}
9202
+ return [
9203
+ "js",
9204
+ "mjs",
9205
+ "cjs",
9206
+ "ts",
9207
+ "mts",
9208
+ "cts"
9209
+ ].some((ext) => {
9210
+ const configPath = path.default.join(cwd, `app.config.${ext}`);
9211
+ return fs.default.existsSync(configPath);
9212
+ });
9213
+ }
9214
+ function isExpo() {
9215
+ try {
9216
+ require.resolve("expo/package.json");
9217
+ return true;
9218
+ } catch {
9219
+ return false;
9220
+ }
9221
+ }
9222
+ /**
9223
+ * Shows warning if the project is Expo CNG.
9224
+ * Call this once at the start of commands that use native parsers.
9225
+ */
9226
+ function warnIfExpoCNG() {
9227
+ if (!isExpoCNG()) return;
9228
+ console.log("");
9229
+ __hot_updater_cli_tools.p.log.warn("Expo CNG project detected:");
9230
+ __hot_updater_cli_tools.p.log.info("Configure in app.json or app.config.js:");
9231
+ __hot_updater_cli_tools.p.log.info(" \"plugins\": [[\"@hot-updater/react-native\", { \"channel\": \"production\" }]]");
9232
+ __hot_updater_cli_tools.p.log.info(" Instead run `npx expo prebuild`.");
9233
+ console.log("");
9234
+ }
9235
+
9184
9236
  //#endregion
9185
9237
  //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
9186
9238
  var require_array = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js": ((exports) => {
@@ -9990,11 +10042,11 @@ var require_expand = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modu
9990
10042
  const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
9991
10043
  const walk$1 = (node, parent = {}) => {
9992
10044
  node.queue = [];
9993
- let p$2 = parent;
10045
+ let p$3 = parent;
9994
10046
  let q = parent.queue;
9995
- while (p$2.type !== "brace" && p$2.type !== "root" && p$2.parent) {
9996
- p$2 = p$2.parent;
9997
- q = p$2.queue;
10047
+ while (p$3.type !== "brace" && p$3.type !== "root" && p$3.parent) {
10048
+ p$3 = p$3.parent;
10049
+ q = p$3.queue;
9998
10050
  }
9999
10051
  if (node.invalid || node.dollar) {
10000
10052
  q.push(append(q.pop(), stringify$2(node, options)));
@@ -12046,7 +12098,7 @@ var require_picomatch$1 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node
12046
12098
  * @api public
12047
12099
  */
12048
12100
  picomatch$1.parse = (pattern$1, options) => {
12049
- if (Array.isArray(pattern$1)) return pattern$1.map((p$2) => picomatch$1.parse(p$2, options));
12101
+ if (Array.isArray(pattern$1)) return pattern$1.map((p$3) => picomatch$1.parse(p$3, options));
12050
12102
  return parse(pattern$1, {
12051
12103
  ...options,
12052
12104
  fastpaths: false
@@ -12231,7 +12283,7 @@ var require_micromatch = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_
12231
12283
  let matches = (negatives === patterns.length ? [...items] : [...keep]).filter((item) => !omit.has(item));
12232
12284
  if (options && matches.length === 0) {
12233
12285
  if (options.failglob === true) throw new Error(`No matches found for "${patterns.join(", ")}"`);
12234
- if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p$2) => p$2.replace(/\\/g, "")) : patterns;
12286
+ if (options.nonull === true || options.nullglob === true) return options.unescape ? patterns.map((p$3) => p$3.replace(/\\/g, "")) : patterns;
12235
12287
  }
12236
12288
  return matches;
12237
12289
  };
@@ -12331,7 +12383,7 @@ var require_micromatch = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_
12331
12383
  */
12332
12384
  micromatch$1.contains = (str, pattern$1, options) => {
12333
12385
  if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
12334
- if (Array.isArray(pattern$1)) return pattern$1.some((p$2) => micromatch$1.contains(str, p$2, options));
12386
+ if (Array.isArray(pattern$1)) return pattern$1.some((p$3) => micromatch$1.contains(str, p$3, options));
12335
12387
  if (typeof pattern$1 === "string") {
12336
12388
  if (isEmptyString(str) || isEmptyString(pattern$1)) return false;
12337
12389
  if (str.includes(pattern$1) || str.startsWith("./") && str.slice(2).includes(pattern$1)) return true;
@@ -12452,7 +12504,7 @@ var require_micromatch = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_
12452
12504
  */
12453
12505
  micromatch$1.all = (str, patterns, options) => {
12454
12506
  if (typeof str !== "string") throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
12455
- return [].concat(patterns).every((p$2) => picomatch(p$2, options)(str));
12507
+ return [].concat(patterns).every((p$3) => picomatch(p$3, options)(str));
12456
12508
  };
12457
12509
  /**
12458
12510
  * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
@@ -12990,8 +13042,8 @@ var require_tasks = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
12990
13042
  //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
12991
13043
  var require_async$5 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js": ((exports) => {
12992
13044
  Object.defineProperty(exports, "__esModule", { value: true });
12993
- function read$3(path$16, settings, callback) {
12994
- settings.fs.lstat(path$16, (lstatError, lstat) => {
13045
+ function read$3(path$17, settings, callback) {
13046
+ settings.fs.lstat(path$17, (lstatError, lstat) => {
12995
13047
  if (lstatError !== null) {
12996
13048
  callFailureCallback$2(callback, lstatError);
12997
13049
  return;
@@ -13000,7 +13052,7 @@ var require_async$5 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
13000
13052
  callSuccessCallback$2(callback, lstat);
13001
13053
  return;
13002
13054
  }
13003
- settings.fs.stat(path$16, (statError, stat$1) => {
13055
+ settings.fs.stat(path$17, (statError, stat$1) => {
13004
13056
  if (statError !== null) {
13005
13057
  if (settings.throwErrorOnBrokenSymbolicLink) {
13006
13058
  callFailureCallback$2(callback, statError);
@@ -13027,11 +13079,11 @@ var require_async$5 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
13027
13079
  //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
13028
13080
  var require_sync$5 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js": ((exports) => {
13029
13081
  Object.defineProperty(exports, "__esModule", { value: true });
13030
- function read$2(path$16, settings) {
13031
- const lstat = settings.fs.lstatSync(path$16);
13082
+ function read$2(path$17, settings) {
13083
+ const lstat = settings.fs.lstatSync(path$17);
13032
13084
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
13033
13085
  try {
13034
- const stat$1 = settings.fs.statSync(path$16);
13086
+ const stat$1 = settings.fs.statSync(path$17);
13035
13087
  if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
13036
13088
  return stat$1;
13037
13089
  } catch (error) {
@@ -13089,17 +13141,17 @@ var require_out$3 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
13089
13141
  const sync$1 = require_sync$5();
13090
13142
  const settings_1$3 = require_settings$3();
13091
13143
  exports.Settings = settings_1$3.default;
13092
- function stat(path$16, optionsOrSettingsOrCallback, callback) {
13144
+ function stat(path$17, optionsOrSettingsOrCallback, callback) {
13093
13145
  if (typeof optionsOrSettingsOrCallback === "function") {
13094
- async$1.read(path$16, getSettings$2(), optionsOrSettingsOrCallback);
13146
+ async$1.read(path$17, getSettings$2(), optionsOrSettingsOrCallback);
13095
13147
  return;
13096
13148
  }
13097
- async$1.read(path$16, getSettings$2(optionsOrSettingsOrCallback), callback);
13149
+ async$1.read(path$17, getSettings$2(optionsOrSettingsOrCallback), callback);
13098
13150
  }
13099
13151
  exports.stat = stat;
13100
- function statSync(path$16, optionsOrSettings) {
13152
+ function statSync(path$17, optionsOrSettings) {
13101
13153
  const settings = getSettings$2(optionsOrSettings);
13102
- return sync$1.read(path$16, settings);
13154
+ return sync$1.read(path$17, settings);
13103
13155
  }
13104
13156
  exports.statSync = statSync;
13105
13157
  function getSettings$2(settingsOrOptions = {}) {
@@ -13293,16 +13345,16 @@ var require_async$4 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
13293
13345
  return;
13294
13346
  }
13295
13347
  rpl(names.map((name) => {
13296
- const path$16 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
13348
+ const path$17 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
13297
13349
  return (done) => {
13298
- fsStat$5.stat(path$16, settings.fsStatSettings, (error, stats) => {
13350
+ fsStat$5.stat(path$17, settings.fsStatSettings, (error, stats) => {
13299
13351
  if (error !== null) {
13300
13352
  done(error);
13301
13353
  return;
13302
13354
  }
13303
13355
  const entry = {
13304
13356
  name,
13305
- path: path$16,
13357
+ path: path$17,
13306
13358
  dirent: utils$8.fs.createDirentFromStats(name, stats)
13307
13359
  };
13308
13360
  if (settings.stats) entry.stats = stats;
@@ -13430,17 +13482,17 @@ var require_out$2 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
13430
13482
  const sync = require_sync$4();
13431
13483
  const settings_1$2 = require_settings$2();
13432
13484
  exports.Settings = settings_1$2.default;
13433
- function scandir(path$16, optionsOrSettingsOrCallback, callback) {
13485
+ function scandir(path$17, optionsOrSettingsOrCallback, callback) {
13434
13486
  if (typeof optionsOrSettingsOrCallback === "function") {
13435
- async.read(path$16, getSettings$1(), optionsOrSettingsOrCallback);
13487
+ async.read(path$17, getSettings$1(), optionsOrSettingsOrCallback);
13436
13488
  return;
13437
13489
  }
13438
- async.read(path$16, getSettings$1(optionsOrSettingsOrCallback), callback);
13490
+ async.read(path$17, getSettings$1(optionsOrSettingsOrCallback), callback);
13439
13491
  }
13440
13492
  exports.scandir = scandir;
13441
- function scandirSync(path$16, optionsOrSettings) {
13493
+ function scandirSync(path$17, optionsOrSettings) {
13442
13494
  const settings = getSettings$1(optionsOrSettings);
13443
- return sync.read(path$16, settings);
13495
+ return sync.read(path$17, settings);
13444
13496
  }
13445
13497
  exports.scandirSync = scandirSync;
13446
13498
  function getSettings$1(settingsOrOptions = {}) {
@@ -13669,7 +13721,7 @@ var require_queue = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
13669
13721
  queue.drained = drained;
13670
13722
  return queue;
13671
13723
  function push(value) {
13672
- var p$2 = new Promise(function(resolve, reject) {
13724
+ var p$3 = new Promise(function(resolve, reject) {
13673
13725
  pushCb(value, function(err, result) {
13674
13726
  if (err) {
13675
13727
  reject(err);
@@ -13678,11 +13730,11 @@ var require_queue = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
13678
13730
  resolve(result);
13679
13731
  });
13680
13732
  });
13681
- p$2.catch(noop);
13682
- return p$2;
13733
+ p$3.catch(noop);
13734
+ return p$3;
13683
13735
  }
13684
13736
  function unshift(value) {
13685
- var p$2 = new Promise(function(resolve, reject) {
13737
+ var p$3 = new Promise(function(resolve, reject) {
13686
13738
  unshiftCb(value, function(err, result) {
13687
13739
  if (err) {
13688
13740
  reject(err);
@@ -13691,8 +13743,8 @@ var require_queue = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
13691
13743
  resolve(result);
13692
13744
  });
13693
13745
  });
13694
- p$2.catch(noop);
13695
- return p$2;
13746
+ p$3.catch(noop);
13747
+ return p$3;
13696
13748
  }
13697
13749
  function drained() {
13698
13750
  if (queue.idle()) return new Promise(function(resolve) {
@@ -14796,12 +14848,13 @@ function getDefaultIgnorePaths() {
14796
14848
  return [
14797
14849
  "**/*",
14798
14850
  "**/.build/**/*",
14799
- "**/build/"
14851
+ "**/build/",
14852
+ "**/build*/**/*"
14800
14853
  ];
14801
14854
  }
14802
- function getOtaFingerprintOptions(platform, path$16, options) {
14855
+ function getOtaFingerprintOptions(platform, path$17, options) {
14803
14856
  return {
14804
- useRNCoreAutolinkingFromExpo: false,
14857
+ useRNCoreAutolinkingFromExpo: isExpo(),
14805
14858
  platforms: [platform],
14806
14859
  ignorePaths: [
14807
14860
  ...getDefaultIgnorePaths(),
@@ -14840,7 +14893,7 @@ function getOtaFingerprintOptions(platform, path$16, options) {
14840
14893
  ...options.ignorePaths ?? []
14841
14894
  ],
14842
14895
  sourceSkips: __expo_fingerprint.SourceSkips.GitIgnore | __expo_fingerprint.SourceSkips.PackageJsonScriptsAll | __expo_fingerprint.SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | __expo_fingerprint.SourceSkips.ExpoConfigAll | __expo_fingerprint.SourceSkips.ExpoConfigVersions | __expo_fingerprint.SourceSkips.ExpoConfigNames | __expo_fingerprint.SourceSkips.ExpoConfigRuntimeVersionIfString | __expo_fingerprint.SourceSkips.ExpoConfigAssets | __expo_fingerprint.SourceSkips.ExpoConfigExtraSection | __expo_fingerprint.SourceSkips.ExpoConfigEASProject | __expo_fingerprint.SourceSkips.ExpoConfigSchemes,
14843
- extraSources: processExtraSources(options.extraSources ?? [], path$16),
14896
+ extraSources: processExtraSources(options.extraSources ?? [], path$17),
14844
14897
  debug: options.debug
14845
14898
  };
14846
14899
  }
@@ -14880,9 +14933,9 @@ function showFingerprintDiff(diff, platform) {
14880
14933
  /**
14881
14934
  * Calculates the fingerprint of the native parts project of the project.
14882
14935
  */
14883
- async function nativeFingerprint(path$16, options) {
14936
+ async function nativeFingerprint(path$17, options) {
14884
14937
  const platform = options.platform;
14885
- return (0, __expo_fingerprint.createFingerprintAsync)(path$16, getOtaFingerprintOptions(platform, path$16, options));
14938
+ return (0, __expo_fingerprint.createFingerprintAsync)(path$17, getOtaFingerprintOptions(platform, path$17, options));
14886
14939
  }
14887
14940
  const generateFingerprints = async () => {
14888
14941
  const fingerprintConfig = await ensureFingerprintConfig();
@@ -15130,4 +15183,10 @@ Object.defineProperty(exports, 'showFingerprintDiff', {
15130
15183
  get: function () {
15131
15184
  return showFingerprintDiff;
15132
15185
  }
15186
+ });
15187
+ Object.defineProperty(exports, 'warnIfExpoCNG', {
15188
+ enumerable: true,
15189
+ get: function () {
15190
+ return warnIfExpoCNG;
15191
+ }
15133
15192
  });
@@ -9201,6 +9201,58 @@ const setFingerprintHash = async (platform, hash) => {
9201
9201
  }
9202
9202
  };
9203
9203
 
9204
+ //#endregion
9205
+ //#region src/utils/expoDetection.ts
9206
+ /**
9207
+ * Checks if the project is using Expo CNG (Continuous Native Generation).
9208
+ * Returns true if expo package is installed and app.json or app.config.{js,mjs,ts,mts,cjs,cts} file exists.
9209
+ */
9210
+ function isExpoCNG() {
9211
+ try {
9212
+ __require.resolve("expo/package.json");
9213
+ } catch {
9214
+ return false;
9215
+ }
9216
+ const cwd = getCwd();
9217
+ const appJsonPath = path$1.join(cwd, "app.json");
9218
+ if (fs.existsSync(appJsonPath)) try {
9219
+ const appJsonContent = fs.readFileSync(appJsonPath, "utf-8");
9220
+ if (JSON.parse(appJsonContent).expo) return true;
9221
+ } catch {}
9222
+ return [
9223
+ "js",
9224
+ "mjs",
9225
+ "cjs",
9226
+ "ts",
9227
+ "mts",
9228
+ "cts"
9229
+ ].some((ext) => {
9230
+ const configPath = path$1.join(cwd, `app.config.${ext}`);
9231
+ return fs.existsSync(configPath);
9232
+ });
9233
+ }
9234
+ function isExpo() {
9235
+ try {
9236
+ __require.resolve("expo/package.json");
9237
+ return true;
9238
+ } catch {
9239
+ return false;
9240
+ }
9241
+ }
9242
+ /**
9243
+ * Shows warning if the project is Expo CNG.
9244
+ * Call this once at the start of commands that use native parsers.
9245
+ */
9246
+ function warnIfExpoCNG() {
9247
+ if (!isExpoCNG()) return;
9248
+ console.log("");
9249
+ p.log.warn("Expo CNG project detected:");
9250
+ p.log.info("Configure in app.json or app.config.js:");
9251
+ p.log.info(" \"plugins\": [[\"@hot-updater/react-native\", { \"channel\": \"production\" }]]");
9252
+ p.log.info(" Instead run `npx expo prebuild`.");
9253
+ console.log("");
9254
+ }
9255
+
9204
9256
  //#endregion
9205
9257
  //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js
9206
9258
  var require_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js": ((exports) => {
@@ -14816,12 +14868,13 @@ function getDefaultIgnorePaths() {
14816
14868
  return [
14817
14869
  "**/*",
14818
14870
  "**/.build/**/*",
14819
- "**/build/"
14871
+ "**/build/",
14872
+ "**/build*/**/*"
14820
14873
  ];
14821
14874
  }
14822
14875
  function getOtaFingerprintOptions(platform, path$12, options) {
14823
14876
  return {
14824
- useRNCoreAutolinkingFromExpo: false,
14877
+ useRNCoreAutolinkingFromExpo: isExpo(),
14825
14878
  platforms: [platform],
14826
14879
  ignorePaths: [
14827
14880
  ...getDefaultIgnorePaths(),
@@ -15043,4 +15096,4 @@ function getPublicKeyFromPrivate(privateKeyPEM) {
15043
15096
  }
15044
15097
 
15045
15098
  //#endregion
15046
- export { require_base64_js as _, createAndInjectFingerprintFiles as a, __require as b, generateFingerprints as c, getFingerprintDiff as d, showFingerprintDiff as f, require_plist as g, IosConfigParser as h, saveKeyPair as i, nativeFingerprint as l, require_out as m, getPublicKeyFromPrivate as n, createFingerprintJSON as o, isFingerprintEquals as p, loadPrivateKey as r, generateFingerprint as s, generateKeyPair as t, readLocalFingerprint as u, AndroidConfigParser as v, __toESM as x, __commonJS as y };
15099
+ export { __toESM as S, require_plist as _, createAndInjectFingerprintFiles as a, __commonJS as b, generateFingerprints as c, getFingerprintDiff as d, showFingerprintDiff as f, IosConfigParser as g, warnIfExpoCNG as h, saveKeyPair as i, nativeFingerprint as l, require_out as m, getPublicKeyFromPrivate as n, createFingerprintJSON as o, isFingerprintEquals as p, loadPrivateKey as r, generateFingerprint as s, generateKeyPair as t, readLocalFingerprint as u, require_base64_js as v, __require as x, AndroidConfigParser as y };