@todesktop/cli 1.10.5 → 1.11.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 +22 -0
- package/dist/cli.js +66 -48
- package/dist/cli.js.map +3 -3
- package/package.json +2 -2
- package/schemas/schema.json +6 -1
package/README.md
CHANGED
|
@@ -150,6 +150,7 @@ We also support:
|
|
|
150
150
|
- `todesktop build --config=<path.to.another.todesktop.json>`. Run a build with a different configuration file.
|
|
151
151
|
- `todesktop build --async`. Run a build in the background. This is handy for CI environments.
|
|
152
152
|
- `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.
|
|
153
|
+
- `todesktop build --ignore-extends-errors`. Ignore `id` and `appId` validation errors when extending another todesktop.json file.
|
|
153
154
|
- `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.
|
|
154
155
|
- Use `todesktop release <id>` to release a specific build by ID.
|
|
155
156
|
- `todesktop release --latest` will release the latest build.
|
|
@@ -549,6 +550,19 @@ The path to your application's Linux desktop icon. It must be an ICNS or PNG.
|
|
|
549
550
|
|
|
550
551
|
Note: to ensure the icon is never missing (e.g. this happens sometimes in Ubuntu), set the [`icon` option](https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions) when creating your `BrowserWindow`s.
|
|
551
552
|
|
|
553
|
+
#### `linux.imageVersion` - (optional) string
|
|
554
|
+
|
|
555
|
+
Example: `0.1.0`
|
|
556
|
+
|
|
557
|
+
Default: `0.0.11`
|
|
558
|
+
|
|
559
|
+
The version of the Linux image that ToDesktop should use to build your app.
|
|
560
|
+
|
|
561
|
+
Linux Changelog:
|
|
562
|
+
|
|
563
|
+
- `0.1.0`: Updated g++ → g++10, gcc → gcc10. WARNING: This compiler has been updated to a newer version that is not compatible with older versions of Linux like Ubuntu 20.04. You should probably only use this version if you know what you're doing.
|
|
564
|
+
- `0.0.11`: Updated git 2.25.1 → 2.47.1 node 18.18.2 → 18.20.5
|
|
565
|
+
|
|
552
566
|
### `linux.noSandbox` - (optional) boolean
|
|
553
567
|
|
|
554
568
|
Default: `true`
|
|
@@ -1146,6 +1160,14 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
1146
1160
|
|
|
1147
1161
|
## Changelog
|
|
1148
1162
|
|
|
1163
|
+
### v1.11.1
|
|
1164
|
+
|
|
1165
|
+
- You can now specify `linux.imageVersion` to explicitly set the version of the Linux image that ToDesktop should use to build your app.
|
|
1166
|
+
|
|
1167
|
+
### v1.11.0
|
|
1168
|
+
|
|
1169
|
+
- Add additional `id` and `appId` validation when extending another `todesktop.json` file. Can be disabled with the `--ignore-extends-errors` flag.
|
|
1170
|
+
|
|
1149
1171
|
### v1.10.5
|
|
1150
1172
|
|
|
1151
1173
|
- Add support for `snap.base` in snap configuration
|
package/dist/cli.js
CHANGED
|
@@ -972,9 +972,9 @@ async function postToFirebaseFunction_default(functionName, body = {}, config2 =
|
|
|
972
972
|
}
|
|
973
973
|
|
|
974
974
|
// src/utilities/projectConfig/getProjectConfig.ts
|
|
975
|
-
var import_path3 = require("path");
|
|
976
|
-
var import_fs = require("fs");
|
|
977
975
|
var import_find_up = __toESM(require("find-up"));
|
|
976
|
+
var import_fs = require("fs");
|
|
977
|
+
var import_path3 = require("path");
|
|
978
978
|
|
|
979
979
|
// src/utilities/projectConfig/loadConfig.ts
|
|
980
980
|
function loadConfig(configPath) {
|
|
@@ -1453,7 +1453,7 @@ var schema_default = {
|
|
|
1453
1453
|
required: ["extends"]
|
|
1454
1454
|
},
|
|
1455
1455
|
then: {
|
|
1456
|
-
required: []
|
|
1456
|
+
required: ["id"]
|
|
1457
1457
|
},
|
|
1458
1458
|
else: {
|
|
1459
1459
|
required: ["id", "icon", "schemaVersion"]
|
|
@@ -1659,6 +1659,11 @@ var schema_default = {
|
|
|
1659
1659
|
},
|
|
1660
1660
|
minLength: 3
|
|
1661
1661
|
},
|
|
1662
|
+
imageVersion: {
|
|
1663
|
+
type: "string",
|
|
1664
|
+
minLength: 1,
|
|
1665
|
+
validSemver: {}
|
|
1666
|
+
},
|
|
1662
1667
|
noSandbox: {
|
|
1663
1668
|
type: "boolean"
|
|
1664
1669
|
}
|
|
@@ -2049,9 +2054,9 @@ ${output}`
|
|
|
2049
2054
|
}
|
|
2050
2055
|
|
|
2051
2056
|
// src/utilities/projectConfig/computeFullProjectConfig.ts
|
|
2052
|
-
var import_path2 = require("path");
|
|
2053
2057
|
var import_lodash2 = __toESM(require("lodash.merge"));
|
|
2054
|
-
|
|
2058
|
+
var import_path2 = require("path");
|
|
2059
|
+
function computeFullProjectConfig(partialConfig, projectRoot, flags) {
|
|
2055
2060
|
if (!partialConfig.extends) {
|
|
2056
2061
|
logger_default.debug("No extends field, returning partial config");
|
|
2057
2062
|
return partialConfig;
|
|
@@ -2062,8 +2067,19 @@ function computeFullProjectConfig(partialConfig, projectRoot) {
|
|
|
2062
2067
|
parentConfig.appPath = parentConfig.appPath || ".";
|
|
2063
2068
|
const parentFullConfig = computeFullProjectConfig(
|
|
2064
2069
|
parentConfig,
|
|
2065
|
-
projectRoot
|
|
2070
|
+
projectRoot,
|
|
2071
|
+
flags
|
|
2066
2072
|
);
|
|
2073
|
+
if ((flags == null ? void 0 : flags.build) && !flags.build.ignoreExtendsErrors) {
|
|
2074
|
+
const hasSameId = partialConfig.id === parentFullConfig.id;
|
|
2075
|
+
const hasSameAppId = partialConfig.appId === parentFullConfig.appId;
|
|
2076
|
+
if (hasSameId || hasSameAppId) {
|
|
2077
|
+
throw new Error(`
|
|
2078
|
+
todesktop.json invalid. Cannot have the same "id" or "appId" as an extended todesktop.json file.
|
|
2079
|
+
|
|
2080
|
+
You can disable this error by running todesktop build with the --ignore-extends-errors flag.`);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2067
2083
|
const result = (0, import_lodash2.default)({}, parentFullConfig, partialConfig);
|
|
2068
2084
|
delete result.extends;
|
|
2069
2085
|
return result;
|
|
@@ -2071,7 +2087,7 @@ function computeFullProjectConfig(partialConfig, projectRoot) {
|
|
|
2071
2087
|
}
|
|
2072
2088
|
|
|
2073
2089
|
// src/utilities/projectConfig/getProjectConfig.ts
|
|
2074
|
-
function getProjectConfig(configPath) {
|
|
2090
|
+
function getProjectConfig(configPath, flags) {
|
|
2075
2091
|
if (!configPath) {
|
|
2076
2092
|
logger_default.debug("No config path provided, searching for one");
|
|
2077
2093
|
configPath = import_find_up.default.sync("todesktop.json");
|
|
@@ -2089,7 +2105,7 @@ function getProjectConfig(configPath) {
|
|
|
2089
2105
|
}
|
|
2090
2106
|
const projectRoot = (0, import_path3.dirname)(configPath);
|
|
2091
2107
|
const partialConfig = loadConfig(configPath);
|
|
2092
|
-
const config2 = computeFullProjectConfig(partialConfig, projectRoot);
|
|
2108
|
+
const config2 = computeFullProjectConfig(partialConfig, projectRoot, flags);
|
|
2093
2109
|
validateConfig({ config: config2, projectRoot });
|
|
2094
2110
|
const result = resolveConfigPaths({ config: config2, projectRoot });
|
|
2095
2111
|
return { config: result, unprocessedConfig: config2, projectRoot };
|
|
@@ -2366,7 +2382,14 @@ Your app is larger than ${fileSizeLimit}MB. Your app is ${import_chalk.default.b
|
|
|
2366
2382
|
|
|
2367
2383
|
// src/commands/build/utilities/uploadApplicationSource.ts
|
|
2368
2384
|
var getAppFiles = async (globsInput, appPath, appPkgJson) => {
|
|
2369
|
-
const globs = [
|
|
2385
|
+
const globs = [
|
|
2386
|
+
"!node_modules",
|
|
2387
|
+
"!**/node_modules",
|
|
2388
|
+
"!.git",
|
|
2389
|
+
"!**/.git",
|
|
2390
|
+
"!.gitignore",
|
|
2391
|
+
"!**/.gitignore"
|
|
2392
|
+
];
|
|
2370
2393
|
if (globsInput && globsInput.length) {
|
|
2371
2394
|
globs.push(
|
|
2372
2395
|
...globsInput,
|
|
@@ -2607,15 +2630,15 @@ async function exists(filePath) {
|
|
|
2607
2630
|
// src/commands/build/utilities/runBuild.ts
|
|
2608
2631
|
async function runBuild({
|
|
2609
2632
|
configPath,
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
onBuildFinishedWebhook,
|
|
2613
|
-
updateState
|
|
2633
|
+
updateState,
|
|
2634
|
+
flags
|
|
2614
2635
|
}) {
|
|
2615
|
-
var _a, _b, _c;
|
|
2636
|
+
var _a, _b, _c, _d;
|
|
2616
2637
|
logForCI_default("Getting application information...");
|
|
2617
2638
|
const primaryUserId = (_a = currentUser()) == null ? void 0 : _a.uid;
|
|
2618
|
-
const { config: config2, unprocessedConfig } = getProjectConfig(configPath
|
|
2639
|
+
const { config: config2, unprocessedConfig } = getProjectConfig(configPath, {
|
|
2640
|
+
build: flags
|
|
2641
|
+
});
|
|
2619
2642
|
const appId = config2.id;
|
|
2620
2643
|
const appPkgJson = getPackageJson_default({ config: config2 });
|
|
2621
2644
|
const buildObserver = spyBuild();
|
|
@@ -2636,9 +2659,9 @@ async function runBuild({
|
|
|
2636
2659
|
appPkgProductName: appPkgJson.productName,
|
|
2637
2660
|
appVersion: appPkgJson.version,
|
|
2638
2661
|
id: config2.id,
|
|
2639
|
-
onBuildFinishedWebhook,
|
|
2662
|
+
onBuildFinishedWebhook: flags.onBuildFinishedWebhook,
|
|
2640
2663
|
projectConfig: unprocessedConfig,
|
|
2641
|
-
shouldCodeSign: shouldCodeSign !== false,
|
|
2664
|
+
shouldCodeSign: flags.shouldCodeSign !== false,
|
|
2642
2665
|
shouldRelease: false,
|
|
2643
2666
|
userId: primaryUserId,
|
|
2644
2667
|
versionControlInfo: await getVersionControlInfo_default(config2.appPath),
|
|
@@ -2680,22 +2703,23 @@ async function runBuild({
|
|
|
2680
2703
|
logForCI_default("Kicking off build...");
|
|
2681
2704
|
try {
|
|
2682
2705
|
await postToFirebaseFunction_default("kickOffBuild", {
|
|
2706
|
+
appBuilderLibVersion: config2.appBuilderLibVersion,
|
|
2683
2707
|
appId,
|
|
2684
2708
|
appPkgName: appPkgJson.name,
|
|
2685
2709
|
appVersion: appPkgJson.version,
|
|
2686
2710
|
buildId,
|
|
2687
|
-
|
|
2688
|
-
|
|
2711
|
+
idToken: await ((_c = currentUser()) == null ? void 0 : _c.getIdToken()),
|
|
2712
|
+
linuxImageVersion: (_d = config2.linux) == null ? void 0 : _d.imageVersion,
|
|
2689
2713
|
nodeVersion: config2.nodeVersion,
|
|
2690
2714
|
npmVersion: config2.npmVersion,
|
|
2691
2715
|
pnpmVersion: config2.pnpmVersion,
|
|
2692
|
-
|
|
2693
|
-
|
|
2716
|
+
sourceArchiveDetails,
|
|
2717
|
+
userId: primaryUserId
|
|
2694
2718
|
});
|
|
2695
2719
|
} catch (e) {
|
|
2696
2720
|
throw addErrorMessage(e, "Failed while kicking off build");
|
|
2697
2721
|
}
|
|
2698
|
-
if (exitAfterUploading) {
|
|
2722
|
+
if (flags.exitAfterUploading) {
|
|
2699
2723
|
updateState({ state: "exit-after-uploading" });
|
|
2700
2724
|
return;
|
|
2701
2725
|
}
|
|
@@ -2728,21 +2752,13 @@ var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
|
2728
2752
|
function Build({
|
|
2729
2753
|
commandUsed,
|
|
2730
2754
|
configPath,
|
|
2731
|
-
|
|
2732
|
-
onBuildFinishedWebhook,
|
|
2733
|
-
shouldCodeSign
|
|
2755
|
+
flags
|
|
2734
2756
|
}) {
|
|
2735
2757
|
var _a, _b, _c, _d, _e, _f;
|
|
2736
2758
|
const exit = useExit_default();
|
|
2737
2759
|
const [state, setState] = (0, import_react6.useState)({ state: "initializing" });
|
|
2738
2760
|
(0, import_react6.useEffect)(() => {
|
|
2739
|
-
runBuild({
|
|
2740
|
-
configPath,
|
|
2741
|
-
exitAfterUploading,
|
|
2742
|
-
onBuildFinishedWebhook,
|
|
2743
|
-
shouldCodeSign,
|
|
2744
|
-
updateState
|
|
2745
|
-
}).catch((e) => {
|
|
2761
|
+
runBuild({ configPath, flags, updateState }).catch((e) => {
|
|
2746
2762
|
const error = e.response ? e.response.data : e;
|
|
2747
2763
|
logForCI_default(error);
|
|
2748
2764
|
updateState({ state: "error", error });
|
|
@@ -3548,16 +3564,14 @@ var useAnalyticsCommand = (command, flags = {}, properties = {}) => {
|
|
|
3548
3564
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3549
3565
|
function BuildCommand({
|
|
3550
3566
|
configPath,
|
|
3551
|
-
|
|
3552
|
-
onBuildFinishedWebhook,
|
|
3553
|
-
shouldCodeSign
|
|
3567
|
+
flags
|
|
3554
3568
|
}) {
|
|
3555
3569
|
checkIfReactIsUsable_default();
|
|
3556
3570
|
useAnalyticsCommand("build", {
|
|
3557
|
-
async: exitAfterUploading,
|
|
3558
|
-
codeSign: shouldCodeSign,
|
|
3571
|
+
async: flags.exitAfterUploading,
|
|
3572
|
+
codeSign: flags.shouldCodeSign,
|
|
3559
3573
|
config: configPath,
|
|
3560
|
-
webhook: onBuildFinishedWebhook
|
|
3574
|
+
webhook: flags.onBuildFinishedWebhook
|
|
3561
3575
|
});
|
|
3562
3576
|
const commandUsed = "todesktop build";
|
|
3563
3577
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary_default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(LoginHOC_default, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(OngoingBuildGuard_default, { configPath, commandUsed, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
@@ -3565,9 +3579,7 @@ function BuildCommand({
|
|
|
3565
3579
|
{
|
|
3566
3580
|
commandUsed,
|
|
3567
3581
|
configPath,
|
|
3568
|
-
|
|
3569
|
-
onBuildFinishedWebhook,
|
|
3570
|
-
shouldCodeSign
|
|
3582
|
+
flags
|
|
3571
3583
|
}
|
|
3572
3584
|
) }) }) });
|
|
3573
3585
|
}
|
|
@@ -5433,7 +5445,7 @@ var package_default = {
|
|
|
5433
5445
|
access: "public"
|
|
5434
5446
|
},
|
|
5435
5447
|
name: "@todesktop/cli",
|
|
5436
|
-
version: "1.
|
|
5448
|
+
version: "1.11.0",
|
|
5437
5449
|
license: "MIT",
|
|
5438
5450
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
5439
5451
|
homepage: "https://todesktop.com/cli",
|
|
@@ -5518,7 +5530,7 @@ var package_default = {
|
|
|
5518
5530
|
"xdg-basedir": "^4.0.0"
|
|
5519
5531
|
},
|
|
5520
5532
|
devDependencies: {
|
|
5521
|
-
"@todesktop/shared": "^7.
|
|
5533
|
+
"@todesktop/shared": "^7.189.6",
|
|
5522
5534
|
"@types/bunyan": "^1.8.6",
|
|
5523
5535
|
"@types/is-ci": "^3.0.4",
|
|
5524
5536
|
"@types/node": "^20.8.4",
|
|
@@ -5672,7 +5684,7 @@ var configOption = new import_commander.Option(
|
|
|
5672
5684
|
}
|
|
5673
5685
|
return value;
|
|
5674
5686
|
});
|
|
5675
|
-
import_commander.program.name("
|
|
5687
|
+
import_commander.program.name("todesktop").version(getCliVersion_default());
|
|
5676
5688
|
import_commander.program.command("build").description(
|
|
5677
5689
|
"Build an Electron app with native installers, code signing baked-in, etc. but without releasing it (existing users won't get an auto-update). For quicker builds, you can append `--code-sign=false` to disable code-signing and notarization."
|
|
5678
5690
|
).option(
|
|
@@ -5684,12 +5696,18 @@ import_commander.program.command("build").description(
|
|
|
5684
5696
|
).option(
|
|
5685
5697
|
"--webhook [string]",
|
|
5686
5698
|
"Send POST request to the webhook URL after building is finished"
|
|
5687
|
-
).
|
|
5699
|
+
).option(
|
|
5700
|
+
"--ignore-extends-errors [bool]",
|
|
5701
|
+
"Ignore `id` and `appId` validation errors when extending another todesktop.json file"
|
|
5702
|
+
).addOption(configOption).action(({ async, codeSign, config: config2, webhook, ignoreExtendsErrors }) => {
|
|
5688
5703
|
runCommand(BuildCommand, {
|
|
5689
5704
|
configPath: config2,
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5705
|
+
flags: {
|
|
5706
|
+
exitAfterUploading: async === true,
|
|
5707
|
+
shouldCodeSign: codeSign !== "false",
|
|
5708
|
+
ignoreExtendsErrors: ignoreExtendsErrors === true,
|
|
5709
|
+
onBuildFinishedWebhook: webhook
|
|
5710
|
+
}
|
|
5693
5711
|
});
|
|
5694
5712
|
});
|
|
5695
5713
|
import_commander.program.command("builds").description("View your builds").argument("[id]", "View a specific build by ID").option("--latest", "View the latest build").addOption(configOption).option("--count [number]", "Number of builds to show per page", parseCount).addOption(
|