@todesktop/cli 1.13.0 → 1.15.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 +86 -26
- package/dist/cli.js +244 -92
- package/dist/cli.js.map +4 -4
- package/dist/types.d.ts +503 -0
- package/package.json +8 -5
- package/schemas/schema.json +2 -2
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, todesktop.js, or todesktop.ts)](#project-configuration-todesktopjson-todesktopjs-or-todesktops)
|
|
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,46 @@ 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.
|
|
45
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.14.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
|
-
|
|
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
|
+
You can also create a `todesktop.ts` file for TypeScript projects with full type checking and IntelliSense:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import type { Schema } from "@todesktop/cli";
|
|
69
|
+
import path from "path";
|
|
70
|
+
|
|
71
|
+
const config: Schema = {
|
|
72
|
+
id: process.env.TODESKTOP_APP_ID || "your-default-todesktop-id",
|
|
73
|
+
icon: path.join(__dirname, "assets", "desktop-icon.png"),
|
|
74
|
+
schemaVersion: 1,
|
|
75
|
+
nodeVersion: "18.12.1",
|
|
76
|
+
mac: {
|
|
77
|
+
category: "public.app-category.productivity",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default config;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
See [Project configuration](#project-configuration-todesktopjson-todesktopjs-or-todesktops) for the full list of configuration options.
|
|
53
85
|
|
|
54
86
|
### Step 3: Add @todesktop/runtime as a dependency
|
|
55
87
|
|
|
@@ -135,27 +167,27 @@ This builds your Electron app with native installers, code signing, and so on ba
|
|
|
135
167
|
We also support:
|
|
136
168
|
|
|
137
169
|
- `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.
|
|
170
|
+
- `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
171
|
- `todesktop build --async`. Run a build in the background. This is handy for CI environments.
|
|
140
172
|
- `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
|
|
173
|
+
- `todesktop build --ignore-extends-errors`. Ignore `id` and `appId` validation errors when extending another configuration file (`.json` or `.js`).
|
|
142
174
|
- `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
175
|
- Use `todesktop release <id>` to release a specific build by ID.
|
|
144
176
|
- `todesktop release --latest` will release the latest build.
|
|
145
177
|
- Append `--force` to skip the interactive confirmation step.
|
|
146
|
-
- Append `--config=<path.to.
|
|
178
|
+
- Append `--config=<path.to.config.file>` to use a different configuration file.
|
|
147
179
|
- `todesktop builds`. View your recent builds.
|
|
148
180
|
- Use `todesktop builds <id>` to view a specific build and its progress.
|
|
149
181
|
- `todesktop builds --latest` will show the latest build and it's progress.
|
|
150
182
|
- `todesktop builds --count=<number>` will show the last `<number>` builds.
|
|
151
183
|
- `todesktop builds --format=json` will output build data in JSON format.
|
|
152
|
-
- Append `--config=<path.to.
|
|
184
|
+
- Append `--config=<path.to.config.file>` to use a different configuration file.
|
|
153
185
|
- Append `--exit` to disable dynamic pagination and exit the process once the build data has been displayed.
|
|
154
186
|
- `todesktop logout`. Logs you out.
|
|
155
187
|
- `todesktop smoke-test` Check whether the build works and can be successfully updated.
|
|
156
188
|
- Use `todesktop smoke-test <id>` to test a specific build by ID.
|
|
157
189
|
- `todesktop smoke-test --latest` will test the latest build.
|
|
158
|
-
- Append `--config=<path.to.
|
|
190
|
+
- Append `--config=<path.to.config.file>` to use a different configuration file.
|
|
159
191
|
- `todesktop whoami`. Prints the email of the account you're signed into.
|
|
160
192
|
- `todesktop --help`. Shows the help documentation.
|
|
161
193
|
- `todesktop --version`. Shows the current version of the CLI.
|
|
@@ -207,13 +239,27 @@ The webhook receives a POST request with the following JSON body:
|
|
|
207
239
|
}
|
|
208
240
|
```
|
|
209
241
|
|
|
210
|
-
## Project configuration (todesktop.json)
|
|
242
|
+
## Project configuration (todesktop.json, todesktop.js, or todesktop.ts)
|
|
243
|
+
|
|
244
|
+
This describes all of the possible configuration options in your `todesktop.json`, `todesktop.js`, or `todesktop.ts` file.
|
|
245
|
+
|
|
246
|
+
You can use:
|
|
247
|
+
|
|
248
|
+
- A standard JSON file (`todesktop.json`) for static configuration
|
|
249
|
+
- A JavaScript file (`todesktop.js`) that exports a configuration object for dynamic configuration
|
|
250
|
+
- A TypeScript file (`todesktop.ts`) that exports a configuration object with full type checking and IntelliSense
|
|
251
|
+
|
|
252
|
+
Using `.js` or `.ts` files allows for dynamic configuration, such as setting values based on environment variables or computing paths.
|
|
211
253
|
|
|
212
|
-
|
|
254
|
+
**Note:**
|
|
255
|
+
|
|
256
|
+
- Schema validation and IntelliSense for `.json` files are available through the JSON schema (described under [Installation](#installation))
|
|
257
|
+
- TypeScript files (`.ts`) provide full type checking and IntelliSense when using the exported `Schema` type from `@todesktop/cli`
|
|
258
|
+
- TypeScript compilation requires a local installation of TypeScript in your project
|
|
213
259
|
|
|
214
260
|
To avoid confusion, the following terms will be used throughout this file:
|
|
215
261
|
|
|
216
|
-
- "Project root": this is the parent directory of your `todesktop.json`.
|
|
262
|
+
- "Project root": this is the parent directory of your `todesktop.json`, `todesktop.js`, or `todesktop.ts`.
|
|
217
263
|
|
|
218
264
|
### `$schema` - (optional) string
|
|
219
265
|
|
|
@@ -226,7 +272,7 @@ To enable JSON validation and IntelliSense for your `todesktop.json` file in com
|
|
|
226
272
|
- For example, if using a hosted version of the schema:
|
|
227
273
|
```json
|
|
228
274
|
{
|
|
229
|
-
"$schema": "https://unpkg.com/@todesktop/cli@1.
|
|
275
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.14.0/schemas/schema.json",
|
|
230
276
|
"id": "your-todesktop-id"
|
|
231
277
|
}
|
|
232
278
|
```
|
|
@@ -418,9 +464,11 @@ The DMG windows position and size. In most cases, you will only want to specify
|
|
|
418
464
|
|
|
419
465
|
### `extends` - (optional) string
|
|
420
466
|
|
|
421
|
-
|
|
467
|
+
Default: `null`.
|
|
468
|
+
|
|
469
|
+
Example: `./todesktop.base.json` or `./todesktop.base.js`.
|
|
422
470
|
|
|
423
|
-
This is the path to a base configuration file. This is especially useful for configuration sharing between staging and production
|
|
471
|
+
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.
|
|
424
472
|
|
|
425
473
|
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).
|
|
426
474
|
|
|
@@ -1202,9 +1250,9 @@ ToDesktop CLI supports the concept of a staging version of your app. This is use
|
|
|
1202
1250
|
|
|
1203
1251
|
1. Create a new app in ToDesktop's web UI.
|
|
1204
1252
|
|
|
1205
|
-
2. Create a new
|
|
1253
|
+
2. Create a new configuration file, for example `todesktop.staging.json` or `todesktop.staging.js`.
|
|
1206
1254
|
|
|
1207
|
-
3. Add the following to your `todesktop.staging.json`
|
|
1255
|
+
3. Add the following to your staging configuration file (e.g., `todesktop.staging.json`):
|
|
1208
1256
|
|
|
1209
1257
|
```json
|
|
1210
1258
|
{
|
|
@@ -1286,6 +1334,18 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1286
1334
|
|
|
1287
1335
|
## Changelog
|
|
1288
1336
|
|
|
1337
|
+
### v1.15.0
|
|
1338
|
+
|
|
1339
|
+
- Add support for `todesktop.ts` configuration file with full TypeScript type checking and IntelliSense.
|
|
1340
|
+
- Export `Schema` type from `@todesktop/cli` for TypeScript configuration files.
|
|
1341
|
+
- TypeScript compilation uses user's local TypeScript installation (no production dependencies added).
|
|
1342
|
+
|
|
1343
|
+
### v1.14.0
|
|
1344
|
+
|
|
1345
|
+
- Add support for `todesktop.js` configuration file for dynamic configurations.
|
|
1346
|
+
- Upgrade to Firebase v11.
|
|
1347
|
+
- Update Node.js engine requirement from >=12 to >=16.
|
|
1348
|
+
|
|
1289
1349
|
### v1.13.0
|
|
1290
1350
|
|
|
1291
1351
|
- Add support for `platformOverrides` in config to specify platform-specific overrides for app configuration
|
|
@@ -1398,7 +1458,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1398
1458
|
|
|
1399
1459
|
### v1.9.0
|
|
1400
1460
|
|
|
1401
|
-
- You can now specify `@electron/rebuild` as a custom `rebuildLibrary` in your
|
|
1461
|
+
- You can now specify `@electron/rebuild` as a custom `rebuildLibrary` in your configuration file.
|
|
1402
1462
|
|
|
1403
1463
|
### v1.8.1
|
|
1404
1464
|
|
|
@@ -1408,8 +1468,8 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1408
1468
|
|
|
1409
1469
|
- Add support for `--webhook` flag for `todesktop build` command
|
|
1410
1470
|
- Add support for `--async` flag to run a build in the in the background
|
|
1411
|
-
- Add support for specifying custom `yarnVersion` in
|
|
1412
|
-
- Add support for specifying custom `pnpmVersion` in
|
|
1471
|
+
- Add support for specifying custom `yarnVersion` in the configuration file
|
|
1472
|
+
- Add support for specifying custom `pnpmVersion` in the configuration file
|
|
1413
1473
|
|
|
1414
1474
|
### v1.7.7
|
|
1415
1475
|
|
|
@@ -1421,8 +1481,8 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1421
1481
|
|
|
1422
1482
|
### v1.7.5
|
|
1423
1483
|
|
|
1424
|
-
- Add support for specifying custom `npmVersion` in
|
|
1425
|
-
- Add support for bundling a requirements file for Mac
|
|
1484
|
+
- Add support for specifying custom `npmVersion` in the configuration file
|
|
1485
|
+
- Add support for bundling a requirements file for Mac (`mac.requirements`)
|
|
1426
1486
|
|
|
1427
1487
|
### v1.7.4
|
|
1428
1488
|
|
|
@@ -1434,7 +1494,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1434
1494
|
|
|
1435
1495
|
### v1.7.1
|
|
1436
1496
|
|
|
1437
|
-
- Add support for specifying custom `appBuilderLibVersion` in
|
|
1497
|
+
- Add support for specifying custom `appBuilderLibVersion` in the configuration file
|
|
1438
1498
|
- Show suggestion to run a Smoke Test when releasing an untested build
|
|
1439
1499
|
|
|
1440
1500
|
### v1.7.0
|
|
@@ -1443,15 +1503,15 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1443
1503
|
|
|
1444
1504
|
### v1.6.3
|
|
1445
1505
|
|
|
1446
|
-
- Add support for specifying custom `windows.nsisCustomBinary` in
|
|
1506
|
+
- Add support for specifying custom `windows.nsisCustomBinary` in the configuration file
|
|
1447
1507
|
|
|
1448
1508
|
### v1.6.2
|
|
1449
1509
|
|
|
1450
|
-
- Add support for specifying custom `nodeVersion` in
|
|
1510
|
+
- Add support for specifying custom `nodeVersion` in the configuration file
|
|
1451
1511
|
|
|
1452
1512
|
### v1.6.1
|
|
1453
1513
|
|
|
1454
|
-
- Add support for specifying `windows.nsisInclude` in
|
|
1514
|
+
- Add support for specifying `windows.nsisInclude` in the configuration file
|
|
1455
1515
|
|
|
1456
1516
|
### v1.6.0
|
|
1457
1517
|
|
|
@@ -1480,7 +1540,7 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1480
1540
|
|
|
1481
1541
|
### v1.4.0
|
|
1482
1542
|
|
|
1483
|
-
- Adds `extends` and `packageJson`
|
|
1543
|
+
- Adds `extends` and `packageJson` fields to the configuration file.
|
|
1484
1544
|
- Added `--config` option to pass a different configuration file.
|
|
1485
1545
|
|
|
1486
1546
|
### v1.3.0
|