hot-updater 0.19.8 → 0.19.9

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  require('./picocolors-nLcU57DT.cjs');
2
- const require_fingerprint = require('./fingerprint-BL6Q0AuW.cjs');
2
+ const require_fingerprint = require('./fingerprint-BLWMqaEq.cjs');
3
3
 
4
4
  //#region src/config.ts
5
5
  const defineConfig = (config) => {
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./picocolors-OFVOrezl.js";
2
- import { createAndInjectFingerprintFiles, generateFingerprint, generateFingerprints, readLocalFingerprint } from "./fingerprint-BQRKmTNL.js";
2
+ import { createAndInjectFingerprintFiles, generateFingerprint, generateFingerprints, readLocalFingerprint } from "./fingerprint-CHhBVEC9.js";
3
3
 
4
4
  //#region src/config.ts
5
5
  const defineConfig = (config) => {
@@ -14899,6 +14899,7 @@ function getFingerprintOptions(platform, path$14, options) {
14899
14899
  ignorePaths: [
14900
14900
  "**/android/**/strings.xml",
14901
14901
  "**/ios/**/*.plist",
14902
+ "**/.gitignore",
14902
14903
  ...options.ignorePaths
14903
14904
  ],
14904
14905
  extraSources: processExtraSources(options.extraSources, path$14, options.ignorePaths),
@@ -14900,6 +14900,7 @@ function getFingerprintOptions(platform, path$11, options) {
14900
14900
  ignorePaths: [
14901
14901
  "**/android/**/strings.xml",
14902
14902
  "**/ios/**/*.plist",
14903
+ "**/.gitignore",
14903
14904
  ...options.ignorePaths
14904
14905
  ],
14905
14906
  extraSources: processExtraSources(options.extraSources, path$11, options.ignorePaths),
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  const require_picocolors$1 = require('./picocolors-nLcU57DT.cjs');
3
- const require_fingerprint = require('./fingerprint-BL6Q0AuW.cjs');
3
+ const require_fingerprint = require('./fingerprint-BLWMqaEq.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"));
@@ -1058,8 +1058,8 @@ var require_suggestSimilar = require_picocolors$1.__commonJS({ "../../node_modul
1058
1058
  var require_command = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/commander@14.0.0/node_modules/commander/lib/command.js"(exports) {
1059
1059
  const EventEmitter$1 = require("node:events").EventEmitter;
1060
1060
  const childProcess$1 = require("node:child_process");
1061
- const path$22 = require("node:path");
1062
- const fs$19 = require("node:fs");
1061
+ const path$24 = require("node:path");
1062
+ const fs$20 = require("node:fs");
1063
1063
  const process$15 = require("node:process");
1064
1064
  const { Argument: Argument$2, humanReadableArgName } = require_argument();
1065
1065
  const { CommanderError: CommanderError$2 } = require_error();
@@ -1956,7 +1956,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1956
1956
  * @param {string} subcommandName
1957
1957
  */
1958
1958
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
1959
- if (fs$19.existsSync(executableFile)) return;
1959
+ if (fs$20.existsSync(executableFile)) return;
1960
1960
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
1961
1961
  const executableMissing = `'${executableFile}' does not exist
1962
1962
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -1980,10 +1980,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1980
1980
  ".cjs"
1981
1981
  ];
1982
1982
  function findFile(baseDir, baseName) {
1983
- const localBin = path$22.resolve(baseDir, baseName);
1984
- if (fs$19.existsSync(localBin)) return localBin;
1985
- if (sourceExt.includes(path$22.extname(baseName))) return void 0;
1986
- const foundExt = sourceExt.find((ext) => fs$19.existsSync(`${localBin}${ext}`));
1983
+ const localBin = path$24.resolve(baseDir, baseName);
1984
+ if (fs$20.existsSync(localBin)) return localBin;
1985
+ if (sourceExt.includes(path$24.extname(baseName))) return void 0;
1986
+ const foundExt = sourceExt.find((ext) => fs$20.existsSync(`${localBin}${ext}`));
1987
1987
  if (foundExt) return `${localBin}${foundExt}`;
1988
1988
  return void 0;
1989
1989
  }
@@ -1994,21 +1994,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
1994
1994
  if (this._scriptPath) {
1995
1995
  let resolvedScriptPath;
1996
1996
  try {
1997
- resolvedScriptPath = fs$19.realpathSync(this._scriptPath);
1997
+ resolvedScriptPath = fs$20.realpathSync(this._scriptPath);
1998
1998
  } catch {
1999
1999
  resolvedScriptPath = this._scriptPath;
2000
2000
  }
2001
- executableDir = path$22.resolve(path$22.dirname(resolvedScriptPath), executableDir);
2001
+ executableDir = path$24.resolve(path$24.dirname(resolvedScriptPath), executableDir);
2002
2002
  }
2003
2003
  if (executableDir) {
2004
2004
  let localFile = findFile(executableDir, executableFile);
2005
2005
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2006
- const legacyName = path$22.basename(this._scriptPath, path$22.extname(this._scriptPath));
2006
+ const legacyName = path$24.basename(this._scriptPath, path$24.extname(this._scriptPath));
2007
2007
  if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
2008
2008
  }
2009
2009
  executableFile = localFile || executableFile;
2010
2010
  }
2011
- launchWithNode = sourceExt.includes(path$22.extname(executableFile));
2011
+ launchWithNode = sourceExt.includes(path$24.extname(executableFile));
2012
2012
  let proc;
2013
2013
  if (process$15.platform !== "win32") if (launchWithNode) {
2014
2014
  args.unshift(executableFile);
@@ -2783,7 +2783,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2783
2783
  * @return {Command}
2784
2784
  */
2785
2785
  nameFromFilename(filename) {
2786
- this._name = path$22.basename(filename, path$22.extname(filename));
2786
+ this._name = path$24.basename(filename, path$24.extname(filename));
2787
2787
  return this;
2788
2788
  }
2789
2789
  /**
@@ -2797,9 +2797,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2797
2797
  * @param {string} [path]
2798
2798
  * @return {(string|null|Command)}
2799
2799
  */
2800
- executableDir(path$23) {
2801
- if (path$23 === void 0) return this._executableDir;
2802
- this._executableDir = path$23;
2800
+ executableDir(path$25) {
2801
+ if (path$25 === void 0) return this._executableDir;
2802
+ this._executableDir = path$25;
2803
2803
  return this;
2804
2804
  }
2805
2805
  /**
@@ -3919,29 +3919,29 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
3919
3919
  var require_windows = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
3920
3920
  module.exports = isexe$3;
3921
3921
  isexe$3.sync = sync$2;
3922
- var fs$18 = require("fs");
3923
- function checkPathExt(path$23, options) {
3922
+ var fs$19 = require("fs");
3923
+ function checkPathExt(path$25, options) {
3924
3924
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
3925
3925
  if (!pathext) return true;
3926
3926
  pathext = pathext.split(";");
3927
3927
  if (pathext.indexOf("") !== -1) return true;
3928
3928
  for (var i$1 = 0; i$1 < pathext.length; i$1++) {
3929
3929
  var p = pathext[i$1].toLowerCase();
3930
- if (p && path$23.substr(-p.length).toLowerCase() === p) return true;
3930
+ if (p && path$25.substr(-p.length).toLowerCase() === p) return true;
3931
3931
  }
3932
3932
  return false;
3933
3933
  }
3934
- function checkStat$1(stat, path$23, options) {
3934
+ function checkStat$1(stat, path$25, options) {
3935
3935
  if (!stat.isSymbolicLink() && !stat.isFile()) return false;
3936
- return checkPathExt(path$23, options);
3936
+ return checkPathExt(path$25, options);
3937
3937
  }
3938
- function isexe$3(path$23, options, cb) {
3939
- fs$18.stat(path$23, function(er, stat) {
3940
- cb(er, er ? false : checkStat$1(stat, path$23, options));
3938
+ function isexe$3(path$25, options, cb) {
3939
+ fs$19.stat(path$25, function(er, stat) {
3940
+ cb(er, er ? false : checkStat$1(stat, path$25, options));
3941
3941
  });
3942
3942
  }
3943
- function sync$2(path$23, options) {
3944
- return checkStat$1(fs$18.statSync(path$23), path$23, options);
3943
+ function sync$2(path$25, options) {
3944
+ return checkStat$1(fs$19.statSync(path$25), path$25, options);
3945
3945
  }
3946
3946
  } });
3947
3947
 
@@ -3950,14 +3950,14 @@ var require_windows = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
3950
3950
  var require_mode = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
3951
3951
  module.exports = isexe$2;
3952
3952
  isexe$2.sync = sync$1;
3953
- var fs$17 = require("fs");
3954
- function isexe$2(path$23, options, cb) {
3955
- fs$17.stat(path$23, function(er, stat) {
3953
+ var fs$18 = require("fs");
3954
+ function isexe$2(path$25, options, cb) {
3955
+ fs$18.stat(path$25, function(er, stat) {
3956
3956
  cb(er, er ? false : checkStat(stat, options));
3957
3957
  });
3958
3958
  }
3959
- function sync$1(path$23, options) {
3960
- return checkStat(fs$17.statSync(path$23), options);
3959
+ function sync$1(path$25, options) {
3960
+ return checkStat(fs$18.statSync(path$25), options);
3961
3961
  }
3962
3962
  function checkStat(stat, options) {
3963
3963
  return stat.isFile() && checkMode(stat, options);
@@ -3980,13 +3980,13 @@ var require_mode = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/i
3980
3980
  //#endregion
3981
3981
  //#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
3982
3982
  var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
3983
- var fs$16 = require("fs");
3983
+ var fs$17 = require("fs");
3984
3984
  var core;
3985
3985
  if (process.platform === "win32" || global.TESTING_WINDOWS) core = require_windows();
3986
3986
  else core = require_mode();
3987
3987
  module.exports = isexe$1;
3988
3988
  isexe$1.sync = sync;
3989
- function isexe$1(path$23, options, cb) {
3989
+ function isexe$1(path$25, options, cb) {
3990
3990
  if (typeof options === "function") {
3991
3991
  cb = options;
3992
3992
  options = {};
@@ -3994,13 +3994,13 @@ var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
3994
3994
  if (!cb) {
3995
3995
  if (typeof Promise !== "function") throw new TypeError("callback not provided");
3996
3996
  return new Promise(function(resolve, reject) {
3997
- isexe$1(path$23, options || {}, function(er, is) {
3997
+ isexe$1(path$25, options || {}, function(er, is) {
3998
3998
  if (er) reject(er);
3999
3999
  else resolve(is);
4000
4000
  });
4001
4001
  });
4002
4002
  }
4003
- core(path$23, options || {}, function(er, is) {
4003
+ core(path$25, options || {}, function(er, is) {
4004
4004
  if (er) {
4005
4005
  if (er.code === "EACCES" || options && options.ignoreErrors) {
4006
4006
  er = null;
@@ -4010,9 +4010,9 @@ var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
4010
4010
  cb(er, is);
4011
4011
  });
4012
4012
  }
4013
- function sync(path$23, options) {
4013
+ function sync(path$25, options) {
4014
4014
  try {
4015
- return core.sync(path$23, options || {});
4015
+ return core.sync(path$25, options || {});
4016
4016
  } catch (er) {
4017
4017
  if (options && options.ignoreErrors || er.code === "EACCES") return false;
4018
4018
  else throw er;
@@ -4024,7 +4024,7 @@ var require_isexe = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
4024
4024
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
4025
4025
  var require_which = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
4026
4026
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
4027
- const path$21 = require("path");
4027
+ const path$23 = require("path");
4028
4028
  const COLON = isWindows ? ";" : ":";
4029
4029
  const isexe = require_isexe();
4030
4030
  const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -4054,7 +4054,7 @@ var require_which = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
4054
4054
  if (i$1 === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
4055
4055
  const ppRaw = pathEnv[i$1];
4056
4056
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4057
- const pCmd = path$21.join(pathPart, cmd);
4057
+ const pCmd = path$23.join(pathPart, cmd);
4058
4058
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4059
4059
  resolve(subStep(p, i$1, 0));
4060
4060
  });
@@ -4076,7 +4076,7 @@ var require_which = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
4076
4076
  for (let i$1 = 0; i$1 < pathEnv.length; i$1++) {
4077
4077
  const ppRaw = pathEnv[i$1];
4078
4078
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
4079
- const pCmd = path$21.join(pathPart, cmd);
4079
+ const pCmd = path$23.join(pathPart, cmd);
4080
4080
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
4081
4081
  for (let j = 0; j < pathExt.length; j++) {
4082
4082
  const cur = p + pathExt[j];
@@ -4111,7 +4111,7 @@ var require_path_key = require_picocolors$1.__commonJS({ "../../node_modules/.pn
4111
4111
  //#endregion
4112
4112
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
4113
4113
  var require_resolveCommand = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
4114
- const path$20 = require("path");
4114
+ const path$22 = require("path");
4115
4115
  const which = require_which();
4116
4116
  const getPathKey = require_path_key();
4117
4117
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -4126,12 +4126,12 @@ var require_resolveCommand = require_picocolors$1.__commonJS({ "../../node_modul
4126
4126
  try {
4127
4127
  resolved = which.sync(parsed.command, {
4128
4128
  path: env$1[getPathKey({ env: env$1 })],
4129
- pathExt: withoutPathExt ? path$20.delimiter : void 0
4129
+ pathExt: withoutPathExt ? path$22.delimiter : void 0
4130
4130
  });
4131
4131
  } catch (e) {} finally {
4132
4132
  if (shouldSwitchCwd) process.chdir(cwd);
4133
4133
  }
4134
- if (resolved) resolved = path$20.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4134
+ if (resolved) resolved = path$22.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
4135
4135
  return resolved;
4136
4136
  }
4137
4137
  function resolveCommand$1(parsed) {
@@ -4174,8 +4174,8 @@ var require_shebang_command = require_picocolors$1.__commonJS({ "../../node_modu
4174
4174
  module.exports = (string = "") => {
4175
4175
  const match = string.match(shebangRegex);
4176
4176
  if (!match) return null;
4177
- const [path$23, argument] = match[0].replace(/#! ?/, "").split(" ");
4178
- const binary = path$23.split("/").pop();
4177
+ const [path$25, argument] = match[0].replace(/#! ?/, "").split(" ");
4178
+ const binary = path$25.split("/").pop();
4179
4179
  if (binary === "env") return argument;
4180
4180
  return argument ? `${binary} ${argument}` : binary;
4181
4181
  };
@@ -4184,16 +4184,16 @@ var require_shebang_command = require_picocolors$1.__commonJS({ "../../node_modu
4184
4184
  //#endregion
4185
4185
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
4186
4186
  var require_readShebang = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
4187
- const fs$15 = require("fs");
4187
+ const fs$16 = require("fs");
4188
4188
  const shebangCommand = require_shebang_command();
4189
4189
  function readShebang$1(command) {
4190
4190
  const size = 150;
4191
4191
  const buffer = Buffer.alloc(size);
4192
4192
  let fd;
4193
4193
  try {
4194
- fd = fs$15.openSync(command, "r");
4195
- fs$15.readSync(fd, buffer, 0, size, 0);
4196
- fs$15.closeSync(fd);
4194
+ fd = fs$16.openSync(command, "r");
4195
+ fs$16.readSync(fd, buffer, 0, size, 0);
4196
+ fs$16.closeSync(fd);
4197
4197
  } catch (e) {}
4198
4198
  return shebangCommand(buffer.toString());
4199
4199
  }
@@ -4203,7 +4203,7 @@ var require_readShebang = require_picocolors$1.__commonJS({ "../../node_modules/
4203
4203
  //#endregion
4204
4204
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
4205
4205
  var require_parse$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
4206
- const path$19 = require("path");
4206
+ const path$21 = require("path");
4207
4207
  const resolveCommand = require_resolveCommand();
4208
4208
  const escape = require_escape();
4209
4209
  const readShebang = require_readShebang();
@@ -4226,7 +4226,7 @@ var require_parse$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnp
4226
4226
  const needsShell = !isExecutableRegExp.test(commandFile);
4227
4227
  if (parsed.options.forceShell || needsShell) {
4228
4228
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
4229
- parsed.command = path$19.normalize(parsed.command);
4229
+ parsed.command = path$21.normalize(parsed.command);
4230
4230
  parsed.command = escape.command(parsed.command);
4231
4231
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
4232
4232
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -7358,12 +7358,12 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
7358
7358
  }
7359
7359
  };
7360
7360
  const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
7361
- for (const { path: path$23, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
7362
- const pathString = typeof path$23 === "string" ? path$23 : path$23.toString();
7363
- if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$23, serializedResult);
7361
+ for (const { path: path$25, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
7362
+ const pathString = typeof path$25 === "string" ? path$25 : path$25.toString();
7363
+ if (append || outputFiles.has(pathString)) (0, node_fs.appendFileSync)(path$25, serializedResult);
7364
7364
  else {
7365
7365
  outputFiles.add(pathString);
7366
- (0, node_fs.writeFileSync)(path$23, serializedResult);
7366
+ (0, node_fs.writeFileSync)(path$25, serializedResult);
7367
7367
  }
7368
7368
  }
7369
7369
  };
@@ -9561,28 +9561,31 @@ Tasks ${tasks.join(", ")}
9561
9561
  else if (e instanceof Error) __clack_prompts.log.error(e.message);
9562
9562
  throw new Error("Faild to build the app. See the error above for details from Gradle.");
9563
9563
  }
9564
- const outputFilePath = await findOutputFile({
9564
+ return findBuildDirectory({
9565
9565
  androidProjectPath,
9566
9566
  moduleName: appModuleName,
9567
9567
  tasks
9568
9568
  });
9569
- __clack_prompts.log.success(`Output file: ${outputFilePath}`);
9570
9569
  }
9571
- async function findOutputFile({ moduleName, tasks, androidProjectPath }) {
9570
+ async function findBuildDirectory({ moduleName, tasks, androidProjectPath }) {
9572
9571
  const selectedTask = tasks.find((t$5) => t$5.startsWith("install") || t$5.startsWith("assemble") || t$5.startsWith("bundle"));
9573
- if (!selectedTask) return false;
9572
+ if (!selectedTask) throw new Error(`Not supported gradle task: ${tasks.join(", ")}`);
9574
9573
  const variantFromSelectedTask = selectedTask?.replace("install", "")?.replace("assemble", "")?.replace("bundle", "").split(/(?=[A-Z])/);
9575
9574
  const variantPath = variantFromSelectedTask?.join("/")?.toLowerCase();
9576
9575
  const variant = variantFromSelectedTask?.join("-")?.toLowerCase();
9577
9576
  const isAabOutput = selectedTask?.includes("bundle") === true;
9578
9577
  const buildDirectory = `${androidProjectPath}/${moduleName}/build/outputs/${isAabOutput ? "bundle" : "apk"}/${variantPath}`;
9579
- const outputPath = await getOutputFilePath({
9578
+ if (!buildDirectory) throw new Error("Failed to find Android gradle build directory.");
9579
+ const outputFile = await getOutputFilePath({
9580
9580
  aab: isAabOutput,
9581
9581
  appModuleName: moduleName,
9582
9582
  buildDirectory,
9583
9583
  variant
9584
9584
  });
9585
- return outputPath ?? null;
9585
+ return {
9586
+ buildDirectory,
9587
+ outputFile
9588
+ };
9586
9589
  }
9587
9590
  async function getOutputFilePath({ aab, appModuleName, buildDirectory, variant }) {
9588
9591
  const outputFile = `${appModuleName}-${variant}.${aab ? "aab" : "apk"}`;
@@ -9608,13 +9611,17 @@ const runAndroidNativeBuild = async ({ config }) => {
9608
9611
  //#region src/utils/nativeBuild/runNativeBuild.ts
9609
9612
  const runNativeBuild = async ({ platform: platform$2, config }) => {
9610
9613
  switch (platform$2) {
9611
- case "android":
9612
- await runAndroidNativeBuild({ config: config.android });
9613
- break;
9614
+ case "android": return runAndroidNativeBuild({ config: config.android });
9614
9615
  case "ios": throw new Error("Not Implemented");
9615
9616
  }
9616
9617
  };
9617
9618
 
9619
+ //#endregion
9620
+ //#region src/utils/output/getDefaultOutputPath.ts
9621
+ const getDefaultOutputPath = () => {
9622
+ return path.default.join((0, __hot_updater_plugin_core.getCwd)(), ".hot-updater", "output");
9623
+ };
9624
+
9618
9625
  //#endregion
9619
9626
  //#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
9620
9627
  const toPath$1 = (urlOrPath) => urlOrPath instanceof URL ? (0, node_url.fileURLToPath)(urlOrPath) : urlOrPath;
@@ -10789,11 +10796,11 @@ var require_lib$4 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
10789
10796
  //#region ../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js
10790
10797
  var require_lib$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"(exports) {
10791
10798
  Object.defineProperty(exports, "__esModule", { value: true });
10792
- var picocolors$4 = require_picocolors$1.require_picocolors();
10799
+ var picocolors$5 = require_picocolors$1.require_picocolors();
10793
10800
  var jsTokens = require_js_tokens();
10794
10801
  var helperValidatorIdentifier = require_lib$4();
10795
10802
  function isColorSupported() {
10796
- return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$4.isColorSupported;
10803
+ return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$5.isColorSupported;
10797
10804
  }
10798
10805
  const compose = (f, g) => (v) => f(g(v));
10799
10806
  function buildDefs(colors) {
@@ -10813,8 +10820,8 @@ var require_lib$3 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
10813
10820
  reset: colors.reset
10814
10821
  };
10815
10822
  }
10816
- const defsOn = buildDefs(picocolors$4.createColors(true));
10817
- const defsOff = buildDefs(picocolors$4.createColors(false));
10823
+ const defsOn = buildDefs(picocolors$5.createColors(true));
10824
+ const defsOff = buildDefs(picocolors$5.createColors(false));
10818
10825
  function getDefs(enabled) {
10819
10826
  return enabled ? defsOn : defsOff;
10820
10827
  }
@@ -13774,13 +13781,13 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13774
13781
  const defaults = {
13775
13782
  sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
13776
13783
  sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13777
- edittemplate: ({ domain, user, project, committish, editpath, path: path$23 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path$23)}`,
13784
+ edittemplate: ({ domain, user, project, committish, editpath, path: path$25 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path$25)}`,
13778
13785
  browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
13779
- browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$23, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path$23}${maybeJoin("#", hashformat(fragment || ""))}`,
13780
- browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$23, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path$23}${maybeJoin("#", hashformat(fragment || ""))}`,
13786
+ browsetreetemplate: ({ domain, user, project, committish, treepath, path: path$25, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path$25}${maybeJoin("#", hashformat(fragment || ""))}`,
13787
+ browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path$25, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path$25}${maybeJoin("#", hashformat(fragment || ""))}`,
13781
13788
  docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
13782
13789
  httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13783
- filetemplate: ({ domain, user, project, committish, path: path$23 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path$23}`,
13790
+ filetemplate: ({ domain, user, project, committish, path: path$25 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path$25}`,
13784
13791
  shortcuttemplate: ({ type: type$1, user, project, committish }) => `${type$1}:${user}/${project}${maybeJoin("#", committish)}`,
13785
13792
  pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
13786
13793
  bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
@@ -13800,7 +13807,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13800
13807
  treepath: "tree",
13801
13808
  blobpath: "blob",
13802
13809
  editpath: "edit",
13803
- filetemplate: ({ auth, user, project, committish, path: path$23 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path$23}`,
13810
+ filetemplate: ({ auth, user, project, committish, path: path$25 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path$25}`,
13804
13811
  gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13805
13812
  tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
13806
13813
  extract: (url$2) => {
@@ -13827,7 +13834,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13827
13834
  treepath: "src",
13828
13835
  blobpath: "src",
13829
13836
  editpath: "?mode=edit",
13830
- edittemplate: ({ domain, user, project, committish, treepath, path: path$23, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path$23, editpath)}`,
13837
+ edittemplate: ({ domain, user, project, committish, treepath, path: path$25, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path$25, editpath)}`,
13831
13838
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
13832
13839
  extract: (url$2) => {
13833
13840
  let [, user, project, aux] = url$2.pathname.split("/", 4);
@@ -13855,9 +13862,9 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13855
13862
  httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13856
13863
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`,
13857
13864
  extract: (url$2) => {
13858
- const path$23 = url$2.pathname.slice(1);
13859
- if (path$23.includes("/-/") || path$23.includes("/archive.tar.gz")) return;
13860
- const segments = path$23.split("/");
13865
+ const path$25 = url$2.pathname.slice(1);
13866
+ if (path$25.includes("/-/") || path$25.includes("/archive.tar.gz")) return;
13867
+ const segments = path$25.split("/");
13861
13868
  let project = segments.pop();
13862
13869
  if (project.endsWith(".git")) project = project.slice(0, -4);
13863
13870
  const user = segments.join("/");
@@ -13883,11 +13890,11 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13883
13890
  sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
13884
13891
  edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
13885
13892
  browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
13886
- browsetreetemplate: ({ domain, project, committish, path: path$23, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$23))}`,
13887
- browseblobtemplate: ({ domain, project, committish, path: path$23, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$23))}`,
13893
+ browsetreetemplate: ({ domain, project, committish, path: path$25, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$25))}`,
13894
+ browseblobtemplate: ({ domain, project, committish, path: path$25, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path$25))}`,
13888
13895
  docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
13889
13896
  httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
13890
- filetemplate: ({ user, project, committish, path: path$23 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path$23}`,
13897
+ filetemplate: ({ user, project, committish, path: path$25 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path$25}`,
13891
13898
  shortcuttemplate: ({ type: type$1, project, committish }) => `${type$1}:${project}${maybeJoin("#", committish)}`,
13892
13899
  pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
13893
13900
  bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
@@ -13917,7 +13924,7 @@ var require_hosts = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
13917
13924
  domain: "git.sr.ht",
13918
13925
  treepath: "tree",
13919
13926
  blobpath: "tree",
13920
- filetemplate: ({ domain, user, project, committish, path: path$23 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path$23}`,
13927
+ filetemplate: ({ domain, user, project, committish, path: path$25 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path$25}`,
13921
13928
  httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
13922
13929
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
13923
13930
  bugstemplate: () => null,
@@ -14129,27 +14136,27 @@ var require_lib$2 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
14129
14136
  sshurl(opts) {
14130
14137
  return this.#fill(this.sshurltemplate, opts);
14131
14138
  }
14132
- browse(path$23, ...args) {
14133
- if (typeof path$23 !== "string") return this.#fill(this.browsetemplate, path$23);
14139
+ browse(path$25, ...args) {
14140
+ if (typeof path$25 !== "string") return this.#fill(this.browsetemplate, path$25);
14134
14141
  if (typeof args[0] !== "string") return this.#fill(this.browsetreetemplate, {
14135
14142
  ...args[0],
14136
- path: path$23
14143
+ path: path$25
14137
14144
  });
14138
14145
  return this.#fill(this.browsetreetemplate, {
14139
14146
  ...args[1],
14140
14147
  fragment: args[0],
14141
- path: path$23
14148
+ path: path$25
14142
14149
  });
14143
14150
  }
14144
- browseFile(path$23, ...args) {
14151
+ browseFile(path$25, ...args) {
14145
14152
  if (typeof args[0] !== "string") return this.#fill(this.browseblobtemplate, {
14146
14153
  ...args[0],
14147
- path: path$23
14154
+ path: path$25
14148
14155
  });
14149
14156
  return this.#fill(this.browseblobtemplate, {
14150
14157
  ...args[1],
14151
14158
  fragment: args[0],
14152
- path: path$23
14159
+ path: path$25
14153
14160
  });
14154
14161
  }
14155
14162
  docs(opts) {
@@ -14176,16 +14183,16 @@ var require_lib$2 = require_picocolors$1.__commonJS({ "../../node_modules/.pnpm/
14176
14183
  noCommittish: false
14177
14184
  });
14178
14185
  }
14179
- file(path$23, opts) {
14186
+ file(path$25, opts) {
14180
14187
  return this.#fill(this.filetemplate, {
14181
14188
  ...opts,
14182
- path: path$23
14189
+ path: path$25
14183
14190
  });
14184
14191
  }
14185
- edit(path$23, opts) {
14192
+ edit(path$25, opts) {
14186
14193
  return this.#fill(this.edittemplate, {
14187
14194
  ...opts,
14188
- path: path$23
14195
+ path: path$25
14189
14196
  });
14190
14197
  }
14191
14198
  getDefaultRepresentation() {
@@ -33517,8 +33524,8 @@ var require_XcodeProject = require_picocolors$1.__commonJS({ "../../node_modules
33517
33524
  const json$3 = __importStar$3(require_types());
33518
33525
  const constants_1$2 = require_constants();
33519
33526
  const debug$1 = require_src()("xcparse:model:XcodeProject");
33520
- function uuidForPath(path$23) {
33521
- return "XX" + crypto_1.default.createHash("md5").update(path$23).digest("hex").toUpperCase().slice(0, 20) + "XX";
33527
+ function uuidForPath(path$25) {
33528
+ return "XX" + crypto_1.default.createHash("md5").update(path$25).digest("hex").toUpperCase().slice(0, 20) + "XX";
33522
33529
  }
33523
33530
  const KNOWN_ISA = {
33524
33531
  [json$3.ISA.PBXBuildFile]: () => require_PBXBuildFile().PBXBuildFile,
@@ -33882,8 +33889,8 @@ var require_PBXFileReference = require_picocolors$1.__commonJS({ "../../node_mod
33882
33889
  getProxyContainers() {
33883
33890
  return Array.from(this.getXcodeProject().values()).filter((object) => PBXContainerItemProxy_1$1.PBXContainerItemProxy.is(object) && object.props.containerPortal.uuid === this.uuid);
33884
33891
  }
33885
- setPath(path$23) {
33886
- if (path$23) setPathWithSourceTree(this, path$23, this.props.sourceTree);
33892
+ setPath(path$25) {
33893
+ if (path$25) setPathWithSourceTree(this, path$25, this.props.sourceTree);
33887
33894
  else this.props.path = void 0;
33888
33895
  }
33889
33896
  getBuildFiles() {
@@ -34010,8 +34017,8 @@ var require_AbstractGroup = require_picocolors$1.__commonJS({ "../../node_module
34010
34017
  * @return `PBXGroup` the group if found.
34011
34018
  * @return `null` if the `path` could not be found and `shouldCreate` is `false`.
34012
34019
  */
34013
- mkdir(path$23, { recursive } = {}) {
34014
- let pathArr = typeof path$23 === "string" ? path$23.split("/") : path$23;
34020
+ mkdir(path$25, { recursive } = {}) {
34021
+ let pathArr = typeof path$25 === "string" ? path$25.split("/") : path$25;
34015
34022
  if (!pathArr.length) return this;
34016
34023
  let childName = pathArr.shift();
34017
34024
  let child = this.getChildGroups().find((c$1) => c$1.getDisplayName() === childName);
@@ -34019,7 +34026,7 @@ var require_AbstractGroup = require_picocolors$1.__commonJS({ "../../node_module
34019
34026
  if (!recursive) return null;
34020
34027
  child = this.createGroup({ path: childName });
34021
34028
  }
34022
- if (!path$23.length) return child;
34029
+ if (!path$25.length) return child;
34023
34030
  return child.mkdir(pathArr, { recursive });
34024
34031
  }
34025
34032
  getChildGroups() {
@@ -34029,9 +34036,9 @@ var require_AbstractGroup = require_picocolors$1.__commonJS({ "../../node_module
34029
34036
  let prefix = "";
34030
34037
  if (type$1 == "staticLibrary") prefix = "lib";
34031
34038
  let extension = constants_1.PRODUCT_UTI_EXTENSIONS[type$1];
34032
- let path$23 = `${prefix}${productBaseName}`;
34033
- if (extension) path$23 += `.${extension}`;
34034
- let ref = newReference(this, path$23, "BUILT_PRODUCTS_DIR");
34039
+ let path$25 = `${prefix}${productBaseName}`;
34040
+ if (extension) path$25 += `.${extension}`;
34041
+ let ref = newReference(this, path$25, "BUILT_PRODUCTS_DIR");
34035
34042
  ref.props.includeInIndex = 0;
34036
34043
  ref.setExplicitFileType();
34037
34044
  return ref;
@@ -34415,9 +34422,9 @@ var import_build = require_picocolors$1.__toESM(require_build());
34415
34422
  var import_out = require_picocolors$1.__toESM(require_fingerprint.require_out());
34416
34423
  var import_plist = require_picocolors$1.__toESM(require_fingerprint.require_plist());
34417
34424
  var import_valid$3 = require_picocolors$1.__toESM(require_valid());
34418
- const isFileExist = async (path$23) => {
34425
+ const isFileExist = async (path$25) => {
34419
34426
  try {
34420
- await fs_promises.default.access(path$23);
34427
+ await fs_promises.default.access(path$25);
34421
34428
  return true;
34422
34429
  } catch {
34423
34430
  return false;
@@ -34482,7 +34489,7 @@ const getNativeAppVersion = async (platform$2) => {
34482
34489
 
34483
34490
  //#endregion
34484
34491
  //#region src/commands/buildNative.ts
34485
- var import_picocolors$3 = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
34492
+ var import_picocolors$4 = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
34486
34493
  const nativeBuild = async (options) => {
34487
34494
  printBanner();
34488
34495
  const cwd = (0, __hot_updater_plugin_core.getCwd)();
@@ -34511,7 +34518,7 @@ const nativeBuild = async (options) => {
34511
34518
  s$1.start(`Fingerprinting (${platform$2})`);
34512
34519
  const generatedFingerprint = (await require_fingerprint.createAndInjectFingerprintFiles())[platform$2];
34513
34520
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34514
- if (!require_fingerprint.isFingerprintEquals(localFingerprint, generatedFingerprint)) __clack_prompts.log.info(`${import_picocolors$3.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34521
+ 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.`);
34515
34522
  target.fingerprintHash = generatedFingerprint.hash;
34516
34523
  } else if (config.updateStrategy === "appVersion") {
34517
34524
  const s$1 = __clack_prompts.spinner();
@@ -34524,29 +34531,41 @@ const nativeBuild = async (options) => {
34524
34531
  return;
34525
34532
  }
34526
34533
  }
34527
- const outputPath = options.outputPath ?? path.default.join(cwd, "nativebuild");
34528
- const normalizeOutputPath = path.default.isAbsolute(outputPath) ? outputPath : path.default.join(cwd, outputPath);
34534
+ const artifactResultStorePath = options.outputPath ?? path.default.join(getDefaultOutputPath(), "build", platform$2, platform$2 === "android" ? config.nativeBuild.android.aab ? "aab" : "apk" : "");
34535
+ const normalizeOutputPath = path.default.isAbsolute(artifactResultStorePath) ? artifactResultStorePath : path.default.join(cwd, artifactResultStorePath);
34529
34536
  const artifactPath = path.default.join(normalizeOutputPath, platform$2);
34530
34537
  const [buildPlugin] = await Promise.all([config.build({ cwd })]);
34531
34538
  try {
34532
34539
  const taskRef = {
34533
- buildResult: null,
34540
+ buildResult: {
34541
+ outputPath: null,
34542
+ stdout: null,
34543
+ buildDirectory: null
34544
+ },
34534
34545
  storageUri: null
34535
34546
  };
34536
34547
  await __clack_prompts.tasks([{
34537
34548
  title: `📦 Building Native (${buildPlugin.name})`,
34538
34549
  task: async () => {
34539
34550
  await buildPlugin.nativeBuild?.prebuild?.({ platform: platform$2 });
34540
- await runNativeBuild({
34551
+ const { buildDirectory, outputFile } = await runNativeBuild({
34541
34552
  platform: platform$2,
34542
34553
  config: config.nativeBuild
34543
34554
  });
34555
+ taskRef.buildResult.outputPath = outputFile;
34556
+ taskRef.buildResult.buildDirectory = buildDirectory;
34544
34557
  await buildPlugin.nativeBuild?.postbuild?.({ platform: platform$2 });
34545
34558
  await fs.default.promises.mkdir(normalizeOutputPath, { recursive: true });
34559
+ __clack_prompts.log.success(`Artifact stored at ${import_picocolors$4.default.blueBright(path.default.relative((0, __hot_updater_plugin_core.getCwd)(), artifactResultStorePath))}.`);
34560
+ await fs.default.promises.rm(artifactResultStorePath, {
34561
+ recursive: true,
34562
+ force: true
34563
+ });
34564
+ await fs.default.promises.cp(taskRef.buildResult.buildDirectory, artifactResultStorePath, { recursive: true });
34546
34565
  return `Build Complete (${buildPlugin.name})`;
34547
34566
  }
34548
34567
  }]);
34549
- if (taskRef.buildResult?.stdout) __clack_prompts.log.success(taskRef.buildResult.stdout);
34568
+ if (taskRef.buildResult.stdout) __clack_prompts.log.success(taskRef.buildResult.stdout);
34550
34569
  } catch (e) {
34551
34570
  await fs.default.promises.rm(artifactPath, { force: true });
34552
34571
  if (e instanceof ExecaError) console.error(e);
@@ -34982,6 +35001,36 @@ const getLatestGitCommit = async () => {
34982
35001
  return null;
34983
35002
  }
34984
35003
  };
35004
+ /**
35005
+ * append globLines into project's .gitignore
35006
+ *
35007
+ * @returns whether .gitignore was changed
35008
+ */
35009
+ const appendToProjectRootGitignore = ({ cwd, globLines }) => {
35010
+ if (!globLines.length) return false;
35011
+ const comment = "# hot-updater";
35012
+ const projectDir = cwd ?? (0, __hot_updater_plugin_core.getCwd)();
35013
+ const gitIgnorePath = path.default.join(projectDir, ".gitignore");
35014
+ if (fs.default.existsSync(gitIgnorePath)) {
35015
+ const content = fs.default.readFileSync(gitIgnorePath, { encoding: "utf8" });
35016
+ const allLines = content.split(/\r?\n/);
35017
+ const willAppendedLines = [];
35018
+ for (const line of globLines) if (!allLines.find((l) => l.trim() === line)) willAppendedLines.push(line);
35019
+ if (!willAppendedLines.length) return false;
35020
+ fs.default.appendFileSync(gitIgnorePath, [comment, ...willAppendedLines].join("\n"), { encoding: "utf8" });
35021
+ } else fs.default.writeFileSync(gitIgnorePath, [comment, ...globLines].join("\n"), { encoding: "utf8" });
35022
+ return true;
35023
+ };
35024
+
35025
+ //#endregion
35026
+ //#region src/utils/output/appendOutputDirectoryIntoGitignore.ts
35027
+ const appendOutputDirectoryIntoGitignore = ({ cwd } = {}) => {
35028
+ const appendedLines = [".hot-updater/output"];
35029
+ return appendToProjectRootGitignore({
35030
+ cwd,
35031
+ globLines: appendedLines
35032
+ });
35033
+ };
34985
35034
 
34986
35035
  //#endregion
34987
35036
  //#region src/utils/version/getDefaultTargetAppVersion.ts
@@ -35425,6 +35474,7 @@ var open_default = open;
35425
35474
 
35426
35475
  //#endregion
35427
35476
  //#region src/commands/deploy.ts
35477
+ var import_picocolors$3 = require_picocolors$1.__toESM(require_picocolors$1.require_picocolors());
35428
35478
  var import_valid$1 = require_picocolors$1.__toESM(require_valid());
35429
35479
  const deploy = async (options) => {
35430
35480
  printBanner();
@@ -35502,11 +35552,12 @@ const deploy = async (options) => {
35502
35552
  else __clack_prompts.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35503
35553
  process.exit(1);
35504
35554
  }
35505
- const outputPath = options.bundleOutputPath ?? cwd;
35555
+ if (appendOutputDirectoryIntoGitignore()) __clack_prompts.log.info(".gitignore has been modified");
35556
+ const outputPath = options.bundleOutputPath ?? getDefaultOutputPath();
35506
35557
  let bundleId = null;
35507
35558
  let fileHash;
35508
35559
  const normalizeOutputPath = path.default.isAbsolute(outputPath) ? outputPath : path.default.join(cwd, outputPath);
35509
- const bundlePath = path.default.join(normalizeOutputPath, "bundle.zip");
35560
+ const bundlePath = path.default.join(normalizeOutputPath, "bundle", "bundle.zip");
35510
35561
  const [buildPlugin, storagePlugin, databasePlugin] = await Promise.all([
35511
35562
  config.build({ cwd }),
35512
35563
  config.storage({ cwd }),
@@ -35532,6 +35583,7 @@ const deploy = async (options) => {
35532
35583
  });
35533
35584
  bundleId = taskRef.buildResult.bundleId;
35534
35585
  fileHash = await getFileHashFromFile(bundlePath);
35586
+ __clack_prompts.log.success(`Bundle stored at ${import_picocolors$3.default.blueBright(path.default.relative(cwd, bundlePath))}`);
35535
35587
  return `✅ Build Complete (${buildPlugin.name})`;
35536
35588
  }
35537
35589
  }]);
@@ -35576,7 +35628,6 @@ const deploy = async (options) => {
35576
35628
  throw e;
35577
35629
  }
35578
35630
  await databasePlugin.onUnmount?.();
35579
- await fs.default.promises.rm(bundlePath);
35580
35631
  return `✅ Update Complete (${databasePlugin.name})`;
35581
35632
  }
35582
35633
  }]);
@@ -35609,7 +35660,6 @@ const deploy = async (options) => {
35609
35660
  process.exit(1);
35610
35661
  } finally {
35611
35662
  await databasePlugin.onUnmount?.();
35612
- await fs.default.promises.rm(bundlePath, { force: true });
35613
35663
  }
35614
35664
  };
35615
35665
 
@@ -35807,6 +35857,7 @@ const init = async () => {
35807
35857
  }
35808
35858
  default: throw new Error("Invalid provider");
35809
35859
  }
35860
+ if (appendOutputDirectoryIntoGitignore()) __clack_prompts.log.info(".gitignore has been modified");
35810
35861
  };
35811
35862
 
35812
35863
  //#endregion
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-OFVOrezl.js";
3
- import { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff } from "./fingerprint-BQRKmTNL.js";
3
+ import { AndroidConfigParser, IosConfigParser, createAndInjectFingerprintFiles, generateFingerprints, getFingerprintDiff, isFingerprintEquals, nativeFingerprint, readLocalFingerprint, require_base64_js, require_out, require_plist, showFingerprintDiff } from "./fingerprint-CHhBVEC9.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";
@@ -9570,28 +9570,31 @@ Tasks ${tasks.join(", ")}
9570
9570
  else if (e instanceof Error) p$8.log.error(e.message);
9571
9571
  throw new Error("Faild to build the app. See the error above for details from Gradle.");
9572
9572
  }
9573
- const outputFilePath = await findOutputFile({
9573
+ return findBuildDirectory({
9574
9574
  androidProjectPath,
9575
9575
  moduleName: appModuleName,
9576
9576
  tasks
9577
9577
  });
9578
- p$8.log.success(`Output file: ${outputFilePath}`);
9579
9578
  }
9580
- async function findOutputFile({ moduleName, tasks, androidProjectPath }) {
9579
+ async function findBuildDirectory({ moduleName, tasks, androidProjectPath }) {
9581
9580
  const selectedTask = tasks.find((t$5) => t$5.startsWith("install") || t$5.startsWith("assemble") || t$5.startsWith("bundle"));
9582
- if (!selectedTask) return false;
9581
+ if (!selectedTask) throw new Error(`Not supported gradle task: ${tasks.join(", ")}`);
9583
9582
  const variantFromSelectedTask = selectedTask?.replace("install", "")?.replace("assemble", "")?.replace("bundle", "").split(/(?=[A-Z])/);
9584
9583
  const variantPath = variantFromSelectedTask?.join("/")?.toLowerCase();
9585
9584
  const variant = variantFromSelectedTask?.join("-")?.toLowerCase();
9586
9585
  const isAabOutput = selectedTask?.includes("bundle") === true;
9587
9586
  const buildDirectory = `${androidProjectPath}/${moduleName}/build/outputs/${isAabOutput ? "bundle" : "apk"}/${variantPath}`;
9588
- const outputPath = await getOutputFilePath({
9587
+ if (!buildDirectory) throw new Error("Failed to find Android gradle build directory.");
9588
+ const outputFile = await getOutputFilePath({
9589
9589
  aab: isAabOutput,
9590
9590
  appModuleName: moduleName,
9591
9591
  buildDirectory,
9592
9592
  variant
9593
9593
  });
9594
- return outputPath ?? null;
9594
+ return {
9595
+ buildDirectory,
9596
+ outputFile
9597
+ };
9595
9598
  }
9596
9599
  async function getOutputFilePath({ aab, appModuleName, buildDirectory, variant }) {
9597
9600
  const outputFile = `${appModuleName}-${variant}.${aab ? "aab" : "apk"}`;
@@ -9617,13 +9620,17 @@ const runAndroidNativeBuild = async ({ config }) => {
9617
9620
  //#region src/utils/nativeBuild/runNativeBuild.ts
9618
9621
  const runNativeBuild = async ({ platform: platform$2, config }) => {
9619
9622
  switch (platform$2) {
9620
- case "android":
9621
- await runAndroidNativeBuild({ config: config.android });
9622
- break;
9623
+ case "android": return runAndroidNativeBuild({ config: config.android });
9623
9624
  case "ios": throw new Error("Not Implemented");
9624
9625
  }
9625
9626
  };
9626
9627
 
9628
+ //#endregion
9629
+ //#region src/utils/output/getDefaultOutputPath.ts
9630
+ const getDefaultOutputPath = () => {
9631
+ return path$1.join(getCwd(), ".hot-updater", "output");
9632
+ };
9633
+
9627
9634
  //#endregion
9628
9635
  //#region ../../node_modules/.pnpm/tsdown@0.12.6_typescript@5.8.3/node_modules/tsdown/esm-shims.js
9629
9636
  const getFilename = () => fileURLToPath(import.meta.url);
@@ -10804,11 +10811,11 @@ var require_lib$4 = __commonJS({ "../../node_modules/.pnpm/@babel+helper-validat
10804
10811
  //#region ../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js
10805
10812
  var require_lib$3 = __commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.27.1/node_modules/@babel/code-frame/lib/index.js"(exports) {
10806
10813
  Object.defineProperty(exports, "__esModule", { value: true });
10807
- var picocolors$4 = require_picocolors();
10814
+ var picocolors$5 = require_picocolors();
10808
10815
  var jsTokens = require_js_tokens();
10809
10816
  var helperValidatorIdentifier = require_lib$4();
10810
10817
  function isColorSupported() {
10811
- return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$4.isColorSupported;
10818
+ return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors$5.isColorSupported;
10812
10819
  }
10813
10820
  const compose = (f, g) => (v) => f(g(v));
10814
10821
  function buildDefs(colors) {
@@ -10828,8 +10835,8 @@ var require_lib$3 = __commonJS({ "../../node_modules/.pnpm/@babel+code-frame@7.2
10828
10835
  reset: colors.reset
10829
10836
  };
10830
10837
  }
10831
- const defsOn = buildDefs(picocolors$4.createColors(true));
10832
- const defsOff = buildDefs(picocolors$4.createColors(false));
10838
+ const defsOn = buildDefs(picocolors$5.createColors(true));
10839
+ const defsOff = buildDefs(picocolors$5.createColors(false));
10833
10840
  function getDefs(enabled) {
10834
10841
  return enabled ? defsOn : defsOff;
10835
10842
  }
@@ -34497,7 +34504,7 @@ const getNativeAppVersion = async (platform$2) => {
34497
34504
 
34498
34505
  //#endregion
34499
34506
  //#region src/commands/buildNative.ts
34500
- var import_picocolors$3 = __toESM(require_picocolors());
34507
+ var import_picocolors$4 = __toESM(require_picocolors());
34501
34508
  const nativeBuild = async (options) => {
34502
34509
  printBanner$1();
34503
34510
  const cwd = getCwd();
@@ -34526,7 +34533,7 @@ const nativeBuild = async (options) => {
34526
34533
  s$1.start(`Fingerprinting (${platform$2})`);
34527
34534
  const generatedFingerprint = (await createAndInjectFingerprintFiles())[platform$2];
34528
34535
  s$1.stop(`Fingerprint(${platform$2}): ${generatedFingerprint}`);
34529
- if (!isFingerprintEquals(localFingerprint, generatedFingerprint)) p$7.log.info(`${import_picocolors$3.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34536
+ if (!isFingerprintEquals(localFingerprint, generatedFingerprint)) p$7.log.info(`${import_picocolors$4.default.blue(`fingerprint.json, ${platform$2} fingerprint config files`)} have been changed.`);
34530
34537
  target.fingerprintHash = generatedFingerprint.hash;
34531
34538
  } else if (config.updateStrategy === "appVersion") {
34532
34539
  const s$1 = p$7.spinner();
@@ -34539,29 +34546,41 @@ const nativeBuild = async (options) => {
34539
34546
  return;
34540
34547
  }
34541
34548
  }
34542
- const outputPath = options.outputPath ?? path$1.join(cwd, "nativebuild");
34543
- const normalizeOutputPath = path$1.isAbsolute(outputPath) ? outputPath : path$1.join(cwd, outputPath);
34549
+ const artifactResultStorePath = options.outputPath ?? path$1.join(getDefaultOutputPath(), "build", platform$2, platform$2 === "android" ? config.nativeBuild.android.aab ? "aab" : "apk" : "");
34550
+ const normalizeOutputPath = path$1.isAbsolute(artifactResultStorePath) ? artifactResultStorePath : path$1.join(cwd, artifactResultStorePath);
34544
34551
  const artifactPath = path$1.join(normalizeOutputPath, platform$2);
34545
34552
  const [buildPlugin] = await Promise.all([config.build({ cwd })]);
34546
34553
  try {
34547
34554
  const taskRef = {
34548
- buildResult: null,
34555
+ buildResult: {
34556
+ outputPath: null,
34557
+ stdout: null,
34558
+ buildDirectory: null
34559
+ },
34549
34560
  storageUri: null
34550
34561
  };
34551
34562
  await p$7.tasks([{
34552
34563
  title: `📦 Building Native (${buildPlugin.name})`,
34553
34564
  task: async () => {
34554
34565
  await buildPlugin.nativeBuild?.prebuild?.({ platform: platform$2 });
34555
- await runNativeBuild({
34566
+ const { buildDirectory, outputFile } = await runNativeBuild({
34556
34567
  platform: platform$2,
34557
34568
  config: config.nativeBuild
34558
34569
  });
34570
+ taskRef.buildResult.outputPath = outputFile;
34571
+ taskRef.buildResult.buildDirectory = buildDirectory;
34559
34572
  await buildPlugin.nativeBuild?.postbuild?.({ platform: platform$2 });
34560
34573
  await fs$1.promises.mkdir(normalizeOutputPath, { recursive: true });
34574
+ p$7.log.success(`Artifact stored at ${import_picocolors$4.default.blueBright(path$1.relative(getCwd(), artifactResultStorePath))}.`);
34575
+ await fs$1.promises.rm(artifactResultStorePath, {
34576
+ recursive: true,
34577
+ force: true
34578
+ });
34579
+ await fs$1.promises.cp(taskRef.buildResult.buildDirectory, artifactResultStorePath, { recursive: true });
34561
34580
  return `Build Complete (${buildPlugin.name})`;
34562
34581
  }
34563
34582
  }]);
34564
- if (taskRef.buildResult?.stdout) p$7.log.success(taskRef.buildResult.stdout);
34583
+ if (taskRef.buildResult.stdout) p$7.log.success(taskRef.buildResult.stdout);
34565
34584
  } catch (e) {
34566
34585
  await fs$1.promises.rm(artifactPath, { force: true });
34567
34586
  if (e instanceof ExecaError) console.error(e);
@@ -34997,6 +35016,36 @@ const getLatestGitCommit = async () => {
34997
35016
  return null;
34998
35017
  }
34999
35018
  };
35019
+ /**
35020
+ * append globLines into project's .gitignore
35021
+ *
35022
+ * @returns whether .gitignore was changed
35023
+ */
35024
+ const appendToProjectRootGitignore = ({ cwd, globLines }) => {
35025
+ if (!globLines.length) return false;
35026
+ const comment = "# hot-updater";
35027
+ const projectDir = cwd ?? getCwd();
35028
+ const gitIgnorePath = path$1.join(projectDir, ".gitignore");
35029
+ if (fs$1.existsSync(gitIgnorePath)) {
35030
+ const content = fs$1.readFileSync(gitIgnorePath, { encoding: "utf8" });
35031
+ const allLines = content.split(/\r?\n/);
35032
+ const willAppendedLines = [];
35033
+ for (const line of globLines) if (!allLines.find((l) => l.trim() === line)) willAppendedLines.push(line);
35034
+ if (!willAppendedLines.length) return false;
35035
+ fs$1.appendFileSync(gitIgnorePath, [comment, ...willAppendedLines].join("\n"), { encoding: "utf8" });
35036
+ } else fs$1.writeFileSync(gitIgnorePath, [comment, ...globLines].join("\n"), { encoding: "utf8" });
35037
+ return true;
35038
+ };
35039
+
35040
+ //#endregion
35041
+ //#region src/utils/output/appendOutputDirectoryIntoGitignore.ts
35042
+ const appendOutputDirectoryIntoGitignore = ({ cwd } = {}) => {
35043
+ const appendedLines = [".hot-updater/output"];
35044
+ return appendToProjectRootGitignore({
35045
+ cwd,
35046
+ globLines: appendedLines
35047
+ });
35048
+ };
35000
35049
 
35001
35050
  //#endregion
35002
35051
  //#region src/utils/version/getDefaultTargetAppVersion.ts
@@ -35440,6 +35489,7 @@ var open_default = open;
35440
35489
 
35441
35490
  //#endregion
35442
35491
  //#region src/commands/deploy.ts
35492
+ var import_picocolors$3 = __toESM(require_picocolors());
35443
35493
  var import_valid$1 = __toESM(require_valid());
35444
35494
  const deploy = async (options) => {
35445
35495
  printBanner$1();
@@ -35517,11 +35567,12 @@ const deploy = async (options) => {
35517
35567
  else p$6.log.error("Target app version not found. -t <targetAppVersion> semver format (e.g. 1.0.0, 1.x.x)");
35518
35568
  process.exit(1);
35519
35569
  }
35520
- const outputPath = options.bundleOutputPath ?? cwd;
35570
+ if (appendOutputDirectoryIntoGitignore()) p$6.log.info(".gitignore has been modified");
35571
+ const outputPath = options.bundleOutputPath ?? getDefaultOutputPath();
35521
35572
  let bundleId = null;
35522
35573
  let fileHash;
35523
35574
  const normalizeOutputPath = path$1.isAbsolute(outputPath) ? outputPath : path$1.join(cwd, outputPath);
35524
- const bundlePath = path$1.join(normalizeOutputPath, "bundle.zip");
35575
+ const bundlePath = path$1.join(normalizeOutputPath, "bundle", "bundle.zip");
35525
35576
  const [buildPlugin, storagePlugin, databasePlugin] = await Promise.all([
35526
35577
  config.build({ cwd }),
35527
35578
  config.storage({ cwd }),
@@ -35547,6 +35598,7 @@ const deploy = async (options) => {
35547
35598
  });
35548
35599
  bundleId = taskRef.buildResult.bundleId;
35549
35600
  fileHash = await getFileHashFromFile(bundlePath);
35601
+ p$6.log.success(`Bundle stored at ${import_picocolors$3.default.blueBright(path$1.relative(cwd, bundlePath))}`);
35550
35602
  return `✅ Build Complete (${buildPlugin.name})`;
35551
35603
  }
35552
35604
  }]);
@@ -35591,7 +35643,6 @@ const deploy = async (options) => {
35591
35643
  throw e;
35592
35644
  }
35593
35645
  await databasePlugin.onUnmount?.();
35594
- await fs$1.promises.rm(bundlePath);
35595
35646
  return `✅ Update Complete (${databasePlugin.name})`;
35596
35647
  }
35597
35648
  }]);
@@ -35624,7 +35675,6 @@ const deploy = async (options) => {
35624
35675
  process.exit(1);
35625
35676
  } finally {
35626
35677
  await databasePlugin.onUnmount?.();
35627
- await fs$1.promises.rm(bundlePath, { force: true });
35628
35678
  }
35629
35679
  };
35630
35680
 
@@ -35822,6 +35872,7 @@ const init = async () => {
35822
35872
  }
35823
35873
  default: throw new Error("Invalid provider");
35824
35874
  }
35875
+ if (appendOutputDirectoryIntoGitignore()) p$4.log.info(".gitignore has been modified");
35825
35876
  };
35826
35877
 
35827
35878
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hot-updater",
3
3
  "type": "module",
4
- "version": "0.19.8",
4
+ "version": "0.19.9",
5
5
  "bin": {
6
6
  "hot-updater": "./dist/index.js"
7
7
  },
@@ -53,9 +53,9 @@
53
53
  "cosmiconfig": "^9.0.0",
54
54
  "cosmiconfig-typescript-loader": "^5.0.0",
55
55
  "es-git": "^0.2.0",
56
- "@hot-updater/plugin-core": "0.19.8",
57
- "@hot-updater/core": "0.19.8",
58
- "@hot-updater/console": "0.19.8"
56
+ "@hot-updater/console": "0.19.9",
57
+ "@hot-updater/plugin-core": "0.19.9",
58
+ "@hot-updater/core": "0.19.9"
59
59
  },
60
60
  "devDependencies": {
61
61
  "fast-xml-parser": "^5.2.3",
@@ -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/cloudflare": "0.19.8",
90
- "@hot-updater/supabase": "0.19.8",
91
- "@hot-updater/aws": "0.19.8",
92
- "@hot-updater/firebase": "0.19.8"
89
+ "@hot-updater/aws": "0.19.9",
90
+ "@hot-updater/cloudflare": "0.19.9",
91
+ "@hot-updater/firebase": "0.19.9",
92
+ "@hot-updater/supabase": "0.19.9"
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@hot-updater/aws": "*",