hot-updater 0.23.0 → 0.24.0
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/config.cjs +8 -6
- package/dist/config.d.cts +16 -1
- package/dist/config.d.ts +16 -1
- package/dist/config.js +2 -2
- package/dist/index.cjs +135 -199
- package/dist/index.js +6 -70
- package/dist/{fingerprint-BHiixsXU.cjs → keyGeneration-BsF6FbpU.cjs} +171 -73
- package/dist/{fingerprint-11-3nNgi.js → keyGeneration-D_2zTEmt.js} +164 -93
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_keyGeneration = require('./keyGeneration-BsF6FbpU.cjs');
|
|
4
4
|
let node_events = require("node:events");
|
|
5
5
|
node_events = require_chunk.__toESM(node_events);
|
|
6
6
|
let node_child_process = require("node:child_process");
|
|
@@ -1091,8 +1091,8 @@ var require_suggestSimilar = /* @__PURE__ */ require_chunk.__commonJS({ "../../n
|
|
|
1091
1091
|
var require_command = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/commander@14.0.0/node_modules/commander/lib/command.js": ((exports) => {
|
|
1092
1092
|
const EventEmitter$1 = require("node:events").EventEmitter;
|
|
1093
1093
|
const childProcess$1 = require("node:child_process");
|
|
1094
|
-
const path$
|
|
1095
|
-
const fs$
|
|
1094
|
+
const path$27 = require("node:path");
|
|
1095
|
+
const fs$19 = require("node:fs");
|
|
1096
1096
|
const process$15 = require("node:process");
|
|
1097
1097
|
const { Argument: Argument$2, humanReadableArgName } = require_argument();
|
|
1098
1098
|
const { CommanderError: CommanderError$2 } = require_error();
|
|
@@ -1985,7 +1985,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1985
1985
|
* @param {string} subcommandName
|
|
1986
1986
|
*/
|
|
1987
1987
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
1988
|
-
if (fs$
|
|
1988
|
+
if (fs$19.existsSync(executableFile)) return;
|
|
1989
1989
|
const executableMissing = `'${executableFile}' does not exist
|
|
1990
1990
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
1991
1991
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
@@ -2008,10 +2008,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2008
2008
|
".cjs"
|
|
2009
2009
|
];
|
|
2010
2010
|
function findFile(baseDir, baseName) {
|
|
2011
|
-
const localBin = path$
|
|
2012
|
-
if (fs$
|
|
2013
|
-
if (sourceExt.includes(path$
|
|
2014
|
-
const foundExt = sourceExt.find((ext) => fs$
|
|
2011
|
+
const localBin = path$27.resolve(baseDir, baseName);
|
|
2012
|
+
if (fs$19.existsSync(localBin)) return localBin;
|
|
2013
|
+
if (sourceExt.includes(path$27.extname(baseName))) return void 0;
|
|
2014
|
+
const foundExt = sourceExt.find((ext) => fs$19.existsSync(`${localBin}${ext}`));
|
|
2015
2015
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2016
2016
|
}
|
|
2017
2017
|
this._checkForMissingMandatoryOptions();
|
|
@@ -2021,21 +2021,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2021
2021
|
if (this._scriptPath) {
|
|
2022
2022
|
let resolvedScriptPath;
|
|
2023
2023
|
try {
|
|
2024
|
-
resolvedScriptPath = fs$
|
|
2024
|
+
resolvedScriptPath = fs$19.realpathSync(this._scriptPath);
|
|
2025
2025
|
} catch {
|
|
2026
2026
|
resolvedScriptPath = this._scriptPath;
|
|
2027
2027
|
}
|
|
2028
|
-
executableDir = path$
|
|
2028
|
+
executableDir = path$27.resolve(path$27.dirname(resolvedScriptPath), executableDir);
|
|
2029
2029
|
}
|
|
2030
2030
|
if (executableDir) {
|
|
2031
2031
|
let localFile = findFile(executableDir, executableFile);
|
|
2032
2032
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2033
|
-
const legacyName = path$
|
|
2033
|
+
const legacyName = path$27.basename(this._scriptPath, path$27.extname(this._scriptPath));
|
|
2034
2034
|
if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
2035
2035
|
}
|
|
2036
2036
|
executableFile = localFile || executableFile;
|
|
2037
2037
|
}
|
|
2038
|
-
launchWithNode = sourceExt.includes(path$
|
|
2038
|
+
launchWithNode = sourceExt.includes(path$27.extname(executableFile));
|
|
2039
2039
|
let proc;
|
|
2040
2040
|
if (process$15.platform !== "win32") if (launchWithNode) {
|
|
2041
2041
|
args.unshift(executableFile);
|
|
@@ -2804,7 +2804,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2804
2804
|
* @return {Command}
|
|
2805
2805
|
*/
|
|
2806
2806
|
nameFromFilename(filename) {
|
|
2807
|
-
this._name = path$
|
|
2807
|
+
this._name = path$27.basename(filename, path$27.extname(filename));
|
|
2808
2808
|
return this;
|
|
2809
2809
|
}
|
|
2810
2810
|
/**
|
|
@@ -2818,9 +2818,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2818
2818
|
* @param {string} [path]
|
|
2819
2819
|
* @return {(string|null|Command)}
|
|
2820
2820
|
*/
|
|
2821
|
-
executableDir(path$
|
|
2822
|
-
if (path$
|
|
2823
|
-
this._executableDir = path$
|
|
2821
|
+
executableDir(path$28) {
|
|
2822
|
+
if (path$28 === void 0) return this._executableDir;
|
|
2823
|
+
this._executableDir = path$28;
|
|
2824
2824
|
return this;
|
|
2825
2825
|
}
|
|
2826
2826
|
/**
|
|
@@ -4715,29 +4715,29 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
4715
4715
|
var require_windows = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js": ((exports, module) => {
|
|
4716
4716
|
module.exports = isexe$3;
|
|
4717
4717
|
isexe$3.sync = sync$2;
|
|
4718
|
-
var fs$
|
|
4719
|
-
function checkPathExt(path$
|
|
4718
|
+
var fs$18 = require("fs");
|
|
4719
|
+
function checkPathExt(path$28, options) {
|
|
4720
4720
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
4721
4721
|
if (!pathext) return true;
|
|
4722
4722
|
pathext = pathext.split(";");
|
|
4723
4723
|
if (pathext.indexOf("") !== -1) return true;
|
|
4724
4724
|
for (var i$1 = 0; i$1 < pathext.length; i$1++) {
|
|
4725
4725
|
var p$16 = pathext[i$1].toLowerCase();
|
|
4726
|
-
if (p$16 && path$
|
|
4726
|
+
if (p$16 && path$28.substr(-p$16.length).toLowerCase() === p$16) return true;
|
|
4727
4727
|
}
|
|
4728
4728
|
return false;
|
|
4729
4729
|
}
|
|
4730
|
-
function checkStat$1(stat, path$
|
|
4730
|
+
function checkStat$1(stat, path$28, options) {
|
|
4731
4731
|
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
|
|
4732
|
-
return checkPathExt(path$
|
|
4732
|
+
return checkPathExt(path$28, options);
|
|
4733
4733
|
}
|
|
4734
|
-
function isexe$3(path$
|
|
4735
|
-
fs$
|
|
4736
|
-
cb(er, er ? false : checkStat$1(stat, path$
|
|
4734
|
+
function isexe$3(path$28, options, cb) {
|
|
4735
|
+
fs$18.stat(path$28, function(er, stat) {
|
|
4736
|
+
cb(er, er ? false : checkStat$1(stat, path$28, options));
|
|
4737
4737
|
});
|
|
4738
4738
|
}
|
|
4739
|
-
function sync$2(path$
|
|
4740
|
-
return checkStat$1(fs$
|
|
4739
|
+
function sync$2(path$28, options) {
|
|
4740
|
+
return checkStat$1(fs$18.statSync(path$28), path$28, options);
|
|
4741
4741
|
}
|
|
4742
4742
|
}) });
|
|
4743
4743
|
|
|
@@ -4746,14 +4746,14 @@ var require_windows = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
|
|
|
4746
4746
|
var require_mode = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js": ((exports, module) => {
|
|
4747
4747
|
module.exports = isexe$2;
|
|
4748
4748
|
isexe$2.sync = sync$1;
|
|
4749
|
-
var fs$
|
|
4750
|
-
function isexe$2(path$
|
|
4751
|
-
fs$
|
|
4749
|
+
var fs$17 = require("fs");
|
|
4750
|
+
function isexe$2(path$28, options, cb) {
|
|
4751
|
+
fs$17.stat(path$28, function(er, stat) {
|
|
4752
4752
|
cb(er, er ? false : checkStat(stat, options));
|
|
4753
4753
|
});
|
|
4754
4754
|
}
|
|
4755
|
-
function sync$1(path$
|
|
4756
|
-
return checkStat(fs$
|
|
4755
|
+
function sync$1(path$28, options) {
|
|
4756
|
+
return checkStat(fs$17.statSync(path$28), options);
|
|
4757
4757
|
}
|
|
4758
4758
|
function checkStat(stat, options) {
|
|
4759
4759
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -4781,7 +4781,7 @@ var require_isexe = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4781
4781
|
else core = require_mode();
|
|
4782
4782
|
module.exports = isexe$1;
|
|
4783
4783
|
isexe$1.sync = sync;
|
|
4784
|
-
function isexe$1(path$
|
|
4784
|
+
function isexe$1(path$28, options, cb) {
|
|
4785
4785
|
if (typeof options === "function") {
|
|
4786
4786
|
cb = options;
|
|
4787
4787
|
options = {};
|
|
@@ -4789,13 +4789,13 @@ var require_isexe = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4789
4789
|
if (!cb) {
|
|
4790
4790
|
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
4791
4791
|
return new Promise(function(resolve, reject) {
|
|
4792
|
-
isexe$1(path$
|
|
4792
|
+
isexe$1(path$28, options || {}, function(er, is) {
|
|
4793
4793
|
if (er) reject(er);
|
|
4794
4794
|
else resolve(is);
|
|
4795
4795
|
});
|
|
4796
4796
|
});
|
|
4797
4797
|
}
|
|
4798
|
-
core(path$
|
|
4798
|
+
core(path$28, options || {}, function(er, is) {
|
|
4799
4799
|
if (er) {
|
|
4800
4800
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
4801
4801
|
er = null;
|
|
@@ -4805,9 +4805,9 @@ var require_isexe = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4805
4805
|
cb(er, is);
|
|
4806
4806
|
});
|
|
4807
4807
|
}
|
|
4808
|
-
function sync(path$
|
|
4808
|
+
function sync(path$28, options) {
|
|
4809
4809
|
try {
|
|
4810
|
-
return core.sync(path$
|
|
4810
|
+
return core.sync(path$28, options || {});
|
|
4811
4811
|
} catch (er) {
|
|
4812
4812
|
if (options && options.ignoreErrors || er.code === "EACCES") return false;
|
|
4813
4813
|
else throw er;
|
|
@@ -4819,7 +4819,7 @@ var require_isexe = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4819
4819
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
4820
4820
|
var require_which = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js": ((exports, module) => {
|
|
4821
4821
|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4822
|
-
const path$
|
|
4822
|
+
const path$26 = require("path");
|
|
4823
4823
|
const COLON = isWindows ? ";" : ":";
|
|
4824
4824
|
const isexe = require_isexe();
|
|
4825
4825
|
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -4849,7 +4849,7 @@ var require_which = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4849
4849
|
if (i$1 === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
4850
4850
|
const ppRaw = pathEnv[i$1];
|
|
4851
4851
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4852
|
-
const pCmd = path$
|
|
4852
|
+
const pCmd = path$26.join(pathPart, cmd);
|
|
4853
4853
|
resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i$1, 0));
|
|
4854
4854
|
});
|
|
4855
4855
|
const subStep = (p$16, i$1, ii) => new Promise((resolve, reject) => {
|
|
@@ -4870,7 +4870,7 @@ var require_which = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
4870
4870
|
for (let i$1 = 0; i$1 < pathEnv.length; i$1++) {
|
|
4871
4871
|
const ppRaw = pathEnv[i$1];
|
|
4872
4872
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
4873
|
-
const pCmd = path$
|
|
4873
|
+
const pCmd = path$26.join(pathPart, cmd);
|
|
4874
4874
|
const p$16 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
4875
4875
|
for (let j = 0; j < pathExt.length; j++) {
|
|
4876
4876
|
const cur = p$16 + pathExt[j];
|
|
@@ -4903,7 +4903,7 @@ var require_path_key = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mo
|
|
|
4903
4903
|
//#endregion
|
|
4904
4904
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
4905
4905
|
var require_resolveCommand = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js": ((exports, module) => {
|
|
4906
|
-
const path$
|
|
4906
|
+
const path$25 = require("path");
|
|
4907
4907
|
const which = require_which();
|
|
4908
4908
|
const getPathKey = require_path_key();
|
|
4909
4909
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -4918,12 +4918,12 @@ var require_resolveCommand = /* @__PURE__ */ require_chunk.__commonJS({ "../../n
|
|
|
4918
4918
|
try {
|
|
4919
4919
|
resolved = which.sync(parsed.command, {
|
|
4920
4920
|
path: env$2[getPathKey({ env: env$2 })],
|
|
4921
|
-
pathExt: withoutPathExt ? path$
|
|
4921
|
+
pathExt: withoutPathExt ? path$25.delimiter : void 0
|
|
4922
4922
|
});
|
|
4923
4923
|
} catch (e) {} finally {
|
|
4924
4924
|
if (shouldSwitchCwd) process.chdir(cwd);
|
|
4925
4925
|
}
|
|
4926
|
-
if (resolved) resolved = path$
|
|
4926
|
+
if (resolved) resolved = path$25.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
4927
4927
|
return resolved;
|
|
4928
4928
|
}
|
|
4929
4929
|
function resolveCommand$1(parsed) {
|
|
@@ -4966,8 +4966,8 @@ var require_shebang_command = /* @__PURE__ */ require_chunk.__commonJS({ "../../
|
|
|
4966
4966
|
module.exports = (string = "") => {
|
|
4967
4967
|
const match = string.match(shebangRegex);
|
|
4968
4968
|
if (!match) return null;
|
|
4969
|
-
const [path$
|
|
4970
|
-
const binary = path$
|
|
4969
|
+
const [path$28, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
4970
|
+
const binary = path$28.split("/").pop();
|
|
4971
4971
|
if (binary === "env") return argument;
|
|
4972
4972
|
return argument ? `${binary} ${argument}` : binary;
|
|
4973
4973
|
};
|
|
@@ -4976,16 +4976,16 @@ var require_shebang_command = /* @__PURE__ */ require_chunk.__commonJS({ "../../
|
|
|
4976
4976
|
//#endregion
|
|
4977
4977
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
4978
4978
|
var require_readShebang = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js": ((exports, module) => {
|
|
4979
|
-
const fs$
|
|
4979
|
+
const fs$16 = require("fs");
|
|
4980
4980
|
const shebangCommand = require_shebang_command();
|
|
4981
4981
|
function readShebang$1(command) {
|
|
4982
4982
|
const size = 150;
|
|
4983
4983
|
const buffer = Buffer.alloc(size);
|
|
4984
4984
|
let fd;
|
|
4985
4985
|
try {
|
|
4986
|
-
fd = fs$
|
|
4987
|
-
fs$
|
|
4988
|
-
fs$
|
|
4986
|
+
fd = fs$16.openSync(command, "r");
|
|
4987
|
+
fs$16.readSync(fd, buffer, 0, size, 0);
|
|
4988
|
+
fs$16.closeSync(fd);
|
|
4989
4989
|
} catch (e) {}
|
|
4990
4990
|
return shebangCommand(buffer.toString());
|
|
4991
4991
|
}
|
|
@@ -4995,7 +4995,7 @@ var require_readShebang = /* @__PURE__ */ require_chunk.__commonJS({ "../../node
|
|
|
4995
4995
|
//#endregion
|
|
4996
4996
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
4997
4997
|
var require_parse$4 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js": ((exports, module) => {
|
|
4998
|
-
const path$
|
|
4998
|
+
const path$24 = require("path");
|
|
4999
4999
|
const resolveCommand = require_resolveCommand();
|
|
5000
5000
|
const escape = require_escape();
|
|
5001
5001
|
const readShebang = require_readShebang();
|
|
@@ -5018,7 +5018,7 @@ var require_parse$4 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
|
|
|
5018
5018
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
5019
5019
|
if (parsed.options.forceShell || needsShell) {
|
|
5020
5020
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
5021
|
-
parsed.command = path$
|
|
5021
|
+
parsed.command = path$24.normalize(parsed.command);
|
|
5022
5022
|
parsed.command = escape.command(parsed.command);
|
|
5023
5023
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
5024
5024
|
parsed.args = [
|
|
@@ -8103,12 +8103,12 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
|
|
|
8103
8103
|
}
|
|
8104
8104
|
};
|
|
8105
8105
|
const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
8106
|
-
for (const { path: path$
|
|
8107
|
-
const pathString = typeof path$
|
|
8108
|
-
if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$
|
|
8106
|
+
for (const { path: path$28, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
|
|
8107
|
+
const pathString = typeof path$28 === "string" ? path$28 : path$28.toString();
|
|
8108
|
+
if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$28, serializedResult);
|
|
8109
8109
|
else {
|
|
8110
8110
|
outputFiles.add(pathString);
|
|
8111
|
-
(0, node_fs.writeFileSync)(path$
|
|
8111
|
+
(0, node_fs.writeFileSync)(path$28, serializedResult);
|
|
8112
8112
|
}
|
|
8113
8113
|
}
|
|
8114
8114
|
};
|
|
@@ -14529,13 +14529,13 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14529
14529
|
const defaults = {
|
|
14530
14530
|
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14531
14531
|
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14532
|
-
edittemplate: ({ domain, user, project, committish, editpath, path: path$
|
|
14532
|
+
edittemplate: ({ domain, user, project, committish, editpath, path: path$28 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path$28)}`,
|
|
14533
14533
|
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
14534
|
-
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$
|
|
14535
|
-
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$
|
|
14534
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$28, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path$28}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14535
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$28, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path$28}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14536
14536
|
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
14537
14537
|
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14538
|
-
filetemplate: ({ domain, user, project, committish, path: path$
|
|
14538
|
+
filetemplate: ({ domain, user, project, committish, path: path$28 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path$28}`,
|
|
14539
14539
|
shortcuttemplate: ({ type: type$1, user, project, committish }) => `${type$1}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
14540
14540
|
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
14541
14541
|
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
@@ -14555,7 +14555,7 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14555
14555
|
treepath: "tree",
|
|
14556
14556
|
blobpath: "blob",
|
|
14557
14557
|
editpath: "edit",
|
|
14558
|
-
filetemplate: ({ auth, user, project, committish, path: path$
|
|
14558
|
+
filetemplate: ({ auth, user, project, committish, path: path$28 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path$28}`,
|
|
14559
14559
|
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14560
14560
|
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14561
14561
|
extract: (url$2) => {
|
|
@@ -14582,7 +14582,7 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14582
14582
|
treepath: "src",
|
|
14583
14583
|
blobpath: "src",
|
|
14584
14584
|
editpath: "?mode=edit",
|
|
14585
|
-
edittemplate: ({ domain, user, project, committish, treepath, path: path$
|
|
14585
|
+
edittemplate: ({ domain, user, project, committish, treepath, path: path$28, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path$28, editpath)}`,
|
|
14586
14586
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
14587
14587
|
extract: (url$2) => {
|
|
14588
14588
|
let [, user, project, aux] = url$2.pathname.split("/", 4);
|
|
@@ -14610,9 +14610,9 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14610
14610
|
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14611
14611
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
|
|
14612
14612
|
extract: (url$2) => {
|
|
14613
|
-
const path$
|
|
14614
|
-
if (path$
|
|
14615
|
-
const segments = path$
|
|
14613
|
+
const path$28 = url$2.pathname.slice(1);
|
|
14614
|
+
if (path$28.includes("/-/") || path$28.includes("/archive.tar.gz")) return;
|
|
14615
|
+
const segments = path$28.split("/");
|
|
14616
14616
|
let project = segments.pop();
|
|
14617
14617
|
if (project.endsWith(".git")) project = project.slice(0, -4);
|
|
14618
14618
|
const user = segments.join("/");
|
|
@@ -14638,11 +14638,11 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14638
14638
|
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14639
14639
|
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
14640
14640
|
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14641
|
-
browsetreetemplate: ({ domain, project, committish, path: path$
|
|
14642
|
-
browseblobtemplate: ({ domain, project, committish, path: path$
|
|
14641
|
+
browsetreetemplate: ({ domain, project, committish, path: path$28, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$28))}`,
|
|
14642
|
+
browseblobtemplate: ({ domain, project, committish, path: path$28, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$28))}`,
|
|
14643
14643
|
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14644
14644
|
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14645
|
-
filetemplate: ({ user, project, committish, path: path$
|
|
14645
|
+
filetemplate: ({ user, project, committish, path: path$28 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path$28}`,
|
|
14646
14646
|
shortcuttemplate: ({ type: type$1, project, committish }) => `${type$1}:${project}${maybeJoin("#", committish)}`,
|
|
14647
14647
|
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
14648
14648
|
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
@@ -14672,7 +14672,7 @@ var require_hosts = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14672
14672
|
domain: "git.sr.ht",
|
|
14673
14673
|
treepath: "tree",
|
|
14674
14674
|
blobpath: "tree",
|
|
14675
|
-
filetemplate: ({ domain, user, project, committish, path: path$
|
|
14675
|
+
filetemplate: ({ domain, user, project, committish, path: path$28 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path$28}`,
|
|
14676
14676
|
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14677
14677
|
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
14678
14678
|
bugstemplate: () => null,
|
|
@@ -14882,27 +14882,27 @@ var require_lib$2 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14882
14882
|
sshurl(opts) {
|
|
14883
14883
|
return this.#fill(this.sshurltemplate, opts);
|
|
14884
14884
|
}
|
|
14885
|
-
browse(path$
|
|
14886
|
-
if (typeof path$
|
|
14885
|
+
browse(path$28, ...args) {
|
|
14886
|
+
if (typeof path$28 !== "string") return this.#fill(this.browsetemplate, path$28);
|
|
14887
14887
|
if (typeof args[0] !== "string") return this.#fill(this.browsetreetemplate, {
|
|
14888
14888
|
...args[0],
|
|
14889
|
-
path: path$
|
|
14889
|
+
path: path$28
|
|
14890
14890
|
});
|
|
14891
14891
|
return this.#fill(this.browsetreetemplate, {
|
|
14892
14892
|
...args[1],
|
|
14893
14893
|
fragment: args[0],
|
|
14894
|
-
path: path$
|
|
14894
|
+
path: path$28
|
|
14895
14895
|
});
|
|
14896
14896
|
}
|
|
14897
|
-
browseFile(path$
|
|
14897
|
+
browseFile(path$28, ...args) {
|
|
14898
14898
|
if (typeof args[0] !== "string") return this.#fill(this.browseblobtemplate, {
|
|
14899
14899
|
...args[0],
|
|
14900
|
-
path: path$
|
|
14900
|
+
path: path$28
|
|
14901
14901
|
});
|
|
14902
14902
|
return this.#fill(this.browseblobtemplate, {
|
|
14903
14903
|
...args[1],
|
|
14904
14904
|
fragment: args[0],
|
|
14905
|
-
path: path$
|
|
14905
|
+
path: path$28
|
|
14906
14906
|
});
|
|
14907
14907
|
}
|
|
14908
14908
|
docs(opts) {
|
|
@@ -14929,16 +14929,16 @@ var require_lib$2 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
14929
14929
|
noCommittish: false
|
|
14930
14930
|
});
|
|
14931
14931
|
}
|
|
14932
|
-
file(path$
|
|
14932
|
+
file(path$28, opts) {
|
|
14933
14933
|
return this.#fill(this.filetemplate, {
|
|
14934
14934
|
...opts,
|
|
14935
|
-
path: path$
|
|
14935
|
+
path: path$28
|
|
14936
14936
|
});
|
|
14937
14937
|
}
|
|
14938
|
-
edit(path$
|
|
14938
|
+
edit(path$28, opts) {
|
|
14939
14939
|
return this.#fill(this.edittemplate, {
|
|
14940
14940
|
...opts,
|
|
14941
|
-
path: path$
|
|
14941
|
+
path: path$28
|
|
14942
14942
|
});
|
|
14943
14943
|
}
|
|
14944
14944
|
getDefaultRepresentation() {
|
|
@@ -27881,7 +27881,7 @@ var require_build$2 = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_mod
|
|
|
27881
27881
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
27882
27882
|
};
|
|
27883
27883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27884
|
-
const base64_js_1 = __importDefault$8(
|
|
27884
|
+
const base64_js_1 = __importDefault$8(require_keyGeneration.require_base64_js());
|
|
27885
27885
|
const xmlbuilder_1 = __importDefault$8(require_lib$1());
|
|
27886
27886
|
/**
|
|
27887
27887
|
* Accepts a `Date` instance and returns an ISO date string.
|
|
@@ -33537,8 +33537,8 @@ var require_XcodeProject = /* @__PURE__ */ require_chunk.__commonJS({ "../../nod
|
|
|
33537
33537
|
const json$3 = __importStar$3(require_types());
|
|
33538
33538
|
const constants_1$2 = require_constants();
|
|
33539
33539
|
const debug$1 = require_src()("xcparse:model:XcodeProject");
|
|
33540
|
-
function uuidForPath(path$
|
|
33541
|
-
return "XX" + crypto_1.default.createHash("md5").update(path$
|
|
33540
|
+
function uuidForPath(path$28) {
|
|
33541
|
+
return "XX" + crypto_1.default.createHash("md5").update(path$28).digest("hex").toUpperCase().slice(0, 20) + "XX";
|
|
33542
33542
|
}
|
|
33543
33543
|
const KNOWN_ISA = {
|
|
33544
33544
|
[json$3.ISA.PBXBuildFile]: () => require_PBXBuildFile().PBXBuildFile,
|
|
@@ -33899,8 +33899,8 @@ var require_PBXFileReference = /* @__PURE__ */ require_chunk.__commonJS({ "../..
|
|
|
33899
33899
|
getProxyContainers() {
|
|
33900
33900
|
return Array.from(this.getXcodeProject().values()).filter((object) => PBXContainerItemProxy_1$1.PBXContainerItemProxy.is(object) && object.props.containerPortal.uuid === this.uuid);
|
|
33901
33901
|
}
|
|
33902
|
-
setPath(path$
|
|
33903
|
-
if (path$
|
|
33902
|
+
setPath(path$28) {
|
|
33903
|
+
if (path$28) setPathWithSourceTree(this, path$28, this.props.sourceTree);
|
|
33904
33904
|
else this.props.path = void 0;
|
|
33905
33905
|
}
|
|
33906
33906
|
getBuildFiles() {
|
|
@@ -34026,8 +34026,8 @@ var require_AbstractGroup = /* @__PURE__ */ require_chunk.__commonJS({ "../../no
|
|
|
34026
34026
|
* @return `PBXGroup` the group if found.
|
|
34027
34027
|
* @return `null` if the `path` could not be found and `shouldCreate` is `false`.
|
|
34028
34028
|
*/
|
|
34029
|
-
mkdir(path$
|
|
34030
|
-
let pathArr = typeof path$
|
|
34029
|
+
mkdir(path$28, { recursive } = {}) {
|
|
34030
|
+
let pathArr = typeof path$28 === "string" ? path$28.split("/") : path$28;
|
|
34031
34031
|
if (!pathArr.length) return this;
|
|
34032
34032
|
let childName = pathArr.shift();
|
|
34033
34033
|
let child = this.getChildGroups().find((c$1) => c$1.getDisplayName() === childName);
|
|
@@ -34035,7 +34035,7 @@ var require_AbstractGroup = /* @__PURE__ */ require_chunk.__commonJS({ "../../no
|
|
|
34035
34035
|
if (!recursive) return null;
|
|
34036
34036
|
child = this.createGroup({ path: childName });
|
|
34037
34037
|
}
|
|
34038
|
-
if (!path$
|
|
34038
|
+
if (!path$28.length) return child;
|
|
34039
34039
|
return child.mkdir(pathArr, { recursive });
|
|
34040
34040
|
}
|
|
34041
34041
|
getChildGroups() {
|
|
@@ -34045,9 +34045,9 @@ var require_AbstractGroup = /* @__PURE__ */ require_chunk.__commonJS({ "../../no
|
|
|
34045
34045
|
let prefix = "";
|
|
34046
34046
|
if (type$1 == "staticLibrary") prefix = "lib";
|
|
34047
34047
|
let extension = constants_1.PRODUCT_UTI_EXTENSIONS[type$1];
|
|
34048
|
-
let path$
|
|
34049
|
-
if (extension) path$
|
|
34050
|
-
let ref = newReference(this, path$
|
|
34048
|
+
let path$28 = `${prefix}${productBaseName}`;
|
|
34049
|
+
if (extension) path$28 += `.${extension}`;
|
|
34050
|
+
let ref = newReference(this, path$28, "BUILT_PRODUCTS_DIR");
|
|
34051
34051
|
ref.props.includeInIndex = 0;
|
|
34052
34052
|
ref.setExplicitFileType();
|
|
34053
34053
|
return ref;
|
|
@@ -34415,8 +34415,8 @@ var require_build = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modul
|
|
|
34415
34415
|
//#endregion
|
|
34416
34416
|
//#region src/utils/getIosAppTargetDirectoryName.ts
|
|
34417
34417
|
var import_build = /* @__PURE__ */ require_chunk.__toESM(require_build(), 1);
|
|
34418
|
-
var import_plist = /* @__PURE__ */ require_chunk.__toESM(
|
|
34419
|
-
var import_out$1 = /* @__PURE__ */ require_chunk.__toESM(
|
|
34418
|
+
var import_plist = /* @__PURE__ */ require_chunk.__toESM(require_keyGeneration.require_plist(), 1);
|
|
34419
|
+
var import_out$1 = /* @__PURE__ */ require_chunk.__toESM(require_keyGeneration.require_out(), 1);
|
|
34420
34420
|
const getIosAppTargetDirectoryName = () => {
|
|
34421
34421
|
const iosDirectory = path.default.join((0, __hot_updater_cli_tools.getCwd)(), "ios");
|
|
34422
34422
|
const [xcodeprojPath] = import_out$1.default.globSync("*.xcodeproj/project.pbxproj", {
|
|
@@ -34429,11 +34429,11 @@ const getIosAppTargetDirectoryName = () => {
|
|
|
34429
34429
|
|
|
34430
34430
|
//#endregion
|
|
34431
34431
|
//#region src/utils/version/getIOSVersion.ts
|
|
34432
|
-
var import_out = /* @__PURE__ */ require_chunk.__toESM(
|
|
34432
|
+
var import_out = /* @__PURE__ */ require_chunk.__toESM(require_keyGeneration.require_out(), 1);
|
|
34433
34433
|
var import_valid$3 = /* @__PURE__ */ require_chunk.__toESM(require_valid$2(), 1);
|
|
34434
|
-
const isFileExist = async (path$
|
|
34434
|
+
const isFileExist = async (path$28) => {
|
|
34435
34435
|
try {
|
|
34436
|
-
await fs_promises.default.access(path$
|
|
34436
|
+
await fs_promises.default.access(path$28);
|
|
34437
34437
|
return true;
|
|
34438
34438
|
} catch {
|
|
34439
34439
|
return false;
|
|
@@ -34519,12 +34519,12 @@ const nativeBuild = async (options) => {
|
|
|
34519
34519
|
};
|
|
34520
34520
|
if (config.updateStrategy === "fingerprint") {
|
|
34521
34521
|
const s$1 = __hot_updater_cli_tools.p.spinner();
|
|
34522
|
-
const localFingerprint = (await
|
|
34522
|
+
const localFingerprint = (await require_keyGeneration.readLocalFingerprint())?.[platform$2];
|
|
34523
34523
|
if (!localFingerprint) __hot_updater_cli_tools.p.log.warn(`Resolving fingerprint for ${platform$2} failed. Building native will generate it.`);
|
|
34524
34524
|
s$1.start(`Fingerprinting (${platform$2})`);
|
|
34525
|
-
const generatedFingerprint = (await
|
|
34525
|
+
const generatedFingerprint = (await require_keyGeneration.createAndInjectFingerprintFiles()).fingerprint[platform$2];
|
|
34526
34526
|
s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
|
|
34527
|
-
if (!
|
|
34527
|
+
if (!require_keyGeneration.isFingerprintEquals(localFingerprint, generatedFingerprint)) __hot_updater_cli_tools.p.log.info(`${__hot_updater_cli_tools.colors.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
|
|
34528
34528
|
target.fingerprintHash = generatedFingerprint.hash;
|
|
34529
34529
|
} else if (config.updateStrategy === "appVersion") {
|
|
34530
34530
|
const s$1 = __hot_updater_cli_tools.p.spinner();
|
|
@@ -35467,74 +35467,6 @@ const appendOutputDirectoryIntoGitignore = ({ cwd } = {}) => {
|
|
|
35467
35467
|
});
|
|
35468
35468
|
};
|
|
35469
35469
|
|
|
35470
|
-
//#endregion
|
|
35471
|
-
//#region src/utils/signing/keyGeneration.ts
|
|
35472
|
-
/**
|
|
35473
|
-
* Generate RSA key pair for bundle signing.
|
|
35474
|
-
* @param keySize Key size in bits (2048 or 4096)
|
|
35475
|
-
* @returns Promise resolving to key pair in PEM format
|
|
35476
|
-
*/
|
|
35477
|
-
async function generateKeyPair(keySize = 4096) {
|
|
35478
|
-
return new Promise((resolve, reject) => {
|
|
35479
|
-
node_crypto.default.generateKeyPair("rsa", {
|
|
35480
|
-
modulusLength: keySize,
|
|
35481
|
-
publicKeyEncoding: {
|
|
35482
|
-
type: "spki",
|
|
35483
|
-
format: "pem"
|
|
35484
|
-
},
|
|
35485
|
-
privateKeyEncoding: {
|
|
35486
|
-
type: "pkcs8",
|
|
35487
|
-
format: "pem"
|
|
35488
|
-
}
|
|
35489
|
-
}, (err, publicKey, privateKey) => {
|
|
35490
|
-
if (err) reject(err);
|
|
35491
|
-
else resolve({
|
|
35492
|
-
privateKey,
|
|
35493
|
-
publicKey
|
|
35494
|
-
});
|
|
35495
|
-
});
|
|
35496
|
-
});
|
|
35497
|
-
}
|
|
35498
|
-
/**
|
|
35499
|
-
* Save key pair to disk with secure permissions.
|
|
35500
|
-
* @param keyPair Generated key pair
|
|
35501
|
-
* @param outputDir Directory to save keys
|
|
35502
|
-
*/
|
|
35503
|
-
async function saveKeyPair(keyPair, outputDir) {
|
|
35504
|
-
await node_fs_promises.default.mkdir(outputDir, { recursive: true });
|
|
35505
|
-
const privateKeyPath = node_path.default.join(outputDir, "private-key.pem");
|
|
35506
|
-
const publicKeyPath = node_path.default.join(outputDir, "public-key.pem");
|
|
35507
|
-
await node_fs_promises.default.writeFile(privateKeyPath, keyPair.privateKey, { mode: 384 });
|
|
35508
|
-
await node_fs_promises.default.writeFile(publicKeyPath, keyPair.publicKey, { mode: 420 });
|
|
35509
|
-
}
|
|
35510
|
-
/**
|
|
35511
|
-
* Load private key from PEM file.
|
|
35512
|
-
* @param privateKeyPath Path to private key file
|
|
35513
|
-
* @returns Private key in PEM format
|
|
35514
|
-
* @throws Error if file not found or invalid format
|
|
35515
|
-
*/
|
|
35516
|
-
async function loadPrivateKey(privateKeyPath) {
|
|
35517
|
-
try {
|
|
35518
|
-
const privateKey = await node_fs_promises.default.readFile(privateKeyPath, "utf-8");
|
|
35519
|
-
node_crypto.default.createPrivateKey(privateKey);
|
|
35520
|
-
return privateKey;
|
|
35521
|
-
} catch (error) {
|
|
35522
|
-
throw new Error(`Failed to load private key from ${privateKeyPath}: ${error.message}`);
|
|
35523
|
-
}
|
|
35524
|
-
}
|
|
35525
|
-
/**
|
|
35526
|
-
* Extract public key from private key.
|
|
35527
|
-
* @param privateKeyPEM Private key in PEM format
|
|
35528
|
-
* @returns Public key in PEM format
|
|
35529
|
-
*/
|
|
35530
|
-
function getPublicKeyFromPrivate(privateKeyPEM) {
|
|
35531
|
-
const privateKey = node_crypto.default.createPrivateKey(privateKeyPEM);
|
|
35532
|
-
return node_crypto.default.createPublicKey(privateKey).export({
|
|
35533
|
-
type: "spki",
|
|
35534
|
-
format: "pem"
|
|
35535
|
-
});
|
|
35536
|
-
}
|
|
35537
|
-
|
|
35538
35470
|
//#endregion
|
|
35539
35471
|
//#region src/utils/signing/bundleSigning.ts
|
|
35540
35472
|
/**
|
|
@@ -35544,7 +35476,7 @@ function getPublicKeyFromPrivate(privateKeyPEM) {
|
|
|
35544
35476
|
* @returns Base64-encoded RSA-SHA256 signature
|
|
35545
35477
|
*/
|
|
35546
35478
|
async function signBundle(fileHash, privateKeyPath) {
|
|
35547
|
-
const privateKeyPEM = await loadPrivateKey(privateKeyPath);
|
|
35479
|
+
const privateKeyPEM = await require_keyGeneration.loadPrivateKey(privateKeyPath);
|
|
35548
35480
|
const fileHashBuffer = Buffer.from(fileHash, "hex");
|
|
35549
35481
|
const sign = node_crypto.default.createSign("RSA-SHA256");
|
|
35550
35482
|
sign.update(fileHashBuffer);
|
|
@@ -35562,8 +35494,8 @@ const IOS_KEY$1 = "HOT_UPDATER_PUBLIC_KEY";
|
|
|
35562
35494
|
*/
|
|
35563
35495
|
async function validateSigningConfig(config) {
|
|
35564
35496
|
const signingEnabled = config.signing?.enabled ?? false;
|
|
35565
|
-
const iosParser = new
|
|
35566
|
-
const androidParser = new
|
|
35497
|
+
const iosParser = new require_keyGeneration.IosConfigParser(config.platform.ios.infoPlistPaths);
|
|
35498
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(config.platform.android.stringResourcePaths);
|
|
35567
35499
|
const [iosExists, androidExists] = await Promise.all([iosParser.exists(), androidParser.exists()]);
|
|
35568
35500
|
const [iosResult, androidResult] = await Promise.all([iosExists ? iosParser.get(IOS_KEY$1) : Promise.resolve({
|
|
35569
35501
|
value: null,
|
|
@@ -35766,15 +35698,15 @@ const deploy = async (options) => {
|
|
|
35766
35698
|
s$1.stop("Fingerprint.json not found. Please run 'hot-updater fingerprint create' to update fingerprint.json", 1);
|
|
35767
35699
|
process.exit(1);
|
|
35768
35700
|
}
|
|
35769
|
-
const newFingerprint = await
|
|
35701
|
+
const newFingerprint = await require_keyGeneration.nativeFingerprint(cwd, {
|
|
35770
35702
|
platform: platform$2,
|
|
35771
35703
|
...config.fingerprint
|
|
35772
35704
|
});
|
|
35773
|
-
const projectFingerprint = await
|
|
35774
|
-
if (!
|
|
35705
|
+
const projectFingerprint = await require_keyGeneration.readLocalFingerprint();
|
|
35706
|
+
if (!require_keyGeneration.isFingerprintEquals(newFingerprint, projectFingerprint?.[platform$2])) {
|
|
35775
35707
|
s$1.stop("Fingerprint mismatch. 'hot-updater fingerprint create' to update fingerprint.json", 1);
|
|
35776
35708
|
if (projectFingerprint?.[platform$2]) try {
|
|
35777
|
-
|
|
35709
|
+
require_keyGeneration.showFingerprintDiff(await require_keyGeneration.getFingerprintDiff(projectFingerprint[platform$2], {
|
|
35778
35710
|
platform: platform$2,
|
|
35779
35711
|
...config.fingerprint
|
|
35780
35712
|
}), platform$2 === "ios" ? "iOS" : "Android");
|
|
@@ -36172,21 +36104,21 @@ function merge(target, source) {
|
|
|
36172
36104
|
const DEFAULT_CHANNEL$1 = "production";
|
|
36173
36105
|
const setAndroidChannel = async (channel) => {
|
|
36174
36106
|
const customPaths = (await (0, __hot_updater_cli_tools.loadConfig)(null)).platform.android.stringResourcePaths;
|
|
36175
|
-
return await new
|
|
36107
|
+
return await new require_keyGeneration.AndroidConfigParser(customPaths).set("hot_updater_channel", channel);
|
|
36176
36108
|
};
|
|
36177
36109
|
const getAndroidChannel = async () => {
|
|
36178
36110
|
const customPaths = (await (0, __hot_updater_cli_tools.loadConfig)(null)).platform.android.stringResourcePaths;
|
|
36179
|
-
const androidParser = new
|
|
36111
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(customPaths);
|
|
36180
36112
|
if (!await androidParser.exists()) throw new Error("No Android strings.xml files found");
|
|
36181
36113
|
return merge({ value: DEFAULT_CHANNEL$1 }, await androidParser.get("hot_updater_channel"));
|
|
36182
36114
|
};
|
|
36183
36115
|
const setIosChannel = async (channel) => {
|
|
36184
36116
|
const customPaths = (await (0, __hot_updater_cli_tools.loadConfig)(null)).platform.ios.infoPlistPaths;
|
|
36185
|
-
return await new
|
|
36117
|
+
return await new require_keyGeneration.IosConfigParser(customPaths).set("HOT_UPDATER_CHANNEL", channel);
|
|
36186
36118
|
};
|
|
36187
36119
|
const getIosChannel = async () => {
|
|
36188
36120
|
const customPaths = (await (0, __hot_updater_cli_tools.loadConfig)(null)).platform.ios.infoPlistPaths;
|
|
36189
|
-
const iosParser = new
|
|
36121
|
+
const iosParser = new require_keyGeneration.IosConfigParser(customPaths);
|
|
36190
36122
|
if (!await iosParser.exists()) throw new Error("No iOS Info.plist files found");
|
|
36191
36123
|
return merge({ value: DEFAULT_CHANNEL$1 }, await iosParser.get("HOT_UPDATER_CHANNEL"));
|
|
36192
36124
|
};
|
|
@@ -36218,13 +36150,13 @@ const handleSetChannel = async (channel) => {
|
|
|
36218
36150
|
__hot_updater_cli_tools.p.log.success(`Set Android channel to: ${__hot_updater_cli_tools.colors.green(channel)}`);
|
|
36219
36151
|
if (androidPaths.length > 0) {
|
|
36220
36152
|
__hot_updater_cli_tools.p.log.info(__hot_updater_cli_tools.colors.bold("Changed Android paths:"));
|
|
36221
|
-
for (const path$
|
|
36153
|
+
for (const path$28 of androidPaths) __hot_updater_cli_tools.p.log.info(` ${__hot_updater_cli_tools.colors.green(path$28)}`);
|
|
36222
36154
|
}
|
|
36223
36155
|
const { paths: iosPaths } = await setChannel("ios", channel);
|
|
36224
36156
|
__hot_updater_cli_tools.p.log.success(`Set iOS channel to: ${__hot_updater_cli_tools.colors.green(channel)}`);
|
|
36225
36157
|
if (iosPaths.length > 0) {
|
|
36226
36158
|
__hot_updater_cli_tools.p.log.info(__hot_updater_cli_tools.colors.bold("Changed iOS paths:"));
|
|
36227
|
-
for (const path$
|
|
36159
|
+
for (const path$28 of iosPaths) __hot_updater_cli_tools.p.log.info(` ${__hot_updater_cli_tools.colors.green(path$28)}`);
|
|
36228
36160
|
}
|
|
36229
36161
|
__hot_updater_cli_tools.p.log.success("You need to rebuild the native app if the channel has changed.");
|
|
36230
36162
|
};
|
|
@@ -36957,7 +36889,7 @@ const handleDoctor = async ({ fix }) => {
|
|
|
36957
36889
|
const handleFingerprint = async () => {
|
|
36958
36890
|
const s$1 = __hot_updater_cli_tools.p.spinner();
|
|
36959
36891
|
s$1.start("Generating fingerprints");
|
|
36960
|
-
const fingerPrintRef = await
|
|
36892
|
+
const fingerPrintRef = await require_keyGeneration.generateFingerprints();
|
|
36961
36893
|
s$1.stop(`Fingerprint generated. iOS: ${fingerPrintRef.ios.hash}, Android: ${fingerPrintRef.android.hash}`);
|
|
36962
36894
|
const localFingerprintPath = path.default.join((0, __hot_updater_cli_tools.getCwd)(), "fingerprint.json");
|
|
36963
36895
|
if (!fs.default.existsSync(localFingerprintPath)) return;
|
|
@@ -36967,7 +36899,7 @@ const handleFingerprint = async () => {
|
|
|
36967
36899
|
if (localFingerprint.ios.hash !== fingerPrintRef.ios?.hash) {
|
|
36968
36900
|
__hot_updater_cli_tools.p.log.error("iOS fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
36969
36901
|
try {
|
|
36970
|
-
|
|
36902
|
+
require_keyGeneration.showFingerprintDiff(await require_keyGeneration.getFingerprintDiff(localFingerprint.ios, {
|
|
36971
36903
|
platform: "ios",
|
|
36972
36904
|
...fingerprintConfig
|
|
36973
36905
|
}), "iOS");
|
|
@@ -36979,7 +36911,7 @@ const handleFingerprint = async () => {
|
|
|
36979
36911
|
if (localFingerprint.android.hash !== fingerPrintRef.android?.hash) {
|
|
36980
36912
|
__hot_updater_cli_tools.p.log.error("Android fingerprint mismatch. Please update using 'hot-updater fingerprint create' command.");
|
|
36981
36913
|
try {
|
|
36982
|
-
|
|
36914
|
+
require_keyGeneration.showFingerprintDiff(await require_keyGeneration.getFingerprintDiff(localFingerprint.android, {
|
|
36983
36915
|
platform: "android",
|
|
36984
36916
|
...fingerprintConfig
|
|
36985
36917
|
}), "Android");
|
|
@@ -36997,9 +36929,9 @@ const handleCreateFingerprint = async () => {
|
|
|
36997
36929
|
const s$1 = __hot_updater_cli_tools.p.spinner();
|
|
36998
36930
|
s$1.start("Creating fingerprint.json");
|
|
36999
36931
|
try {
|
|
37000
|
-
localFingerprint = await
|
|
37001
|
-
result = await
|
|
37002
|
-
if (!
|
|
36932
|
+
localFingerprint = await require_keyGeneration.readLocalFingerprint();
|
|
36933
|
+
result = await require_keyGeneration.createAndInjectFingerprintFiles();
|
|
36934
|
+
if (!require_keyGeneration.isFingerprintEquals(localFingerprint, result.fingerprint)) diffChanged = true;
|
|
37003
36935
|
s$1.stop("Created fingerprint.json");
|
|
37004
36936
|
} catch (error) {
|
|
37005
36937
|
if (error instanceof Error) __hot_updater_cli_tools.p.log.error(error.message);
|
|
@@ -37009,21 +36941,21 @@ const handleCreateFingerprint = async () => {
|
|
|
37009
36941
|
if (diffChanged && result) {
|
|
37010
36942
|
if (result.androidPaths.length > 0) {
|
|
37011
36943
|
__hot_updater_cli_tools.p.log.info(__hot_updater_cli_tools.colors.bold("Changed Android paths:"));
|
|
37012
|
-
for (const path$
|
|
36944
|
+
for (const path$28 of result.androidPaths) __hot_updater_cli_tools.p.log.info(` ${__hot_updater_cli_tools.colors.green(path$28)}`);
|
|
37013
36945
|
}
|
|
37014
36946
|
if (result.iosPaths.length > 0) {
|
|
37015
36947
|
__hot_updater_cli_tools.p.log.info(__hot_updater_cli_tools.colors.bold("Changed iOS paths:"));
|
|
37016
|
-
for (const path$
|
|
36948
|
+
for (const path$28 of result.iosPaths) __hot_updater_cli_tools.p.log.info(` ${__hot_updater_cli_tools.colors.green(path$28)}`);
|
|
37017
36949
|
}
|
|
37018
36950
|
__hot_updater_cli_tools.p.log.success(__hot_updater_cli_tools.colors.bold(`${__hot_updater_cli_tools.colors.blue("fingerprint.json")} has changed, you need to rebuild the native app.`));
|
|
37019
36951
|
if (localFingerprint && result.fingerprint) {
|
|
37020
36952
|
const fingerprintConfig = (await (0, __hot_updater_cli_tools.loadConfig)(null)).fingerprint;
|
|
37021
36953
|
try {
|
|
37022
|
-
if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash)
|
|
36954
|
+
if (localFingerprint.ios && localFingerprint.ios.hash !== result.fingerprint.ios.hash) require_keyGeneration.showFingerprintDiff(await require_keyGeneration.getFingerprintDiff(localFingerprint.ios, {
|
|
37023
36955
|
platform: "ios",
|
|
37024
36956
|
...fingerprintConfig
|
|
37025
36957
|
}), "iOS");
|
|
37026
|
-
if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash)
|
|
36958
|
+
if (localFingerprint.android && localFingerprint.android.hash !== result.fingerprint.android.hash) require_keyGeneration.showFingerprintDiff(await require_keyGeneration.getFingerprintDiff(localFingerprint.android, {
|
|
37027
36959
|
platform: "android",
|
|
37028
36960
|
...fingerprintConfig
|
|
37029
36961
|
}), "Android");
|
|
@@ -37564,13 +37496,17 @@ const keysGenerate = async (options = {}) => {
|
|
|
37564
37496
|
const spinner = __hot_updater_cli_tools.p.spinner();
|
|
37565
37497
|
spinner.start("Generating keys");
|
|
37566
37498
|
try {
|
|
37567
|
-
await saveKeyPair(await generateKeyPair(keySize), outputDir);
|
|
37499
|
+
await require_keyGeneration.saveKeyPair(await require_keyGeneration.generateKeyPair(keySize), outputDir);
|
|
37568
37500
|
spinner.stop("Keys generated successfully");
|
|
37569
37501
|
__hot_updater_cli_tools.p.log.success(`Private key: ${node_path.default.join(outputDir, "private-key.pem")}`);
|
|
37570
37502
|
__hot_updater_cli_tools.p.log.success(`Public key: ${node_path.default.join(outputDir, "public-key.pem")}`);
|
|
37503
|
+
const keysDir = node_path.default.basename(outputDir);
|
|
37504
|
+
if (appendToProjectRootGitignore({
|
|
37505
|
+
cwd,
|
|
37506
|
+
globLines: [`${keysDir}/`]
|
|
37507
|
+
})) __hot_updater_cli_tools.p.log.success(`Added ${keysDir}/ to .gitignore`);
|
|
37571
37508
|
console.log("");
|
|
37572
37509
|
__hot_updater_cli_tools.p.log.warn("⚠️ Keep private key secure!");
|
|
37573
|
-
__hot_updater_cli_tools.p.log.warn(" - Add keys/ to .gitignore");
|
|
37574
37510
|
__hot_updater_cli_tools.p.log.warn(" - Use secure storage for CI/CD (AWS Secrets Manager, etc.)");
|
|
37575
37511
|
console.log("");
|
|
37576
37512
|
__hot_updater_cli_tools.p.log.info("Next steps:");
|
|
@@ -37587,7 +37523,7 @@ const keysGenerate = async (options = {}) => {
|
|
|
37587
37523
|
};
|
|
37588
37524
|
async function writePublicKeyToAndroid(publicKey, customPaths) {
|
|
37589
37525
|
try {
|
|
37590
|
-
const androidParser = new
|
|
37526
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(customPaths);
|
|
37591
37527
|
if (!await androidParser.exists()) return {
|
|
37592
37528
|
platform: "android",
|
|
37593
37529
|
paths: [],
|
|
@@ -37610,7 +37546,7 @@ async function writePublicKeyToAndroid(publicKey, customPaths) {
|
|
|
37610
37546
|
}
|
|
37611
37547
|
async function writePublicKeyToIos(publicKey, customPaths) {
|
|
37612
37548
|
try {
|
|
37613
|
-
const iosParser = new
|
|
37549
|
+
const iosParser = new require_keyGeneration.IosConfigParser(customPaths);
|
|
37614
37550
|
if (!await iosParser.exists()) return {
|
|
37615
37551
|
platform: "ios",
|
|
37616
37552
|
paths: [],
|
|
@@ -37671,14 +37607,14 @@ const keysExportPublic = async (options = {}) => {
|
|
|
37671
37607
|
else if (configPrivateKeyPath) privateKeyPath = node_path.default.isAbsolute(configPrivateKeyPath) ? configPrivateKeyPath : node_path.default.join(cwd, configPrivateKeyPath);
|
|
37672
37608
|
else privateKeyPath = node_path.default.join(cwd, "keys", "private-key.pem");
|
|
37673
37609
|
try {
|
|
37674
|
-
const publicKeyPEM = getPublicKeyFromPrivate(await loadPrivateKey(privateKeyPath));
|
|
37610
|
+
const publicKeyPEM = require_keyGeneration.getPublicKeyFromPrivate(await require_keyGeneration.loadPrivateKey(privateKeyPath));
|
|
37675
37611
|
if (options.printOnly) {
|
|
37676
37612
|
printPublicKeyInstructions(publicKeyPEM);
|
|
37677
37613
|
return;
|
|
37678
37614
|
}
|
|
37679
37615
|
__hot_updater_cli_tools.p.log.info("Preparing to write public key to native configuration files...");
|
|
37680
|
-
const androidParser = new
|
|
37681
|
-
const iosParser = new
|
|
37616
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(config.platform.android.stringResourcePaths);
|
|
37617
|
+
const iosParser = new require_keyGeneration.IosConfigParser(config.platform.ios.infoPlistPaths);
|
|
37682
37618
|
const androidExists = await androidParser.exists();
|
|
37683
37619
|
const iosExists = await iosParser.exists();
|
|
37684
37620
|
if (!androidExists && !iosExists) {
|
|
@@ -37738,7 +37674,7 @@ const keysExportPublic = async (options = {}) => {
|
|
|
37738
37674
|
};
|
|
37739
37675
|
async function removePublicKeyFromAndroid(customPaths) {
|
|
37740
37676
|
try {
|
|
37741
|
-
const androidParser = new
|
|
37677
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(customPaths);
|
|
37742
37678
|
if (!await androidParser.exists()) return {
|
|
37743
37679
|
platform: "android",
|
|
37744
37680
|
paths: [],
|
|
@@ -37770,7 +37706,7 @@ async function removePublicKeyFromAndroid(customPaths) {
|
|
|
37770
37706
|
}
|
|
37771
37707
|
async function removePublicKeyFromIos(customPaths) {
|
|
37772
37708
|
try {
|
|
37773
|
-
const iosParser = new
|
|
37709
|
+
const iosParser = new require_keyGeneration.IosConfigParser(customPaths);
|
|
37774
37710
|
if (!await iosParser.exists()) return {
|
|
37775
37711
|
platform: "ios",
|
|
37776
37712
|
paths: [],
|
|
@@ -37808,8 +37744,8 @@ async function removePublicKeyFromIos(customPaths) {
|
|
|
37808
37744
|
*/
|
|
37809
37745
|
const keysRemove = async (options = {}) => {
|
|
37810
37746
|
const config = await (0, __hot_updater_cli_tools.loadConfig)(null);
|
|
37811
|
-
const androidParser = new
|
|
37812
|
-
const iosParser = new
|
|
37747
|
+
const androidParser = new require_keyGeneration.AndroidConfigParser(config.platform.android.stringResourcePaths);
|
|
37748
|
+
const iosParser = new require_keyGeneration.IosConfigParser(config.platform.ios.infoPlistPaths);
|
|
37813
37749
|
const [androidExists, iosExists] = await Promise.all([androidParser.exists(), iosParser.exists()]);
|
|
37814
37750
|
if (!androidExists && !iosExists) {
|
|
37815
37751
|
__hot_updater_cli_tools.p.log.info("No native configuration files found.");
|