hot-updater 0.20.2 → 0.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -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-DaEOh777.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"));
@@ -34467,7 +34467,7 @@ const nativeBuild = async (options) => {
34467
34467
  const localFingerprint = (await require_fingerprint.readLocalFingerprint())?.[platform$2];
34468
34468
  if (!localFingerprint) __clack_prompts.log.warn(`Resolving fingerprint for ${platform$2} failed. Building native will generate it.`);
34469
34469
  s$1.start(`Fingerprinting (${platform$2})`);
34470
- const generatedFingerprint = (await require_fingerprint.createAndInjectFingerprintFiles())[platform$2];
34470
+ const generatedFingerprint = (await require_fingerprint.createAndInjectFingerprintFiles()).fingerprint[platform$2];
34471
34471
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34472
34472
  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
34473
  target.fingerprintHash = generatedFingerprint.hash;
@@ -35845,26 +35845,26 @@ function merge(target, source) {
35845
35845
  const DEFAULT_CHANNEL$1 = "production";
35846
35846
  const setAndroidChannel = async (channel) => {
35847
35847
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35848
- const customPaths = config.platform?.android?.stringResourcePaths;
35848
+ const customPaths = config.platform.android.stringResourcePaths;
35849
35849
  const androidParser = new require_fingerprint.AndroidConfigParser(customPaths);
35850
35850
  return await androidParser.set("hot_updater_channel", channel);
35851
35851
  };
35852
35852
  const getAndroidChannel = async () => {
35853
35853
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35854
- const customPaths = config.platform?.android?.stringResourcePaths;
35854
+ const customPaths = config.platform.android.stringResourcePaths;
35855
35855
  const androidParser = new require_fingerprint.AndroidConfigParser(customPaths);
35856
35856
  if (!await androidParser.exists()) throw new Error("No Android strings.xml files found");
35857
35857
  return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
35858
35858
  };
35859
35859
  const setIosChannel = async (channel) => {
35860
35860
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35861
- const customPaths = config.platform?.ios?.infoPlistPaths;
35861
+ const customPaths = config.platform.ios.infoPlistPaths;
35862
35862
  const iosParser = new require_fingerprint.IosConfigParser(customPaths);
35863
35863
  return await iosParser.set("HOT_UPDATER_CHANNEL", channel);
35864
35864
  };
35865
35865
  const getIosChannel = async () => {
35866
35866
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
35867
- const customPaths = config.platform?.ios?.infoPlistPaths;
35867
+ const customPaths = config.platform.ios.infoPlistPaths;
35868
35868
  const iosParser = new require_fingerprint.IosConfigParser(customPaths);
35869
35869
  if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
35870
35870
  return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
@@ -35889,17 +35889,23 @@ const handleChannel = async () => {
35889
35889
  const androidChannel = await getChannel("android");
35890
35890
  const iosChannel = await getChannel("ios");
35891
35891
  __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)}`);
35892
+ __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.paths[0])}`);
35893
35893
  __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)}`);
35894
+ __clack_prompts.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.paths[0])}`);
35895
35895
  };
35896
35896
  const handleSetChannel = async (channel) => {
35897
- const { path: androidPath } = await setChannel("android", channel);
35897
+ const { paths: androidPaths } = await setChannel("android", channel);
35898
35898
  __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);
35899
+ if (androidPaths.length > 0) {
35900
+ __clack_prompts.log.info(import_picocolors$2.default.bold("Changed Android paths:"));
35901
+ for (const path$25 of androidPaths) __clack_prompts.log.info(` ${import_picocolors$2.default.green(path$25)}`);
35902
+ }
35903
+ const { paths: iosPaths } = await setChannel("ios", channel);
35901
35904
  __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)}`);
35905
+ if (iosPaths.length > 0) {
35906
+ __clack_prompts.log.info(import_picocolors$2.default.bold("Changed iOS paths:"));
35907
+ for (const path$25 of iosPaths) __clack_prompts.log.info(` ${import_picocolors$2.default.green(path$25)}`);
35908
+ }
35903
35909
  __clack_prompts.log.success("You need to rebuild the native app if the channel has changed.");
35904
35910
  };
35905
35911
 
@@ -36642,36 +36648,41 @@ const handleFingerprint = async () => {
36642
36648
  const handleCreateFingerprint = async () => {
36643
36649
  let diffChanged = false;
36644
36650
  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
- }
36651
+ let result = null;
36652
+ const s$1 = __clack_prompts.spinner();
36653
+ s$1.start("Creating fingerprint.json");
36654
+ try {
36655
+ localFingerprint = await require_fingerprint.readLocalFingerprint();
36656
+ result = await require_fingerprint.createAndInjectFingerprintFiles();
36657
+ if (!require_fingerprint.isFingerprintEquals(localFingerprint, result.fingerprint)) diffChanged = true;
36658
+ s$1.stop("Created fingerprint.json");
36659
+ } catch (error) {
36660
+ if (error instanceof Error) __clack_prompts.log.error(error.message);
36661
+ console.error(error);
36662
+ process.exit(1);
36663
+ }
36664
+ if (diffChanged && result) {
36665
+ if (result.androidPaths.length > 0) {
36666
+ __clack_prompts.log.info(import_picocolors$1.default.bold("Changed Android paths:"));
36667
+ for (const path$25 of result.androidPaths) __clack_prompts.log.info(` ${import_picocolors$1.default.green(path$25)}`);
36668
+ }
36669
+ if (result.iosPaths.length > 0) {
36670
+ __clack_prompts.log.info(import_picocolors$1.default.bold("Changed iOS paths:"));
36671
+ for (const path$25 of result.iosPaths) __clack_prompts.log.info(` ${import_picocolors$1.default.green(path$25)}`);
36659
36672
  }
36660
- }]);
36661
- if (diffChanged) {
36662
36673
  __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) {
36674
+ if (localFingerprint && result.fingerprint) {
36664
36675
  const config = await (0, __hot_updater_plugin_core.loadConfig)(null);
36665
36676
  const fingerprintConfig = config.fingerprint;
36666
36677
  try {
36667
- if (localFingerprint.ios && localFingerprint.ios.hash !== newFingerprint.ios.hash) {
36678
+ if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash) {
36668
36679
  const iosDiff = await require_fingerprint.getFingerprintDiff(localFingerprint.ios, {
36669
36680
  platform: "ios",
36670
36681
  ...fingerprintConfig
36671
36682
  });
36672
36683
  require_fingerprint.showFingerprintDiff(iosDiff, "iOS");
36673
36684
  }
36674
- if (localFingerprint.android && localFingerprint.android.hash !== newFingerprint.android.hash) {
36685
+ if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash) {
36675
36686
  const androidDiff = await require_fingerprint.getFingerprintDiff(localFingerprint.android, {
36676
36687
  platform: "android",
36677
36688
  ...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-o6DNNENt.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";
@@ -34473,7 +34473,7 @@ const nativeBuild = async (options) => {
34473
34473
  const localFingerprint = (await readLocalFingerprint())?.[platform$2];
34474
34474
  if (!localFingerprint) p.log.warn(`Resolving fingerprint for ${platform$2} failed. Building native will generate it.`);
34475
34475
  s$1.start(`Fingerprinting (${platform$2})`);
34476
- const generatedFingerprint = (await createAndInjectFingerprintFiles())[platform$2];
34476
+ const generatedFingerprint = (await createAndInjectFingerprintFiles()).fingerprint[platform$2];
34477
34477
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34478
34478
  if (!isFingerprintEquals(localFingerprint, generatedFingerprint)) p.log.info(`${import_picocolors$4.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34479
34479
  target.fingerprintHash = generatedFingerprint.hash;
@@ -35851,26 +35851,26 @@ function merge(target, source) {
35851
35851
  const DEFAULT_CHANNEL$1 = "production";
35852
35852
  const setAndroidChannel = async (channel) => {
35853
35853
  const config = await loadConfig(null);
35854
- const customPaths = config.platform?.android?.stringResourcePaths;
35854
+ const customPaths = config.platform.android.stringResourcePaths;
35855
35855
  const androidParser = new AndroidConfigParser(customPaths);
35856
35856
  return await androidParser.set("hot_updater_channel", channel);
35857
35857
  };
35858
35858
  const getAndroidChannel = async () => {
35859
35859
  const config = await loadConfig(null);
35860
- const customPaths = config.platform?.android?.stringResourcePaths;
35860
+ const customPaths = config.platform.android.stringResourcePaths;
35861
35861
  const androidParser = new AndroidConfigParser(customPaths);
35862
35862
  if (!await androidParser.exists()) throw new Error("No Android strings.xml files found");
35863
35863
  return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
35864
35864
  };
35865
35865
  const setIosChannel = async (channel) => {
35866
35866
  const config = await loadConfig(null);
35867
- const customPaths = config.platform?.ios?.infoPlistPaths;
35867
+ const customPaths = config.platform.ios.infoPlistPaths;
35868
35868
  const iosParser = new IosConfigParser(customPaths);
35869
35869
  return await iosParser.set("HOT_UPDATER_CHANNEL", channel);
35870
35870
  };
35871
35871
  const getIosChannel = async () => {
35872
35872
  const config = await loadConfig(null);
35873
- const customPaths = config.platform?.ios?.infoPlistPaths;
35873
+ const customPaths = config.platform.ios.infoPlistPaths;
35874
35874
  const iosParser = new IosConfigParser(customPaths);
35875
35875
  if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
35876
35876
  return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
@@ -35895,17 +35895,23 @@ const handleChannel = async () => {
35895
35895
  const androidChannel = await getChannel("android");
35896
35896
  const iosChannel = await getChannel("ios");
35897
35897
  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)}`);
35898
+ p.log.info(` from: ${import_picocolors$2.default.blue(androidChannel.paths[0])}`);
35899
35899
  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)}`);
35900
+ p.log.info(` from: ${import_picocolors$2.default.blue(iosChannel.paths[0])}`);
35901
35901
  };
35902
35902
  const handleSetChannel = async (channel) => {
35903
- const { path: androidPath } = await setChannel("android", channel);
35903
+ const { paths: androidPaths } = await setChannel("android", channel);
35904
35904
  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);
35905
+ if (androidPaths.length > 0) {
35906
+ p.log.info(import_picocolors$2.default.bold("Changed Android paths:"));
35907
+ for (const path$6 of androidPaths) p.log.info(` ${import_picocolors$2.default.green(path$6)}`);
35908
+ }
35909
+ const { paths: iosPaths } = await setChannel("ios", channel);
35907
35910
  p.log.success(`Set iOS channel to: ${import_picocolors$2.default.green(channel)}`);
35908
- p.log.info(` from: ${import_picocolors$2.default.blue(iosPath)}`);
35911
+ if (iosPaths.length > 0) {
35912
+ p.log.info(import_picocolors$2.default.bold("Changed iOS paths:"));
35913
+ for (const path$6 of iosPaths) p.log.info(` ${import_picocolors$2.default.green(path$6)}`);
35914
+ }
35909
35915
  p.log.success("You need to rebuild the native app if the channel has changed.");
35910
35916
  };
35911
35917
 
@@ -36648,36 +36654,41 @@ const handleFingerprint = async () => {
36648
36654
  const handleCreateFingerprint = async () => {
36649
36655
  let diffChanged = false;
36650
36656
  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
- }
36657
+ let result = null;
36658
+ const s$1 = p.spinner();
36659
+ s$1.start("Creating fingerprint.json");
36660
+ try {
36661
+ localFingerprint = await readLocalFingerprint();
36662
+ result = await createAndInjectFingerprintFiles();
36663
+ if (!isFingerprintEquals(localFingerprint, result.fingerprint)) diffChanged = true;
36664
+ s$1.stop("Created fingerprint.json");
36665
+ } catch (error) {
36666
+ if (error instanceof Error) p.log.error(error.message);
36667
+ console.error(error);
36668
+ process.exit(1);
36669
+ }
36670
+ if (diffChanged && result) {
36671
+ if (result.androidPaths.length > 0) {
36672
+ p.log.info(import_picocolors$1.default.bold("Changed Android paths:"));
36673
+ for (const path$6 of result.androidPaths) p.log.info(` ${import_picocolors$1.default.green(path$6)}`);
36674
+ }
36675
+ if (result.iosPaths.length > 0) {
36676
+ p.log.info(import_picocolors$1.default.bold("Changed iOS paths:"));
36677
+ for (const path$6 of result.iosPaths) p.log.info(` ${import_picocolors$1.default.green(path$6)}`);
36665
36678
  }
36666
- }]);
36667
- if (diffChanged) {
36668
36679
  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) {
36680
+ if (localFingerprint && result.fingerprint) {
36670
36681
  const config = await loadConfig(null);
36671
36682
  const fingerprintConfig = config.fingerprint;
36672
36683
  try {
36673
- if (localFingerprint.ios && localFingerprint.ios.hash !== newFingerprint.ios.hash) {
36684
+ if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash) {
36674
36685
  const iosDiff = await getFingerprintDiff(localFingerprint.ios, {
36675
36686
  platform: "ios",
36676
36687
  ...fingerprintConfig
36677
36688
  });
36678
36689
  showFingerprintDiff(iosDiff, "iOS");
36679
36690
  }
36680
- if (localFingerprint.android && localFingerprint.android.hash !== newFingerprint.android.hash) {
36691
+ if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash) {
36681
36692
  const androidDiff = await getFingerprintDiff(localFingerprint.android, {
36682
36693
  platform: "android",
36683
36694
  ...fingerprintConfig
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.3",
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/plugin-core": "0.20.3",
57
+ "@hot-updater/console": "0.20.3",
58
+ "@hot-updater/core": "0.20.3"
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/aws": "0.20.3",
90
+ "@hot-updater/cloudflare": "0.20.3",
91
+ "@hot-updater/firebase": "0.20.3",
92
+ "@hot-updater/supabase": "0.20.3"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@hot-updater/aws": "*",