@todesktop/cli 1.13.0-0 → 1.14.0

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
@@ -10,7 +10,7 @@ For more information, visit the project [landing page](https://www.todesktop.com
10
10
  - [Get started](#get-started)
11
11
  - [CLI commands](#cli-commands)
12
12
  - [Automating your builds (CI)](#automating-your-builds-ci)
13
- - [Project configuration (todesktop.json)](#project-configuration-todesktopjson)
13
+ - [Project configuration (todesktop.json or todesktop.js)](#project-configuration-todesktopjson-or-todesktopjs)
14
14
  - [Build lifecycle hooks (package.json scripts)](#build-lifecycle-hooks-packagejson-scripts)
15
15
  - [App package.json requirements](#app-packagejson-requirements)
16
16
  - [FAQs](#faqs)
@@ -42,14 +42,27 @@ Create a `todesktop.json` file in the root of your Electron project.
42
42
 
43
43
  ```json
44
44
  {
45
- "$schema": "https://unpkg.com/@todesktop/cli@1.12.5/schemas/schema.json",
45
+ "$schema": "https://unpkg.com/@todesktop/cli@1.13.0/schemas/schema.json",
46
46
  "schemaVersion": 1
47
47
  "id": "your-todesktop-id",
48
48
  "icon": "./desktop-icon.png",
49
+ "schemaVersion": 1
49
50
  }
50
51
  ```
51
52
 
52
- See [Project configuration](#project-configuration-todesktopjson) for the full list of configuration options.
53
+ Alternatively, you can create a `todesktop.js` file. This allows you to use JavaScript to dynamically generate your configuration. For example:
54
+
55
+ ```javascript
56
+ const path = require("path");
57
+
58
+ module.exports = {
59
+ id: process.env.TODESKTOP_APP_ID || "your-default-todesktop-id",
60
+ icon: path.join(__dirname, "assets", "desktop-icon.png"),
61
+ schemaVersion: 1,
62
+ };
63
+ ```
64
+
65
+ See [Project configuration](#project-configuration-todesktopjson-or-todesktopjs) for the full list of configuration options.
53
66
 
54
67
  ### Step 3: Add @todesktop/runtime as a dependency
55
68
 
@@ -135,27 +148,27 @@ This builds your Electron app with native installers, code signing, and so on ba
135
148
  We also support:
136
149
 
137
150
  - `todesktop build --code-sign=false`. Run a build with code-signing and notarization disabled. This is handy for testing builds quickly.
138
- - `todesktop build --config=<path.to.another.todesktop.json>`. Run a build with a different configuration file.
151
+ - `todesktop build --config=<path.to.config.file>`. Run a build with a different configuration file (e.g., `todesktop.staging.json` or `todesktop.prod.js`).
139
152
  - `todesktop build --async`. Run a build in the background. This is handy for CI environments.
140
153
  - `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.
141
- - `todesktop build --ignore-extends-errors`. Ignore `id` and `appId` validation errors when extending another todesktop.json file.
154
+ - `todesktop build --ignore-extends-errors`. Ignore `id` and `appId` validation errors when extending another configuration file (`.json` or `.js`).
142
155
  - `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.
143
156
  - Use `todesktop release <id>` to release a specific build by ID.
144
157
  - `todesktop release --latest` will release the latest build.
145
158
  - Append `--force` to skip the interactive confirmation step.
146
- - Append `--config=<path.to.another.todesktop.json>` to use a different configuration file.
159
+ - Append `--config=<path.to.config.file>` to use a different configuration file.
147
160
  - `todesktop builds`. View your recent builds.
148
161
  - Use `todesktop builds <id>` to view a specific build and its progress.
149
162
  - `todesktop builds --latest` will show the latest build and it's progress.
150
163
  - `todesktop builds --count=<number>` will show the last `<number>` builds.
151
164
  - `todesktop builds --format=json` will output build data in JSON format.
152
- - Append `--config=<path.to.another.todesktop.json>` to use a different configuration file.
165
+ - Append `--config=<path.to.config.file>` to use a different configuration file.
153
166
  - Append `--exit` to disable dynamic pagination and exit the process once the build data has been displayed.
154
167
  - `todesktop logout`. Logs you out.
155
168
  - `todesktop smoke-test` Check whether the build works and can be successfully updated.
156
169
  - Use `todesktop smoke-test <id>` to test a specific build by ID.
157
170
  - `todesktop smoke-test --latest` will test the latest build.
158
- - Append `--config=<path.to.another.todesktop.json>` to use a different configuration file.
171
+ - Append `--config=<path.to.config.file>` to use a different configuration file.
159
172
  - `todesktop whoami`. Prints the email of the account you're signed into.
160
173
  - `todesktop --help`. Shows the help documentation.
161
174
  - `todesktop --version`. Shows the current version of the CLI.
@@ -207,13 +220,17 @@ The webhook receives a POST request with the following JSON body:
207
220
  }
208
221
  ```
209
222
 
210
- ## Project configuration (todesktop.json)
223
+ ## Project configuration (todesktop.json or todesktop.js)
211
224
 
212
- This describes all of the possible configuration options ín your `todesktop.json`.
225
+ This describes all of the possible configuration options in your `todesktop.json` or `todesktop.js` file.
226
+
227
+ You can use a standard JSON file (`todesktop.json`) for static configuration, or a JavaScript file (`todesktop.js`) that exports a configuration object. Using a `.js` file allows for dynamic configuration, such as setting values based on environment variables or computing paths.
228
+
229
+ **Note:** Schema validation and IntelliSense (described under [Installation](#installation)) currently only work for `.json` files.
213
230
 
214
231
  To avoid confusion, the following terms will be used throughout this file:
215
232
 
216
- - "Project root": this is the parent directory of your `todesktop.json`.
233
+ - "Project root": this is the parent directory of your `todesktop.json` or `todesktop.js`.
217
234
 
218
235
  ### `$schema` - (optional) string
219
236
 
@@ -226,9 +243,8 @@ To enable JSON validation and IntelliSense for your `todesktop.json` file in com
226
243
  - For example, if using a hosted version of the schema:
227
244
  ```json
228
245
  {
229
- "$schema": "https://unpkg.com/@todesktop/cli@1.12.5/schemas/schema.json", // Example URL
246
+ "$schema": "https://unpkg.com/@todesktop/cli@1.13.0/schemas/schema.json",
230
247
  "id": "your-todesktop-id"
231
- // ... other configurations
232
248
  }
233
249
  ```
234
250
  - Or if ToDesktop CLI is installed locally, you can use a local path:
@@ -236,7 +252,6 @@ To enable JSON validation and IntelliSense for your `todesktop.json` file in com
236
252
  {
237
253
  "$schema": "./node_modules/@todesktop/cli/schemas/schema.json",
238
254
  "id": "your-todesktop-id"
239
- // ... other configurations
240
255
  }
241
256
  ```
242
257
 
@@ -420,9 +435,11 @@ The DMG windows position and size. In most cases, you will only want to specify
420
435
 
421
436
  ### `extends` - (optional) string
422
437
 
423
- Example: `./todesktop.staging.json`
438
+ Default: `null`.
424
439
 
425
- This is the path to a base configuration file. This is especially useful for configuration sharing between staging and production builds. The base configuration file can be a relative path from the project root or an absolute path.
440
+ Example: `./todesktop.base.json` or `./todesktop.base.js`.
441
+
442
+ This is the path to a base configuration file (`.json` or `.js`). This is especially useful for configuration sharing between different environments (e.g., staging and production). The base configuration file can be a relative path from the project root or an absolute path.
426
443
 
427
444
  For more information about how to create a staging version of your app see: [How do I create a staging version of my app?](#how-do-i-create-a-staging-version-of-my-app).
428
445
 
@@ -1204,9 +1221,9 @@ ToDesktop CLI supports the concept of a staging version of your app. This is use
1204
1221
 
1205
1222
  1. Create a new app in ToDesktop's web UI.
1206
1223
 
1207
- 2. Create a new todesktop configuration file named `todesktop.staging.json`
1224
+ 2. Create a new configuration file, for example `todesktop.staging.json` or `todesktop.staging.js`.
1208
1225
 
1209
- 3. Add the following to your `todesktop.staging.json` file:
1226
+ 3. Add the following to your staging configuration file (e.g., `todesktop.staging.json`):
1210
1227
 
1211
1228
  ```json
1212
1229
  {
@@ -1288,6 +1305,17 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1288
1305
 
1289
1306
  ## Changelog
1290
1307
 
1308
+ ### v1.14.0
1309
+
1310
+ - Add support for `todesktop.js` configuration file for dynamic configurations.
1311
+ - Upgrade to Firebase v11.
1312
+ - Update Node.js engine requirement from >=12 to >=16.
1313
+
1314
+ ### v1.13.0
1315
+
1316
+ - Add support for `platformOverrides` in config to specify platform-specific overrides for app configuration
1317
+ - Add support for `$schema` in config to enable JSON schema validation and IDE intellisense
1318
+
1291
1319
  ### v1.12.5
1292
1320
 
1293
1321
  - Fix: Removed invalid React Hook call in `BuildCommand` that caused errors.
@@ -1395,7 +1423,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1395
1423
 
1396
1424
  ### v1.9.0
1397
1425
 
1398
- - You can now specify `@electron/rebuild` as a custom `rebuildLibrary` in your `todesktop.json` file.
1426
+ - You can now specify `@electron/rebuild` as a custom `rebuildLibrary` in your configuration file.
1399
1427
 
1400
1428
  ### v1.8.1
1401
1429
 
@@ -1405,8 +1433,8 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1405
1433
 
1406
1434
  - Add support for `--webhook` flag for `todesktop build` command
1407
1435
  - Add support for `--async` flag to run a build in the in the background
1408
- - Add support for specifying custom `yarnVersion` in config
1409
- - Add support for specifying custom `pnpmVersion` in config
1436
+ - Add support for specifying custom `yarnVersion` in the configuration file
1437
+ - Add support for specifying custom `pnpmVersion` in the configuration file
1410
1438
 
1411
1439
  ### v1.7.7
1412
1440
 
@@ -1418,8 +1446,8 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1418
1446
 
1419
1447
  ### v1.7.5
1420
1448
 
1421
- - Add support for specifying custom `npmVersion` in config
1422
- - Add support for bundling a requirements file for Mac
1449
+ - Add support for specifying custom `npmVersion` in the configuration file
1450
+ - Add support for bundling a requirements file for Mac (`mac.requirements`)
1423
1451
 
1424
1452
  ### v1.7.4
1425
1453
 
@@ -1431,7 +1459,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1431
1459
 
1432
1460
  ### v1.7.1
1433
1461
 
1434
- - Add support for specifying custom `appBuilderLibVersion` in config
1462
+ - Add support for specifying custom `appBuilderLibVersion` in the configuration file
1435
1463
  - Show suggestion to run a Smoke Test when releasing an untested build
1436
1464
 
1437
1465
  ### v1.7.0
@@ -1440,15 +1468,15 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1440
1468
 
1441
1469
  ### v1.6.3
1442
1470
 
1443
- - Add support for specifying custom `windows.nsisCustomBinary` in config
1471
+ - Add support for specifying custom `windows.nsisCustomBinary` in the configuration file
1444
1472
 
1445
1473
  ### v1.6.2
1446
1474
 
1447
- - Add support for specifying custom `nodeVersion` in config
1475
+ - Add support for specifying custom `nodeVersion` in the configuration file
1448
1476
 
1449
1477
  ### v1.6.1
1450
1478
 
1451
- - Add support for specifying `windows.nsisInclude` in config
1479
+ - Add support for specifying `windows.nsisInclude` in the configuration file
1452
1480
 
1453
1481
  ### v1.6.0
1454
1482
 
@@ -1477,7 +1505,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1477
1505
 
1478
1506
  ### v1.4.0
1479
1507
 
1480
- - Adds `extends` and `packageJson` field to `todesktop.json` file.
1508
+ - Adds `extends` and `packageJson` fields to the configuration file.
1481
1509
  - Added `--config` option to pass a different configuration file.
1482
1510
 
1483
1511
  ### v1.3.0