@todesktop/cli 1.9.0 → 1.9.2

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/.env CHANGED
@@ -1,7 +1,5 @@
1
1
  TODESKTOP_CLI_ENV=production
2
2
  TODESKTOP_CLI_S3_BUCKET=todesktop-builds-prod
3
- TODESKTOP_CLI_AWS_ACCESS_ID=AKIAS5AB4EBXRGDWLNWA
4
- TODESKTOP_CLI_AWS_ACCESS_SECRET=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
5
3
  TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE=https://us-central1-todesktop-prod1.cloudfunctions.net/
6
4
  TODESKTOP_CLI_FIREBASE_API_KEY=AIzaSyB3bfv74OgIezU160UPDVXDP6c1ApNfc6M
7
5
  TODESKTOP_CLI_FIREBASE_AUTH_DOMAIN=todesktop-prod1.firebaseapp.com
package/README.md CHANGED
@@ -297,6 +297,12 @@ If you want to unpack only files that are required to be unpacked, you can set t
297
297
 
298
298
  You can also specify a list of glob patterns to unpack.
299
299
 
300
+ ### `buildVersion` - (optional) string
301
+
302
+ Default: auto-generated from build id
303
+
304
+ The build version. Maps to the CFBundleVersion on macOS, and FileVersion metadata property on Windows.
305
+
300
306
  ### `copyright` - (optional) string
301
307
 
302
308
  Default: The `package.json` [productName](#recommendations-for-app-packagejson) / `name`.
@@ -538,6 +544,12 @@ This option allows you to configure whether your app should run in a sandboxed e
538
544
 
539
545
  We default this to `true` for compatibility reasons because some Linux distributions do not support unprivileged user namespaces.
540
546
 
547
+ ### `includeSubNodeModules` - (optional) boolean
548
+
549
+ Default: `false`
550
+
551
+ Whether to include **all** of the submodules node_modules directories
552
+
541
553
  ### `mac` - (optional) object
542
554
 
543
555
  Default: We have good default settings for Mac.
@@ -585,6 +597,13 @@ Default: The root [`icon`](#icon---string) is used.
585
597
 
586
598
  The path to your application's Mac desktop icon. It must be an ICNS or PNG.
587
599
 
600
+ #### `mac.provisioningProfile` - (optional) string
601
+
602
+ Default: No provisioning profile is used by default.
603
+ Example: `./mas.provisionprofile`.
604
+
605
+ The path to a provisioning profile for authorizing your application. This is required for Mac App Store.
606
+
588
607
  #### `mac.requirements` - (optional) string
589
608
 
590
609
  Example: `./requirements.txt`.
@@ -592,6 +611,20 @@ Default: No requirements file is used by default.
592
611
 
593
612
  The path to the [requirements file](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used when signing your application.
594
613
 
614
+ ### `mas` - (optional) object
615
+
616
+ Default: We use default development settings for Mac App Store.
617
+ Example: `{ "type": "development" }`.
618
+
619
+ This object contains options that only apply to building the application for Mac App Store.
620
+
621
+ #### `mas.type` - (optional) string
622
+
623
+ Default: `"development"`
624
+ Example: `"distribution"`.
625
+
626
+ Whether to sign app for development or for distribution.
627
+
595
628
  ### `nodeVersion` - string
596
629
 
597
630
  Example: `18.12.1`.
@@ -1056,6 +1089,16 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1056
1089
 
1057
1090
  ## Changelog
1058
1091
 
1092
+ ## v1.9.2
1093
+
1094
+ - Add support for `mas.type` in config.
1095
+ - Add support for `mac.provisioningProfile` in config.
1096
+ - Add support for specifying `buildVersion` in config.
1097
+
1098
+ ## v1.9.1
1099
+
1100
+ - Add support for `includeSubNodeModules` in config.
1101
+
1059
1102
  ## v1.9.0
1060
1103
 
1061
1104
  - You can now specify `@electron/rebuild` as a custom `rebuildLibrary` in your `todesktop.json` file.
package/dist/cli.js CHANGED
@@ -946,6 +946,7 @@ Preparation.propTypes = {
946
946
  var Preparation_default = Preparation;
947
947
 
948
948
  // src/commands/build/utilities/runBuild.ts
949
+ var import_axios2 = __toESM(require("axios"));
949
950
  var import_pretty_bytes = __toESM(require("pretty-bytes"));
950
951
 
951
952
  // src/utilities/postToFirebaseFunction.ts
@@ -1023,6 +1024,11 @@ function resolveConfigPaths({
1023
1024
  if (config2.mac.entitlements) {
1024
1025
  result.mac.entitlements = resolvePath(config2.mac.entitlements);
1025
1026
  }
1027
+ if (config2.mac.provisioningProfile) {
1028
+ result.mac.provisioningProfile = resolvePath(
1029
+ config2.mac.provisioningProfile
1030
+ );
1031
+ }
1026
1032
  if (config2.mac.requirements) {
1027
1033
  result.mac.requirements = resolvePath(config2.mac.requirements);
1028
1034
  }
@@ -1500,6 +1506,7 @@ var full_default = (context) => {
1500
1506
  }
1501
1507
  ]
1502
1508
  },
1509
+ buildVersion: { type: "string", minLength: 1 },
1503
1510
  copyright: { type: "string", minLength: 1 },
1504
1511
  electronMirror: {
1505
1512
  type: "string",
@@ -1596,6 +1603,10 @@ var full_default = (context) => {
1596
1603
  }
1597
1604
  },
1598
1605
  id: { type: "string", minLength: 1 },
1606
+ includeSubNodeModules: {
1607
+ type: "boolean",
1608
+ default: false
1609
+ },
1599
1610
  mac: {
1600
1611
  type: "object",
1601
1612
  properties: {
@@ -1616,6 +1627,15 @@ var full_default = (context) => {
1616
1627
  },
1617
1628
  minLength: 1
1618
1629
  },
1630
+ provisioningProfile: {
1631
+ type: "string",
1632
+ file: {
1633
+ from: context.projectRoot,
1634
+ extensions: ["provisionprofile"],
1635
+ mustBeFile: true
1636
+ },
1637
+ minLength: 1
1638
+ },
1619
1639
  extendInfo: {
1620
1640
  type: "object"
1621
1641
  },
@@ -1631,6 +1651,15 @@ var full_default = (context) => {
1631
1651
  }
1632
1652
  }
1633
1653
  },
1654
+ mas: {
1655
+ type: "object",
1656
+ properties: {
1657
+ type: {
1658
+ type: "string",
1659
+ enum: ["development", "distribution"]
1660
+ }
1661
+ }
1662
+ },
1634
1663
  dmg: {
1635
1664
  type: "object",
1636
1665
  properties: {
@@ -2290,6 +2319,12 @@ async function uploadApplicationSource({
2290
2319
  to: path9.join("other", "mac", "entitlements.mac.plist")
2291
2320
  });
2292
2321
  }
2322
+ if (config2.mac.provisioningProfile) {
2323
+ files.push({
2324
+ from: config2.mac.provisioningProfile,
2325
+ to: path9.join("other", "mac", "mas.provisionprofile")
2326
+ });
2327
+ }
2293
2328
  if (config2.mac.icon) {
2294
2329
  files.push({
2295
2330
  from: config2.mac.icon,
@@ -2459,8 +2494,11 @@ async function runBuild({
2459
2494
  }
2460
2495
  }
2461
2496
  function addErrorMessage(e, message2) {
2497
+ var _a, _b;
2462
2498
  let originalMessage = "";
2463
- if (e instanceof Error) {
2499
+ if (import_axios2.default.isAxiosError(e) && ((_b = (_a = e.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message)) {
2500
+ originalMessage = e.response.data.message;
2501
+ } else if (e instanceof Error) {
2464
2502
  originalMessage = e.message;
2465
2503
  } else if (e && typeof e === "object") {
2466
2504
  originalMessage = JSON.stringify(e);
@@ -2641,6 +2679,7 @@ var Login = ({ setIsLoggedIn }) => {
2641
2679
  setActiveField(0);
2642
2680
  };
2643
2681
  const onSubmitLogin = async ({ email, accessToken }) => {
2682
+ var _a, _b;
2644
2683
  setFailureMessage(null);
2645
2684
  setIsSubmittingForm(true);
2646
2685
  try {
@@ -2659,7 +2698,9 @@ var Login = ({ setIsLoggedIn }) => {
2659
2698
  if (err.code === 500) {
2660
2699
  setError(err);
2661
2700
  } else {
2662
- onFailure(`Login unsuccessful: ${err.message}`);
2701
+ onFailure(
2702
+ `Login unsuccessful: ${((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || err.message}`
2703
+ );
2663
2704
  }
2664
2705
  }
2665
2706
  };
@@ -2734,8 +2775,6 @@ var LoginHOC = ({ children, isInteractive = true }) => {
2734
2775
  const [isEffectDone, setEffectDone] = (0, import_react10.useState)(false);
2735
2776
  const [error, setError] = (0, import_react10.useState)(null);
2736
2777
  const { isRawModeSupported } = (0, import_ink16.useStdin)();
2737
- const { stdout } = (0, import_ink16.useStdout)();
2738
- const stdOutRedirected = !stdout.isTTY;
2739
2778
  const onFailure = (message2, err = {}) => {
2740
2779
  setError({
2741
2780
  ...err,
@@ -5162,7 +5201,7 @@ var package_default = {
5162
5201
  access: "public"
5163
5202
  },
5164
5203
  name: "@todesktop/cli",
5165
- version: "1.8.1",
5204
+ version: "1.9.1",
5166
5205
  license: "MIT",
5167
5206
  author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
5168
5207
  homepage: "https://todesktop.com/cli",
@@ -5178,6 +5217,7 @@ var package_default = {
5178
5217
  scripts: {
5179
5218
  dev: "cp-cli dev.env .env && npm run build:dev && npm link",
5180
5219
  "dev:prod": "cp-cli prod.env .env && npm run build && npm link",
5220
+ "dev:local:prod": "cp-cli prod-local.env .env && npm run build && npm link && cp-cli prod-local.env .env",
5181
5221
  build: "esbuild src/index.ts --packages=external --bundle --sourcemap --platform=node --outfile=dist/cli.js && cp-cli prod.env .env",
5182
5222
  "build:dev": "esbuild src/index.ts --packages=external --bundle --sourcemap --platform=node --outfile=dist/cli.js && cp-cli dev.env .env",
5183
5223
  lint: "npm run lint:types && npm run lint:styles",
@@ -5242,7 +5282,7 @@ var package_default = {
5242
5282
  "xdg-basedir": "^4.0.0"
5243
5283
  },
5244
5284
  devDependencies: {
5245
- "@todesktop/shared": "^7.186.18",
5285
+ "@todesktop/shared": "^7.188.18",
5246
5286
  "@types/bunyan": "^1.8.6",
5247
5287
  "@types/node": "^20.8.4",
5248
5288
  "@types/react": "^18.0.26",