@todesktop/cli 1.7.3 → 1.7.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/README.md CHANGED
@@ -548,12 +548,25 @@ Default: The root [`icon`](#icon---string) is used.
548
548
 
549
549
  The path to your application's Mac desktop icon. It must be an ICNS or PNG.
550
550
 
551
+ #### `mac.requirements` - (optional) string
552
+
553
+ Example: `./requirements.txt`.
554
+ Default: No requirements file is used by default.
555
+
556
+ The path to the [requirements file](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used when signing your application.
557
+
551
558
  ### `nodeVersion` - string
552
559
 
553
560
  Example: `18.12.1`.
554
561
 
555
562
  The version of Node.js that ToDesktop should use to build your app.
556
563
 
564
+ ### `npmVersion` - string
565
+
566
+ Example: `9.8.1`.
567
+
568
+ The version of NPM that ToDesktop should use for installation.
569
+
557
570
  ### `packageJson` - (optional) object
558
571
 
559
572
  Default: `{}`
@@ -590,7 +603,7 @@ Default: If `yarn.lock` exists, `yarn` is used. If `pnpm-lock.yaml` or `shrinkwr
590
603
 
591
604
  Example: `yarn`
592
605
 
593
- The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `npm`.
606
+ The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `pnpm`.
594
607
 
595
608
  ### `schemaVersion` - number
596
609
 
@@ -849,10 +862,10 @@ const { writeFile } = require("fs/promises");
849
862
  module.exports = async ({ appOutDir, packager }) => {
850
863
  if (os.platform() === "darwin") {
851
864
  const appName = packager.appInfo.productFilename;
852
- const appPath = path.join(`${appOutDir}`, `${APP_NAME}.app`);
865
+ const appPath = path.join(`${appOutDir}`, `${appName}.app`);
853
866
  await writeFile(
854
867
  path.join(appPath, "copyright.txt"),
855
- `Copyright © ${new Date().getFullYear()} ${APP_NAME}`
868
+ `Copyright © ${new Date().getFullYear()} ${appName}`
856
869
  );
857
870
  }
858
871
  };
@@ -976,10 +989,28 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
976
989
 
977
990
  ## Changelog
978
991
 
992
+ ### v1.7.5
993
+
994
+ - Add support for specifying custom `npmVersion` in config
995
+ - Add support for bundling a requirements file for Mac
996
+
997
+ ### v1.7.4
998
+
999
+ - Fix: Linux/Windows platform links no longer have mac/zip/{arch} added to the end of the download URL
1000
+
979
1001
  ### v1.7.3
980
1002
 
981
1003
  - Add asar configuration support
982
1004
 
1005
+ ### v1.7.1
1006
+
1007
+ - Add support for specifying custom `appBuilderLibVersion` in config
1008
+ - Show suggestion to run a Smoke Test when releasing an untested build
1009
+
1010
+ ### v1.7.0
1011
+
1012
+ - Add `todesktop smoke-test` command
1013
+
983
1014
  ### v1.6.3
984
1015
 
985
1016
  - Add support for specifying custom `windows.nsisCustomBinary` in config
package/dist/cli.js CHANGED
@@ -393,7 +393,7 @@ var PlatformProgress = ({
393
393
  }) => {
394
394
  let progressIndicator;
395
395
  if (activityType === "done") {
396
- if (process.platform === "darwin") {
396
+ if (platform === "mac") {
397
397
  downloadUrl = import_path3.default.posix.join(downloadUrl, "mac", "zip", process.arch);
398
398
  }
399
399
  progressIndicator = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Box, { flexDirection: "column", marginBottom: 1, children: [
@@ -1012,6 +1012,9 @@ function resolveConfigPaths({
1012
1012
  if (config2.mac.entitlements) {
1013
1013
  result.mac.entitlements = resolvePath(config2.mac.entitlements);
1014
1014
  }
1015
+ if (config2.mac.requirements) {
1016
+ result.mac.requirements = resolvePath(config2.mac.requirements);
1017
+ }
1015
1018
  if (config2.mac.icon) {
1016
1019
  result.mac.icon = resolvePath(config2.mac.icon);
1017
1020
  }
@@ -1591,7 +1594,16 @@ var full_default = (context) => {
1591
1594
  extendInfo: {
1592
1595
  type: "object"
1593
1596
  },
1594
- icon: getIconSchema()
1597
+ icon: getIconSchema(),
1598
+ requirements: {
1599
+ type: "string",
1600
+ file: {
1601
+ from: context.projectRoot,
1602
+ extensions: ["txt"],
1603
+ mustBeFile: true
1604
+ },
1605
+ minLength: 1
1606
+ }
1595
1607
  }
1596
1608
  },
1597
1609
  dmg: {
@@ -1637,6 +1649,11 @@ var full_default = (context) => {
1637
1649
  validSemver: {},
1638
1650
  minLength: 1
1639
1651
  },
1652
+ npmVersion: {
1653
+ type: "string",
1654
+ validSemver: {},
1655
+ minLength: 1
1656
+ },
1640
1657
  appBuilderLibVersion: {
1641
1658
  type: "string",
1642
1659
  validSemver: {},
@@ -2135,6 +2152,12 @@ var uploadApplicationSource_default = async ({ appId, appPkgJson, buildId, confi
2135
2152
  to: path8.join("icons", "appIcon-mac" + path8.extname(config2.mac.icon))
2136
2153
  });
2137
2154
  }
2155
+ if (config2.mac.requirements) {
2156
+ files.push({
2157
+ from: config2.mac.requirements,
2158
+ to: path8.join("other", "mac", "requirements.txt")
2159
+ });
2160
+ }
2138
2161
  }
2139
2162
  if (config2.dmg) {
2140
2163
  if (config2.dmg.background) {
@@ -2293,6 +2316,7 @@ var runBuild_default = async ({ onEvent, shouldCodeSign = true, configPath }) =>
2293
2316
  userId: primaryUserId,
2294
2317
  sourceArchiveDetails,
2295
2318
  nodeVersion: config2.nodeVersion,
2319
+ npmVersion: config2.npmVersion,
2296
2320
  appBuilderLibVersion: config2.appBuilderLibVersion
2297
2321
  });
2298
2322
  } catch (e) {
@@ -2759,6 +2783,7 @@ var findAppUserId = async (appId) => {
2759
2783
  if (doc.exists)
2760
2784
  return user;
2761
2785
  } catch (err) {
2786
+ console.error(err);
2762
2787
  }
2763
2788
  }
2764
2789
  return primaryUser;
@@ -3882,10 +3907,23 @@ async function getBuildAttributes({
3882
3907
  buildId,
3883
3908
  configPath
3884
3909
  }) {
3885
- const { id: appId, nodeVersion } = getProjectConfig(configPath).config;
3886
- const userId = await fetchUserIdByAppId(appId);
3910
+ const {
3911
+ id: appId,
3912
+ nodeVersion,
3913
+ npmVersion
3914
+ } = getProjectConfig(configPath).config;
3915
+ const { id: userId } = await findAppUserId_default(appId);
3916
+ const { uid: contextUserId } = currentUser();
3887
3917
  const build = await fetchBuild({ appId, buildId, userId });
3888
- return { appId, build, buildId, nodeVersion, userId };
3918
+ return {
3919
+ appId,
3920
+ build,
3921
+ buildId,
3922
+ contextUserId,
3923
+ nodeVersion,
3924
+ npmVersion,
3925
+ userId
3926
+ };
3889
3927
  }
3890
3928
  async function fetchBuild({
3891
3929
  appId,
@@ -3898,14 +3936,6 @@ async function fetchBuild({
3898
3936
  }
3899
3937
  return build;
3900
3938
  }
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
3939
 
3910
3940
  // src/commands/release/components/ReleaseBuild.tsx
3911
3941
  var import_jsx_runtime35 = require("react/jsx-runtime");
@@ -4534,7 +4564,9 @@ async function cancelSmokeTest({
4534
4564
  async function queueSmokeTest({
4535
4565
  appId,
4536
4566
  buildId,
4567
+ contextUserId,
4537
4568
  nodeVersion,
4569
+ npmVersion,
4538
4570
  userId
4539
4571
  }) {
4540
4572
  try {
@@ -4542,7 +4574,9 @@ async function queueSmokeTest({
4542
4574
  appId,
4543
4575
  buildId,
4544
4576
  nodeVersion,
4545
- userId
4577
+ npmVersion,
4578
+ userId,
4579
+ contextUserId
4546
4580
  });
4547
4581
  } catch (e) {
4548
4582
  if (["failed-precondition", "not-found"].includes(e.code)) {
@@ -4651,14 +4685,21 @@ async function smokeTestWorkflow({
4651
4685
  updateState
4652
4686
  }) {
4653
4687
  try {
4654
- const { appId, build, nodeVersion, userId } = await getBuildAttributes({
4688
+ const { appId, build, contextUserId, nodeVersion, npmVersion, userId } = await getBuildAttributes({
4655
4689
  buildId,
4656
4690
  configPath
4657
4691
  });
4658
4692
  updateState({ appId, build, userId });
4659
4693
  validateBuild(build);
4660
4694
  if (!abortSignal.aborted && !isTestRunning(build)) {
4661
- await queueSmokeTest({ appId, buildId, nodeVersion, userId });
4695
+ await queueSmokeTest({
4696
+ appId,
4697
+ buildId,
4698
+ nodeVersion,
4699
+ npmVersion,
4700
+ userId,
4701
+ contextUserId
4702
+ });
4662
4703
  }
4663
4704
  updateState({ state: "progress" });
4664
4705
  const { total } = await waitUntilFinished({
@@ -4750,7 +4791,7 @@ var package_default = {
4750
4791
  access: "public"
4751
4792
  },
4752
4793
  name: "@todesktop/cli",
4753
- version: "1.7.2",
4794
+ version: "1.7.4",
4754
4795
  license: "MIT",
4755
4796
  author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
4756
4797
  homepage: "https://todesktop.com/cli",
@@ -4830,7 +4871,7 @@ var package_default = {
4830
4871
  "xdg-basedir": "^4.0.0"
4831
4872
  },
4832
4873
  devDependencies: {
4833
- "@todesktop/shared": "^7.180.0",
4874
+ "@todesktop/shared": "^7.186.3",
4834
4875
  "@types/bunyan": "^1.8.6",
4835
4876
  "@types/react": "^18.0.26",
4836
4877
  "@typescript-eslint/eslint-plugin": "^5.46.1",