@todesktop/cli 1.7.4 → 1.7.5
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 +18 -0
- package/dist/cli.js +48 -42
- package/dist/cli.js.map +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -548,12 +548,25 @@ Default: The root [`icon`](#icon---string) is used.
|
|
|
548
548
|
|
|
549
549
|
The path to your application's Mac desktop icon. It must be an ICNS or PNG.
|
|
550
550
|
|
|
551
|
+
#### `mac.requirements` - (optional) string
|
|
552
|
+
|
|
553
|
+
Example: `./requirements.txt`.
|
|
554
|
+
Default: No requirements file is used by default.
|
|
555
|
+
|
|
556
|
+
The path to the [requirements file](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used when signing your application.
|
|
557
|
+
|
|
551
558
|
### `nodeVersion` - string
|
|
552
559
|
|
|
553
560
|
Example: `18.12.1`.
|
|
554
561
|
|
|
555
562
|
The version of Node.js that ToDesktop should use to build your app.
|
|
556
563
|
|
|
564
|
+
### `npmVersion` - string
|
|
565
|
+
|
|
566
|
+
Example: `9.8.1`.
|
|
567
|
+
|
|
568
|
+
The version of NPM that ToDesktop should use for installation.
|
|
569
|
+
|
|
557
570
|
### `packageJson` - (optional) object
|
|
558
571
|
|
|
559
572
|
Default: `{}`
|
|
@@ -976,6 +989,11 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
|
|
|
976
989
|
|
|
977
990
|
## Changelog
|
|
978
991
|
|
|
992
|
+
### v1.7.5
|
|
993
|
+
|
|
994
|
+
- Add support for specifying custom `npmVersion` in config
|
|
995
|
+
- Add support for bundling a requirements file for Mac
|
|
996
|
+
|
|
979
997
|
### v1.7.4
|
|
980
998
|
|
|
981
999
|
- Fix: Linux/Windows platform links no longer have mac/zip/{arch} added to the end of the download URL
|
package/dist/cli.js
CHANGED
|
@@ -14,10 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
17
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
18
|
mod
|
|
23
19
|
));
|
|
@@ -308,16 +304,11 @@ var useExit_default = () => {
|
|
|
308
304
|
return (error = void 0) => {
|
|
309
305
|
logger_default.debug({ error }, "Exit called");
|
|
310
306
|
firestore_default.terminate().catch(
|
|
311
|
-
(e) => (
|
|
312
|
-
// Ignore
|
|
313
|
-
logger_default.error(e)
|
|
314
|
-
)
|
|
307
|
+
(e) => logger_default.error(e)
|
|
315
308
|
);
|
|
316
309
|
let timeoutId;
|
|
317
310
|
Promise.race([
|
|
318
|
-
// flush the analytics to make sure all outstanding events are pushed to segment
|
|
319
311
|
new Promise((resolve4) => flush(() => resolve4())),
|
|
320
|
-
// If it takes longer than 1 second, resolve early to proceed with program exit
|
|
321
312
|
new Promise(
|
|
322
313
|
(resolve4) => timeoutId = setTimeout(() => resolve4(), 1e3)
|
|
323
314
|
)
|
|
@@ -464,8 +455,7 @@ var isPlatformBuildRunning = (platformBuild) => {
|
|
|
464
455
|
if (!platformBuild) {
|
|
465
456
|
return false;
|
|
466
457
|
}
|
|
467
|
-
return !platformBuild.shouldSkip &&
|
|
468
|
-
!["cancelled", "succeeded"].includes(platformBuild.status) && ("failed" !== platformBuild.status || platformBuild.numberOfAttemptedBuilds < 2);
|
|
458
|
+
return !platformBuild.shouldSkip && !["cancelled", "succeeded"].includes(platformBuild.status) && ("failed" !== platformBuild.status || platformBuild.numberOfAttemptedBuilds < 2);
|
|
469
459
|
};
|
|
470
460
|
|
|
471
461
|
// src/components/BuildProgress.tsx
|
|
@@ -611,7 +601,6 @@ var ProgressBar = ({ left, right, percent }) => /* @__PURE__ */ (0, import_jsx_r
|
|
|
611
601
|
ProgressBar.propTypes = {
|
|
612
602
|
left: import_prop_types5.default.number,
|
|
613
603
|
right: import_prop_types5.default.number,
|
|
614
|
-
// 0 -> 1
|
|
615
604
|
percent: import_prop_types5.default.number.isRequired
|
|
616
605
|
};
|
|
617
606
|
var ProgressBar_default = ProgressBar;
|
|
@@ -1023,6 +1012,9 @@ function resolveConfigPaths({
|
|
|
1023
1012
|
if (config2.mac.entitlements) {
|
|
1024
1013
|
result.mac.entitlements = resolvePath(config2.mac.entitlements);
|
|
1025
1014
|
}
|
|
1015
|
+
if (config2.mac.requirements) {
|
|
1016
|
+
result.mac.requirements = resolvePath(config2.mac.requirements);
|
|
1017
|
+
}
|
|
1026
1018
|
if (config2.mac.icon) {
|
|
1027
1019
|
result.mac.icon = resolvePath(config2.mac.icon);
|
|
1028
1020
|
}
|
|
@@ -1078,7 +1070,6 @@ var packageJSON_default = (context) => {
|
|
|
1078
1070
|
dependencies: {
|
|
1079
1071
|
type: "object",
|
|
1080
1072
|
required: ["@todesktop/runtime"],
|
|
1081
|
-
// custom keyword that checks package names aren't included in dependencies
|
|
1082
1073
|
excludedDependencies: {
|
|
1083
1074
|
dependencyKey: "dependencies",
|
|
1084
1075
|
blacklist: ["@todesktop/cli"]
|
|
@@ -1603,7 +1594,16 @@ var full_default = (context) => {
|
|
|
1603
1594
|
extendInfo: {
|
|
1604
1595
|
type: "object"
|
|
1605
1596
|
},
|
|
1606
|
-
icon: getIconSchema()
|
|
1597
|
+
icon: getIconSchema(),
|
|
1598
|
+
requirements: {
|
|
1599
|
+
type: "string",
|
|
1600
|
+
file: {
|
|
1601
|
+
from: context.projectRoot,
|
|
1602
|
+
extensions: ["txt"],
|
|
1603
|
+
mustBeFile: true
|
|
1604
|
+
},
|
|
1605
|
+
minLength: 1
|
|
1606
|
+
}
|
|
1607
1607
|
}
|
|
1608
1608
|
},
|
|
1609
1609
|
dmg: {
|
|
@@ -1649,6 +1649,11 @@ var full_default = (context) => {
|
|
|
1649
1649
|
validSemver: {},
|
|
1650
1650
|
minLength: 1
|
|
1651
1651
|
},
|
|
1652
|
+
npmVersion: {
|
|
1653
|
+
type: "string",
|
|
1654
|
+
validSemver: {},
|
|
1655
|
+
minLength: 1
|
|
1656
|
+
},
|
|
1652
1657
|
appBuilderLibVersion: {
|
|
1653
1658
|
type: "string",
|
|
1654
1659
|
validSemver: {},
|
|
@@ -2105,36 +2110,19 @@ var uploadApplicationSource_default = async ({ appId, appPkgJson, buildId, confi
|
|
|
2105
2110
|
);
|
|
2106
2111
|
let totalBytes = 0;
|
|
2107
2112
|
const files = [
|
|
2108
|
-
/*
|
|
2109
|
-
App files (stored in app/ in the ZIP)
|
|
2110
|
-
*/
|
|
2111
2113
|
...await getAppFiles(config2.appFiles, config2.appPath, appPkgJson),
|
|
2112
|
-
/*
|
|
2113
|
-
Optional extra content files (stored in extraContentFiles/ in the ZIP). Their
|
|
2114
|
-
paths within is the their relative path from the project root so
|
|
2115
|
-
there will be no issues with clashing filenames. We also don't
|
|
2116
|
-
also any file paths in our todesktop.json that are outside of the
|
|
2117
|
-
project directory
|
|
2118
|
-
*/
|
|
2119
2114
|
...(config2.extraContentFiles || []).map(({ from, to = "." }) => {
|
|
2120
2115
|
return {
|
|
2121
2116
|
from,
|
|
2122
2117
|
to: path8.join("extraContentFiles", to, path8.basename(from))
|
|
2123
2118
|
};
|
|
2124
2119
|
}),
|
|
2125
|
-
/*
|
|
2126
|
-
Optional extra resources (stored in extraResources/ in the ZIP).
|
|
2127
|
-
Similar to extra content files above
|
|
2128
|
-
*/
|
|
2129
2120
|
...(config2.extraResources || []).map(({ from, to = "." }) => {
|
|
2130
2121
|
return {
|
|
2131
2122
|
from,
|
|
2132
2123
|
to: path8.join("extraResources", to, path8.basename(from))
|
|
2133
2124
|
};
|
|
2134
2125
|
}),
|
|
2135
|
-
/*
|
|
2136
|
-
Icons (more may be added below)
|
|
2137
|
-
*/
|
|
2138
2126
|
{
|
|
2139
2127
|
from: config2.icon,
|
|
2140
2128
|
to: path8.join("icons", "appIcon" + path8.extname(config2.icon))
|
|
@@ -2164,6 +2152,12 @@ var uploadApplicationSource_default = async ({ appId, appPkgJson, buildId, confi
|
|
|
2164
2152
|
to: path8.join("icons", "appIcon-mac" + path8.extname(config2.mac.icon))
|
|
2165
2153
|
});
|
|
2166
2154
|
}
|
|
2155
|
+
if (config2.mac.requirements) {
|
|
2156
|
+
files.push({
|
|
2157
|
+
from: config2.mac.requirements,
|
|
2158
|
+
to: path8.join("other", "mac", "requirements.txt")
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2167
2161
|
}
|
|
2168
2162
|
if (config2.dmg) {
|
|
2169
2163
|
if (config2.dmg.background) {
|
|
@@ -2322,6 +2316,7 @@ var runBuild_default = async ({ onEvent, shouldCodeSign = true, configPath }) =>
|
|
|
2322
2316
|
userId: primaryUserId,
|
|
2323
2317
|
sourceArchiveDetails,
|
|
2324
2318
|
nodeVersion: config2.nodeVersion,
|
|
2319
|
+
npmVersion: config2.npmVersion,
|
|
2325
2320
|
appBuilderLibVersion: config2.appBuilderLibVersion
|
|
2326
2321
|
});
|
|
2327
2322
|
} catch (e) {
|
|
@@ -3379,7 +3374,7 @@ async function getBuilds({
|
|
|
3379
3374
|
|
|
3380
3375
|
// src/utilities/getRelativeDateFromDateString.ts
|
|
3381
3376
|
var dateFns = __toESM(require("date-fns"));
|
|
3382
|
-
var getRelativeDateFromDateString_default = (input) => dateFns.formatDistance(new Date(input),
|
|
3377
|
+
var getRelativeDateFromDateString_default = (input) => dateFns.formatDistance(new Date(input), new Date()) + " ago";
|
|
3383
3378
|
|
|
3384
3379
|
// src/components/SyntaxHighlight.tsx
|
|
3385
3380
|
var import_chalk2 = __toESM(require("chalk"));
|
|
@@ -3694,9 +3689,7 @@ var SelectTable = ({ data, onSelect }) => {
|
|
|
3694
3689
|
});
|
|
3695
3690
|
};
|
|
3696
3691
|
const ItemComponent = ({
|
|
3697
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3698
3692
|
label,
|
|
3699
|
-
// Make it compatible to SelectInput type, not used actually
|
|
3700
3693
|
index,
|
|
3701
3694
|
isSelected
|
|
3702
3695
|
}) => {
|
|
@@ -3914,11 +3907,23 @@ async function getBuildAttributes({
|
|
|
3914
3907
|
buildId,
|
|
3915
3908
|
configPath
|
|
3916
3909
|
}) {
|
|
3917
|
-
const {
|
|
3910
|
+
const {
|
|
3911
|
+
id: appId,
|
|
3912
|
+
nodeVersion,
|
|
3913
|
+
npmVersion
|
|
3914
|
+
} = getProjectConfig(configPath).config;
|
|
3918
3915
|
const { id: userId } = await findAppUserId_default(appId);
|
|
3919
3916
|
const { uid: contextUserId } = currentUser();
|
|
3920
3917
|
const build = await fetchBuild({ appId, buildId, userId });
|
|
3921
|
-
return {
|
|
3918
|
+
return {
|
|
3919
|
+
appId,
|
|
3920
|
+
build,
|
|
3921
|
+
buildId,
|
|
3922
|
+
contextUserId,
|
|
3923
|
+
nodeVersion,
|
|
3924
|
+
npmVersion,
|
|
3925
|
+
userId
|
|
3926
|
+
};
|
|
3922
3927
|
}
|
|
3923
3928
|
async function fetchBuild({
|
|
3924
3929
|
appId,
|
|
@@ -4472,7 +4477,6 @@ function OsProgress({
|
|
|
4472
4477
|
error: "red",
|
|
4473
4478
|
done: "green",
|
|
4474
4479
|
skipped: "yellow"
|
|
4475
|
-
// Not used actually, just for type matching
|
|
4476
4480
|
};
|
|
4477
4481
|
const text = progress.message + (progress.state === "progress" ? "..." : "");
|
|
4478
4482
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -4562,6 +4566,7 @@ async function queueSmokeTest({
|
|
|
4562
4566
|
buildId,
|
|
4563
4567
|
contextUserId,
|
|
4564
4568
|
nodeVersion,
|
|
4569
|
+
npmVersion,
|
|
4565
4570
|
userId
|
|
4566
4571
|
}) {
|
|
4567
4572
|
try {
|
|
@@ -4569,6 +4574,7 @@ async function queueSmokeTest({
|
|
|
4569
4574
|
appId,
|
|
4570
4575
|
buildId,
|
|
4571
4576
|
nodeVersion,
|
|
4577
|
+
npmVersion,
|
|
4572
4578
|
userId,
|
|
4573
4579
|
contextUserId
|
|
4574
4580
|
});
|
|
@@ -4679,7 +4685,7 @@ async function smokeTestWorkflow({
|
|
|
4679
4685
|
updateState
|
|
4680
4686
|
}) {
|
|
4681
4687
|
try {
|
|
4682
|
-
const { appId, build, contextUserId, nodeVersion, userId } = await getBuildAttributes({
|
|
4688
|
+
const { appId, build, contextUserId, nodeVersion, npmVersion, userId } = await getBuildAttributes({
|
|
4683
4689
|
buildId,
|
|
4684
4690
|
configPath
|
|
4685
4691
|
});
|
|
@@ -4690,6 +4696,7 @@ async function smokeTestWorkflow({
|
|
|
4690
4696
|
appId,
|
|
4691
4697
|
buildId,
|
|
4692
4698
|
nodeVersion,
|
|
4699
|
+
npmVersion,
|
|
4693
4700
|
userId,
|
|
4694
4701
|
contextUserId
|
|
4695
4702
|
});
|
|
@@ -4704,7 +4711,6 @@ async function smokeTestWorkflow({
|
|
|
4704
4711
|
const stateMap = {
|
|
4705
4712
|
done: "complete",
|
|
4706
4713
|
progress: "complete",
|
|
4707
|
-
// Not actually used, just for TS
|
|
4708
4714
|
error: "progress-error",
|
|
4709
4715
|
canceled: "canceled"
|
|
4710
4716
|
};
|
|
@@ -4785,7 +4791,7 @@ var package_default = {
|
|
|
4785
4791
|
access: "public"
|
|
4786
4792
|
},
|
|
4787
4793
|
name: "@todesktop/cli",
|
|
4788
|
-
version: "1.7.
|
|
4794
|
+
version: "1.7.4",
|
|
4789
4795
|
license: "MIT",
|
|
4790
4796
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
4791
4797
|
homepage: "https://todesktop.com/cli",
|
|
@@ -4865,7 +4871,7 @@ var package_default = {
|
|
|
4865
4871
|
"xdg-basedir": "^4.0.0"
|
|
4866
4872
|
},
|
|
4867
4873
|
devDependencies: {
|
|
4868
|
-
"@todesktop/shared": "^7.
|
|
4874
|
+
"@todesktop/shared": "^7.186.3",
|
|
4869
4875
|
"@types/bunyan": "^1.8.6",
|
|
4870
4876
|
"@types/react": "^18.0.26",
|
|
4871
4877
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|