@todesktop/cli 1.7.3 → 1.7.4

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/README.md CHANGED
@@ -590,7 +590,7 @@ Default: If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwr
590
590
 
591
591
  Example: `yarn`
592
592
 
593
- The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `npm`.
593
+ The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `pnpm`.
594
594
 
595
595
  ### `schemaVersion` - number
596
596
 
@@ -849,10 +849,10 @@ const { writeFile } = require("fs/promises");
849
849
  module.exports = async ({ appOutDir, packager }) => {
850
850
  if (os.platform() === "darwin") {
851
851
  const appName = packager.appInfo.productFilename;
852
- const appPath = path.join(`${appOutDir}`, `${APP_NAME}.app`);
852
+ const appPath = path.join(`${appOutDir}`, `${appName}.app`);
853
853
  await writeFile(
854
854
  path.join(appPath, "copyright.txt"),
855
- `Copyright © ${new Date().getFullYear()} ${APP_NAME}`
855
+ `Copyright © ${new Date().getFullYear()} ${appName}`
856
856
  );
857
857
  }
858
858
  };
@@ -976,10 +976,23 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
976
976
 
977
977
  ## Changelog
978
978
 
979
+ ### v1.7.4
980
+
981
+ - Fix: Linux/Windows platform links no longer have mac/zip/{arch} added to the end of the download URL
982
+
979
983
  ### v1.7.3
980
984
 
981
985
  - Add asar configuration support
982
986
 
987
+ ### v1.7.1
988
+
989
+ - Add support for specifying custom `appBuilderLibVersion` in config
990
+ - Show suggestion to run a Smoke Test when releasing an untested build
991
+
992
+ ### v1.7.0
993
+
994
+ - Add `todesktop smoke-test` command
995
+
983
996
  ### v1.6.3
984
997
 
985
998
  - Add support for specifying custom `windows.nsisCustomBinary` in config
package/dist/cli.js CHANGED
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
14
14
  return to;
15
15
  };
16
16
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
17
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
18
22
  mod
19
23
  ));
@@ -304,11 +308,16 @@ var useExit_default = () => {
304
308
  return (error = void 0) => {
305
309
  logger_default.debug({ error }, "Exit called");
306
310
  firestore_default.terminate().catch(
307
- (e) => logger_default.error(e)
311
+ (e) => (
312
+ // Ignore
313
+ logger_default.error(e)
314
+ )
308
315
  );
309
316
  let timeoutId;
310
317
  Promise.race([
318
+ // flush the analytics to make sure all outstanding events are pushed to segment
311
319
  new Promise((resolve4) => flush(() => resolve4())),
320
+ // If it takes longer than 1 second, resolve early to proceed with program exit
312
321
  new Promise(
313
322
  (resolve4) => timeoutId = setTimeout(() => resolve4(), 1e3)
314
323
  )
@@ -393,7 +402,7 @@ var PlatformProgress = ({
393
402
  }) => {
394
403
  let progressIndicator;
395
404
  if (activityType === "done") {
396
- if (process.platform === "darwin") {
405
+ if (platform === "mac") {
397
406
  downloadUrl = import_path3.default.posix.join(downloadUrl, "mac", "zip", process.arch);
398
407
  }
399
408
  progressIndicator = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Box, { flexDirection: "column", marginBottom: 1, children: [
@@ -455,7 +464,8 @@ var isPlatformBuildRunning = (platformBuild) => {
455
464
  if (!platformBuild) {
456
465
  return false;
457
466
  }
458
- return !platformBuild.shouldSkip && !["cancelled", "succeeded"].includes(platformBuild.status) && ("failed" !== platformBuild.status || platformBuild.numberOfAttemptedBuilds < 2);
467
+ return !platformBuild.shouldSkip && // <-- Noteworthy
468
+ !["cancelled", "succeeded"].includes(platformBuild.status) && ("failed" !== platformBuild.status || platformBuild.numberOfAttemptedBuilds < 2);
459
469
  };
460
470
 
461
471
  // src/components/BuildProgress.tsx
@@ -601,6 +611,7 @@ var ProgressBar = ({ left, right, percent }) => /* @__PURE__ */ (0, import_jsx_r
601
611
  ProgressBar.propTypes = {
602
612
  left: import_prop_types5.default.number,
603
613
  right: import_prop_types5.default.number,
614
+ // 0 -> 1
604
615
  percent: import_prop_types5.default.number.isRequired
605
616
  };
606
617
  var ProgressBar_default = ProgressBar;
@@ -1067,6 +1078,7 @@ var packageJSON_default = (context) => {
1067
1078
  dependencies: {
1068
1079
  type: "object",
1069
1080
  required: ["@todesktop/runtime"],
1081
+ // custom keyword that checks package names aren't included in dependencies
1070
1082
  excludedDependencies: {
1071
1083
  dependencyKey: "dependencies",
1072
1084
  blacklist: ["@todesktop/cli"]
@@ -2093,19 +2105,36 @@ var uploadApplicationSource_default = async ({ appId, appPkgJson, buildId, confi
2093
2105
  );
2094
2106
  let totalBytes = 0;
2095
2107
  const files = [
2108
+ /*
2109
+ App files (stored in app/ in the ZIP)
2110
+ */
2096
2111
  ...await getAppFiles(config2.appFiles, config2.appPath, appPkgJson),
2112
+ /*
2113
+ Optional extra content files (stored in extraContentFiles/ in the ZIP). Their
2114
+ paths within is the their relative path from the project root so
2115
+ there will be no issues with clashing filenames. We also don't
2116
+ also any file paths in our todesktop.json that are outside of the
2117
+ project directory
2118
+ */
2097
2119
  ...(config2.extraContentFiles || []).map(({ from, to = "." }) => {
2098
2120
  return {
2099
2121
  from,
2100
2122
  to: path8.join("extraContentFiles", to, path8.basename(from))
2101
2123
  };
2102
2124
  }),
2125
+ /*
2126
+ Optional extra resources (stored in extraResources/ in the ZIP).
2127
+ Similar to extra content files above
2128
+ */
2103
2129
  ...(config2.extraResources || []).map(({ from, to = "." }) => {
2104
2130
  return {
2105
2131
  from,
2106
2132
  to: path8.join("extraResources", to, path8.basename(from))
2107
2133
  };
2108
2134
  }),
2135
+ /*
2136
+ Icons (more may be added below)
2137
+ */
2109
2138
  {
2110
2139
  from: config2.icon,
2111
2140
  to: path8.join("icons", "appIcon" + path8.extname(config2.icon))
@@ -2759,6 +2788,7 @@ var findAppUserId = async (appId) => {
2759
2788
  if (doc.exists)
2760
2789
  return user;
2761
2790
  } catch (err) {
2791
+ console.error(err);
2762
2792
  }
2763
2793
  }
2764
2794
  return primaryUser;
@@ -3349,7 +3379,7 @@ async function getBuilds({
3349
3379
 
3350
3380
  // src/utilities/getRelativeDateFromDateString.ts
3351
3381
  var dateFns = __toESM(require("date-fns"));
3352
- var getRelativeDateFromDateString_default = (input) => dateFns.formatDistance(new Date(input), new Date()) + " ago";
3382
+ var getRelativeDateFromDateString_default = (input) => dateFns.formatDistance(new Date(input), /* @__PURE__ */ new Date()) + " ago";
3353
3383
 
3354
3384
  // src/components/SyntaxHighlight.tsx
3355
3385
  var import_chalk2 = __toESM(require("chalk"));
@@ -3664,7 +3694,9 @@ var SelectTable = ({ data, onSelect }) => {
3664
3694
  });
3665
3695
  };
3666
3696
  const ItemComponent = ({
3697
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3667
3698
  label,
3699
+ // Make it compatible to SelectInput type, not used actually
3668
3700
  index,
3669
3701
  isSelected
3670
3702
  }) => {
@@ -3883,9 +3915,10 @@ async function getBuildAttributes({
3883
3915
  configPath
3884
3916
  }) {
3885
3917
  const { id: appId, nodeVersion } = getProjectConfig(configPath).config;
3886
- const userId = await fetchUserIdByAppId(appId);
3918
+ const { id: userId } = await findAppUserId_default(appId);
3919
+ const { uid: contextUserId } = currentUser();
3887
3920
  const build = await fetchBuild({ appId, buildId, userId });
3888
- return { appId, build, buildId, nodeVersion, userId };
3921
+ return { appId, build, buildId, contextUserId, nodeVersion, userId };
3889
3922
  }
3890
3923
  async function fetchBuild({
3891
3924
  appId,
@@ -3898,14 +3931,6 @@ async function fetchBuild({
3898
3931
  }
3899
3932
  return build;
3900
3933
  }
3901
- async function fetchUserIdByAppId(appId) {
3902
- try {
3903
- const { id: userId } = await findAppUserId_default(appId);
3904
- return userId;
3905
- } catch (e) {
3906
- throw new Error(`Can't fetch user for app ${appId}, ${e.message}`);
3907
- }
3908
- }
3909
3934
 
3910
3935
  // src/commands/release/components/ReleaseBuild.tsx
3911
3936
  var import_jsx_runtime35 = require("react/jsx-runtime");
@@ -4447,6 +4472,7 @@ function OsProgress({
4447
4472
  error: "red",
4448
4473
  done: "green",
4449
4474
  skipped: "yellow"
4475
+ // Not used actually, just for type matching
4450
4476
  };
4451
4477
  const text = progress.message + (progress.state === "progress" ? "..." : "");
4452
4478
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
@@ -4534,6 +4560,7 @@ async function cancelSmokeTest({
4534
4560
  async function queueSmokeTest({
4535
4561
  appId,
4536
4562
  buildId,
4563
+ contextUserId,
4537
4564
  nodeVersion,
4538
4565
  userId
4539
4566
  }) {
@@ -4542,7 +4569,8 @@ async function queueSmokeTest({
4542
4569
  appId,
4543
4570
  buildId,
4544
4571
  nodeVersion,
4545
- userId
4572
+ userId,
4573
+ contextUserId
4546
4574
  });
4547
4575
  } catch (e) {
4548
4576
  if (["failed-precondition", "not-found"].includes(e.code)) {
@@ -4651,14 +4679,20 @@ async function smokeTestWorkflow({
4651
4679
  updateState
4652
4680
  }) {
4653
4681
  try {
4654
- const { appId, build, nodeVersion, userId } = await getBuildAttributes({
4682
+ const { appId, build, contextUserId, nodeVersion, userId } = await getBuildAttributes({
4655
4683
  buildId,
4656
4684
  configPath
4657
4685
  });
4658
4686
  updateState({ appId, build, userId });
4659
4687
  validateBuild(build);
4660
4688
  if (!abortSignal.aborted && !isTestRunning(build)) {
4661
- await queueSmokeTest({ appId, buildId, nodeVersion, userId });
4689
+ await queueSmokeTest({
4690
+ appId,
4691
+ buildId,
4692
+ nodeVersion,
4693
+ userId,
4694
+ contextUserId
4695
+ });
4662
4696
  }
4663
4697
  updateState({ state: "progress" });
4664
4698
  const { total } = await waitUntilFinished({
@@ -4670,6 +4704,7 @@ async function smokeTestWorkflow({
4670
4704
  const stateMap = {
4671
4705
  done: "complete",
4672
4706
  progress: "complete",
4707
+ // Not actually used, just for TS
4673
4708
  error: "progress-error",
4674
4709
  canceled: "canceled"
4675
4710
  };
@@ -4750,7 +4785,7 @@ var package_default = {
4750
4785
  access: "public"
4751
4786
  },
4752
4787
  name: "@todesktop/cli",
4753
- version: "1.7.2",
4788
+ version: "1.7.3",
4754
4789
  license: "MIT",
4755
4790
  author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
4756
4791
  homepage: "https://todesktop.com/cli",