@todesktop/cli 1.18.1 → 1.18.3
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 +34 -8
- package/dist/cli.js +92 -14
- package/dist/cli.js.map +2 -2
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
- package/schemas/schema.json +6 -0
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ For more information, visit the project
|
|
|
11
11
|
- [Installation](#installation)
|
|
12
12
|
- [Get started](#get-started)
|
|
13
13
|
- [CLI commands](#cli-commands)
|
|
14
|
+
- [Release Webhooks](#release-webhooks)
|
|
14
15
|
- [Automating your builds (CI)](#automating-your-builds-ci)
|
|
15
16
|
- [Project configuration (todesktop.json, todesktop.js, or todesktop.ts)](#project-configuration-todesktopjson-todesktopjs-or-todesktops)
|
|
16
17
|
- [Build lifecycle hooks (package.json scripts)](#build-lifecycle-hooks-packagejson-scripts)
|
|
@@ -46,7 +47,7 @@ Create a `todesktop.json` file in the root of your Electron project.
|
|
|
46
47
|
|
|
47
48
|
```json
|
|
48
49
|
{
|
|
49
|
-
"$schema": "https://unpkg.com/@todesktop/cli@1.18.
|
|
50
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.18.3/schemas/schema.json",
|
|
50
51
|
"schemaVersion": 1
|
|
51
52
|
"id": "your-todesktop-id",
|
|
52
53
|
"icon": "./desktop-icon.png",
|
|
@@ -201,6 +202,10 @@ We also support:
|
|
|
201
202
|
- Append `--force` to skip the interactive confirmation step.
|
|
202
203
|
- Append `--config=<path.to.config.file>` to use a different configuration
|
|
203
204
|
file.
|
|
205
|
+
- **Note:** By default, apps can not be released via the CLI. For security
|
|
206
|
+
reasons, you can only release apps through the
|
|
207
|
+
[web UI](https://app.todesktop.com) with security token authentication. If
|
|
208
|
+
you wish to enable CLI releases, please contact support with your app ID.
|
|
204
209
|
- `todesktop builds`. View your recent builds.
|
|
205
210
|
- Use `todesktop builds <id>` to view a specific build and its progress.
|
|
206
211
|
- `todesktop builds --latest` will show the latest build and it's progress.
|
|
@@ -232,12 +237,6 @@ TODESKTOP_ACCESS_TOKEN=accessToken
|
|
|
232
237
|
TODESKTOP_EMAIL=email
|
|
233
238
|
```
|
|
234
239
|
|
|
235
|
-
To build and release in one step, you can execute:
|
|
236
|
-
|
|
237
|
-
```sh
|
|
238
|
-
todesktop build && todesktop release --latest --force
|
|
239
|
-
```
|
|
240
|
-
|
|
241
240
|
If you need to run a build in the background, you can use the `--async` flag. To
|
|
242
241
|
get notified when the build is finished you can optionally specify a webhook URL
|
|
243
242
|
which will receive a POST request with the build data:
|
|
@@ -270,6 +269,15 @@ The webhook receives a POST request with the following JSON body:
|
|
|
270
269
|
}
|
|
271
270
|
```
|
|
272
271
|
|
|
272
|
+
## Release Webhooks
|
|
273
|
+
|
|
274
|
+
You can configure a webhook URL to receive notifications when a release is
|
|
275
|
+
published. This is useful for triggering downstream processes like deployment
|
|
276
|
+
pipelines or notifications.
|
|
277
|
+
|
|
278
|
+
You can read about how to do this in
|
|
279
|
+
[our release webhooks guide](https://www.todesktop.com/electron/docs/guides/release-webhooks).
|
|
280
|
+
|
|
273
281
|
## Project configuration (todesktop.json, todesktop.js, or todesktop.ts)
|
|
274
282
|
|
|
275
283
|
This describes all of the possible configuration options in your
|
|
@@ -311,7 +319,7 @@ To enable JSON validation and IntelliSense for your `todesktop.json` file in com
|
|
|
311
319
|
- For example, if using a hosted version of the schema:
|
|
312
320
|
```json
|
|
313
321
|
{
|
|
314
|
-
"$schema": "https://unpkg.com/@todesktop/cli@1.18.
|
|
322
|
+
"$schema": "https://unpkg.com/@todesktop/cli@1.18.3/schemas/schema.json",
|
|
315
323
|
"id": "your-todesktop-id"
|
|
316
324
|
}
|
|
317
325
|
```
|
|
@@ -877,6 +885,12 @@ Example: `distribution`
|
|
|
877
885
|
|
|
878
886
|
Whether to sign app for development or for distribution.
|
|
879
887
|
|
|
888
|
+
#### `mas.minimumSystemVersion` - (optional) string
|
|
889
|
+
|
|
890
|
+
Example: `12.0`, `11.0`, `10.15`
|
|
891
|
+
|
|
892
|
+
The minimum macOS version required to run the app. Set to '12.0' or higher for arm64-only Mac App Store submissions.
|
|
893
|
+
|
|
880
894
|
### `mas.x64ArchFiles` - (optional) string
|
|
881
895
|
|
|
882
896
|
Default: not defined
|
|
@@ -1517,6 +1531,18 @@ Now, when we build your app on ToDesktop servers, it will also run your custom
|
|
|
1517
1531
|
|
|
1518
1532
|
## Changelog
|
|
1519
1533
|
|
|
1534
|
+
### 1.18.3
|
|
1535
|
+
|
|
1536
|
+
#### Patch Changes
|
|
1537
|
+
|
|
1538
|
+
- 51821cc: Add support for pnpm workspace catalogs in workspace bundling
|
|
1539
|
+
|
|
1540
|
+
### 1.18.2
|
|
1541
|
+
|
|
1542
|
+
#### Patch Changes
|
|
1543
|
+
|
|
1544
|
+
- 797f9cc: feat(mas): add `mas.minimumSystemVersion` config option
|
|
1545
|
+
|
|
1520
1546
|
### 1.18.0
|
|
1521
1547
|
|
|
1522
1548
|
#### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -2158,6 +2158,12 @@ var schema_default = {
|
|
|
2158
2158
|
examples: ["distribution"],
|
|
2159
2159
|
default: "development"
|
|
2160
2160
|
},
|
|
2161
|
+
minimumSystemVersion: {
|
|
2162
|
+
type: "string",
|
|
2163
|
+
description: "The minimum macOS version required to run the app. Set to '12.0' or higher for arm64-only Mac App Store submissions.",
|
|
2164
|
+
examples: ["12.0", "11.0", "10.15"],
|
|
2165
|
+
pattern: "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$"
|
|
2166
|
+
},
|
|
2161
2167
|
x64ArchFiles: {
|
|
2162
2168
|
type: "string",
|
|
2163
2169
|
description: "Minimatch pattern of paths that are allowed to be x64 binaries in both ASAR files.",
|
|
@@ -3069,12 +3075,17 @@ async function prepareWorkspaceBundle(input) {
|
|
|
3069
3075
|
bundlePath,
|
|
3070
3076
|
workspacePackage: pkg,
|
|
3071
3077
|
bundledNames: bundledPackageNames,
|
|
3072
|
-
contexts: bundledPackageContexts
|
|
3078
|
+
contexts: bundledPackageContexts,
|
|
3079
|
+
workspace
|
|
3073
3080
|
});
|
|
3074
3081
|
bundleEntries.push(...packageEntries.files);
|
|
3075
3082
|
bundleEntries.push(packageEntries.packageJsonEntry);
|
|
3076
3083
|
}
|
|
3077
|
-
const rewrittenAppPkgJson = applyRewriteMap(
|
|
3084
|
+
const rewrittenAppPkgJson = applyRewriteMap(
|
|
3085
|
+
appPkgJson,
|
|
3086
|
+
appRewriteMap,
|
|
3087
|
+
workspace.catalog
|
|
3088
|
+
);
|
|
3078
3089
|
logger_default.info(
|
|
3079
3090
|
`Bundling ${sortedPackageNames.length} workspace package(s) from ${workspace.type} workspace at ${workspace.rootDir}`
|
|
3080
3091
|
);
|
|
@@ -3161,7 +3172,7 @@ function createPnpmDefinition({
|
|
|
3161
3172
|
pnpmFile,
|
|
3162
3173
|
rootDir
|
|
3163
3174
|
}) {
|
|
3164
|
-
const packages = parsePnpmWorkspaceFile(pnpmFile);
|
|
3175
|
+
const { packages, catalog } = parsePnpmWorkspaceFile(pnpmFile);
|
|
3165
3176
|
if (!packages.length) {
|
|
3166
3177
|
throw new Error(
|
|
3167
3178
|
`pnpm workspace file at ${pnpmFile} does not define any packages.`
|
|
@@ -3171,7 +3182,8 @@ function createPnpmDefinition({
|
|
|
3171
3182
|
globs: packages,
|
|
3172
3183
|
rootDir,
|
|
3173
3184
|
realRootDir: import_fs3.default.realpathSync(rootDir),
|
|
3174
|
-
type: "pnpm"
|
|
3185
|
+
type: "pnpm",
|
|
3186
|
+
catalog
|
|
3175
3187
|
};
|
|
3176
3188
|
}
|
|
3177
3189
|
function createNpmDefinition({
|
|
@@ -3203,8 +3215,13 @@ function parsePnpmWorkspaceFile(filePath) {
|
|
|
3203
3215
|
const content = import_fs3.default.readFileSync(filePath, "utf8");
|
|
3204
3216
|
const parsed = import_js_yaml.default.load(content);
|
|
3205
3217
|
let packagesField;
|
|
3218
|
+
let catalogField;
|
|
3219
|
+
let catalogsField;
|
|
3206
3220
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
3207
|
-
|
|
3221
|
+
const parsedObj = parsed;
|
|
3222
|
+
packagesField = parsedObj.packages;
|
|
3223
|
+
catalogField = parsedObj.catalog;
|
|
3224
|
+
catalogsField = parsedObj.catalogs;
|
|
3208
3225
|
} else {
|
|
3209
3226
|
packagesField = parsed;
|
|
3210
3227
|
}
|
|
@@ -3219,7 +3236,26 @@ function parsePnpmWorkspaceFile(filePath) {
|
|
|
3219
3236
|
`pnpm workspace file at ${filePath} does not define any packages.`
|
|
3220
3237
|
);
|
|
3221
3238
|
}
|
|
3222
|
-
|
|
3239
|
+
const catalog = {};
|
|
3240
|
+
if (catalogField && typeof catalogField === "object" && !Array.isArray(catalogField)) {
|
|
3241
|
+
for (const [key, value] of Object.entries(catalogField)) {
|
|
3242
|
+
if (typeof value === "string") {
|
|
3243
|
+
catalog[key] = value;
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
if (catalogsField && typeof catalogsField === "object" && !Array.isArray(catalogsField)) {
|
|
3248
|
+
for (const [catalogName, catalogContent] of Object.entries(catalogsField)) {
|
|
3249
|
+
if (catalogContent && typeof catalogContent === "object" && !Array.isArray(catalogContent)) {
|
|
3250
|
+
for (const [packageName, version] of Object.entries(catalogContent)) {
|
|
3251
|
+
if (typeof version === "string") {
|
|
3252
|
+
catalog[`${catalogName}:${packageName}`] = version;
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
}
|
|
3258
|
+
return { packages, catalog };
|
|
3223
3259
|
}
|
|
3224
3260
|
function workspaceIncludesPath({
|
|
3225
3261
|
appDir,
|
|
@@ -3391,7 +3427,7 @@ function getBundlePath(packageName) {
|
|
|
3391
3427
|
}
|
|
3392
3428
|
return packageName;
|
|
3393
3429
|
}
|
|
3394
|
-
function applyRewriteMap(manifest, rewriteMap) {
|
|
3430
|
+
function applyRewriteMap(manifest, rewriteMap, catalog) {
|
|
3395
3431
|
const clone = JSON.parse(JSON.stringify(manifest));
|
|
3396
3432
|
const sections = [
|
|
3397
3433
|
"dependencies",
|
|
@@ -3406,6 +3442,34 @@ function applyRewriteMap(manifest, rewriteMap) {
|
|
|
3406
3442
|
sectionDeps[depName] = rewrite;
|
|
3407
3443
|
}
|
|
3408
3444
|
}
|
|
3445
|
+
if (catalog) {
|
|
3446
|
+
for (const [depName, spec] of Object.entries(sectionDeps)) {
|
|
3447
|
+
if (typeof spec === "string" && spec.startsWith("catalog:")) {
|
|
3448
|
+
let catalogKey;
|
|
3449
|
+
if (spec === "catalog:") {
|
|
3450
|
+
catalogKey = depName;
|
|
3451
|
+
} else {
|
|
3452
|
+
const catalogRef = spec.slice("catalog:".length);
|
|
3453
|
+
const namedCatalogKey = `${catalogRef}:${depName}`;
|
|
3454
|
+
if (catalog[namedCatalogKey]) {
|
|
3455
|
+
catalogKey = namedCatalogKey;
|
|
3456
|
+
} else {
|
|
3457
|
+
catalogKey = catalogRef;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
const resolvedVersion = catalog[catalogKey];
|
|
3461
|
+
if (resolvedVersion) {
|
|
3462
|
+
sectionDeps[depName] = resolvedVersion;
|
|
3463
|
+
} else {
|
|
3464
|
+
throw new Error(
|
|
3465
|
+
`Catalog reference "${spec}" for dependency "${depName}" not found in pnpm catalog. Available catalog entries: ${Object.keys(
|
|
3466
|
+
catalog
|
|
3467
|
+
).join(", ")}`
|
|
3468
|
+
);
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3409
3473
|
}
|
|
3410
3474
|
return clone;
|
|
3411
3475
|
}
|
|
@@ -3413,7 +3477,8 @@ async function buildPackageEntries({
|
|
|
3413
3477
|
bundlePath,
|
|
3414
3478
|
workspacePackage,
|
|
3415
3479
|
bundledNames,
|
|
3416
|
-
contexts
|
|
3480
|
+
contexts,
|
|
3481
|
+
workspace
|
|
3417
3482
|
}) {
|
|
3418
3483
|
const packageDir = workspacePackage.dir;
|
|
3419
3484
|
const { manifest } = workspacePackage;
|
|
@@ -3434,7 +3499,11 @@ async function buildPackageEntries({
|
|
|
3434
3499
|
});
|
|
3435
3500
|
const packageJsonEntry = {
|
|
3436
3501
|
content: Buffer.from(
|
|
3437
|
-
`${JSON.stringify(
|
|
3502
|
+
`${JSON.stringify(
|
|
3503
|
+
applyRewriteMap(manifest, rewrites, workspace.catalog),
|
|
3504
|
+
null,
|
|
3505
|
+
2
|
|
3506
|
+
)}
|
|
3438
3507
|
`
|
|
3439
3508
|
),
|
|
3440
3509
|
to: import_path8.default.posix.join(BUNDLED_ROOT, bundlePath, "package.json")
|
|
@@ -3457,7 +3526,7 @@ async function gatherPackageFiles({
|
|
|
3457
3526
|
const posixPattern = pattern.replace(/\\/g, "/");
|
|
3458
3527
|
return [pattern, `${posixPattern}/**/*`];
|
|
3459
3528
|
}
|
|
3460
|
-
} catch {
|
|
3529
|
+
} catch (_error) {
|
|
3461
3530
|
}
|
|
3462
3531
|
return [pattern];
|
|
3463
3532
|
});
|
|
@@ -4143,7 +4212,10 @@ var Login = ({ setIsLoggedIn }) => {
|
|
|
4143
4212
|
failureMessage && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Error2, { errorMessage: failureMessage, marginTop: true })
|
|
4144
4213
|
] });
|
|
4145
4214
|
};
|
|
4146
|
-
var Error2 = ({
|
|
4215
|
+
var Error2 = ({
|
|
4216
|
+
errorMessage,
|
|
4217
|
+
marginTop
|
|
4218
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ink14.Box, { marginTop: marginTop ? 1 : 0, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ink14.Text, { color: "red", children: errorMessage }) });
|
|
4147
4219
|
Error2.propTypes = {
|
|
4148
4220
|
errorMessage: import_prop_types8.default.string.isRequired,
|
|
4149
4221
|
marginTop: import_prop_types8.default.bool
|
|
@@ -5444,7 +5516,10 @@ function BuildPicker({
|
|
|
5444
5516
|
});
|
|
5445
5517
|
function updateState(changes) {
|
|
5446
5518
|
setState(
|
|
5447
|
-
(previousState) => ({
|
|
5519
|
+
(previousState) => ({
|
|
5520
|
+
...previousState,
|
|
5521
|
+
...changes
|
|
5522
|
+
})
|
|
5448
5523
|
);
|
|
5449
5524
|
if (changes.state && ["error", "no-builds"].includes(changes.state)) {
|
|
5450
5525
|
setTimeout(() => exit(), 10);
|
|
@@ -5987,7 +6062,10 @@ function ReleaseConfirmation({
|
|
|
5987
6062
|
}, []);
|
|
5988
6063
|
function updateState(changes) {
|
|
5989
6064
|
setState(
|
|
5990
|
-
(previousState) => ({
|
|
6065
|
+
(previousState) => ({
|
|
6066
|
+
...previousState,
|
|
6067
|
+
...changes
|
|
6068
|
+
})
|
|
5991
6069
|
);
|
|
5992
6070
|
}
|
|
5993
6071
|
switch (state.state) {
|
|
@@ -6649,7 +6727,7 @@ var package_default = {
|
|
|
6649
6727
|
access: "public"
|
|
6650
6728
|
},
|
|
6651
6729
|
name: "@todesktop/cli",
|
|
6652
|
-
version: "1.18.
|
|
6730
|
+
version: "1.18.3",
|
|
6653
6731
|
license: "MIT",
|
|
6654
6732
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
6655
6733
|
homepage: "https://todesktop.com/cli",
|