hot-updater 0.36.6 → 0.36.8
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.mjs +80 -69
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
import { C as __require, S as __commonJSMin, _ as IosConfigParser, a as createAndInjectFingerprintFiles, b as require_lib$2, c as generateFingerprints, d as getFingerprintDiff, f as showFingerprintDiff, g as warnIfExpoCNG, h as isMissingFingerprintDependencyError, 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 parsePlist, w as __toESM, x as AndroidConfigParser, y as require_base64_js } from "./keyGeneration-CaZJ23gF.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import fs, { createReadStream, existsSync, realpathSync, statSync } from "fs";
|
|
@@ -27307,9 +27307,9 @@ const initHelp = [
|
|
|
27307
27307
|
"",
|
|
27308
27308
|
"Environment file replay:",
|
|
27309
27309
|
" Re-run init with saved values to reconcile provider infrastructure:",
|
|
27310
|
-
" $ hot-updater init --provider aws --env-file .env.hotupdater",
|
|
27310
|
+
" $ hot-updater init --provider aws --from-env-file .env.hotupdater",
|
|
27311
27311
|
"",
|
|
27312
|
-
" --env-file disables init prompts and reports every missing value.",
|
|
27312
|
+
" --from-env-file disables init prompts and reports every missing value.",
|
|
27313
27313
|
" Interactive init asks once before saving credential inputs for reuse.",
|
|
27314
27314
|
"",
|
|
27315
27315
|
"Provider inputs:",
|
|
@@ -27752,6 +27752,79 @@ async function waitForDeletedBundle(databasePlugin, bundleId) {
|
|
|
27752
27752
|
return false;
|
|
27753
27753
|
}
|
|
27754
27754
|
//#endregion
|
|
27755
|
+
//#region src/utils/setChannel.ts
|
|
27756
|
+
const DEFAULT_CHANNEL$1 = "production";
|
|
27757
|
+
const setAndroidChannel = async (channel) => {
|
|
27758
|
+
const config = await loadConfig(null);
|
|
27759
|
+
return await new AndroidConfigParser(config.platform.android.stringResourcePaths ?? [], config.platform.android.androidManifestPaths ?? []).set("hot_updater_channel", channel);
|
|
27760
|
+
};
|
|
27761
|
+
const getAndroidChannel = async () => {
|
|
27762
|
+
const config = await loadConfig(null);
|
|
27763
|
+
const androidParser = new AndroidConfigParser(config.platform.android.stringResourcePaths ?? [], config.platform.android.androidManifestPaths ?? []);
|
|
27764
|
+
if (!await androidParser.exists()) throw new Error("No Android native config files found");
|
|
27765
|
+
const { value, paths } = await androidParser.get("hot_updater_channel");
|
|
27766
|
+
return {
|
|
27767
|
+
value: value ?? DEFAULT_CHANNEL$1,
|
|
27768
|
+
paths
|
|
27769
|
+
};
|
|
27770
|
+
};
|
|
27771
|
+
const setIosChannel = async (channel) => {
|
|
27772
|
+
const customPaths = (await loadConfig(null)).platform.ios.infoPlistPaths;
|
|
27773
|
+
return await new IosConfigParser(customPaths).set("HOT_UPDATER_CHANNEL", channel);
|
|
27774
|
+
};
|
|
27775
|
+
const getIosChannel = async () => {
|
|
27776
|
+
const customPaths = (await loadConfig(null)).platform.ios.infoPlistPaths;
|
|
27777
|
+
const iosParser = new IosConfigParser(customPaths);
|
|
27778
|
+
if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
|
|
27779
|
+
const { value, paths } = await iosParser.get("HOT_UPDATER_CHANNEL");
|
|
27780
|
+
return {
|
|
27781
|
+
value: value ?? DEFAULT_CHANNEL$1,
|
|
27782
|
+
paths
|
|
27783
|
+
};
|
|
27784
|
+
};
|
|
27785
|
+
const setChannel = async (platform, channel) => {
|
|
27786
|
+
switch (platform) {
|
|
27787
|
+
case "android": return await setAndroidChannel(channel);
|
|
27788
|
+
case "ios": return await setIosChannel(channel);
|
|
27789
|
+
}
|
|
27790
|
+
};
|
|
27791
|
+
const getChannel = async (platform) => {
|
|
27792
|
+
switch (platform) {
|
|
27793
|
+
case "android": return await getAndroidChannel();
|
|
27794
|
+
case "ios": return await getIosChannel();
|
|
27795
|
+
}
|
|
27796
|
+
};
|
|
27797
|
+
//#endregion
|
|
27798
|
+
//#region src/commands/channel.ts
|
|
27799
|
+
const handleChannel = async () => {
|
|
27800
|
+
const androidChannel = await getChannel("android");
|
|
27801
|
+
const iosChannel = await getChannel("ios");
|
|
27802
|
+
p.log.message(ui.block("Channels", [
|
|
27803
|
+
ui.kv("Android", ui.channel(androidChannel.value)),
|
|
27804
|
+
ui.kv("Path", ui.path(androidChannel.paths[0])),
|
|
27805
|
+
ui.kv("iOS", ui.channel(iosChannel.value)),
|
|
27806
|
+
ui.kv("Path", ui.path(iosChannel.paths[0]))
|
|
27807
|
+
]));
|
|
27808
|
+
};
|
|
27809
|
+
const handleSetChannel = async (channel) => {
|
|
27810
|
+
warnIfExpoCNG();
|
|
27811
|
+
const { paths: androidPaths } = await setChannel("android", channel);
|
|
27812
|
+
p.log.success(ui.line([
|
|
27813
|
+
"Set",
|
|
27814
|
+
ui.platform("Android"),
|
|
27815
|
+
ui.channel(channel)
|
|
27816
|
+
]));
|
|
27817
|
+
if (androidPaths.length > 0) p.log.message(ui.block("Android paths", androidPaths.map((targetPath) => ui.kv("Path", ui.path(targetPath)))));
|
|
27818
|
+
const { paths: iosPaths } = await setChannel("ios", channel);
|
|
27819
|
+
p.log.success(ui.line([
|
|
27820
|
+
"Set",
|
|
27821
|
+
ui.platform("iOS"),
|
|
27822
|
+
ui.channel(channel)
|
|
27823
|
+
]));
|
|
27824
|
+
if (iosPaths.length > 0) p.log.message(ui.block("iOS paths", iosPaths.map((targetPath) => ui.kv("Path", ui.path(targetPath)))));
|
|
27825
|
+
p.log.warn("Rebuild native app after changing channel.");
|
|
27826
|
+
};
|
|
27827
|
+
//#endregion
|
|
27755
27828
|
//#region ../../node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
27756
27829
|
/**
|
|
27757
27830
|
* Checks if a given value is a plain object.
|
|
@@ -27876,71 +27949,6 @@ function isMergeableValue(value) {
|
|
|
27876
27949
|
return isPlainObject(value) || Array.isArray(value);
|
|
27877
27950
|
}
|
|
27878
27951
|
//#endregion
|
|
27879
|
-
//#region src/utils/setChannel.ts
|
|
27880
|
-
const DEFAULT_CHANNEL$1 = "production";
|
|
27881
|
-
const setAndroidChannel = async (channel) => {
|
|
27882
|
-
const config = await loadConfig(null);
|
|
27883
|
-
return await new AndroidConfigParser(config.platform.android.stringResourcePaths ?? [], config.platform.android.androidManifestPaths ?? []).set("hot_updater_channel", channel);
|
|
27884
|
-
};
|
|
27885
|
-
const getAndroidChannel = async () => {
|
|
27886
|
-
const config = await loadConfig(null);
|
|
27887
|
-
const androidParser = new AndroidConfigParser(config.platform.android.stringResourcePaths ?? [], config.platform.android.androidManifestPaths ?? []);
|
|
27888
|
-
if (!await androidParser.exists()) throw new Error("No Android native config files found");
|
|
27889
|
-
return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
|
|
27890
|
-
};
|
|
27891
|
-
const setIosChannel = async (channel) => {
|
|
27892
|
-
const customPaths = (await loadConfig(null)).platform.ios.infoPlistPaths;
|
|
27893
|
-
return await new IosConfigParser(customPaths).set("HOT_UPDATER_CHANNEL", channel);
|
|
27894
|
-
};
|
|
27895
|
-
const getIosChannel = async () => {
|
|
27896
|
-
const customPaths = (await loadConfig(null)).platform.ios.infoPlistPaths;
|
|
27897
|
-
const iosParser = new IosConfigParser(customPaths);
|
|
27898
|
-
if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
|
|
27899
|
-
return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
|
|
27900
|
-
};
|
|
27901
|
-
const setChannel = async (platform, channel) => {
|
|
27902
|
-
switch (platform) {
|
|
27903
|
-
case "android": return await setAndroidChannel(channel);
|
|
27904
|
-
case "ios": return await setIosChannel(channel);
|
|
27905
|
-
}
|
|
27906
|
-
};
|
|
27907
|
-
const getChannel = async (platform) => {
|
|
27908
|
-
switch (platform) {
|
|
27909
|
-
case "android": return await getAndroidChannel();
|
|
27910
|
-
case "ios": return await getIosChannel();
|
|
27911
|
-
}
|
|
27912
|
-
};
|
|
27913
|
-
//#endregion
|
|
27914
|
-
//#region src/commands/channel.ts
|
|
27915
|
-
const handleChannel = async () => {
|
|
27916
|
-
const androidChannel = await getChannel("android");
|
|
27917
|
-
const iosChannel = await getChannel("ios");
|
|
27918
|
-
p.log.message(ui.block("Channels", [
|
|
27919
|
-
ui.kv("Android", ui.channel(androidChannel.value)),
|
|
27920
|
-
ui.kv("Path", ui.path(androidChannel.paths[0])),
|
|
27921
|
-
ui.kv("iOS", ui.channel(iosChannel.value)),
|
|
27922
|
-
ui.kv("Path", ui.path(iosChannel.paths[0]))
|
|
27923
|
-
]));
|
|
27924
|
-
};
|
|
27925
|
-
const handleSetChannel = async (channel) => {
|
|
27926
|
-
warnIfExpoCNG();
|
|
27927
|
-
const { paths: androidPaths } = await setChannel("android", channel);
|
|
27928
|
-
p.log.success(ui.line([
|
|
27929
|
-
"Set",
|
|
27930
|
-
ui.platform("Android"),
|
|
27931
|
-
ui.channel(channel)
|
|
27932
|
-
]));
|
|
27933
|
-
if (androidPaths.length > 0) p.log.message(ui.block("Android paths", androidPaths.map((targetPath) => ui.kv("Path", ui.path(targetPath)))));
|
|
27934
|
-
const { paths: iosPaths } = await setChannel("ios", channel);
|
|
27935
|
-
p.log.success(ui.line([
|
|
27936
|
-
"Set",
|
|
27937
|
-
ui.platform("iOS"),
|
|
27938
|
-
ui.channel(channel)
|
|
27939
|
-
]));
|
|
27940
|
-
if (iosPaths.length > 0) p.log.message(ui.block("iOS paths", iosPaths.map((targetPath) => ui.kv("Path", ui.path(targetPath)))));
|
|
27941
|
-
p.log.warn("Rebuild native app after changing channel.");
|
|
27942
|
-
};
|
|
27943
|
-
//#endregion
|
|
27944
27952
|
//#region src/commands/doctorInfrastructureTargets.ts
|
|
27945
27953
|
const UPDATE_TARGETS = [
|
|
27946
27954
|
{
|
|
@@ -50845,7 +50853,10 @@ program.command("init").description("Initialize Hot Updater").addOption(new Opti
|
|
|
50845
50853
|
"bare",
|
|
50846
50854
|
"rock",
|
|
50847
50855
|
"expo"
|
|
50848
|
-
])).option("--env-file <path>", "load saved init inputs and fail if any are missing").addHelpText("after", initHelp).action((options) => init(
|
|
50856
|
+
])).option("--from-env-file <path>", "load saved init inputs and fail if any are missing").addHelpText("after", initHelp).action(({ fromEnvFile, ...options }) => init({
|
|
50857
|
+
...options,
|
|
50858
|
+
envFile: fromEnvFile
|
|
50859
|
+
}));
|
|
50849
50860
|
program.command("doctor").description("Check the health of Hot Updater").option("--server-base-url <url>", "server base URL used by update checks (doctor appends /version)").option("--json", "output machine-readable doctor result").action(handleDoctor);
|
|
50850
50861
|
const fingerprintCommand = program.command("fingerprint").description("Generate fingerprint");
|
|
50851
50862
|
fingerprintCommand.action(handleFingerprint);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hot-updater",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.36.
|
|
4
|
+
"version": "0.36.8",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
7
7
|
},
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"jiti": "2.6.1",
|
|
52
|
-
"@hot-updater/
|
|
53
|
-
"@hot-updater/
|
|
54
|
-
"@hot-updater/
|
|
55
|
-
"@hot-updater/console": "0.36.
|
|
56
|
-
"@hot-updater/core": "0.36.
|
|
57
|
-
"@hot-updater/
|
|
58
|
-
"@hot-updater/
|
|
52
|
+
"@hot-updater/android-helper": "0.36.8",
|
|
53
|
+
"@hot-updater/cli-tools": "0.36.8",
|
|
54
|
+
"@hot-updater/apple-helper": "0.36.8",
|
|
55
|
+
"@hot-updater/console": "0.36.8",
|
|
56
|
+
"@hot-updater/core": "0.36.8",
|
|
57
|
+
"@hot-updater/server": "0.36.8",
|
|
58
|
+
"@hot-updater/plugin-core": "0.36.8"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@bacons/xcode": "1.0.0-alpha.33",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
79
79
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
80
80
|
"verkit": "0.3.2",
|
|
81
|
-
"@hot-updater/
|
|
82
|
-
"@hot-updater/
|
|
83
|
-
"@hot-updater/firebase": "0.36.
|
|
84
|
-
"@hot-updater/server": "0.36.
|
|
85
|
-
"@hot-updater/
|
|
86
|
-
"@hot-updater/
|
|
81
|
+
"@hot-updater/cloudflare": "0.36.8",
|
|
82
|
+
"@hot-updater/aws": "0.36.8",
|
|
83
|
+
"@hot-updater/firebase": "0.36.8",
|
|
84
|
+
"@hot-updater/server": "0.36.8",
|
|
85
|
+
"@hot-updater/supabase": "0.36.8",
|
|
86
|
+
"@hot-updater/test-utils": "0.36.8"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@expo/fingerprint": "*",
|