@todesktop/cli 1.9.3 → 1.9.5

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/cli.js CHANGED
@@ -325,20 +325,21 @@ var useExit_default = () => {
325
325
  };
326
326
  };
327
327
 
328
+ // src/utilities/fixMacUrl.ts
329
+ function fixMacUrl(url) {
330
+ const baseUrl = new URL(url);
331
+ baseUrl.pathname = `${baseUrl.pathname}/zip/${process.arch}`;
332
+ return baseUrl.href;
333
+ }
334
+
328
335
  // src/components/BuildCompleteMessage.tsx
329
- var import_path2 = __toESM(require("path"));
330
336
  var import_jsx_runtime = require("react/jsx-runtime");
331
- var addTrailingSlash = (url) => {
332
- return url.endsWith("/") ? url : `${url}/`;
333
- };
334
337
  var BuildCompleteMessage = ({ build }) => {
338
+ var _a;
335
339
  const exit = useExit_default();
336
340
  let url = build.standardUniversalDownloadUrl;
337
- if (process.platform === "darwin") {
338
- url = new URL(
339
- import_path2.default.posix.join("mac", "zip", process.arch),
340
- addTrailingSlash(url)
341
- ).href;
341
+ if (process.platform === "darwin" && ((_a = build.mac) == null ? void 0 : _a.standardDownloadUrl)) {
342
+ url = fixMacUrl(build.mac.standardDownloadUrl);
342
343
  }
343
344
  logForCI_default(`Build complete! ${url}`);
344
345
  (0, import_react.useEffect)(() => {
@@ -361,7 +362,6 @@ var BuildCompleteMessage_default = BuildCompleteMessage;
361
362
  var import_prop_types2 = __toESM(require("prop-types"));
362
363
  var import_ink3 = require("ink");
363
364
  var import_ink_link2 = __toESM(require("ink-link"));
364
- var import_path3 = __toESM(require("path"));
365
365
  var import_jsx_runtime2 = require("react/jsx-runtime");
366
366
  var preLabelMaxWidth = "More info: ".length;
367
367
  var getProgressPercentageLabel = (percentage, activityType) => {
@@ -394,7 +394,7 @@ var PlatformProgress = ({
394
394
  let progressIndicator;
395
395
  if (activityType === "done") {
396
396
  if (platform === "mac") {
397
- downloadUrl = import_path3.default.posix.join(downloadUrl, "mac", "zip", process.arch);
397
+ downloadUrl = fixMacUrl(downloadUrl);
398
398
  }
399
399
  progressIndicator = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Box, { flexDirection: "column", marginBottom: 1, children: [
400
400
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Text, { children: [
@@ -837,7 +837,7 @@ var MainLayout = ({
837
837
  ...previousState,
838
838
  canCancelBuild: !import_is_ci3.default && isRawModeSupported && !isCancellingBuild && isBuildCancellable(build)
839
839
  }));
840
- }, [build, isCancellingBuild]);
840
+ }, [build, isCancellingBuild, isRawModeSupported]);
841
841
  onInput(
842
842
  async (input, key) => {
843
843
  if (key.escape && canCancelBuild) {
@@ -972,7 +972,7 @@ async function postToFirebaseFunction_default(functionName, body = {}, config2 =
972
972
  }
973
973
 
974
974
  // src/utilities/projectConfig/getProjectConfig.ts
975
- var import_path5 = require("path");
975
+ var import_path3 = require("path");
976
976
  var import_fs = require("fs");
977
977
  var import_find_up = __toESM(require("find-up"));
978
978
 
@@ -982,14 +982,14 @@ function loadConfig(configPath) {
982
982
  }
983
983
 
984
984
  // src/utilities/projectConfig/resolveConfigPaths.ts
985
- var path5 = __toESM(require("path"));
985
+ var path3 = __toESM(require("path"));
986
986
  function resolveConfigPaths({
987
987
  config: config2,
988
988
  projectRoot
989
989
  }) {
990
- const appRoot = config2.appPath ? path5.isAbsolute(config2.appPath) ? config2.appPath : path5.join(projectRoot, config2.appPath) : projectRoot;
990
+ const appRoot = config2.appPath ? path3.isAbsolute(config2.appPath) ? config2.appPath : path3.join(projectRoot, config2.appPath) : projectRoot;
991
991
  const transformIfExists = (value, transformer) => value ? transformer(value) : void 0;
992
- const resolvePath = (filePath) => path5.isAbsolute(filePath) ? filePath : path5.join(projectRoot, filePath);
992
+ const resolvePath = (filePath) => path3.isAbsolute(filePath) ? filePath : path3.join(projectRoot, filePath);
993
993
  const result = {
994
994
  ...config2,
995
995
  appPath: appRoot,
@@ -1024,6 +1024,11 @@ function resolveConfigPaths({
1024
1024
  if (config2.mac.entitlements) {
1025
1025
  result.mac.entitlements = resolvePath(config2.mac.entitlements);
1026
1026
  }
1027
+ if (config2.mac.entitlementsInherit) {
1028
+ result.mac.entitlementsInherit = resolvePath(
1029
+ config2.mac.entitlementsInherit
1030
+ );
1031
+ }
1027
1032
  if (config2.mac.requirements) {
1028
1033
  result.mac.requirements = resolvePath(config2.mac.requirements);
1029
1034
  }
@@ -1070,7 +1075,7 @@ var import_better_ajv_errors2 = __toESM(require("better-ajv-errors"));
1070
1075
  var import_ajv2 = require("ajv");
1071
1076
  var import_email_regex = __toESM(require("email-regex"));
1072
1077
  var fs3 = __toESM(require("fs"));
1073
- var path6 = __toESM(require("path"));
1078
+ var path4 = __toESM(require("path"));
1074
1079
  var import_parse_author = __toESM(require("parse-author"));
1075
1080
  var semver = __toESM(require("semver"));
1076
1081
 
@@ -1251,8 +1256,8 @@ var addCustomKeywords_default = (ajv, context) => {
1251
1256
  }
1252
1257
  ]);
1253
1258
  }
1254
- const filePath = path6.isAbsolute(data) ? data : path6.join(schema.from, data);
1255
- if (path6.relative(schema.from, filePath).startsWith("..")) {
1259
+ const filePath = path4.isAbsolute(data) ? data : path4.join(schema.from, data);
1260
+ if (path4.relative(schema.from, filePath).startsWith("..")) {
1256
1261
  throw new import_ajv2.ValidationError([
1257
1262
  {
1258
1263
  keyword: mustBeDirectory ? "Directory" : "File",
@@ -1260,11 +1265,11 @@ var addCustomKeywords_default = (ajv, context) => {
1260
1265
  }
1261
1266
  ]);
1262
1267
  }
1263
- if (schema.extensions && !schema.extensions.includes(path6.extname(filePath).substr(1))) {
1268
+ if (schema.extensions && !schema.extensions.includes(path4.extname(filePath).substr(1))) {
1264
1269
  throw new import_ajv2.ValidationError([
1265
1270
  {
1266
1271
  keyword: "File extension",
1267
- message: `invalid. ${path6.extname(data)} Must be${schema.extensions > 1 ? "one of the following:" : ""} "${schema.extensions.join('", "')}"`
1272
+ message: `invalid. ${path4.extname(data)} Must be${schema.extensions > 1 ? "one of the following:" : ""} "${schema.extensions.join('", "')}"`
1268
1273
  }
1269
1274
  ]);
1270
1275
  }
@@ -1293,8 +1298,8 @@ var addCustomKeywords_default = (ajv, context) => {
1293
1298
  ]);
1294
1299
  }
1295
1300
  if (schema.mustBeElectronApp) {
1296
- const appRoot = path6.resolve(filePath);
1297
- const pkgPath = path6.join(appRoot, "package.json");
1301
+ const appRoot = path4.resolve(filePath);
1302
+ const pkgPath = path4.join(appRoot, "package.json");
1298
1303
  if (!fs3.existsSync(pkgPath)) {
1299
1304
  throw new import_ajv2.ValidationError([
1300
1305
  {
@@ -1318,7 +1323,7 @@ var addCustomKeywords_default = (ajv, context) => {
1318
1323
  validatePackageJSON_default(pkg, pkgPath, context);
1319
1324
  const mainFilePath = pkg.main;
1320
1325
  if (mainFilePath) {
1321
- const resolvedMainFilePath = path6.join(appRoot, mainFilePath);
1326
+ const resolvedMainFilePath = path4.join(appRoot, mainFilePath);
1322
1327
  if (!fs3.existsSync(resolvedMainFilePath)) {
1323
1328
  throw new import_ajv2.ValidationError([
1324
1329
  {
@@ -1328,7 +1333,7 @@ var addCustomKeywords_default = (ajv, context) => {
1328
1333
  ]);
1329
1334
  }
1330
1335
  } else {
1331
- if (!fs3.existsSync(path6.join(appRoot, "index.js"))) {
1336
+ if (!fs3.existsSync(path4.join(appRoot, "index.js"))) {
1332
1337
  throw new import_ajv2.ValidationError([
1333
1338
  {
1334
1339
  keyword: "App",
@@ -1638,6 +1643,15 @@ var full_default = (context) => {
1638
1643
  },
1639
1644
  minLength: 1
1640
1645
  },
1646
+ entitlementsInherit: {
1647
+ type: "string",
1648
+ file: {
1649
+ from: context.projectRoot,
1650
+ extensions: ["plist"],
1651
+ mustBeFile: true
1652
+ },
1653
+ minLength: 1
1654
+ },
1641
1655
  extendInfo: {
1642
1656
  type: "object"
1643
1657
  },
@@ -1686,6 +1700,9 @@ var full_default = (context) => {
1686
1700
  type: {
1687
1701
  type: "string",
1688
1702
  enum: ["development", "distribution"]
1703
+ },
1704
+ x64ArchFiles: {
1705
+ type: "string"
1689
1706
  }
1690
1707
  }
1691
1708
  },
@@ -1890,7 +1907,7 @@ We made this change because Electron also uses the "productName" if it exists in
1890
1907
  }
1891
1908
 
1892
1909
  // src/utilities/projectConfig/computeFullProjectConfig.ts
1893
- var import_path4 = require("path");
1910
+ var import_path2 = require("path");
1894
1911
  var import_lodash2 = __toESM(require("lodash.merge"));
1895
1912
  function computeFullProjectConfig(partialConfig, projectRoot) {
1896
1913
  if (!partialConfig.extends) {
@@ -1898,7 +1915,7 @@ function computeFullProjectConfig(partialConfig, projectRoot) {
1898
1915
  return partialConfig;
1899
1916
  } else {
1900
1917
  logger_default.debug("Extends field found, resolving");
1901
- const parentConfigPath = (0, import_path4.resolve)(projectRoot, partialConfig.extends);
1918
+ const parentConfigPath = (0, import_path2.resolve)(projectRoot, partialConfig.extends);
1902
1919
  const parentConfig = loadConfig(parentConfigPath);
1903
1920
  parentConfig.appPath = parentConfig.appPath || ".";
1904
1921
  const parentFullConfig = computeFullProjectConfig(
@@ -1922,13 +1939,13 @@ function getProjectConfig(configPath) {
1922
1939
  );
1923
1940
  }
1924
1941
  } else {
1925
- configPath = (0, import_path5.resolve)(process.cwd(), configPath);
1942
+ configPath = (0, import_path3.resolve)(process.cwd(), configPath);
1926
1943
  if (!(0, import_fs.existsSync)(configPath)) {
1927
1944
  logger_default.error("Provided config path does not exist");
1928
1945
  throw new Error(`Config file not found at ${configPath}`);
1929
1946
  }
1930
1947
  }
1931
- const projectRoot = (0, import_path5.dirname)(configPath);
1948
+ const projectRoot = (0, import_path3.dirname)(configPath);
1932
1949
  const partialConfig = loadConfig(configPath);
1933
1950
  const config2 = computeFullProjectConfig(partialConfig, projectRoot);
1934
1951
  validateConfig({ config: config2, projectRoot });
@@ -1949,7 +1966,7 @@ var shouldExitOnBuildFailure_default = (build) => {
1949
1966
 
1950
1967
  // src/commands/build/utilities/getPackageJson.ts
1951
1968
  var import_lodash3 = __toESM(require("lodash.merge"));
1952
- var import_path6 = __toESM(require("path"));
1969
+ var import_path4 = __toESM(require("path"));
1953
1970
  function deleteNullDeps(dep) {
1954
1971
  Object.keys(dep).forEach((key) => {
1955
1972
  if (dep[key] === null) {
@@ -1971,7 +1988,7 @@ function removeNullDependencies(pkgJson) {
1971
1988
  function getAppPkgJson({ config: config2 }) {
1972
1989
  const packageJsonFromConfig = config2.packageJson || {};
1973
1990
  const extendsFrom = packageJsonFromConfig.extends || "package.json";
1974
- const packageJsonFromFile = readJson(import_path6.default.join(config2.appPath, extendsFrom));
1991
+ const packageJsonFromFile = readJson(import_path4.default.join(config2.appPath, extendsFrom));
1975
1992
  return removeNullDependencies(
1976
1993
  (0, import_lodash3.default)({}, packageJsonFromFile, packageJsonFromConfig)
1977
1994
  );
@@ -2069,7 +2086,7 @@ function buildHasSettled(build) {
2069
2086
  // src/commands/build/utilities/uploadApplicationSource.ts
2070
2087
  var import_fast_glob = __toESM(require("fast-glob"));
2071
2088
  var fs5 = __toESM(require("fs"));
2072
- var path9 = __toESM(require("path"));
2089
+ var path7 = __toESM(require("path"));
2073
2090
 
2074
2091
  // src/commands/build/utilities/generateS3Key.ts
2075
2092
  var generateS3Key_default = ({ appId, buildId, filenameSuffix }) => `${appId}/sourceArchives/${buildId}--${filenameSuffix}`;
@@ -2131,7 +2148,7 @@ var import_archiver = __toESM(require("archiver"));
2131
2148
  var import_du = __toESM(require("du"));
2132
2149
  var import_fs2 = __toESM(require("fs"));
2133
2150
  var import_chalk = __toESM(require("chalk"));
2134
- var import_path7 = __toESM(require("path"));
2151
+ var import_path5 = __toESM(require("path"));
2135
2152
  async function zip_default({
2136
2153
  files,
2137
2154
  fileSizeLimit = 20,
@@ -2186,7 +2203,7 @@ Your app is larger than ${fileSizeLimit}MB. Your app is ${import_chalk.default.b
2186
2203
  processedFiles.forEach(({ from, isDirectory, stats, to }) => {
2187
2204
  if (isDirectory) {
2188
2205
  stream.directory(from, to);
2189
- } else if (appPkgJson && to === import_path7.default.join("app", "package.json")) {
2206
+ } else if (appPkgJson && to === import_path5.default.join("app", "package.json")) {
2190
2207
  stream.append(JSON.stringify(appPkgJson), {
2191
2208
  name: to
2192
2209
  });
@@ -2211,22 +2228,22 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
2211
2228
  if (globsInput && globsInput.length) {
2212
2229
  globs.push(
2213
2230
  ...globsInput,
2214
- path9.join(appPath, "package.json"),
2215
- path9.join(appPath, "package-lock.json"),
2216
- path9.join(appPath, "yarn.lock"),
2217
- path9.join(appPath, "pnpm-lock.yaml"),
2218
- path9.join(appPath, "shrinkwrap.yaml")
2231
+ path7.join(appPath, "package.json"),
2232
+ path7.join(appPath, "package-lock.json"),
2233
+ path7.join(appPath, "yarn.lock"),
2234
+ path7.join(appPath, "pnpm-lock.yaml"),
2235
+ path7.join(appPath, "shrinkwrap.yaml")
2219
2236
  );
2220
2237
  } else {
2221
2238
  globs.push("**");
2222
2239
  }
2223
2240
  for (const hookName of ["todesktop:beforeInstall", "todesktop:afterPack"]) {
2224
2241
  if (appPkgJson.scripts && appPkgJson.scripts[hookName]) {
2225
- globs.push(path9.join(appPath, appPkgJson.scripts[hookName]));
2242
+ globs.push(path7.join(appPath, appPkgJson.scripts[hookName]));
2226
2243
  }
2227
2244
  }
2228
2245
  const normalizedGlobs = globs.map((glob) => {
2229
- const globToUse = path9.isAbsolute(glob) ? path9.relative(appPath, glob) : glob;
2246
+ const globToUse = path7.isAbsolute(glob) ? path7.relative(appPath, glob) : glob;
2230
2247
  return globToUse.replace(/\\/g, "/").replace(/\/+$/, "");
2231
2248
  }).filter((glob) => !glob.startsWith("..") && !glob.startsWith("!.."));
2232
2249
  let absolutePaths = await (0, import_fast_glob.default)(normalizedGlobs, {
@@ -2241,7 +2258,7 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
2241
2258
  });
2242
2259
  if (process.platform === "win32") {
2243
2260
  absolutePaths = absolutePaths.map(
2244
- (absolutePath) => absolutePath.replace(/\//g, path9.sep)
2261
+ (absolutePath) => absolutePath.replace(/\//g, path7.sep)
2245
2262
  );
2246
2263
  }
2247
2264
  if (!absolutePaths || !absolutePaths.length) {
@@ -2253,21 +2270,21 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
2253
2270
  } else {
2254
2271
  let mainFilePath = appPath;
2255
2272
  if (appPkgJson.main) {
2256
- mainFilePath = path9.join(mainFilePath, appPkgJson.main);
2273
+ mainFilePath = path7.join(mainFilePath, appPkgJson.main);
2257
2274
  }
2258
2275
  if (fs5.statSync(mainFilePath).isDirectory()) {
2259
- mainFilePath = path9.join(mainFilePath, "index.js");
2276
+ mainFilePath = path7.join(mainFilePath, "index.js");
2260
2277
  }
2261
2278
  if (!absolutePaths.includes(mainFilePath)) {
2262
2279
  throw new Error(
2263
- `The "main" file specified in your package.json (${appPkgJson.main ? path9.relative(appPath, mainFilePath) : "defaults to index.js"}) is not set to be uploaded to our servers. This is likely due to how you have configured the \`appFiles\` option. Learn more at https://www.npmjs.com/package/@todesktop/cli#appfiles----optional-array-of-glob-patterns. If this is not the case, please contact us.`
2280
+ `The "main" file specified in your package.json (${appPkgJson.main ? path7.relative(appPath, mainFilePath) : "defaults to index.js"}) is not set to be uploaded to our servers. This is likely due to how you have configured the \`appFiles\` option. Learn more at https://www.npmjs.com/package/@todesktop/cli#appfiles----optional-array-of-glob-patterns. If this is not the case, please contact us.`
2264
2281
  );
2265
2282
  }
2266
2283
  }
2267
2284
  return absolutePaths.map((absolutePath) => {
2268
2285
  return {
2269
2286
  from: absolutePath,
2270
- to: path9.join("app", path9.relative(appPath, absolutePath))
2287
+ to: path7.join("app", path7.relative(appPath, absolutePath))
2271
2288
  };
2272
2289
  });
2273
2290
  };
@@ -2294,27 +2311,27 @@ async function uploadApplicationSource({
2294
2311
  ...(config2.extraContentFiles || []).map(({ from, to = "." }) => {
2295
2312
  return {
2296
2313
  from,
2297
- to: path9.join("extraContentFiles", to, path9.basename(from))
2314
+ to: path7.join("extraContentFiles", to, path7.basename(from))
2298
2315
  };
2299
2316
  }),
2300
2317
  ...(config2.extraResources || []).map(({ from, to = "." }) => {
2301
2318
  return {
2302
2319
  from,
2303
- to: path9.join("extraResources", to, path9.basename(from))
2320
+ to: path7.join("extraResources", to, path7.basename(from))
2304
2321
  };
2305
2322
  }),
2306
2323
  {
2307
2324
  from: config2.icon,
2308
- to: path9.join("icons", "appIcon" + path9.extname(config2.icon))
2325
+ to: path7.join("icons", "appIcon" + path7.extname(config2.icon))
2309
2326
  }
2310
2327
  ];
2311
2328
  if (config2.linux) {
2312
2329
  if (config2.linux.icon) {
2313
2330
  files.push({
2314
2331
  from: config2.linux.icon,
2315
- to: path9.join(
2332
+ to: path7.join(
2316
2333
  "icons",
2317
- "appIcon-linux" + path9.extname(config2.linux.icon)
2334
+ "appIcon-linux" + path7.extname(config2.linux.icon)
2318
2335
  )
2319
2336
  });
2320
2337
  }
@@ -2323,10 +2340,10 @@ async function uploadApplicationSource({
2323
2340
  const possibleIcons = [];
2324
2341
  for (const fa of config2.fileAssociations) {
2325
2342
  if (fa.icon) {
2326
- const icon = path9.parse(fa.icon);
2343
+ const icon = path7.parse(fa.icon);
2327
2344
  possibleIcons.push(
2328
- { ext: fa.ext, icon: path9.join(icon.dir, icon.name) + ".ico" },
2329
- { ext: fa.ext, icon: path9.join(icon.dir, icon.name) + ".icns" }
2345
+ { ext: fa.ext, icon: path7.join(icon.dir, icon.name) + ".ico" },
2346
+ { ext: fa.ext, icon: path7.join(icon.dir, icon.name) + ".icns" }
2330
2347
  );
2331
2348
  }
2332
2349
  }
@@ -2335,7 +2352,7 @@ async function uploadApplicationSource({
2335
2352
  if (await exists(icon)) {
2336
2353
  files.push({
2337
2354
  from: icon,
2338
- to: path9.join("icons", "association-" + ext + path9.extname(icon))
2355
+ to: path7.join("icons", "association-" + ext + path7.extname(icon))
2339
2356
  });
2340
2357
  }
2341
2358
  })
@@ -2345,19 +2362,25 @@ async function uploadApplicationSource({
2345
2362
  if (config2.mac.entitlements) {
2346
2363
  files.push({
2347
2364
  from: config2.mac.entitlements,
2348
- to: path9.join("other", "mac", "entitlements.mac.plist")
2365
+ to: path7.join("other", "mac", "entitlements.mac.plist")
2366
+ });
2367
+ }
2368
+ if (config2.mac.entitlementsInherit) {
2369
+ files.push({
2370
+ from: config2.mac.entitlementsInherit,
2371
+ to: path7.join("other", "mac", "entitlementsInherit.mac.plist")
2349
2372
  });
2350
2373
  }
2351
2374
  if (config2.mac.icon) {
2352
2375
  files.push({
2353
2376
  from: config2.mac.icon,
2354
- to: path9.join("icons", "appIcon-mac" + path9.extname(config2.mac.icon))
2377
+ to: path7.join("icons", "appIcon-mac" + path7.extname(config2.mac.icon))
2355
2378
  });
2356
2379
  }
2357
2380
  if (config2.mac.requirements) {
2358
2381
  files.push({
2359
2382
  from: config2.mac.requirements,
2360
- to: path9.join("other", "mac", "requirements.txt")
2383
+ to: path7.join("other", "mac", "requirements.txt")
2361
2384
  });
2362
2385
  }
2363
2386
  }
@@ -2365,19 +2388,19 @@ async function uploadApplicationSource({
2365
2388
  if (config2.mas.entitlements) {
2366
2389
  files.push({
2367
2390
  from: config2.mas.entitlements,
2368
- to: path9.join("other", "mac", "entitlements.mas.plist")
2391
+ to: path7.join("other", "mac", "entitlements.mas.plist")
2369
2392
  });
2370
2393
  }
2371
2394
  if (config2.mas.entitlementsInherit) {
2372
2395
  files.push({
2373
2396
  from: config2.mas.entitlementsInherit,
2374
- to: path9.join("other", "mac", "entitlementsInherit.mas.plist")
2397
+ to: path7.join("other", "mac", "entitlementsInherit.mas.plist")
2375
2398
  });
2376
2399
  }
2377
2400
  if (config2.mas.provisioningProfile) {
2378
2401
  files.push({
2379
2402
  from: config2.mas.provisioningProfile,
2380
- to: path9.join("other", "mac", "mas.provisionprofile")
2403
+ to: path7.join("other", "mac", "mas.provisionprofile")
2381
2404
  });
2382
2405
  }
2383
2406
  }
@@ -2385,7 +2408,7 @@ async function uploadApplicationSource({
2385
2408
  if (config2.dmg.background) {
2386
2409
  files.push({
2387
2410
  from: config2.dmg.background,
2388
- to: path9.join("other", "mac", "dmg-background.tiff")
2411
+ to: path7.join("other", "mac", "dmg-background.tiff")
2389
2412
  });
2390
2413
  }
2391
2414
  }
@@ -2393,16 +2416,16 @@ async function uploadApplicationSource({
2393
2416
  if (config2.windows.icon) {
2394
2417
  files.push({
2395
2418
  from: config2.windows.icon,
2396
- to: path9.join(
2419
+ to: path7.join(
2397
2420
  "icons",
2398
- "appIcon-windows" + path9.extname(config2.windows.icon)
2421
+ "appIcon-windows" + path7.extname(config2.windows.icon)
2399
2422
  )
2400
2423
  });
2401
2424
  }
2402
2425
  if (config2.windows.nsisInclude) {
2403
2426
  files.push({
2404
2427
  from: config2.windows.nsisInclude,
2405
- to: path9.join("other", "installer.nsh")
2428
+ to: path7.join("other", "installer.nsh")
2406
2429
  });
2407
2430
  }
2408
2431
  }
@@ -2877,7 +2900,7 @@ var LoginHOC = ({ children, isInteractive = true }) => {
2877
2900
  setEffectDone(true);
2878
2901
  }
2879
2902
  isAccessTokenValid();
2880
- }, []);
2903
+ }, [isRawModeSupported]);
2881
2904
  if (error && isInteractive) {
2882
2905
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ErrorDisplay, { error });
2883
2906
  }
@@ -3120,7 +3143,7 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
3120
3143
  firebaseUnsubscribe();
3121
3144
  }
3122
3145
  };
3123
- }, [id]);
3146
+ }, [id, configPath]);
3124
3147
  (0, import_react12.useEffect)(() => {
3125
3148
  if (hasBuildEverFailed && shouldExitOnBuildFailure_default(build)) {
3126
3149
  setTimeout(() => exit(new Error("Build has failed")), 10);
@@ -3197,7 +3220,11 @@ var ViewBuild_default = ViewBuild;
3197
3220
  // src/commands/build/components/OngoingBuildGuard.tsx
3198
3221
  var import_is_ci5 = __toESM(require("is-ci"));
3199
3222
  var import_jsx_runtime20 = require("react/jsx-runtime");
3200
- var OngoingBuildGuard = ({ children, commandUsed, configPath }) => {
3223
+ var OngoingBuildGuard = ({
3224
+ children,
3225
+ commandUsed,
3226
+ configPath
3227
+ }) => {
3201
3228
  const { isRawModeSupported } = (0, import_ink20.useStdin)();
3202
3229
  const onInput = useInput_default();
3203
3230
  const exit = useExit_default();
@@ -3216,7 +3243,11 @@ var OngoingBuildGuard = ({ children, commandUsed, configPath }) => {
3216
3243
  try {
3217
3244
  const applicationId = getProjectConfig(configPath).config.id;
3218
3245
  const { id } = await findAppUserId_default(applicationId);
3219
- const buildsResult = await firestore_default.doc(`users/${id}/applications/${applicationId}`).collection("builds").orderBy("createdAt", "desc").limit(10).get();
3246
+ const now = new Date();
3247
+ const twentyFourHoursAgo = new Date(
3248
+ now.getTime() - 24 * 60 * 60 * 1e3
3249
+ );
3250
+ const buildsResult = await firestore_default.doc(`users/${id}/applications/${applicationId}`).collection("builds").where("createdAt", ">=", twentyFourHoursAgo).orderBy("createdAt", "desc").limit(10).get();
3220
3251
  const stateUpdates = {
3221
3252
  appId: applicationId,
3222
3253
  isLoading: false,
@@ -3247,7 +3278,7 @@ var OngoingBuildGuard = ({ children, commandUsed, configPath }) => {
3247
3278
  }));
3248
3279
  }
3249
3280
  })();
3250
- }, [builds, itemChosen, isLoading, isRawModeSupported]);
3281
+ }, [builds, itemChosen, isLoading, isRawModeSupported, configPath]);
3251
3282
  if (isRawModeSupported) {
3252
3283
  onInput(() => {
3253
3284
  });
@@ -3261,9 +3292,9 @@ var OngoingBuildGuard = ({ children, commandUsed, configPath }) => {
3261
3292
  if (itemChosen) {
3262
3293
  logger_default.debug({ itemChosen }, "OngoingBuildGuard component: item chosen");
3263
3294
  const build = builds.find(Boolean);
3264
- if (itemChosen.value === "view") {
3295
+ if (itemChosen.value === "view" && build) {
3265
3296
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ViewBuild_default, { commandUsed, id: build.id });
3266
- } else if (itemChosen.value === "cancel") {
3297
+ } else if (itemChosen.value === "cancel" && build && appId) {
3267
3298
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CancelBuild_default, { appId, commandUsed, id: build.id, children });
3268
3299
  } else if (itemChosen.value === "concurrent") {
3269
3300
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children });
@@ -3300,8 +3331,8 @@ var OngoingBuildGuard = ({ children, commandUsed, configPath }) => {
3300
3331
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ink20.Text, { bold: true, children: multiple ? "There are ongoing builds " : "There is an ongoing build " }),
3301
3332
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_ink20.Text, { children: [
3302
3333
  "(",
3303
- latestBuild.appName,
3304
- latestBuild.appVersion ? ` v${latestBuild.appVersion}` : "",
3334
+ latestBuild == null ? void 0 : latestBuild.appName,
3335
+ (latestBuild == null ? void 0 : latestBuild.appVersion) ? ` v${latestBuild.appVersion}` : "",
3305
3336
  ")"
3306
3337
  ] })
3307
3338
  ] }),
@@ -3761,7 +3792,10 @@ var ViewBuilds = ({
3761
3792
  isInitialLoadComplete,
3762
3793
  isLoading,
3763
3794
  projectConfig,
3764
- startAfter
3795
+ startAfter,
3796
+ configPath,
3797
+ format,
3798
+ count
3765
3799
  ]);
3766
3800
  (0, import_react16.useEffect)(() => {
3767
3801
  if (!hasMoreToLoad) {
@@ -5251,7 +5285,7 @@ var package_default = {
5251
5285
  access: "public"
5252
5286
  },
5253
5287
  name: "@todesktop/cli",
5254
- version: "1.9.3-0",
5288
+ version: "1.9.4",
5255
5289
  license: "MIT",
5256
5290
  author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
5257
5291
  homepage: "https://todesktop.com/cli",
@@ -5272,6 +5306,7 @@ var package_default = {
5272
5306
  "build:dev": "esbuild src/index.ts --packages=external --bundle --sourcemap --platform=node --outfile=dist/cli.js && cp-cli dev.env .env",
5273
5307
  lint: "npm run lint:types && npm run lint:styles",
5274
5308
  "lint:styles": "eslint src test .eslintrc.js && prettier --check .",
5309
+ format: "prettier --write .",
5275
5310
  "lint:types": "tsc && tsc-strict",
5276
5311
  "lint--fix": "eslint src test --fix",
5277
5312
  release: "npm run build && npx np --tag=latest",
@@ -5332,8 +5367,9 @@ var package_default = {
5332
5367
  "xdg-basedir": "^4.0.0"
5333
5368
  },
5334
5369
  devDependencies: {
5335
- "@todesktop/shared": "^7.188.30",
5370
+ "@todesktop/shared": "^7.188.64",
5336
5371
  "@types/bunyan": "^1.8.6",
5372
+ "@types/is-ci": "^3.0.4",
5337
5373
  "@types/node": "^20.8.4",
5338
5374
  "@types/react": "^18.0.26",
5339
5375
  "@typescript-eslint/eslint-plugin": "^5.46.1",