hot-updater 0.22.2 → 0.23.1

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.
@@ -1,8 +1,11 @@
1
1
  import { createRequire } from "node:module";
2
+ import path from "node:path";
2
3
  import { colors, getCwd, loadConfig, p } from "@hot-updater/cli-tools";
3
- import path from "path";
4
+ import path$1 from "path";
4
5
  import fs from "fs";
5
6
  import { SourceSkips, createFingerprintAsync, diffFingerprintChangesAsync } from "@expo/fingerprint";
7
+ import fs$1 from "node:fs/promises";
8
+ import crypto from "node:crypto";
6
9
 
7
10
  //#region rolldown:runtime
8
11
  var __create = Object.create;
@@ -1478,7 +1481,7 @@ var AndroidConfigParser = class {
1478
1481
  parser;
1479
1482
  builder;
1480
1483
  constructor(customPaths) {
1481
- this.stringsXmlPaths = (customPaths || []).map((p$1) => path.isAbsolute(p$1) ? p$1 : path.join(getCwd(), p$1));
1484
+ this.stringsXmlPaths = (customPaths || []).map((p$1) => path$1.isAbsolute(p$1) ? p$1 : path$1.join(getCwd(), p$1));
1482
1485
  const options = {
1483
1486
  ignoreAttributes: false,
1484
1487
  attributeNamePrefix: "@_",
@@ -1497,10 +1500,10 @@ var AndroidConfigParser = class {
1497
1500
  });
1498
1501
  }
1499
1502
  async exists() {
1500
- return this.stringsXmlPaths.some((path$11) => fs.existsSync(path$11));
1503
+ return this.stringsXmlPaths.some((path$12) => fs.existsSync(path$12));
1501
1504
  }
1502
1505
  getExistingPaths() {
1503
- return this.stringsXmlPaths.filter((path$11) => fs.existsSync(path$11));
1506
+ return this.stringsXmlPaths.filter((path$12) => fs.existsSync(path$12));
1504
1507
  }
1505
1508
  async get(key) {
1506
1509
  const existingPaths = this.getExistingPaths();
@@ -1510,7 +1513,7 @@ var AndroidConfigParser = class {
1510
1513
  paths: []
1511
1514
  };
1512
1515
  for (const stringsXmlPath of existingPaths) {
1513
- const relativePath = path.relative(getCwd(), stringsXmlPath);
1516
+ const relativePath = path$1.relative(getCwd(), stringsXmlPath);
1514
1517
  searchedPaths.push(relativePath);
1515
1518
  try {
1516
1519
  const content = await fs.promises.readFile(stringsXmlPath, "utf-8");
@@ -1530,6 +1533,28 @@ var AndroidConfigParser = class {
1530
1533
  paths: searchedPaths
1531
1534
  };
1532
1535
  }
1536
+ async remove(key) {
1537
+ const existingPaths = this.getExistingPaths();
1538
+ if (existingPaths.length === 0) return { paths: [] };
1539
+ const updatedPaths = [];
1540
+ for (const stringsXmlPath of existingPaths) try {
1541
+ const content = await fs.promises.readFile(stringsXmlPath, "utf-8");
1542
+ const result = this.parser.parse(content);
1543
+ if (!result.resources.string) continue;
1544
+ const strings = Array.isArray(result.resources.string) ? result.resources.string : [result.resources.string];
1545
+ const existingIndex = strings.findIndex((str) => str["@_name"] === key && str["@_moduleConfig"] === "true");
1546
+ if (existingIndex === -1) continue;
1547
+ strings.splice(existingIndex, 1);
1548
+ if (strings.length === 0) result.resources.string = void 0;
1549
+ else result.resources.string = strings.length === 1 ? strings[0] : strings;
1550
+ const newContent = this.builder.build(result);
1551
+ await fs.promises.writeFile(stringsXmlPath, newContent, "utf-8");
1552
+ updatedPaths.push(path$1.relative(getCwd(), stringsXmlPath));
1553
+ } catch (error) {
1554
+ throw new Error(`Failed to remove key from strings.xml: ${error}`);
1555
+ }
1556
+ return { paths: updatedPaths };
1557
+ }
1533
1558
  async set(key, value) {
1534
1559
  const existingPaths = this.getExistingPaths();
1535
1560
  if (existingPaths.length === 0) {
@@ -1553,7 +1578,7 @@ var AndroidConfigParser = class {
1553
1578
  result.resources.string = strings.length === 1 ? strings[0] : strings;
1554
1579
  const newContent = this.builder.build(result);
1555
1580
  await fs.promises.writeFile(stringsXmlPath, newContent, "utf-8");
1556
- updatedPaths.push(path.relative(getCwd(), stringsXmlPath));
1581
+ updatedPaths.push(path$1.relative(getCwd(), stringsXmlPath));
1557
1582
  } catch (error) {
1558
1583
  throw new Error(`Failed to parse or update strings.xml: ${error}`);
1559
1584
  }
@@ -9076,7 +9101,7 @@ var IosConfigParser = class {
9076
9101
  this.plistPaths = customPaths || [];
9077
9102
  }
9078
9103
  getPlistPaths() {
9079
- return this.plistPaths.map((p$1) => path.isAbsolute(p$1) ? p$1 : path.join(getCwd(), p$1)).filter((p$1) => fs.existsSync(p$1));
9104
+ return this.plistPaths.map((p$1) => path$1.isAbsolute(p$1) ? p$1 : path$1.join(getCwd(), p$1)).filter((p$1) => fs.existsSync(p$1));
9080
9105
  }
9081
9106
  async exists() {
9082
9107
  return this.getPlistPaths().length > 0;
@@ -9089,7 +9114,7 @@ var IosConfigParser = class {
9089
9114
  paths: []
9090
9115
  };
9091
9116
  for (const plistFile of plistPaths) {
9092
- const relativePath = path.relative(getCwd(), plistFile);
9117
+ const relativePath = path$1.relative(getCwd(), plistFile);
9093
9118
  searchedPaths.push(relativePath);
9094
9119
  const plistXml = await fs.promises.readFile(plistFile, "utf-8");
9095
9120
  const plistObject = import_plist.default.parse(plistXml);
@@ -9107,6 +9132,29 @@ var IosConfigParser = class {
9107
9132
  paths: searchedPaths
9108
9133
  };
9109
9134
  }
9135
+ async remove(key) {
9136
+ const plistPaths = this.getPlistPaths();
9137
+ if (plistPaths.length === 0) return { paths: [] };
9138
+ const updatedPaths = [];
9139
+ for (const plistFile of plistPaths) {
9140
+ const relativePath = path$1.relative(getCwd(), plistFile);
9141
+ try {
9142
+ const plistXml = await fs.promises.readFile(plistFile, "utf-8");
9143
+ const plistObject = import_plist.default.parse(plistXml);
9144
+ if (!(key in plistObject)) continue;
9145
+ delete plistObject[key];
9146
+ const newPlistXml = import_plist.default.build(plistObject, {
9147
+ indent: " ",
9148
+ pretty: true
9149
+ });
9150
+ await fs.promises.writeFile(plistFile, newPlistXml);
9151
+ updatedPaths.push(relativePath);
9152
+ } catch (error) {
9153
+ throw new Error(`Failed to remove key from Info.plist at '${relativePath}': ${error instanceof Error ? error.message : String(error)}`);
9154
+ }
9155
+ }
9156
+ return { paths: updatedPaths };
9157
+ }
9110
9158
  async set(key, value) {
9111
9159
  const plistPaths = this.getPlistPaths();
9112
9160
  if (plistPaths.length === 0) {
@@ -9115,7 +9163,7 @@ var IosConfigParser = class {
9115
9163
  }
9116
9164
  const updatedPaths = [];
9117
9165
  for (const plistFile of plistPaths) {
9118
- const relativePath = path.relative(getCwd(), plistFile);
9166
+ const relativePath = path$1.relative(getCwd(), plistFile);
9119
9167
  try {
9120
9168
  const plistXml = await fs.promises.readFile(plistFile, "utf-8");
9121
9169
  if (!plistXml.trim().startsWith("<?xml")) throw new Error("File does not appear to be valid XML: missing XML declaration");
@@ -9210,7 +9258,7 @@ var require_fs$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-g
9210
9258
  var require_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.js": ((exports) => {
9211
9259
  Object.defineProperty(exports, "__esModule", { value: true });
9212
9260
  const os$1 = __require("os");
9213
- const path$10 = __require("path");
9261
+ const path$11 = __require("path");
9214
9262
  const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
9215
9263
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
9216
9264
  /**
@@ -9239,7 +9287,7 @@ var require_path = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-g
9239
9287
  }
9240
9288
  exports.unixify = unixify;
9241
9289
  function makeAbsolute(cwd, filepath) {
9242
- return path$10.resolve(cwd, filepath);
9290
+ return path$11.resolve(cwd, filepath);
9243
9291
  }
9244
9292
  exports.makeAbsolute = makeAbsolute;
9245
9293
  function removeLeadingDotSegment(entry) {
@@ -10486,7 +10534,7 @@ var require_braces = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/brac
10486
10534
  //#endregion
10487
10535
  //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
10488
10536
  var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js": ((exports, module) => {
10489
- const path$9 = __require("path");
10537
+ const path$10 = __require("path");
10490
10538
  const WIN_SLASH = "\\\\/";
10491
10539
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
10492
10540
  /**
@@ -10611,7 +10659,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
10611
10659
  CHAR_UNDERSCORE: 95,
10612
10660
  CHAR_VERTICAL_LINE: 124,
10613
10661
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
10614
- SEP: path$9.sep,
10662
+ SEP: path$10.sep,
10615
10663
  extglobChars(chars$1) {
10616
10664
  return {
10617
10665
  "!": {
@@ -10650,7 +10698,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
10650
10698
  //#endregion
10651
10699
  //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js
10652
10700
  var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/utils.js": ((exports) => {
10653
- const path$8 = __require("path");
10701
+ const path$9 = __require("path");
10654
10702
  const win32 = process.platform === "win32";
10655
10703
  const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
10656
10704
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
@@ -10670,7 +10718,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/pic
10670
10718
  };
10671
10719
  exports.isWindows = (options) => {
10672
10720
  if (options && typeof options.windows === "boolean") return options.windows;
10673
- return win32 === true || path$8.sep === "\\";
10721
+ return win32 === true || path$9.sep === "\\";
10674
10722
  };
10675
10723
  exports.escapeLast = (input, char, lastIdx) => {
10676
10724
  const idx = input.lastIndexOf(char, lastIdx);
@@ -10984,12 +11032,12 @@ var require_scan = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picoma
10984
11032
  //#endregion
10985
11033
  //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js
10986
11034
  var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/parse.js": ((exports, module) => {
10987
- const constants$1 = require_constants$1();
11035
+ const constants$2 = require_constants$1();
10988
11036
  const utils$12 = require_utils$2();
10989
11037
  /**
10990
11038
  * Constants
10991
11039
  */
10992
- const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$1;
11040
+ const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants$2;
10993
11041
  /**
10994
11042
  * Helpers
10995
11043
  */
@@ -11031,8 +11079,8 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
11031
11079
  const tokens = [bos];
11032
11080
  const capture = opts.capture ? "" : "?:";
11033
11081
  const win32$1 = utils$12.isWindows(options);
11034
- const PLATFORM_CHARS = constants$1.globChars(win32$1);
11035
- const EXTGLOB_CHARS = constants$1.extglobChars(PLATFORM_CHARS);
11082
+ const PLATFORM_CHARS = constants$2.globChars(win32$1);
11083
+ const EXTGLOB_CHARS = constants$2.extglobChars(PLATFORM_CHARS);
11036
11084
  const { DOT_LITERAL: DOT_LITERAL$1, PLUS_LITERAL: PLUS_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK: QMARK$1, QMARK_NO_DOT, STAR, START_ANCHOR: START_ANCHOR$1 } = PLATFORM_CHARS;
11037
11085
  const globstar = (opts$1) => {
11038
11086
  return `(${capture}(?:(?!${START_ANCHOR$1}${opts$1.dot ? DOTS_SLASH$1 : DOT_LITERAL$1}).)*?)`;
@@ -11803,7 +11851,7 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
11803
11851
  if (len$1 > max) throw new SyntaxError(`Input length: ${len$1}, exceeds maximum allowed length: ${max}`);
11804
11852
  input = REPLACEMENTS[input] || input;
11805
11853
  const win32$1 = utils$12.isWindows(options);
11806
- const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR: START_ANCHOR$1 } = constants$1.globChars(win32$1);
11854
+ const { DOT_LITERAL: DOT_LITERAL$1, SLASH_LITERAL: SLASH_LITERAL$1, ONE_CHAR: ONE_CHAR$1, DOTS_SLASH: DOTS_SLASH$1, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR: START_ANCHOR$1 } = constants$2.globChars(win32$1);
11807
11855
  const nodot = opts.dot ? NO_DOTS : NO_DOT;
11808
11856
  const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
11809
11857
  const capture = opts.capture ? "" : "?:";
@@ -11846,11 +11894,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picom
11846
11894
  //#endregion
11847
11895
  //#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js
11848
11896
  var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js": ((exports, module) => {
11849
- const path$7 = __require("path");
11897
+ const path$8 = __require("path");
11850
11898
  const scan = require_scan();
11851
11899
  const parse = require_parse();
11852
11900
  const utils$11 = require_utils$2();
11853
- const constants = require_constants$1();
11901
+ const constants$1 = require_constants$1();
11854
11902
  const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
11855
11903
  /**
11856
11904
  * Creates a matcher function from one or more glob patterns. The
@@ -11985,7 +12033,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
11985
12033
  * @api public
11986
12034
  */
11987
12035
  picomatch$1.matchBase = (input, glob, options, posix = utils$11.isWindows(options)) => {
11988
- return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$7.basename(input));
12036
+ return (glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options)).test(path$8.basename(input));
11989
12037
  };
11990
12038
  /**
11991
12039
  * Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -12130,7 +12178,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
12130
12178
  * Picomatch constants.
12131
12179
  * @return {Object}
12132
12180
  */
12133
- picomatch$1.constants = constants;
12181
+ picomatch$1.constants = constants$1;
12134
12182
  /**
12135
12183
  * Expose "picomatch"
12136
12184
  */
@@ -12542,7 +12590,7 @@ var require_micromatch = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
12542
12590
  //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js
12543
12591
  var require_pattern = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/pattern.js": ((exports) => {
12544
12592
  Object.defineProperty(exports, "__esModule", { value: true });
12545
- const path$6 = __require("path");
12593
+ const path$7 = __require("path");
12546
12594
  const globParent = require_glob_parent();
12547
12595
  const micromatch = require_micromatch();
12548
12596
  const GLOBSTAR = "**";
@@ -12650,7 +12698,7 @@ var require_pattern = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fas
12650
12698
  }
12651
12699
  exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
12652
12700
  function isAffectDepthOfReadingPattern(pattern$1) {
12653
- const basename = path$6.basename(pattern$1);
12701
+ const basename = path$7.basename(pattern$1);
12654
12702
  return endsWithSlashGlobStar(pattern$1) || isStaticPattern(basename);
12655
12703
  }
12656
12704
  exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -12724,7 +12772,7 @@ var require_pattern = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fas
12724
12772
  }
12725
12773
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
12726
12774
  function isAbsolute(pattern$1) {
12727
- return path$6.isAbsolute(pattern$1);
12775
+ return path$7.isAbsolute(pattern$1);
12728
12776
  }
12729
12777
  exports.isAbsolute = isAbsolute;
12730
12778
  }) });
@@ -12852,10 +12900,10 @@ var require_utils$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fas
12852
12900
  exports.array = array;
12853
12901
  const errno = require_errno();
12854
12902
  exports.errno = errno;
12855
- const fs$7 = require_fs$3();
12856
- exports.fs = fs$7;
12857
- const path$5 = require_path();
12858
- exports.path = path$5;
12903
+ const fs$8 = require_fs$3();
12904
+ exports.fs = fs$8;
12905
+ const path$6 = require_path();
12906
+ exports.path = path$6;
12859
12907
  const pattern = require_pattern();
12860
12908
  exports.pattern = pattern;
12861
12909
  const stream = require_stream$3();
@@ -12962,8 +13010,8 @@ var require_tasks = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-
12962
13010
  //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js
12963
13011
  var require_async$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.js": ((exports) => {
12964
13012
  Object.defineProperty(exports, "__esModule", { value: true });
12965
- function read$3(path$11, settings, callback) {
12966
- settings.fs.lstat(path$11, (lstatError, lstat) => {
13013
+ function read$3(path$12, settings, callback) {
13014
+ settings.fs.lstat(path$12, (lstatError, lstat) => {
12967
13015
  if (lstatError !== null) {
12968
13016
  callFailureCallback$2(callback, lstatError);
12969
13017
  return;
@@ -12972,7 +13020,7 @@ var require_async$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@no
12972
13020
  callSuccessCallback$2(callback, lstat);
12973
13021
  return;
12974
13022
  }
12975
- settings.fs.stat(path$11, (statError, stat$1) => {
13023
+ settings.fs.stat(path$12, (statError, stat$1) => {
12976
13024
  if (statError !== null) {
12977
13025
  if (settings.throwErrorOnBrokenSymbolicLink) {
12978
13026
  callFailureCallback$2(callback, statError);
@@ -12999,11 +13047,11 @@ var require_async$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@no
12999
13047
  //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js
13000
13048
  var require_sync$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.js": ((exports) => {
13001
13049
  Object.defineProperty(exports, "__esModule", { value: true });
13002
- function read$2(path$11, settings) {
13003
- const lstat = settings.fs.lstatSync(path$11);
13050
+ function read$2(path$12, settings) {
13051
+ const lstat = settings.fs.lstatSync(path$12);
13004
13052
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
13005
13053
  try {
13006
- const stat$1 = settings.fs.statSync(path$11);
13054
+ const stat$1 = settings.fs.statSync(path$12);
13007
13055
  if (settings.markSymbolicLink) stat$1.isSymbolicLink = () => true;
13008
13056
  return stat$1;
13009
13057
  } catch (error) {
@@ -13019,12 +13067,12 @@ var require_sync$5 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nod
13019
13067
  var require_fs$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/adapters/fs.js": ((exports) => {
13020
13068
  Object.defineProperty(exports, "__esModule", { value: true });
13021
13069
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
13022
- const fs$6 = __require("fs");
13070
+ const fs$7 = __require("fs");
13023
13071
  exports.FILE_SYSTEM_ADAPTER = {
13024
- lstat: fs$6.lstat,
13025
- stat: fs$6.stat,
13026
- lstatSync: fs$6.lstatSync,
13027
- statSync: fs$6.statSync
13072
+ lstat: fs$7.lstat,
13073
+ stat: fs$7.stat,
13074
+ lstatSync: fs$7.lstatSync,
13075
+ statSync: fs$7.statSync
13028
13076
  };
13029
13077
  function createFileSystemAdapter$1(fsMethods) {
13030
13078
  if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
@@ -13037,12 +13085,12 @@ var require_fs$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodel
13037
13085
  //#region ../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js
13038
13086
  var require_settings$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js": ((exports) => {
13039
13087
  Object.defineProperty(exports, "__esModule", { value: true });
13040
- const fs$5 = require_fs$2();
13088
+ const fs$6 = require_fs$2();
13041
13089
  var Settings$3 = class {
13042
13090
  constructor(_options = {}) {
13043
13091
  this._options = _options;
13044
13092
  this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
13045
- this.fs = fs$5.createFileSystemAdapter(this._options.fs);
13093
+ this.fs = fs$6.createFileSystemAdapter(this._options.fs);
13046
13094
  this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
13047
13095
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
13048
13096
  }
@@ -13061,17 +13109,17 @@ var require_out$3 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@node
13061
13109
  const sync$1 = require_sync$5();
13062
13110
  const settings_1$3 = require_settings$3();
13063
13111
  exports.Settings = settings_1$3.default;
13064
- function stat(path$11, optionsOrSettingsOrCallback, callback) {
13112
+ function stat(path$12, optionsOrSettingsOrCallback, callback) {
13065
13113
  if (typeof optionsOrSettingsOrCallback === "function") {
13066
- async$1.read(path$11, getSettings$2(), optionsOrSettingsOrCallback);
13114
+ async$1.read(path$12, getSettings$2(), optionsOrSettingsOrCallback);
13067
13115
  return;
13068
13116
  }
13069
- async$1.read(path$11, getSettings$2(optionsOrSettingsOrCallback), callback);
13117
+ async$1.read(path$12, getSettings$2(optionsOrSettingsOrCallback), callback);
13070
13118
  }
13071
13119
  exports.stat = stat;
13072
- function statSync(path$11, optionsOrSettings) {
13120
+ function statSync(path$12, optionsOrSettings) {
13073
13121
  const settings = getSettings$2(optionsOrSettings);
13074
- return sync$1.read(path$11, settings);
13122
+ return sync$1.read(path$12, settings);
13075
13123
  }
13076
13124
  exports.statSync = statSync;
13077
13125
  function getSettings$2(settingsOrOptions = {}) {
@@ -13178,8 +13226,8 @@ var require_fs$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodel
13178
13226
  //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js
13179
13227
  var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/utils/index.js": ((exports) => {
13180
13228
  Object.defineProperty(exports, "__esModule", { value: true });
13181
- const fs$4 = require_fs$1();
13182
- exports.fs = fs$4;
13229
+ const fs$5 = require_fs$1();
13230
+ exports.fs = fs$5;
13183
13231
  }) });
13184
13232
 
13185
13233
  //#endregion
@@ -13265,16 +13313,16 @@ var require_async$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@no
13265
13313
  return;
13266
13314
  }
13267
13315
  rpl(names.map((name) => {
13268
- const path$11 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
13316
+ const path$12 = common$4.joinPathSegments(directory, name, settings.pathSegmentSeparator);
13269
13317
  return (done) => {
13270
- fsStat$5.stat(path$11, settings.fsStatSettings, (error, stats) => {
13318
+ fsStat$5.stat(path$12, settings.fsStatSettings, (error, stats) => {
13271
13319
  if (error !== null) {
13272
13320
  done(error);
13273
13321
  return;
13274
13322
  }
13275
13323
  const entry = {
13276
13324
  name,
13277
- path: path$11,
13325
+ path: path$12,
13278
13326
  dirent: utils$8.fs.createDirentFromStats(name, stats)
13279
13327
  };
13280
13328
  if (settings.stats) entry.stats = stats;
@@ -13350,14 +13398,14 @@ var require_sync$4 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nod
13350
13398
  var require_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/adapters/fs.js": ((exports) => {
13351
13399
  Object.defineProperty(exports, "__esModule", { value: true });
13352
13400
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
13353
- const fs$3 = __require("fs");
13401
+ const fs$4 = __require("fs");
13354
13402
  exports.FILE_SYSTEM_ADAPTER = {
13355
- lstat: fs$3.lstat,
13356
- stat: fs$3.stat,
13357
- lstatSync: fs$3.lstatSync,
13358
- statSync: fs$3.statSync,
13359
- readdir: fs$3.readdir,
13360
- readdirSync: fs$3.readdirSync
13403
+ lstat: fs$4.lstat,
13404
+ stat: fs$4.stat,
13405
+ lstatSync: fs$4.lstatSync,
13406
+ statSync: fs$4.statSync,
13407
+ readdir: fs$4.readdir,
13408
+ readdirSync: fs$4.readdirSync
13361
13409
  };
13362
13410
  function createFileSystemAdapter(fsMethods) {
13363
13411
  if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
@@ -13370,15 +13418,15 @@ var require_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib
13370
13418
  //#region ../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js
13371
13419
  var require_settings$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js": ((exports) => {
13372
13420
  Object.defineProperty(exports, "__esModule", { value: true });
13373
- const path$4 = __require("path");
13421
+ const path$5 = __require("path");
13374
13422
  const fsStat$3 = require_out$3();
13375
- const fs$2 = require_fs();
13423
+ const fs$3 = require_fs();
13376
13424
  var Settings$2 = class {
13377
13425
  constructor(_options = {}) {
13378
13426
  this._options = _options;
13379
13427
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
13380
- this.fs = fs$2.createFileSystemAdapter(this._options.fs);
13381
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
13428
+ this.fs = fs$3.createFileSystemAdapter(this._options.fs);
13429
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$5.sep);
13382
13430
  this.stats = this._getValue(this._options.stats, false);
13383
13431
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
13384
13432
  this.fsStatSettings = new fsStat$3.Settings({
@@ -13402,17 +13450,17 @@ var require_out$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@node
13402
13450
  const sync = require_sync$4();
13403
13451
  const settings_1$2 = require_settings$2();
13404
13452
  exports.Settings = settings_1$2.default;
13405
- function scandir(path$11, optionsOrSettingsOrCallback, callback) {
13453
+ function scandir(path$12, optionsOrSettingsOrCallback, callback) {
13406
13454
  if (typeof optionsOrSettingsOrCallback === "function") {
13407
- async.read(path$11, getSettings$1(), optionsOrSettingsOrCallback);
13455
+ async.read(path$12, getSettings$1(), optionsOrSettingsOrCallback);
13408
13456
  return;
13409
13457
  }
13410
- async.read(path$11, getSettings$1(optionsOrSettingsOrCallback), callback);
13458
+ async.read(path$12, getSettings$1(optionsOrSettingsOrCallback), callback);
13411
13459
  }
13412
13460
  exports.scandir = scandir;
13413
- function scandirSync(path$11, optionsOrSettings) {
13461
+ function scandirSync(path$12, optionsOrSettings) {
13414
13462
  const settings = getSettings$1(optionsOrSettings);
13415
- return sync.read(path$11, settings);
13463
+ return sync.read(path$12, settings);
13416
13464
  }
13417
13465
  exports.scandirSync = scandirSync;
13418
13466
  function getSettings$1(settingsOrOptions = {}) {
@@ -13957,7 +14005,7 @@ var require_sync$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nod
13957
14005
  //#region ../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js
13958
14006
  var require_settings$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js": ((exports) => {
13959
14007
  Object.defineProperty(exports, "__esModule", { value: true });
13960
- const path$3 = __require("path");
14008
+ const path$4 = __require("path");
13961
14009
  const fsScandir = require_out$2();
13962
14010
  var Settings$1 = class {
13963
14011
  constructor(_options = {}) {
@@ -13967,7 +14015,7 @@ var require_settings$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
13967
14015
  this.deepFilter = this._getValue(this._options.deepFilter, null);
13968
14016
  this.entryFilter = this._getValue(this._options.entryFilter, null);
13969
14017
  this.errorFilter = this._getValue(this._options.errorFilter, null);
13970
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
14018
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
13971
14019
  this.fsScandirSettings = new fsScandir.Settings({
13972
14020
  followSymbolicLinks: this._options.followSymbolicLinks,
13973
14021
  fs: this._options.fs,
@@ -14020,7 +14068,7 @@ var require_out$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@node
14020
14068
  //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js
14021
14069
  var require_reader = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js": ((exports) => {
14022
14070
  Object.defineProperty(exports, "__esModule", { value: true });
14023
- const path$2 = __require("path");
14071
+ const path$3 = __require("path");
14024
14072
  const fsStat$2 = require_out$3();
14025
14073
  const utils$6 = require_utils$1();
14026
14074
  var Reader = class {
@@ -14033,7 +14081,7 @@ var require_reader = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast
14033
14081
  });
14034
14082
  }
14035
14083
  _getFullEntryPath(filepath) {
14036
- return path$2.resolve(this._settings.cwd, filepath);
14084
+ return path$3.resolve(this._settings.cwd, filepath);
14037
14085
  }
14038
14086
  _makeEntry(stats, pattern$1) {
14039
14087
  const entry = {
@@ -14377,7 +14425,7 @@ var require_entry = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-
14377
14425
  //#region ../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js
14378
14426
  var require_provider = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js": ((exports) => {
14379
14427
  Object.defineProperty(exports, "__esModule", { value: true });
14380
- const path$1 = __require("path");
14428
+ const path$2 = __require("path");
14381
14429
  const deep_1 = require_deep();
14382
14430
  const entry_1 = require_entry$1();
14383
14431
  const error_1 = require_error();
@@ -14391,7 +14439,7 @@ var require_provider = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fa
14391
14439
  this.entryTransformer = new entry_2.default(this._settings);
14392
14440
  }
14393
14441
  _getRootDirectory(task) {
14394
- return path$1.resolve(this._settings.cwd, task.base);
14442
+ return path$2.resolve(this._settings.cwd, task.base);
14395
14443
  }
14396
14444
  _getReaderOptions(task) {
14397
14445
  const basePath = task.base === "." ? "" : task.base;
@@ -14552,7 +14600,7 @@ var require_sync = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-g
14552
14600
  var require_settings = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/settings.js": ((exports) => {
14553
14601
  Object.defineProperty(exports, "__esModule", { value: true });
14554
14602
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
14555
- const fs$1 = __require("fs");
14603
+ const fs$2 = __require("fs");
14556
14604
  const os = __require("os");
14557
14605
  /**
14558
14606
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
@@ -14560,12 +14608,12 @@ var require_settings = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fa
14560
14608
  */
14561
14609
  const CPU_COUNT = Math.max(os.cpus().length, 1);
14562
14610
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
14563
- lstat: fs$1.lstat,
14564
- lstatSync: fs$1.lstatSync,
14565
- stat: fs$1.stat,
14566
- statSync: fs$1.statSync,
14567
- readdir: fs$1.readdir,
14568
- readdirSync: fs$1.readdirSync
14611
+ lstat: fs$2.lstat,
14612
+ lstatSync: fs$2.lstatSync,
14613
+ stat: fs$2.stat,
14614
+ statSync: fs$2.statSync,
14615
+ readdir: fs$2.readdir,
14616
+ readdirSync: fs$2.readdirSync
14569
14617
  };
14570
14618
  var Settings = class {
14571
14619
  constructor(_options = {}) {
@@ -14723,7 +14771,7 @@ function processExtraSources(extraSources, cwd) {
14723
14771
  });
14724
14772
  for (const absolutePath of matches) if (fs.existsSync(absolutePath)) {
14725
14773
  const stats = fs.statSync(absolutePath);
14726
- const relativePath = path.relative(cwd, absolutePath);
14774
+ const relativePath = path$1.relative(cwd, absolutePath);
14727
14775
  if (stats.isDirectory()) processedSources.push({
14728
14776
  type: "dir",
14729
14777
  filePath: relativePath,
@@ -14771,7 +14819,7 @@ function getDefaultIgnorePaths() {
14771
14819
  "**/build/"
14772
14820
  ];
14773
14821
  }
14774
- function getOtaFingerprintOptions(platform, path$11, options) {
14822
+ function getOtaFingerprintOptions(platform, path$12, options) {
14775
14823
  return {
14776
14824
  useRNCoreAutolinkingFromExpo: false,
14777
14825
  platforms: [platform],
@@ -14812,7 +14860,7 @@ function getOtaFingerprintOptions(platform, path$11, options) {
14812
14860
  ...options.ignorePaths ?? []
14813
14861
  ],
14814
14862
  sourceSkips: SourceSkips.GitIgnore | SourceSkips.PackageJsonScriptsAll | SourceSkips.PackageJsonAndroidAndIosScriptsIfNotContainRun | SourceSkips.ExpoConfigAll | SourceSkips.ExpoConfigVersions | SourceSkips.ExpoConfigNames | SourceSkips.ExpoConfigRuntimeVersionIfString | SourceSkips.ExpoConfigAssets | SourceSkips.ExpoConfigExtraSection | SourceSkips.ExpoConfigEASProject | SourceSkips.ExpoConfigSchemes,
14815
- extraSources: processExtraSources(options.extraSources ?? [], path$11),
14863
+ extraSources: processExtraSources(options.extraSources ?? [], path$12),
14816
14864
  debug: options.debug
14817
14865
  };
14818
14866
  }
@@ -14852,9 +14900,9 @@ function showFingerprintDiff(diff, platform) {
14852
14900
  /**
14853
14901
  * Calculates the fingerprint of the native parts project of the project.
14854
14902
  */
14855
- async function nativeFingerprint(path$11, options) {
14903
+ async function nativeFingerprint(path$12, options) {
14856
14904
  const platform = options.platform;
14857
- return createFingerprintAsync(path$11, getOtaFingerprintOptions(platform, path$11, options));
14905
+ return createFingerprintAsync(path$12, getOtaFingerprintOptions(platform, path$12, options));
14858
14906
  }
14859
14907
  const generateFingerprints = async () => {
14860
14908
  const fingerprintConfig = await ensureFingerprintConfig();
@@ -14912,12 +14960,12 @@ const createAndInjectFingerprintFiles = async ({ platform } = {}) => {
14912
14960
  };
14913
14961
  };
14914
14962
  const createFingerprintJSON = async (fingerprint) => {
14915
- const FINGERPRINT_FILE_PATH = path.join(getCwd(), "fingerprint.json");
14963
+ const FINGERPRINT_FILE_PATH = path$1.join(getCwd(), "fingerprint.json");
14916
14964
  await fs.promises.writeFile(FINGERPRINT_FILE_PATH, JSON.stringify(fingerprint, null, 2));
14917
14965
  return fingerprint;
14918
14966
  };
14919
14967
  const readLocalFingerprint = async () => {
14920
- const FINGERPRINT_FILE_PATH = path.join(getCwd(), "fingerprint.json");
14968
+ const FINGERPRINT_FILE_PATH = path$1.join(getCwd(), "fingerprint.json");
14921
14969
  try {
14922
14970
  const content = await fs.promises.readFile(FINGERPRINT_FILE_PATH, "utf-8");
14923
14971
  return JSON.parse(content);
@@ -14927,4 +14975,72 @@ const readLocalFingerprint = async () => {
14927
14975
  };
14928
14976
 
14929
14977
  //#endregion
14930
- export { __toESM as _, nativeFingerprint as a, showFingerprintDiff as c, IosConfigParser as d, require_plist as f, __require as g, __commonJS as h, generateFingerprints as i, isFingerprintEquals as l, AndroidConfigParser as m, createFingerprintJSON as n, readLocalFingerprint as o, require_base64_js as p, generateFingerprint as r, getFingerprintDiff as s, createAndInjectFingerprintFiles as t, require_out as u };
14978
+ //#region src/utils/signing/keyGeneration.ts
14979
+ /**
14980
+ * Generate RSA key pair for bundle signing.
14981
+ * @param keySize Key size in bits (2048 or 4096)
14982
+ * @returns Promise resolving to key pair in PEM format
14983
+ */
14984
+ async function generateKeyPair(keySize = 4096) {
14985
+ return new Promise((resolve, reject) => {
14986
+ crypto.generateKeyPair("rsa", {
14987
+ modulusLength: keySize,
14988
+ publicKeyEncoding: {
14989
+ type: "spki",
14990
+ format: "pem"
14991
+ },
14992
+ privateKeyEncoding: {
14993
+ type: "pkcs8",
14994
+ format: "pem"
14995
+ }
14996
+ }, (err, publicKey, privateKey) => {
14997
+ if (err) reject(err);
14998
+ else resolve({
14999
+ privateKey,
15000
+ publicKey
15001
+ });
15002
+ });
15003
+ });
15004
+ }
15005
+ /**
15006
+ * Save key pair to disk with secure permissions.
15007
+ * @param keyPair Generated key pair
15008
+ * @param outputDir Directory to save keys
15009
+ */
15010
+ async function saveKeyPair(keyPair, outputDir) {
15011
+ await fs$1.mkdir(outputDir, { recursive: true });
15012
+ const privateKeyPath = path.join(outputDir, "private-key.pem");
15013
+ const publicKeyPath = path.join(outputDir, "public-key.pem");
15014
+ await fs$1.writeFile(privateKeyPath, keyPair.privateKey, { mode: 384 });
15015
+ await fs$1.writeFile(publicKeyPath, keyPair.publicKey, { mode: 420 });
15016
+ }
15017
+ /**
15018
+ * Load private key from PEM file.
15019
+ * @param privateKeyPath Path to private key file
15020
+ * @returns Private key in PEM format
15021
+ * @throws Error if file not found or invalid format
15022
+ */
15023
+ async function loadPrivateKey(privateKeyPath) {
15024
+ try {
15025
+ const privateKey = await fs$1.readFile(privateKeyPath, "utf-8");
15026
+ crypto.createPrivateKey(privateKey);
15027
+ return privateKey;
15028
+ } catch (error) {
15029
+ throw new Error(`Failed to load private key from ${privateKeyPath}: ${error.message}`);
15030
+ }
15031
+ }
15032
+ /**
15033
+ * Extract public key from private key.
15034
+ * @param privateKeyPEM Private key in PEM format
15035
+ * @returns Public key in PEM format
15036
+ */
15037
+ function getPublicKeyFromPrivate(privateKeyPEM) {
15038
+ const privateKey = crypto.createPrivateKey(privateKeyPEM);
15039
+ return crypto.createPublicKey(privateKey).export({
15040
+ type: "spki",
15041
+ format: "pem"
15042
+ });
15043
+ }
15044
+
15045
+ //#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 };