hot-updater 0.20.2 → 0.20.4

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
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const require_picocolors$1 = require('./picocolors-y8lGs7d-.cjs');
3
- const require_fingerprint = require('./fingerprint-CNuaoV3R.cjs');
3
+ const require_fingerprint = require('./fingerprint-Cgwd8mei.cjs');
4
4
  const node_events = require_picocolors$1.__toESM(require("node:events"));
5
5
  const node_child_process = require_picocolors$1.__toESM(require("node:child_process"));
6
6
  const node_path = require_picocolors$1.__toESM(require("node:path"));
@@ -3704,7 +3704,6 @@ const fallbackSymbols = {
3704
3704
  };
3705
3705
  const shouldUseMain = isUnicodeSupported();
3706
3706
  const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
3707
- var figures_default = figures;
3708
3707
  const replacements = Object.entries(specialMainSymbols);
3709
3708
 
3710
3709
  //#endregion
@@ -3786,8 +3785,8 @@ const defaultVerboseFunction = ({ type: type$1, message, timestamp, piped, comma
3786
3785
  const serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;
3787
3786
  const padField = (field, padding) => String(field).padStart(padding, "0");
3788
3787
  const getFinalIcon = ({ failed, reject }) => {
3789
- if (!failed) return figures_default.tick;
3790
- return reject ? figures_default.cross : figures_default.warning;
3788
+ if (!failed) return figures.tick;
3789
+ return reject ? figures.cross : figures.warning;
3791
3790
  };
3792
3791
  const ICONS = {
3793
3792
  command: ({ piped }) => piped ? "|" : "$",
@@ -12747,7 +12746,6 @@ var require_commonjs = /* @__PURE__ */ require_picocolors$1.__commonJS({ "../../
12747
12746
  }
12748
12747
  /* c8 ignore stop */
12749
12748
  const shouldWarn = (code) => !warned.has(code);
12750
- Symbol("type");
12751
12749
  const isPosInt = (n$1) => n$1 && n$1 === Math.floor(n$1) && n$1 > 0 && isFinite(n$1);
12752
12750
  /* c8 ignore start */
12753
12751
  const getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
@@ -24020,7 +24018,6 @@ var require_comments = /* @__PURE__ */ require_picocolors$1.__commonJS({ "../../
24020
24018
  exports.isPBXFileReference = exports.isPBXBuildFile = exports.createReferenceList = void 0;
24021
24019
  /** Create a list of <UUID, Comment> */
24022
24020
  function createReferenceList(project) {
24023
- const strict = false;
24024
24021
  const objects = project?.objects ?? {};
24025
24022
  const referenceCache = {};
24026
24023
  function getXCConfigurationListComment(id) {
@@ -34357,6 +34354,7 @@ var require_build = /* @__PURE__ */ require_picocolors$1.__commonJS({ "../../nod
34357
34354
  //#endregion
34358
34355
  //#region src/utils/getIosAppTargetDirectoryName.ts
34359
34356
  var import_build = /* @__PURE__ */ require_picocolors$1.__toESM(require_build(), 1);
34357
+ var import_plist = /* @__PURE__ */ require_picocolors$1.__toESM(require_fingerprint.require_plist(), 1);
34360
34358
  var import_out$1 = /* @__PURE__ */ require_picocolors$1.__toESM(require_fingerprint.require_out(), 1);
34361
34359
  const getIosAppTargetDirectoryName = () => {
34362
34360
  const iosDirectory = path.default.join((0, __hot_updater_plugin_core.getCwd)(), "ios");
@@ -34371,7 +34369,6 @@ const getIosAppTargetDirectoryName = () => {
34371
34369
  //#endregion
34372
34370
  //#region src/utils/version/getIOSVersion.ts
34373
34371
  var import_out = /* @__PURE__ */ require_picocolors$1.__toESM(require_fingerprint.require_out(), 1);
34374
- var import_plist = /* @__PURE__ */ require_picocolors$1.__toESM(require_fingerprint.require_plist(), 1);
34375
34372
  var import_valid$3 = /* @__PURE__ */ require_picocolors$1.__toESM(require_valid(), 1);
34376
34373
  const isFileExist = async (path$25) => {
34377
34374
  try {
@@ -34467,7 +34464,7 @@ const nativeBuild = async (options) => {
34467
34464
  const localFingerprint = (await require_fingerprint.readLocalFingerprint())?.[platform$2];
34468
34465
  if (!localFingerprint) __clack_prompts.log.warn(`Resolving fingerprint for ${platform$2} failed. Building native will generate it.`);
34469
34466
  s$1.start(`Fingerprinting (${platform$2})`);
34470
- const generatedFingerprint = (await require_fingerprint.createAndInjectFingerprintFiles())[platform$2];
34467
+ const generatedFingerprint = (await require_fingerprint.createAndInjectFingerprintFiles()).fingerprint[platform$2];
34471
34468
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34472
34469
  if (!require_fingerprint.isFingerprintEquals(localFingerprint, generatedFingerprint)) __clack_prompts.log.info(`${import_picocolors$4.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34473
34470
  target.fingerprintHash = generatedFingerprint.hash;
@@ -35423,7 +35420,6 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
35423
35420
  }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
35424
35421
  defineLazyProperty(apps, "browser", () => "browser");
35425
35422
  defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
35426
- var open_default = open;
35427
35423
 
35428
35424
  //#endregion
35429
35425
  //#region src/commands/deploy.ts
@@ -35599,9 +35595,9 @@ const deploy = async (options) => {
35599
35595
  initialValue: false
35600
35596
  });
35601
35597
  if (!__clack_prompts.isCancel(result) && result) await openConsole(port, () => {
35602
- open_default(url$2);
35598
+ open(url$2);
35603
35599
  });
35604
- } else open_default(url$2);
35600
+ } else open(url$2);
35605
35601
  __clack_prompts.note(note);
35606
35602
  }
35607
35603
  __clack_prompts.outro("🚀 Deployment Successful");
@@ -35727,12 +35723,12 @@ const init = async () => {
35727
35723
  },
35728
35724
  {
35729
35725
  value: {
35730
- name: "rnef",
35726
+ name: "rock",
35731
35727
  dependencies: [],
35732
- devDependencies: ["@hot-updater/rnef"]
35728
+ devDependencies: ["@hot-updater/rock"]
35733
35729
  },
35734
35730
  hint: "React Native Enterprise Framework by Callstack",
35735
- label: "RNEF"
35731
+ label: "Rock"
35736
35732
  },
35737
35733
  {
35738
35734
  value: {
@@ -35845,26 +35841,26 @@ function merge(target, source) {
35845
35841
  const DEFAULT_CHANNEL$1 = "production";
35846
35842
  const setAndroidChannel = async (channel) => {
35847
35843
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35848
- const customPaths = config.platform?.android?.stringResourcePaths;
35844
+ const customPaths = config.platform.android.stringResourcePaths;
35849
35845
  const androidParser = new require_fingerprint.AndroidConfigParser(customPaths);
35850
35846
  return await androidParser.set("hot_updater_channel", channel);
35851
35847
  };
35852
35848
  const getAndroidChannel = async () => {
35853
35849
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35854
- const customPaths = config.platform?.android?.stringResourcePaths;
35850
+ const customPaths = config.platform.android.stringResourcePaths;
35855
35851
  const androidParser = new require_fingerprint.AndroidConfigParser(customPaths);
35856
35852
  if (!await androidParser.exists()) throw new Error("No Android strings.xml files found");
35857
35853
  return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
35858
35854
  };
35859
35855
  const setIosChannel = async (channel) => {
35860
35856
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35861
- const customPaths = config.platform?.ios?.infoPlistPaths;
35857
+ const customPaths = config.platform.ios.infoPlistPaths;
35862
35858
  const iosParser = new require_fingerprint.IosConfigParser(customPaths);
35863
35859
  return await iosParser.set("HOT_UPDATER_CHANNEL", channel);
35864
35860
  };
35865
35861
  const getIosChannel = async () => {
35866
35862
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35867
- const customPaths = config.platform?.ios?.infoPlistPaths;
35863
+ const customPaths = config.platform.ios.infoPlistPaths;
35868
35864
  const iosParser = new require_fingerprint.IosConfigParser(customPaths);
35869
35865
  if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
35870
35866
  return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
@@ -35889,17 +35885,23 @@ const handleChannel = async () => {
35889
35885
  const androidChannel = await getChannel("android");
35890
35886
  const iosChannel = await getChannel("ios");
35891
35887
  __clack_prompts.log.info(`Current Android channel: ${import_picocolors$2.default.green(androidChannel.value)}`);
35892
- __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.path)}`);
35888
+ __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.paths[0])}`);
35893
35889
  __clack_prompts.log.info(`Current iOS channel: ${import_picocolors$2.default.green(iosChannel.value)}`);
35894
- __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.path)}`);
35890
+ __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.paths[0])}`);
35895
35891
  };
35896
35892
  const handleSetChannel = async (channel) => {
35897
- const { path: androidPath } = await setChannel("android", channel);
35893
+ const { paths: androidPaths } = await setChannel("android", channel);
35898
35894
  __clack_prompts.log.success(`Set Android channel to: ${import_picocolors$2.default.green(channel)}`);
35899
- __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(androidPath)}`);
35900
- const { path: iosPath } = await setChannel("ios", channel);
35895
+ if (androidPaths.length > 0) {
35896
+ __clack_prompts.log.info(import_picocolors$2.default.bold("Changed Android paths:"));
35897
+ for (const path$25 of androidPaths) __clack_prompts.log.info(` ${import_picocolors$2.default.green(path$25)}`);
35898
+ }
35899
+ const { paths: iosPaths } = await setChannel("ios", channel);
35901
35900
  __clack_prompts.log.success(`Set iOS channel to: ${import_picocolors$2.default.green(channel)}`);
35902
- __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(iosPath)}`);
35901
+ if (iosPaths.length > 0) {
35902
+ __clack_prompts.log.info(import_picocolors$2.default.bold("Changed iOS paths:"));
35903
+ for (const path$25 of iosPaths) __clack_prompts.log.info(` ${import_picocolors$2.default.green(path$25)}`);
35904
+ }
35903
35905
  __clack_prompts.log.success("You need to rebuild the native app if the channel has changed.");
35904
35906
  };
35905
35907
 
@@ -36642,36 +36644,41 @@ const handleFingerprint = async () => {
36642
36644
  const handleCreateFingerprint = async () => {
36643
36645
  let diffChanged = false;
36644
36646
  let localFingerprint = null;
36645
- let newFingerprint = null;
36646
- await __clack_prompts.tasks([{
36647
- title: "Creating fingerprint.json",
36648
- task: async () => {
36649
- try {
36650
- localFingerprint = await require_fingerprint.readLocalFingerprint();
36651
- newFingerprint = await require_fingerprint.createAndInjectFingerprintFiles();
36652
- if (!require_fingerprint.isFingerprintEquals(localFingerprint, newFingerprint)) diffChanged = true;
36653
- return "Created fingerprint.json";
36654
- } catch (error) {
36655
- if (error instanceof Error) __clack_prompts.log.error(error.message);
36656
- console.error(error);
36657
- process.exit(1);
36658
- }
36647
+ let result = null;
36648
+ const s$1 = __clack_prompts.spinner();
36649
+ s$1.start("Creating fingerprint.json");
36650
+ try {
36651
+ localFingerprint = await require_fingerprint.readLocalFingerprint();
36652
+ result = await require_fingerprint.createAndInjectFingerprintFiles();
36653
+ if (!require_fingerprint.isFingerprintEquals(localFingerprint, result.fingerprint)) diffChanged = true;
36654
+ s$1.stop("Created fingerprint.json");
36655
+ } catch (error) {
36656
+ if (error instanceof Error) __clack_prompts.log.error(error.message);
36657
+ console.error(error);
36658
+ process.exit(1);
36659
+ }
36660
+ if (diffChanged && result) {
36661
+ if (result.androidPaths.length > 0) {
36662
+ __clack_prompts.log.info(import_picocolors$1.default.bold("Changed Android paths:"));
36663
+ for (const path$25 of result.androidPaths) __clack_prompts.log.info(` ${import_picocolors$1.default.green(path$25)}`);
36664
+ }
36665
+ if (result.iosPaths.length > 0) {
36666
+ __clack_prompts.log.info(import_picocolors$1.default.bold("Changed iOS paths:"));
36667
+ for (const path$25 of result.iosPaths) __clack_prompts.log.info(` ${import_picocolors$1.default.green(path$25)}`);
36659
36668
  }
36660
- }]);
36661
- if (diffChanged) {
36662
36669
  __clack_prompts.log.success(import_picocolors$1.default.bold(`${import_picocolors$1.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
36663
- if (localFingerprint && newFingerprint) {
36670
+ if (localFingerprint && result.fingerprint) {
36664
36671
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
36665
36672
  const fingerprintConfig = config.fingerprint;
36666
36673
  try {
36667
- if (localFingerprint.ios && localFingerprint.ios.hash !== newFingerprint.ios.hash) {
36674
+ if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash) {
36668
36675
  const iosDiff = await require_fingerprint.getFingerprintDiff(localFingerprint.ios, {
36669
36676
  platform: "ios",
36670
36677
  ...fingerprintConfig
36671
36678
  });
36672
36679
  require_fingerprint.showFingerprintDiff(iosDiff, "iOS");
36673
36680
  }
36674
- if (localFingerprint.android && localFingerprint.android.hash !== newFingerprint.android.hash) {
36681
+ if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash) {
36675
36682
  const androidDiff = await require_fingerprint.getFingerprintDiff(localFingerprint.android, {
36676
36683
  platform: "android",
36677
36684
  ...fingerprintConfig
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { __commonJS, __require, __toESM, require_picocolors } from "./picocolors-BnzanxXs.js";
3
- import { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff } from "./fingerprint-CyVxz4OY.js";
3
+ import { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff } from "./fingerprint--hj1gaV4.js";
4
4
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
5
5
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
6
6
  import path from "node:path";
@@ -3704,7 +3704,6 @@ const fallbackSymbols = {
3704
3704
  };
3705
3705
  const shouldUseMain = isUnicodeSupported();
3706
3706
  const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
3707
- var figures_default = figures;
3708
3707
  const replacements = Object.entries(specialMainSymbols);
3709
3708
 
3710
3709
  //#endregion
@@ -3786,8 +3785,8 @@ const defaultVerboseFunction = ({ type: type$1, message, timestamp, piped, comma
3786
3785
  const serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`;
3787
3786
  const padField = (field, padding) => String(field).padStart(padding, "0");
3788
3787
  const getFinalIcon = ({ failed, reject }) => {
3789
- if (!failed) return figures_default.tick;
3790
- return reject ? figures_default.cross : figures_default.warning;
3788
+ if (!failed) return figures.tick;
3789
+ return reject ? figures.cross : figures.warning;
3791
3790
  };
3792
3791
  const ICONS = {
3793
3792
  command: ({ piped }) => piped ? "|" : "$",
@@ -12753,7 +12752,6 @@ var require_commonjs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/lr
12753
12752
  }
12754
12753
  /* c8 ignore stop */
12755
12754
  const shouldWarn = (code) => !warned.has(code);
12756
- Symbol("type");
12757
12755
  const isPosInt = (n$1) => n$1 && n$1 === Math.floor(n$1) && n$1 > 0 && isFinite(n$1);
12758
12756
  /* c8 ignore start */
12759
12757
  const getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
@@ -24026,7 +24024,6 @@ var require_comments = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@b
24026
24024
  exports.isPBXFileReference = exports.isPBXBuildFile = exports.createReferenceList = void 0;
24027
24025
  /** Create a list of <UUID, Comment> */
24028
24026
  function createReferenceList(project) {
24029
- const strict = false;
24030
24027
  const objects = project?.objects ?? {};
24031
24028
  const referenceCache = {};
24032
24029
  function getXCConfigurationListComment(id) {
@@ -34363,6 +34360,7 @@ var require_build = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@baco
34363
34360
  //#endregion
34364
34361
  //#region src/utils/getIosAppTargetDirectoryName.ts
34365
34362
  var import_build = /* @__PURE__ */ __toESM(require_build(), 1);
34363
+ var import_plist = /* @__PURE__ */ __toESM(require_plist(), 1);
34366
34364
  var import_out$1 = /* @__PURE__ */ __toESM(require_out(), 1);
34367
34365
  const getIosAppTargetDirectoryName = () => {
34368
34366
  const iosDirectory = path$1.join(getCwd(), "ios");
@@ -34377,7 +34375,6 @@ const getIosAppTargetDirectoryName = () => {
34377
34375
  //#endregion
34378
34376
  //#region src/utils/version/getIOSVersion.ts
34379
34377
  var import_out = /* @__PURE__ */ __toESM(require_out(), 1);
34380
- var import_plist = /* @__PURE__ */ __toESM(require_plist(), 1);
34381
34378
  var import_valid$3 = /* @__PURE__ */ __toESM(require_valid(), 1);
34382
34379
  const isFileExist = async (path$6) => {
34383
34380
  try {
@@ -34473,7 +34470,7 @@ const nativeBuild = async (options) => {
34473
34470
  const localFingerprint = (await readLocalFingerprint())?.[platform$2];
34474
34471
  if (!localFingerprint) p.log.warn(`Resolving fingerprint for ${platform$2} failed. Building native will generate it.`);
34475
34472
  s$1.start(`Fingerprinting (${platform$2})`);
34476
- const generatedFingerprint = (await createAndInjectFingerprintFiles())[platform$2];
34473
+ const generatedFingerprint = (await createAndInjectFingerprintFiles()).fingerprint[platform$2];
34477
34474
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34478
34475
  if (!isFingerprintEquals(localFingerprint, generatedFingerprint)) p.log.info(`${import_picocolors$4.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34479
34476
  target.fingerprintHash = generatedFingerprint.hash;
@@ -35429,7 +35426,6 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
35429
35426
  }, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
35430
35427
  defineLazyProperty(apps, "browser", () => "browser");
35431
35428
  defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
35432
- var open_default = open;
35433
35429
 
35434
35430
  //#endregion
35435
35431
  //#region src/commands/deploy.ts
@@ -35605,9 +35601,9 @@ const deploy = async (options) => {
35605
35601
  initialValue: false
35606
35602
  });
35607
35603
  if (!p.isCancel(result) && result) await openConsole(port, () => {
35608
- open_default(url$2);
35604
+ open(url$2);
35609
35605
  });
35610
- } else open_default(url$2);
35606
+ } else open(url$2);
35611
35607
  p.note(note);
35612
35608
  }
35613
35609
  p.outro("🚀 Deployment Successful");
@@ -35733,12 +35729,12 @@ const init = async () => {
35733
35729
  },
35734
35730
  {
35735
35731
  value: {
35736
- name: "rnef",
35732
+ name: "rock",
35737
35733
  dependencies: [],
35738
- devDependencies: ["@hot-updater/rnef"]
35734
+ devDependencies: ["@hot-updater/rock"]
35739
35735
  },
35740
35736
  hint: "React Native Enterprise Framework by Callstack",
35741
- label: "RNEF"
35737
+ label: "Rock"
35742
35738
  },
35743
35739
  {
35744
35740
  value: {
@@ -35851,26 +35847,26 @@ function merge(target, source) {
35851
35847
  const DEFAULT_CHANNEL$1 = "production";
35852
35848
  const setAndroidChannel = async (channel) => {
35853
35849
  const config = await loadConfig(null);
35854
- const customPaths = config.platform?.android?.stringResourcePaths;
35850
+ const customPaths = config.platform.android.stringResourcePaths;
35855
35851
  const androidParser = new AndroidConfigParser(customPaths);
35856
35852
  return await androidParser.set("hot_updater_channel", channel);
35857
35853
  };
35858
35854
  const getAndroidChannel = async () => {
35859
35855
  const config = await loadConfig(null);
35860
- const customPaths = config.platform?.android?.stringResourcePaths;
35856
+ const customPaths = config.platform.android.stringResourcePaths;
35861
35857
  const androidParser = new AndroidConfigParser(customPaths);
35862
35858
  if (!await androidParser.exists()) throw new Error("No Android strings.xml files found");
35863
35859
  return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
35864
35860
  };
35865
35861
  const setIosChannel = async (channel) => {
35866
35862
  const config = await loadConfig(null);
35867
- const customPaths = config.platform?.ios?.infoPlistPaths;
35863
+ const customPaths = config.platform.ios.infoPlistPaths;
35868
35864
  const iosParser = new IosConfigParser(customPaths);
35869
35865
  return await iosParser.set("HOT_UPDATER_CHANNEL", channel);
35870
35866
  };
35871
35867
  const getIosChannel = async () => {
35872
35868
  const config = await loadConfig(null);
35873
- const customPaths = config.platform?.ios?.infoPlistPaths;
35869
+ const customPaths = config.platform.ios.infoPlistPaths;
35874
35870
  const iosParser = new IosConfigParser(customPaths);
35875
35871
  if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
35876
35872
  return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
@@ -35895,17 +35891,23 @@ const handleChannel = async () => {
35895
35891
  const androidChannel = await getChannel("android");
35896
35892
  const iosChannel = await getChannel("ios");
35897
35893
  p.log.info(`Current Android channel: ${import_picocolors$2.default.green(androidChannel.value)}`);
35898
- p.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.path)}`);
35894
+ p.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.paths[0])}`);
35899
35895
  p.log.info(`Current iOS channel: ${import_picocolors$2.default.green(iosChannel.value)}`);
35900
- p.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.path)}`);
35896
+ p.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.paths[0])}`);
35901
35897
  };
35902
35898
  const handleSetChannel = async (channel) => {
35903
- const { path: androidPath } = await setChannel("android", channel);
35899
+ const { paths: androidPaths } = await setChannel("android", channel);
35904
35900
  p.log.success(`Set Android channel to: ${import_picocolors$2.default.green(channel)}`);
35905
- p.log.info(` from: ${import_picocolors$2.default.blue(androidPath)}`);
35906
- const { path: iosPath } = await setChannel("ios", channel);
35901
+ if (androidPaths.length > 0) {
35902
+ p.log.info(import_picocolors$2.default.bold("Changed Android paths:"));
35903
+ for (const path$6 of androidPaths) p.log.info(` ${import_picocolors$2.default.green(path$6)}`);
35904
+ }
35905
+ const { paths: iosPaths } = await setChannel("ios", channel);
35907
35906
  p.log.success(`Set iOS channel to: ${import_picocolors$2.default.green(channel)}`);
35908
- p.log.info(` from: ${import_picocolors$2.default.blue(iosPath)}`);
35907
+ if (iosPaths.length > 0) {
35908
+ p.log.info(import_picocolors$2.default.bold("Changed iOS paths:"));
35909
+ for (const path$6 of iosPaths) p.log.info(` ${import_picocolors$2.default.green(path$6)}`);
35910
+ }
35909
35911
  p.log.success("You need to rebuild the native app if the channel has changed.");
35910
35912
  };
35911
35913
 
@@ -36648,36 +36650,41 @@ const handleFingerprint = async () => {
36648
36650
  const handleCreateFingerprint = async () => {
36649
36651
  let diffChanged = false;
36650
36652
  let localFingerprint = null;
36651
- let newFingerprint = null;
36652
- await p.tasks([{
36653
- title: "Creating fingerprint.json",
36654
- task: async () => {
36655
- try {
36656
- localFingerprint = await readLocalFingerprint();
36657
- newFingerprint = await createAndInjectFingerprintFiles();
36658
- if (!isFingerprintEquals(localFingerprint, newFingerprint)) diffChanged = true;
36659
- return "Created fingerprint.json";
36660
- } catch (error) {
36661
- if (error instanceof Error) p.log.error(error.message);
36662
- console.error(error);
36663
- process.exit(1);
36664
- }
36653
+ let result = null;
36654
+ const s$1 = p.spinner();
36655
+ s$1.start("Creating fingerprint.json");
36656
+ try {
36657
+ localFingerprint = await readLocalFingerprint();
36658
+ result = await createAndInjectFingerprintFiles();
36659
+ if (!isFingerprintEquals(localFingerprint, result.fingerprint)) diffChanged = true;
36660
+ s$1.stop("Created fingerprint.json");
36661
+ } catch (error) {
36662
+ if (error instanceof Error) p.log.error(error.message);
36663
+ console.error(error);
36664
+ process.exit(1);
36665
+ }
36666
+ if (diffChanged && result) {
36667
+ if (result.androidPaths.length > 0) {
36668
+ p.log.info(import_picocolors$1.default.bold("Changed Android paths:"));
36669
+ for (const path$6 of result.androidPaths) p.log.info(` ${import_picocolors$1.default.green(path$6)}`);
36670
+ }
36671
+ if (result.iosPaths.length > 0) {
36672
+ p.log.info(import_picocolors$1.default.bold("Changed iOS paths:"));
36673
+ for (const path$6 of result.iosPaths) p.log.info(` ${import_picocolors$1.default.green(path$6)}`);
36665
36674
  }
36666
- }]);
36667
- if (diffChanged) {
36668
36675
  p.log.success(import_picocolors$1.default.bold(`${import_picocolors$1.default.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
36669
- if (localFingerprint && newFingerprint) {
36676
+ if (localFingerprint && result.fingerprint) {
36670
36677
  const config = await loadConfig(null);
36671
36678
  const fingerprintConfig = config.fingerprint;
36672
36679
  try {
36673
- if (localFingerprint.ios && localFingerprint.ios.hash !== newFingerprint.ios.hash) {
36680
+ if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash) {
36674
36681
  const iosDiff = await getFingerprintDiff(localFingerprint.ios, {
36675
36682
  platform: "ios",
36676
36683
  ...fingerprintConfig
36677
36684
  });
36678
36685
  showFingerprintDiff(iosDiff, "iOS");
36679
36686
  }
36680
- if (localFingerprint.android && localFingerprint.android.hash !== newFingerprint.android.hash) {
36687
+ if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash) {
36681
36688
  const androidDiff = await getFingerprintDiff(localFingerprint.android, {
36682
36689
  platform: "android",
36683
36690
  ...fingerprintConfig
@@ -3,6 +3,7 @@ const fs = require_picocolors$1.__toESM(require("fs"));
3
3
  const path = require_picocolors$1.__toESM(require("path"));
4
4
 
5
5
  //#region ../../node_modules/.pnpm/uuidv7@1.0.2/node_modules/uuidv7/dist/index.js
6
+ var import_picocolors = /* @__PURE__ */ require_picocolors$1.__toESM(require_picocolors$1.require_picocolors(), 1);
6
7
  /**
7
8
  * uuidv7: A JavaScript implementation of UUID version 7
8
9
  *
@@ -332,7 +333,6 @@ const uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator
332
333
 
333
334
  //#endregion
334
335
  //#region src/plugins/babel.ts
335
- var import_picocolors = /* @__PURE__ */ require_picocolors$1.__toESM(require_picocolors$1.require_picocolors(), 1);
336
336
  const NIL_UUID = "00000000-0000-0000-0000-000000000000";
337
337
  const getBundleId = () => {
338
338
  const buildOutDir = process.env["BUILD_OUT_DIR"];
@@ -3,6 +3,7 @@ import fs from "fs";
3
3
  import path from "path";
4
4
 
5
5
  //#region ../../node_modules/.pnpm/uuidv7@1.0.2/node_modules/uuidv7/dist/index.js
6
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
6
7
  /**
7
8
  * uuidv7: A JavaScript implementation of UUID version 7
8
9
  *
@@ -332,7 +333,6 @@ const uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator
332
333
 
333
334
  //#endregion
334
335
  //#region src/plugins/babel.ts
335
- var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
336
336
  const NIL_UUID = "00000000-0000-0000-0000-000000000000";
337
337
  const getBundleId = () => {
338
338
  const buildOutDir = process.env["BUILD_OUT_DIR"];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.20.2",
4
+ "version": "0.20.4",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.js"
7
7
  },
@@ -50,16 +50,16 @@
50
50
  "dependencies": {
51
51
  "@clack/prompts": "0.10.0",
52
52
  "@expo/fingerprint": "0.13.4",
53
- "cosmiconfig": "^9.0.0",
54
- "cosmiconfig-typescript-loader": "^5.0.0",
55
- "es-git": "^0.2.0",
56
- "@hot-updater/console": "0.20.2",
57
- "@hot-updater/core": "0.20.2",
58
- "@hot-updater/plugin-core": "0.20.2"
53
+ "cosmiconfig": "9.0.0",
54
+ "cosmiconfig-typescript-loader": "5.0.0",
55
+ "es-git": "0.4.0",
56
+ "@hot-updater/console": "0.20.4",
57
+ "@hot-updater/plugin-core": "0.20.4",
58
+ "@hot-updater/core": "0.20.4"
59
59
  },
60
60
  "devDependencies": {
61
61
  "fast-xml-parser": "^5.2.3",
62
- "fast-glob": "^3.3.3",
62
+ "fast-glob": "3.3.3",
63
63
  "@bacons/xcode": "1.0.0-alpha.24",
64
64
  "@commander-js/extra-typings": "^14.0.0",
65
65
  "commander": "^14.0.0",
@@ -86,10 +86,10 @@
86
86
  "read-package-up": "^11.0.0",
87
87
  "semver": "^7.6.3",
88
88
  "uuidv7": "^1.0.2",
89
- "@hot-updater/aws": "0.20.2",
90
- "@hot-updater/firebase": "0.20.2",
91
- "@hot-updater/cloudflare": "0.20.2",
92
- "@hot-updater/supabase": "0.20.2"
89
+ "@hot-updater/cloudflare": "0.20.4",
90
+ "@hot-updater/aws": "0.20.4",
91
+ "@hot-updater/firebase": "0.20.4",
92
+ "@hot-updater/supabase": "0.20.4"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@hot-updater/aws": "*",