@todesktop/cli 1.7.7 → 1.8.1

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
@@ -135,6 +135,8 @@ We also support:
135
135
 
136
136
  - `todesktop build --code-sign=false`. Run a build with code-signing and notarization disabled. This is handy for testing builds quickly.
137
137
  - `todesktop build --config=<path.to.another.todesktop.json>`. Run a build with a different configuration file.
138
+ - `todesktop build --async`. Run a build in the background. This is handy for CI environments.
139
+ - `todesktop build --webhook URL`. Send a POST request to the webhook URL when the build is finished. It's especially useful together with the `--async` flag.
138
140
  - `todesktop release`. Release a build. This will publish a new download and an auto-update for existing users. By default it shows a list of builds for you to choose from.
139
141
  - Use `todesktop release <id>` to release a specific build by ID.
140
142
  - `todesktop release --latest` will release the latest build.
@@ -171,6 +173,38 @@ To build and release in one step, you can execute:
171
173
  todesktop build && todesktop release --latest --force
172
174
  ```
173
175
 
176
+ If you need to run a build in the background, you can use the `--async` flag. To
177
+ get notified when the build is finished you can optionally specify a webhook URL
178
+ which will receive a POST request with the build data:
179
+
180
+ ```sh
181
+ todesktop build --async --webhook https://example.com/build-finished-webhook
182
+ ```
183
+
184
+ The webhook receives a POST request with the following JSON body:
185
+
186
+ ```
187
+ POST https://example.com/build-finished-webhook
188
+ {
189
+ appId: string;
190
+ accountUserEmail: string;
191
+ accountUserId: string;
192
+ artifacts: {
193
+ linux?: LinuxArtifactDownloads;
194
+ mac?: MacArtifactDownloads;
195
+ windows?: WindowsArtifactDownloads;
196
+ };
197
+ buildId: string;
198
+ endedAt: string; // 2023-01-01T00:00:00Z
199
+ errorMessage?: string;
200
+ requesterUserEmail: string;
201
+ requesterUserId: string; // The same as accountUserId or `contextUserId`
202
+ schemaVersion: number; // Currently always `1`
203
+ startedAt: string; // 2023-01-01T00:00:00Z
204
+ status: 'queued' | 'failed' | 'building' | 'preparation' | 'succeeded' | 'cancelled';
205
+ }
206
+ ```
207
+
174
208
  ## Project configuration (todesktop.json)
175
209
 
176
210
  This describes all of the possible configuration options ín your `todesktop.json`.
@@ -187,7 +221,7 @@ Example: `["dist/**", "!static/**"]`
187
221
 
188
222
  This option allows you to decide which files get uploaded to be built on the ToDesktop servers. By default, all files in your app path are included in your app, except for `node_modules` and `.git`. Dependencies are installed on our build servers as there could be platform-specific postinstall steps.
189
223
 
190
- If you wish to include files for the build process but exclude them in the distribtion version of your app then you should use the [`filesForDistribution`](#filesForDistribution---optional-array-of-glob-patterns) property
224
+ If you wish to include files for the build process but exclude them in the distribution version of your app then you should use the [`filesForDistribution`](#filesForDistribution---optional-array-of-glob-patterns) property
191
225
 
192
226
  The files must be within your [`appPath`](#apppath---optional-string).
193
227
 
@@ -425,9 +459,12 @@ Example:
425
459
  - `ext` String | Array<String> - The extension (minus the leading period). e.g. png.
426
460
  - `name` String - The name. e.g. PNG. Defaults to value of `ext`.
427
461
  - `description` String - windows-only. The description.
462
+ - `icon` String - macOS and windows. Icon file name without extension. It points
463
+ to ico file for Windows and icns for macOS. For example, if the `icon` value is `"icons/py"` then it will look for both `"icons/py.ico"` and `"icons/py.icns"` in your project directory.
428
464
  - `mimeType` String - linux-only. The mime-type.
429
- - `role` = `Editor` String - macOS-only The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.
430
- - `isPackage` Boolean - macOS-only Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.
465
+ - `role` = `Editor` String - macOS-only. The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.
466
+ - `isPackage` Boolean - macOS-only. Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.
467
+ - `rank` = `Default` String macOS-only. Determines how Launch Services ranks this app among the apps that declare themselves editors or viewers of files of this type. The possible values are: `Owner` (this app is the primary creator of files of this type), `Default` (this app is an opener of files of this type; this value is also used if no rank is specified), `Alternate` (this app is a secondary viewer of files of this type), and `None` (this app is never selected to open files of this type, but it accepts drops of files of this type).
431
468
 
432
469
  ### `filesForDistribution` - (optional) array of glob patterns
433
470
 
@@ -605,6 +642,12 @@ Example: `yarn`
605
642
 
606
643
  The package manager to use when installing dependencies. Valid values are `npm`, `yarn` or `pnpm`.
607
644
 
645
+ ### `pnpmVersion` - string
646
+
647
+ Example: `8.10.5`.
648
+
649
+ The version of pnpm that ToDesktop should use for installation.
650
+
608
651
  ### `schemaVersion` - number
609
652
 
610
653
  Example: `1`.
@@ -850,8 +893,8 @@ The `afterPack` function also has the following arguments added to it's signatur
850
893
  - shouldCodeSign - boolean - whether the app will be code signed or not
851
894
  - outDir - string - the path to the output directory
852
895
  - appOutDir - string - the path to the app output directory
853
- - arch - string - the architecture of the app
854
896
  - packager - object - the packager object
897
+ - arch - number - the architecture of the app. `ia32 = 0`, `x64 = 1`, `armv7l = 2`, `arm64 = 3`, `universal = 4`.
855
898
 
856
899
  Example script:
857
900
 
@@ -899,6 +942,24 @@ To summarize:
899
942
 
900
943
  Note: **Do not put a token in this file**. You are specifying a literal value of `${NPM_TOKEN}`. NPM will replace the value for you. 5. Add `.npmrc` to your `appFiles` array `[".npmrc"]` in `todesktop.json`.
901
944
 
945
+ ### How can I specify a specific yarnVersion for use with my app?
946
+
947
+ By default, ToDesktop uses version `1.x.x` of `Yarn` if a `yarn.lock` file is present in your project. You can override this by creating a `.yarnrc.yml` file in your project directory and specifying the `yarnPath` property to point to your specified version of yarn:
948
+
949
+ ```yml
950
+ yarnPath: .yarn/releases/yarn-3.1.1.cjs
951
+ ```
952
+
953
+ This can be done automatically by running `yarn set version x.x.x` from within your project directory. This will create a `.yarnrc.yml` file and a corresponding `.yarn/releases/yarn-x.x.x.cjs` that the `yarnPath` property points to. This will also add a `packageManager` field in your `package.json` with a value of `yarn@x.x.x`
954
+
955
+ It's important to ensure that the `.yarn` folder is included in your build. If you had previously changed your `todesktop.json`'s [`appFiles`](#appfiles---optional-array-of-glob-patterns) property from its default glob implementation of `**`, then please ensure that it includes the `.yarn` directory:
956
+
957
+ Example: `[".yarn/**", ".yarnrc.yml", "...include your other changes here..."]`
958
+
959
+ You will want to exclude the `.yarn` directory in the distribution version of your app. You can use the [`filesForDistribution`](#filesForDistribution---optional-array-of-glob-patterns) property to achieve this:
960
+
961
+ Example: `[".yarn/**", ".yarnrc.yml"]`
962
+
902
963
  ### How do I create a staging version of my app?
903
964
 
904
965
  ToDesktop CLI supports the concept of a staging version of your app. This is useful if you want to test your app before releasing it to the public. To create a staging version of your app, you need to do the following:
@@ -989,6 +1050,17 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
989
1050
 
990
1051
  ## Changelog
991
1052
 
1053
+ ### v1.8.1
1054
+
1055
+ - Revert support for `yarnVersion` in config. Instead use `.yarnrc.yml` file to specify yarn version.
1056
+
1057
+ ### v1.8.0
1058
+
1059
+ - Add support for `--webhook` flag for `todesktop build` command
1060
+ - Add support for `--async` flag to run a build in the in the background
1061
+ - Add support for specifying custom `yarnVersion` in config
1062
+ - Add support for specifying custom `pnpmVersion` in config
1063
+
992
1064
  ### v1.7.7
993
1065
 
994
1066
  - Report errors when S3 upload fails and retry 3 times