@todesktop/cli 1.18.0 → 1.18.2
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 +341 -153
- package/dist/cli.js +118 -155
- package/dist/cli.js.map +3 -3
- package/dist/types.d.ts +4 -0
- package/package.json +9 -35
- package/schemas/schema.json +6 -0
package/dist/cli.js
CHANGED
|
@@ -136,18 +136,18 @@ try {
|
|
|
136
136
|
};
|
|
137
137
|
try {
|
|
138
138
|
Sentry.captureException(e);
|
|
139
|
-
} catch
|
|
139
|
+
} catch {
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
var logger_default = logger;
|
|
143
143
|
|
|
144
144
|
// src/utilities/logForCI.ts
|
|
145
|
-
|
|
145
|
+
function logForCI(...args2) {
|
|
146
146
|
logger_default.info({ args: args2 }, "logForCI");
|
|
147
147
|
if (import_is_ci.default || !process.stdin.isTTY) {
|
|
148
|
-
console.
|
|
148
|
+
console.info(...args2);
|
|
149
149
|
}
|
|
150
|
-
}
|
|
150
|
+
}
|
|
151
151
|
|
|
152
152
|
// src/utilities/useExit.ts
|
|
153
153
|
var import_ink = require("ink");
|
|
@@ -241,7 +241,7 @@ if (fs2.existsSync(oldConfigPath)) {
|
|
|
241
241
|
const { email, accessToken, jwtToken } = require(oldConfigPath);
|
|
242
242
|
setAuthConfig(email, accessToken, jwtToken);
|
|
243
243
|
(0, import_del.default)(oldConfigPath, { force: true });
|
|
244
|
-
} catch
|
|
244
|
+
} catch {
|
|
245
245
|
(0, import_del.default)(oldConfigPath, { force: true });
|
|
246
246
|
}
|
|
247
247
|
}
|
|
@@ -298,26 +298,26 @@ function getAnalyticsBaseProperties() {
|
|
|
298
298
|
name: import_os.default.platform(),
|
|
299
299
|
version: import_os.default.release()
|
|
300
300
|
};
|
|
301
|
-
} catch
|
|
301
|
+
} catch {
|
|
302
302
|
}
|
|
303
303
|
try {
|
|
304
304
|
baseProps.user = {
|
|
305
305
|
email: getAuthConfig().email
|
|
306
306
|
};
|
|
307
|
-
} catch
|
|
307
|
+
} catch {
|
|
308
308
|
}
|
|
309
309
|
try {
|
|
310
310
|
baseProps.app = {
|
|
311
311
|
cliVersion: getCliVersion_default()
|
|
312
312
|
};
|
|
313
|
-
} catch
|
|
313
|
+
} catch {
|
|
314
314
|
}
|
|
315
315
|
try {
|
|
316
316
|
baseProps.runtime = {
|
|
317
317
|
name: "Node.js",
|
|
318
318
|
version: process.version
|
|
319
319
|
};
|
|
320
|
-
} catch
|
|
320
|
+
} catch {
|
|
321
321
|
}
|
|
322
322
|
return baseProps;
|
|
323
323
|
}
|
|
@@ -338,14 +338,14 @@ var track = (event, properties = {}, callback = () => {
|
|
|
338
338
|
},
|
|
339
339
|
callback
|
|
340
340
|
);
|
|
341
|
-
} catch
|
|
341
|
+
} catch {
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
344
|
var identify = (id, traits = {}, callback = () => {
|
|
345
345
|
}) => {
|
|
346
346
|
try {
|
|
347
347
|
analytics.identify({ userId: id, anonymousId, traits }, callback);
|
|
348
|
-
} catch
|
|
348
|
+
} catch {
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
var flush = (callback = () => {
|
|
@@ -393,7 +393,7 @@ var BuildCompleteMessage = ({ build }) => {
|
|
|
393
393
|
if (process.platform === "darwin" && ((_a2 = build.mac) == null ? void 0 : _a2.standardDownloadUrl)) {
|
|
394
394
|
url = fixMacUrl(build.mac.standardDownloadUrl);
|
|
395
395
|
}
|
|
396
|
-
|
|
396
|
+
logForCI(`Build complete! ${url}`);
|
|
397
397
|
(0, import_react.useEffect)(() => {
|
|
398
398
|
if (url) {
|
|
399
399
|
setTimeout(exit, 10);
|
|
@@ -463,11 +463,11 @@ var PlatformProgress = ({
|
|
|
463
463
|
if (activityNameToDisplay.length > 64) {
|
|
464
464
|
activityNameToDisplay = `${activityNameToDisplay.substr(0, 61)}...`;
|
|
465
465
|
}
|
|
466
|
-
progressIndicator = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
466
|
+
progressIndicator = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink3.Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Text, { children: [
|
|
467
467
|
["preparation", "queue"].includes(activityType) ? void 0 : getProgressPercentageLabel(percent, activityType),
|
|
468
468
|
activityNameToDisplay,
|
|
469
469
|
activityType === "error" ? "" : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink3.Text, { children: "..." })
|
|
470
|
-
] }) })
|
|
470
|
+
] }) });
|
|
471
471
|
}
|
|
472
472
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Box, { children: [
|
|
473
473
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink3.Box, { width: preLabelMaxWidth, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink3.Text, { children: [
|
|
@@ -513,7 +513,7 @@ var isPlatformBuildRunning = (platformBuild) => {
|
|
|
513
513
|
|
|
514
514
|
// src/components/BuildProgress.tsx
|
|
515
515
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
516
|
-
var logForCIThrottled = (0, import_lodash.default)(
|
|
516
|
+
var logForCIThrottled = (0, import_lodash.default)(logForCI, 60 * 1e3, { trailing: true });
|
|
517
517
|
var BuildProgress = ({ build, onBuildFailure }) => {
|
|
518
518
|
const exit = useExit_default();
|
|
519
519
|
const [{ hasKickedOff }, setState] = (0, import_react2.useState)({
|
|
@@ -549,7 +549,7 @@ var BuildProgress = ({ build, onBuildFailure }) => {
|
|
|
549
549
|
if (!hasKickedOff) {
|
|
550
550
|
return null;
|
|
551
551
|
}
|
|
552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink4.Box, { flexDirection: "column", children: platformsNotSkipped.map((platform) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink4.Box, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
553
553
|
PlatformProgress_default,
|
|
554
554
|
{
|
|
555
555
|
activityName: build[platform].status === "failed" ? build[platform].errorMessage : build[platform].progressActivityName,
|
|
@@ -559,7 +559,7 @@ var BuildProgress = ({ build, onBuildFailure }) => {
|
|
|
559
559
|
platform,
|
|
560
560
|
shouldShowReadyPrefix: !(build && ["failed", "succeeded"].includes(build.status))
|
|
561
561
|
}
|
|
562
|
-
) }, platform)) })
|
|
562
|
+
) }, platform)) });
|
|
563
563
|
};
|
|
564
564
|
BuildProgress.propTypes = {
|
|
565
565
|
build: import_prop_types3.default.object.isRequired,
|
|
@@ -690,7 +690,7 @@ var CancelBuild = ({
|
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
692
|
setState((previousState) => ({ ...previousState, hasStarted: true }));
|
|
693
|
-
|
|
693
|
+
logForCI("Cancelling build...");
|
|
694
694
|
cancelBuild({ appId, buildId: id }).then((result) => {
|
|
695
695
|
logger_default.debug(
|
|
696
696
|
{ appId, buildId: id, result },
|
|
@@ -905,7 +905,7 @@ var MainLayout = ({
|
|
|
905
905
|
}));
|
|
906
906
|
}, [build, isCancellingBuild, isRawModeSupported]);
|
|
907
907
|
onInput(
|
|
908
|
-
async (
|
|
908
|
+
async (_input, key) => {
|
|
909
909
|
if (key.escape && canCancelBuild) {
|
|
910
910
|
logger_default.debug("MainLayout component: esc pressed, cancelling build");
|
|
911
911
|
setState((previousState) => ({
|
|
@@ -1019,7 +1019,7 @@ var import_pretty_bytes = __toESM(require("pretty-bytes"));
|
|
|
1019
1019
|
// src/utilities/postToFirebaseFunction.ts
|
|
1020
1020
|
var import_axios = __toESM(require("axios"));
|
|
1021
1021
|
var { TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE } = getEnvironmentVariables_default();
|
|
1022
|
-
async function
|
|
1022
|
+
async function postToFirebaseFunction(functionName, body = {}, config2 = {}) {
|
|
1023
1023
|
logger_default.debug(
|
|
1024
1024
|
{ scrub: { functionName, body, config: config2 } },
|
|
1025
1025
|
"postToFirebaseFunction"
|
|
@@ -1064,11 +1064,11 @@ function loadTypeScriptConfig(configPath) {
|
|
|
1064
1064
|
const tsPath = (0, import_path2.resolve)(projectRoot, "node_modules", "typescript");
|
|
1065
1065
|
typescript = require(tsPath);
|
|
1066
1066
|
logger_default.debug(`Found TypeScript in user's project at: ${tsPath}`);
|
|
1067
|
-
} catch
|
|
1067
|
+
} catch {
|
|
1068
1068
|
try {
|
|
1069
1069
|
typescript = require("typescript");
|
|
1070
1070
|
logger_default.debug("Using globally available TypeScript installation");
|
|
1071
|
-
} catch
|
|
1071
|
+
} catch {
|
|
1072
1072
|
throw new Error(
|
|
1073
1073
|
`TypeScript is required to load .ts configuration files but was not found. Please install TypeScript in your project: npm install --save-dev typescript`
|
|
1074
1074
|
);
|
|
@@ -1376,7 +1376,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1376
1376
|
addKeyword({
|
|
1377
1377
|
keyword: "validSemver",
|
|
1378
1378
|
type: "string",
|
|
1379
|
-
validate: (
|
|
1379
|
+
validate: (_schema, data) => {
|
|
1380
1380
|
if (!(0, import_valid.default)(data)) {
|
|
1381
1381
|
throw new import_ajv2.ValidationError([
|
|
1382
1382
|
{
|
|
@@ -1409,7 +1409,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1409
1409
|
addKeyword({
|
|
1410
1410
|
keyword: "email",
|
|
1411
1411
|
type: "string",
|
|
1412
|
-
validate: (
|
|
1412
|
+
validate: (_schema, data) => {
|
|
1413
1413
|
if (!(0, import_email_regex.default)({ exact: true }).test(data)) {
|
|
1414
1414
|
throw new import_ajv2.ValidationError([
|
|
1415
1415
|
{
|
|
@@ -1492,7 +1492,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1492
1492
|
let pkg;
|
|
1493
1493
|
try {
|
|
1494
1494
|
pkg = require(pkgPath);
|
|
1495
|
-
} catch
|
|
1495
|
+
} catch {
|
|
1496
1496
|
throw new import_ajv2.ValidationError([
|
|
1497
1497
|
{
|
|
1498
1498
|
keyword: "App",
|
|
@@ -1513,15 +1513,13 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1513
1513
|
}
|
|
1514
1514
|
]);
|
|
1515
1515
|
}
|
|
1516
|
-
} else {
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
]);
|
|
1524
|
-
}
|
|
1516
|
+
} else if (!fs3.existsSync(path4.join(appRoot, "index.js"))) {
|
|
1517
|
+
throw new import_ajv2.ValidationError([
|
|
1518
|
+
{
|
|
1519
|
+
keyword: "App",
|
|
1520
|
+
message: 'invalid. There is neither a "main" property in your package.json nor an index.js at the root of your app'
|
|
1521
|
+
}
|
|
1522
|
+
]);
|
|
1525
1523
|
}
|
|
1526
1524
|
}
|
|
1527
1525
|
return true;
|
|
@@ -1530,7 +1528,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1530
1528
|
});
|
|
1531
1529
|
addKeyword({
|
|
1532
1530
|
keyword: "npmAuthor",
|
|
1533
|
-
validate: (
|
|
1531
|
+
validate: (_schema, data) => {
|
|
1534
1532
|
const dataType = typeof data;
|
|
1535
1533
|
if (dataType === "undefined") {
|
|
1536
1534
|
return true;
|
|
@@ -1568,24 +1566,22 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
1568
1566
|
message: `invalid. "email" property is missing.`
|
|
1569
1567
|
}
|
|
1570
1568
|
]);
|
|
1571
|
-
} else {
|
|
1572
|
-
if (
|
|
1573
|
-
if (!(0, import_email_regex.default)({ exact: true }).test(data.email)) {
|
|
1574
|
-
throw new import_ajv2.ValidationError([
|
|
1575
|
-
{
|
|
1576
|
-
keyword: "author",
|
|
1577
|
-
message: `.email invalid. It does not look like an email.`
|
|
1578
|
-
}
|
|
1579
|
-
]);
|
|
1580
|
-
}
|
|
1581
|
-
} else {
|
|
1569
|
+
} else if (typeof data.email === "string") {
|
|
1570
|
+
if (!(0, import_email_regex.default)({ exact: true }).test(data.email)) {
|
|
1582
1571
|
throw new import_ajv2.ValidationError([
|
|
1583
1572
|
{
|
|
1584
1573
|
keyword: "author",
|
|
1585
|
-
message: `.email invalid. It
|
|
1574
|
+
message: `.email invalid. It does not look like an email.`
|
|
1586
1575
|
}
|
|
1587
1576
|
]);
|
|
1588
1577
|
}
|
|
1578
|
+
} else {
|
|
1579
|
+
throw new import_ajv2.ValidationError([
|
|
1580
|
+
{
|
|
1581
|
+
keyword: "author",
|
|
1582
|
+
message: `.email invalid. It must be a string.`
|
|
1583
|
+
}
|
|
1584
|
+
]);
|
|
1589
1585
|
}
|
|
1590
1586
|
}
|
|
1591
1587
|
} else {
|
|
@@ -2162,6 +2158,12 @@ var schema_default = {
|
|
|
2162
2158
|
examples: ["distribution"],
|
|
2163
2159
|
default: "development"
|
|
2164
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
|
+
},
|
|
2165
2167
|
x64ArchFiles: {
|
|
2166
2168
|
type: "string",
|
|
2167
2169
|
description: "Minimatch pattern of paths that are allowed to be x64 binaries in both ASAR files.",
|
|
@@ -2580,8 +2582,7 @@ var schema_default = {
|
|
|
2580
2582
|
// src/utilities/projectConfig/schema/full.ts
|
|
2581
2583
|
var full_default = (context) => {
|
|
2582
2584
|
function updateFileProperty(record) {
|
|
2583
|
-
for (const key
|
|
2584
|
-
const value = record[key];
|
|
2585
|
+
for (const [key, value] of Object.entries(record)) {
|
|
2585
2586
|
if (key === "file" && typeof value === "object") {
|
|
2586
2587
|
value["from"] = context.projectRoot;
|
|
2587
2588
|
} else if (typeof value === "object" && value !== null) {
|
|
@@ -2756,7 +2757,7 @@ var getVersionControlInfo_default = async (directory) => {
|
|
|
2756
2757
|
versionControlSystemName: "git"
|
|
2757
2758
|
};
|
|
2758
2759
|
}
|
|
2759
|
-
} catch
|
|
2760
|
+
} catch {
|
|
2760
2761
|
}
|
|
2761
2762
|
return result;
|
|
2762
2763
|
};
|
|
@@ -2909,7 +2910,7 @@ var import_du = __toESM(require("du"));
|
|
|
2909
2910
|
var import_fs2 = __toESM(require("fs"));
|
|
2910
2911
|
var import_chalk = __toESM(require("chalk"));
|
|
2911
2912
|
var import_path7 = __toESM(require("path"));
|
|
2912
|
-
async function
|
|
2913
|
+
async function zip({
|
|
2913
2914
|
files,
|
|
2914
2915
|
fileSizeLimit = 20,
|
|
2915
2916
|
onError,
|
|
@@ -2918,7 +2919,7 @@ async function zip_default({
|
|
|
2918
2919
|
}) {
|
|
2919
2920
|
logger_default.debug({ files }, "zip");
|
|
2920
2921
|
const stream = (0, import_archiver.default)("zip");
|
|
2921
|
-
stream.on("warning",
|
|
2922
|
+
stream.on("warning", (err) => {
|
|
2922
2923
|
if (err.code === "ENOENT") {
|
|
2923
2924
|
console.warn(err);
|
|
2924
2925
|
logger_default.warn({ err }, "zip: stream warning ENOENT");
|
|
@@ -2926,7 +2927,7 @@ async function zip_default({
|
|
|
2926
2927
|
onError(err);
|
|
2927
2928
|
}
|
|
2928
2929
|
});
|
|
2929
|
-
stream.on("error",
|
|
2930
|
+
stream.on("error", (err) => {
|
|
2930
2931
|
onError(err);
|
|
2931
2932
|
});
|
|
2932
2933
|
const processedFiles = await Promise.all(
|
|
@@ -3260,7 +3261,7 @@ function collectWorkspacePackages(definition) {
|
|
|
3260
3261
|
if (!manifest || !manifest.name) {
|
|
3261
3262
|
continue;
|
|
3262
3263
|
}
|
|
3263
|
-
const name = manifest
|
|
3264
|
+
const { name } = manifest;
|
|
3264
3265
|
if (packages.has(name)) {
|
|
3265
3266
|
const existing = packages.get(name);
|
|
3266
3267
|
throw new Error(
|
|
@@ -3421,7 +3422,7 @@ async function buildPackageEntries({
|
|
|
3421
3422
|
contexts
|
|
3422
3423
|
}) {
|
|
3423
3424
|
const packageDir = workspacePackage.dir;
|
|
3424
|
-
const manifest = workspacePackage
|
|
3425
|
+
const { manifest } = workspacePackage;
|
|
3425
3426
|
const filesToInclude = await gatherPackageFiles({ packageDir, manifest });
|
|
3426
3427
|
const files = filesToInclude.map((absolutePath) => {
|
|
3427
3428
|
const relative3 = import_path8.default.relative(packageDir, absolutePath);
|
|
@@ -3462,7 +3463,7 @@ async function gatherPackageFiles({
|
|
|
3462
3463
|
const posixPattern = pattern.replace(/\\/g, "/");
|
|
3463
3464
|
return [pattern, `${posixPattern}/**/*`];
|
|
3464
3465
|
}
|
|
3465
|
-
} catch
|
|
3466
|
+
} catch {
|
|
3466
3467
|
}
|
|
3467
3468
|
return [pattern];
|
|
3468
3469
|
});
|
|
@@ -3789,7 +3790,7 @@ async function uploadApplicationSource({
|
|
|
3789
3790
|
}
|
|
3790
3791
|
return uploadToS3_default({
|
|
3791
3792
|
bucket: config2.bucket || void 0,
|
|
3792
|
-
inputStream: await
|
|
3793
|
+
inputStream: await zip({
|
|
3793
3794
|
files,
|
|
3794
3795
|
fileSizeLimit: config2.uploadSizeLimit,
|
|
3795
3796
|
onError: (e) => {
|
|
@@ -3814,7 +3815,7 @@ async function exists(filePath) {
|
|
|
3814
3815
|
try {
|
|
3815
3816
|
await fs6.promises.access(filePath);
|
|
3816
3817
|
return true;
|
|
3817
|
-
} catch
|
|
3818
|
+
} catch {
|
|
3818
3819
|
return false;
|
|
3819
3820
|
}
|
|
3820
3821
|
}
|
|
@@ -3826,7 +3827,7 @@ async function runBuild({
|
|
|
3826
3827
|
flags
|
|
3827
3828
|
}) {
|
|
3828
3829
|
var _a2, _b, _c, _d;
|
|
3829
|
-
|
|
3830
|
+
logForCI("Getting application information...");
|
|
3830
3831
|
const primaryUserId = (_a2 = currentUser()) == null ? void 0 : _a2.uid;
|
|
3831
3832
|
const { config: config2, unprocessedConfig } = getProjectConfig(configPath, {
|
|
3832
3833
|
build: flags
|
|
@@ -3843,10 +3844,10 @@ async function runBuild({
|
|
|
3843
3844
|
preparationProgress: 0.02,
|
|
3844
3845
|
state: "preparing"
|
|
3845
3846
|
});
|
|
3846
|
-
|
|
3847
|
+
logForCI("Preparing...");
|
|
3847
3848
|
let buildId;
|
|
3848
3849
|
try {
|
|
3849
|
-
const prepareResult = await
|
|
3850
|
+
const prepareResult = await postToFirebaseFunction("prepareNewBuild", {
|
|
3850
3851
|
appPkgName: appPkgJson.name,
|
|
3851
3852
|
appPkgProductName: appPkgJson.productName,
|
|
3852
3853
|
appVersion: appPkgJson.version,
|
|
@@ -3865,12 +3866,12 @@ async function runBuild({
|
|
|
3865
3866
|
} catch (e) {
|
|
3866
3867
|
throw addErrorMessage(e, "Failed while preparing new build");
|
|
3867
3868
|
}
|
|
3868
|
-
|
|
3869
|
+
logForCI(`Retrieved build ID: ${buildId}`);
|
|
3869
3870
|
updateState({
|
|
3870
3871
|
preparationProgress: 0.05,
|
|
3871
3872
|
preparationStageLabel: "Uploading"
|
|
3872
3873
|
});
|
|
3873
|
-
|
|
3874
|
+
logForCI("Uploading...");
|
|
3874
3875
|
let sourceArchiveDetails;
|
|
3875
3876
|
try {
|
|
3876
3877
|
sourceArchiveDetails = await uploadApplicationSource({
|
|
@@ -3893,9 +3894,9 @@ async function runBuild({
|
|
|
3893
3894
|
throw addErrorMessage(e, "Failed while uploading application source");
|
|
3894
3895
|
}
|
|
3895
3896
|
updateState({ state: "building" });
|
|
3896
|
-
|
|
3897
|
+
logForCI("Kicking off build...");
|
|
3897
3898
|
try {
|
|
3898
|
-
await
|
|
3899
|
+
await postToFirebaseFunction("kickOffBuild", {
|
|
3899
3900
|
appBuilderLibVersion: config2.appBuilderLibVersion,
|
|
3900
3901
|
appId,
|
|
3901
3902
|
appPkgName: appPkgJson.name,
|
|
@@ -3953,7 +3954,7 @@ function Build({
|
|
|
3953
3954
|
(0, import_react6.useEffect)(() => {
|
|
3954
3955
|
runBuild({ configPath, flags, updateState }).catch((e) => {
|
|
3955
3956
|
const error = e.response ? e.response.data : e;
|
|
3956
|
-
|
|
3957
|
+
logForCI(error);
|
|
3957
3958
|
updateState({ state: "error", error });
|
|
3958
3959
|
});
|
|
3959
3960
|
return () => {
|
|
@@ -4090,7 +4091,7 @@ var Login = ({ setIsLoggedIn }) => {
|
|
|
4090
4091
|
setFailureMessage(null);
|
|
4091
4092
|
setIsSubmittingForm(true);
|
|
4092
4093
|
try {
|
|
4093
|
-
const jwtToken = await
|
|
4094
|
+
const jwtToken = await postToFirebaseFunction("loginWithAccessToken", {
|
|
4094
4095
|
email,
|
|
4095
4096
|
accessToken
|
|
4096
4097
|
});
|
|
@@ -4188,7 +4189,7 @@ var LoginHOC = ({ children, isInteractive = true }) => {
|
|
|
4188
4189
|
const { TODESKTOP_ACCESS_TOKEN, TODESKTOP_EMAIL } = getEnvironmentVariables_default();
|
|
4189
4190
|
try {
|
|
4190
4191
|
if (TODESKTOP_ACCESS_TOKEN && TODESKTOP_EMAIL) {
|
|
4191
|
-
const newJwtToken = await
|
|
4192
|
+
const newJwtToken = await postToFirebaseFunction(
|
|
4192
4193
|
"loginWithAccessToken",
|
|
4193
4194
|
{
|
|
4194
4195
|
email: TODESKTOP_EMAIL,
|
|
@@ -4217,11 +4218,11 @@ var LoginHOC = ({ children, isInteractive = true }) => {
|
|
|
4217
4218
|
userCreds = await signInWithCustomToken(jwtToken);
|
|
4218
4219
|
if (userCreds.user) setIsLoggedIn(true);
|
|
4219
4220
|
}
|
|
4220
|
-
} catch
|
|
4221
|
+
} catch {
|
|
4221
4222
|
}
|
|
4222
4223
|
try {
|
|
4223
4224
|
if (!userCreds && accessToken && email) {
|
|
4224
|
-
const newJwtToken = await
|
|
4225
|
+
const newJwtToken = await postToFirebaseFunction(
|
|
4225
4226
|
"loginWithAccessToken",
|
|
4226
4227
|
{ email, accessToken }
|
|
4227
4228
|
);
|
|
@@ -4231,7 +4232,7 @@ var LoginHOC = ({ children, isInteractive = true }) => {
|
|
|
4231
4232
|
if (userCreds.user) setIsLoggedIn(true);
|
|
4232
4233
|
}
|
|
4233
4234
|
}
|
|
4234
|
-
} catch
|
|
4235
|
+
} catch {
|
|
4235
4236
|
}
|
|
4236
4237
|
setEffectDone(true);
|
|
4237
4238
|
}
|
|
@@ -4255,12 +4256,12 @@ LoginHOC.propTypes = {
|
|
|
4255
4256
|
var LoginHOC_default = LoginHOC;
|
|
4256
4257
|
|
|
4257
4258
|
// src/components/ErrorBoundary.tsx
|
|
4258
|
-
var import_react10 = __toESM(require("react"));
|
|
4259
4259
|
var Sentry2 = __toESM(require("@sentry/node"));
|
|
4260
|
+
var import_react10 = __toESM(require("react"));
|
|
4260
4261
|
var ErrorBoundary = class extends import_react10.default.Component {
|
|
4261
4262
|
constructor(props) {
|
|
4262
4263
|
super(props);
|
|
4263
|
-
this.state = {
|
|
4264
|
+
this.state = { error: null };
|
|
4264
4265
|
}
|
|
4265
4266
|
static getDerivedStateFromError(error) {
|
|
4266
4267
|
return { error };
|
|
@@ -4268,15 +4269,16 @@ var ErrorBoundary = class extends import_react10.default.Component {
|
|
|
4268
4269
|
componentDidCatch(error, errorInfo) {
|
|
4269
4270
|
Sentry2.withScope((scope) => {
|
|
4270
4271
|
scope.setExtras(errorInfo);
|
|
4271
|
-
|
|
4272
|
-
this.setState({ eventId });
|
|
4272
|
+
Sentry2.captureException(error);
|
|
4273
4273
|
});
|
|
4274
4274
|
}
|
|
4275
4275
|
render() {
|
|
4276
|
-
|
|
4277
|
-
|
|
4276
|
+
const { children } = this.props;
|
|
4277
|
+
const { error } = this.state;
|
|
4278
|
+
if (error) {
|
|
4279
|
+
throw error;
|
|
4278
4280
|
}
|
|
4279
|
-
return
|
|
4281
|
+
return children;
|
|
4280
4282
|
}
|
|
4281
4283
|
};
|
|
4282
4284
|
var ErrorBoundary_default = ErrorBoundary;
|
|
@@ -4431,7 +4433,7 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
|
|
|
4431
4433
|
});
|
|
4432
4434
|
const onError = (e) => {
|
|
4433
4435
|
const error2 = e.response ? e.response.data : e;
|
|
4434
|
-
|
|
4436
|
+
logForCI(error2);
|
|
4435
4437
|
setState((prevState) => ({
|
|
4436
4438
|
...prevState,
|
|
4437
4439
|
error: error2
|
|
@@ -4536,7 +4538,7 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
|
|
|
4536
4538
|
);
|
|
4537
4539
|
};
|
|
4538
4540
|
ViewBuild.propTypes = {
|
|
4539
|
-
id: (props,
|
|
4541
|
+
id: (props, _propName, componentName) => {
|
|
4540
4542
|
if ([props.id, props.shouldViewLatest].filter(Boolean).length !== 1) {
|
|
4541
4543
|
return new Error(
|
|
4542
4544
|
`Exactly one of 'id' and 'shouldViewLatest' must be specified in '${componentName}'`
|
|
@@ -4550,19 +4552,6 @@ ViewBuild.propTypes = {
|
|
|
4550
4552
|
}
|
|
4551
4553
|
},
|
|
4552
4554
|
commandUsed: import_prop_types10.default.string.isRequired,
|
|
4553
|
-
shouldViewLatest: (props, propName, componentName) => {
|
|
4554
|
-
if ([props.id, props.shouldViewLatest].filter(Boolean).length !== 1) {
|
|
4555
|
-
return new Error(
|
|
4556
|
-
`Exactly one of 'id' and 'shouldViewLatest' must be specified in '${componentName}'`
|
|
4557
|
-
);
|
|
4558
|
-
}
|
|
4559
|
-
const type = typeof props.shouldViewLatest;
|
|
4560
|
-
if (!["boolean", "undefined"].includes(type)) {
|
|
4561
|
-
return new Error(
|
|
4562
|
-
`'shouldViewLatest' is a '${type}', not a boolean, in '${componentName}'.`
|
|
4563
|
-
);
|
|
4564
|
-
}
|
|
4565
|
-
},
|
|
4566
4555
|
configPath: import_prop_types10.default.string
|
|
4567
4556
|
};
|
|
4568
4557
|
var ViewBuild_default = ViewBuild;
|
|
@@ -4729,7 +4718,7 @@ var useAnalyticsCommand = (command, flags = {}, properties = {}) => {
|
|
|
4729
4718
|
...getProjectConfig()
|
|
4730
4719
|
};
|
|
4731
4720
|
}
|
|
4732
|
-
} catch
|
|
4721
|
+
} catch {
|
|
4733
4722
|
}
|
|
4734
4723
|
(0, import_react13.useEffect)(() => {
|
|
4735
4724
|
const authUnsubscribe = onUserAuth(async (user) => {
|
|
@@ -4750,7 +4739,7 @@ var useAnalyticsCommand = (command, flags = {}, properties = {}) => {
|
|
|
4750
4739
|
},
|
|
4751
4740
|
() => setTrackingAttempt(true)
|
|
4752
4741
|
);
|
|
4753
|
-
authUnsubscribe
|
|
4742
|
+
authUnsubscribe == null ? void 0 : authUnsubscribe();
|
|
4754
4743
|
}
|
|
4755
4744
|
);
|
|
4756
4745
|
}
|
|
@@ -4876,10 +4865,10 @@ var TableRow = ({
|
|
|
4876
4865
|
}),
|
|
4877
4866
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ink23.Text, { children: " \u2502" })
|
|
4878
4867
|
] });
|
|
4879
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.
|
|
4868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_ink23.Box, { flexDirection: "column", children: [
|
|
4880
4869
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ink23.Text, { children: topLine }),
|
|
4881
4870
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ink23.Box, { children: content })
|
|
4882
|
-
] })
|
|
4871
|
+
] });
|
|
4883
4872
|
};
|
|
4884
4873
|
TableRow.propTypes = {
|
|
4885
4874
|
data: import_prop_types14.default.object.isRequired,
|
|
@@ -4903,7 +4892,7 @@ var TableBody = ({ data, getCellTextProps, keyDetails }) => {
|
|
|
4903
4892
|
)) });
|
|
4904
4893
|
};
|
|
4905
4894
|
TableBody.propTypes = {
|
|
4906
|
-
data: (props,
|
|
4895
|
+
data: (props, _propName, componentName) => {
|
|
4907
4896
|
const type = typeof props.data;
|
|
4908
4897
|
if (Array.isArray("array")) {
|
|
4909
4898
|
return new Error(
|
|
@@ -4954,7 +4943,7 @@ var Table = ({ data, getCellTextProps }) => {
|
|
|
4954
4943
|
] });
|
|
4955
4944
|
};
|
|
4956
4945
|
Table.propTypes = {
|
|
4957
|
-
data: (props,
|
|
4946
|
+
data: (props, _propName, componentName) => {
|
|
4958
4947
|
const type = typeof props.data;
|
|
4959
4948
|
if (Array.isArray("array")) {
|
|
4960
4949
|
return new Error(
|
|
@@ -5136,7 +5125,7 @@ var ViewBuilds = ({
|
|
|
5136
5125
|
};
|
|
5137
5126
|
});
|
|
5138
5127
|
}).catch((e) => {
|
|
5139
|
-
|
|
5128
|
+
logForCI(e);
|
|
5140
5129
|
setState((previousState) => ({
|
|
5141
5130
|
...previousState,
|
|
5142
5131
|
error: e,
|
|
@@ -5174,12 +5163,12 @@ var ViewBuilds = ({
|
|
|
5174
5163
|
}
|
|
5175
5164
|
if (builds.length) {
|
|
5176
5165
|
const formatData = (builds2) => builds2.map((build) => ({
|
|
5177
|
-
ID: build.id,
|
|
5178
|
-
Version: build.appVersion || "n/a",
|
|
5166
|
+
"ID": build.id,
|
|
5167
|
+
"Version": build.appVersion || "n/a",
|
|
5179
5168
|
"Creation date": getRelativeDateFromDateString_default(build.createdAt),
|
|
5180
|
-
Status: capitalize_default(build.status),
|
|
5169
|
+
"Status": capitalize_default(build.status),
|
|
5181
5170
|
"Release date": build.releasedAt ? getRelativeDateFromDateString_default(build.releasedAt) : "Unreleased",
|
|
5182
|
-
Owner: user ? user.label : "unknown"
|
|
5171
|
+
"Owner": user ? user.label : "unknown"
|
|
5183
5172
|
}));
|
|
5184
5173
|
const getCellTextProps = ({ key, props, value }) => {
|
|
5185
5174
|
const result = { ...props };
|
|
@@ -5361,7 +5350,7 @@ var SelectTable = ({ data, onSelect }) => {
|
|
|
5361
5350
|
] });
|
|
5362
5351
|
};
|
|
5363
5352
|
SelectTable.propTypes = {
|
|
5364
|
-
data: (props,
|
|
5353
|
+
data: (props, _propName, componentName) => {
|
|
5365
5354
|
const type = typeof props.data;
|
|
5366
5355
|
if (Array.isArray("array")) {
|
|
5367
5356
|
return new Error(
|
|
@@ -5552,10 +5541,10 @@ async function getBuildItems({
|
|
|
5552
5541
|
userId
|
|
5553
5542
|
});
|
|
5554
5543
|
return rawBuilds.filter((build) => buildFilter({ build, latestReleasedBuild })).slice(0, 5).map((build) => ({
|
|
5555
|
-
ID: build.id,
|
|
5556
|
-
Version: build.appVersion || "unknown",
|
|
5544
|
+
"ID": build.id,
|
|
5545
|
+
"Version": build.appVersion || "unknown",
|
|
5557
5546
|
"Creation date": getRelativeDateFromDateString_default(build.createdAt),
|
|
5558
|
-
Owner: userName || "unknown"
|
|
5547
|
+
"Owner": userName || "unknown"
|
|
5559
5548
|
}));
|
|
5560
5549
|
}
|
|
5561
5550
|
|
|
@@ -5728,7 +5717,7 @@ async function releaseBuildWorkflow({
|
|
|
5728
5717
|
updateState({ build });
|
|
5729
5718
|
updateState({ state: "releasing" });
|
|
5730
5719
|
await releaseBuild({ appId, buildId });
|
|
5731
|
-
|
|
5720
|
+
logForCI("Released!");
|
|
5732
5721
|
updateState({ state: "complete" });
|
|
5733
5722
|
} catch (e) {
|
|
5734
5723
|
const error = CliError.from(e);
|
|
@@ -5747,7 +5736,7 @@ function isBuildTestable(build) {
|
|
|
5747
5736
|
try {
|
|
5748
5737
|
validateBuild(build);
|
|
5749
5738
|
return true;
|
|
5750
|
-
} catch
|
|
5739
|
+
} catch {
|
|
5751
5740
|
return false;
|
|
5752
5741
|
}
|
|
5753
5742
|
}
|
|
@@ -6243,7 +6232,7 @@ function Cancellation({
|
|
|
6243
6232
|
const [error, setError] = (0, import_react21.useState)();
|
|
6244
6233
|
const onInput = useInput_default();
|
|
6245
6234
|
const exit = useExit_default();
|
|
6246
|
-
onInput(async (
|
|
6235
|
+
onInput(async (_input, key) => {
|
|
6247
6236
|
if (key.escape) {
|
|
6248
6237
|
cancel();
|
|
6249
6238
|
}
|
|
@@ -6409,7 +6398,7 @@ async function cancelSmokeTest({
|
|
|
6409
6398
|
userId
|
|
6410
6399
|
}) {
|
|
6411
6400
|
var _a2;
|
|
6412
|
-
await
|
|
6401
|
+
await postToFirebaseFunction("cancelSmokeTest_HTTP", {
|
|
6413
6402
|
appId,
|
|
6414
6403
|
buildId,
|
|
6415
6404
|
userId,
|
|
@@ -6429,7 +6418,7 @@ async function queueSmokeTest({
|
|
|
6429
6418
|
}) {
|
|
6430
6419
|
var _a2;
|
|
6431
6420
|
try {
|
|
6432
|
-
await
|
|
6421
|
+
await postToFirebaseFunction("queueSmokeTest_HTTP", {
|
|
6433
6422
|
appId,
|
|
6434
6423
|
buildId,
|
|
6435
6424
|
nodeVersion,
|
|
@@ -6643,12 +6632,12 @@ var exitIfCLIOutOfDate_default = () => {
|
|
|
6643
6632
|
const commandToUpdate = import_chalk3.default.greenBright(
|
|
6644
6633
|
`npm install ${import_is_installed_globally.default ? "-g" : "--save-dev"} @todesktop/cli`
|
|
6645
6634
|
);
|
|
6646
|
-
console.
|
|
6635
|
+
console.warn(
|
|
6647
6636
|
`Your version of @todesktop/cli is out of date.
|
|
6648
6637
|
Run ${commandToUpdate} to update to v${latest}.`
|
|
6649
6638
|
);
|
|
6650
6639
|
if (!import_semver3.default.satisfies(latest, `^${pkg.version}`)) {
|
|
6651
|
-
console.
|
|
6640
|
+
console.error(`CLI is exiting because it is out out of date.`);
|
|
6652
6641
|
process.exit(1);
|
|
6653
6642
|
}
|
|
6654
6643
|
}
|
|
@@ -6666,7 +6655,7 @@ var package_default = {
|
|
|
6666
6655
|
access: "public"
|
|
6667
6656
|
},
|
|
6668
6657
|
name: "@todesktop/cli",
|
|
6669
|
-
version: "1.18.
|
|
6658
|
+
version: "1.18.2",
|
|
6670
6659
|
license: "MIT",
|
|
6671
6660
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
6672
6661
|
homepage: "https://todesktop.com/cli",
|
|
@@ -6681,16 +6670,13 @@ var package_default = {
|
|
|
6681
6670
|
node: ">=16"
|
|
6682
6671
|
},
|
|
6683
6672
|
scripts: {
|
|
6684
|
-
build: "scripts/esbuild.js",
|
|
6685
|
-
dev: "scripts/esbuild.js --link --watch --stage dev",
|
|
6686
|
-
"dev:local:prod": "scripts/esbuild.js --link --watch --stage prod-local",
|
|
6687
|
-
"dev:prod": "scripts/esbuild.js --link --watch",
|
|
6673
|
+
build: "node scripts/esbuild.js",
|
|
6674
|
+
dev: "node scripts/esbuild.js --link --watch --stage dev",
|
|
6675
|
+
"dev:local:prod": "node scripts/esbuild.js --link --watch --stage prod-local",
|
|
6676
|
+
"dev:prod": "node scripts/esbuild.js --link --watch",
|
|
6688
6677
|
"docs:generate": "node scripts/generate-readme.js",
|
|
6689
|
-
format: "prettier --write
|
|
6690
|
-
lint: "
|
|
6691
|
-
"lint--fix": "eslint src test --fix",
|
|
6692
|
-
"lint:styles": "eslint src test .eslintrc.js && prettier --check .",
|
|
6693
|
-
"lint:types": "tsc && tsc-strict",
|
|
6678
|
+
format: "prettier . --write && eslint --fix",
|
|
6679
|
+
lint: "prettier . --check && eslint",
|
|
6694
6680
|
"types:generate": "node scripts/generate-types.js",
|
|
6695
6681
|
release: "npm run docs:generate && npm run build && pnpx np --tag=latest",
|
|
6696
6682
|
"release-beta": "npm run docs:generate && npm run build && npx np --any-branch --no-tests --tag=beta",
|
|
@@ -6758,30 +6744,18 @@ var package_default = {
|
|
|
6758
6744
|
"@types/is-ci": "^3.0.4",
|
|
6759
6745
|
"@types/node": "^20.8.4",
|
|
6760
6746
|
"@types/react": "^18.0.26",
|
|
6761
|
-
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
6762
|
-
"@typescript-eslint/parser": "^5.46.1",
|
|
6763
6747
|
ava: "^4.3.1",
|
|
6764
6748
|
"cp-cli": "^2.0.0",
|
|
6765
6749
|
esbuild: "^0.25.10",
|
|
6766
6750
|
"esbuild-register": "^3.4.1",
|
|
6767
|
-
eslint: "
|
|
6768
|
-
"eslint-config-prettier": "^8.5.0",
|
|
6769
|
-
"eslint-plugin-import": "^2.26.0",
|
|
6770
|
-
"eslint-plugin-node": "^11.1.0",
|
|
6771
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
6772
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
6773
|
-
"eslint-plugin-react": "^7.31.11",
|
|
6774
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
6775
|
-
"eslint-plugin-standard": "^4.1.0",
|
|
6751
|
+
eslint: "catalog:",
|
|
6776
6752
|
execa: "^4.0.3",
|
|
6777
6753
|
"extract-zip": "^2.0.1",
|
|
6778
6754
|
"fs-extra": "^9.0.1",
|
|
6779
|
-
husky: "^4.3.0",
|
|
6780
6755
|
"ink-testing-library": "^2.1.0",
|
|
6781
6756
|
"json-schema-to-typescript": "^15.0.4",
|
|
6782
|
-
"lint-staged": "^10.2.11",
|
|
6783
6757
|
"package-json-type": "^1.0.3",
|
|
6784
|
-
prettier: "
|
|
6758
|
+
prettier: "catalog:",
|
|
6785
6759
|
proxyquire: "^2.1.3",
|
|
6786
6760
|
sinon: "^9.0.3",
|
|
6787
6761
|
typescript: "catalog:",
|
|
@@ -6807,17 +6781,6 @@ var package_default = {
|
|
|
6807
6781
|
],
|
|
6808
6782
|
timeout: "10m"
|
|
6809
6783
|
},
|
|
6810
|
-
"lint-staged": {
|
|
6811
|
-
"**/*.{js,ts,tsx}": [
|
|
6812
|
-
"eslint src --fix",
|
|
6813
|
-
"git add"
|
|
6814
|
-
]
|
|
6815
|
-
},
|
|
6816
|
-
husky: {
|
|
6817
|
-
hooks: {
|
|
6818
|
-
"pre-commit": "lint-staged"
|
|
6819
|
-
}
|
|
6820
|
-
},
|
|
6821
6784
|
packageExtensions: {
|
|
6822
6785
|
"ink-progress-bar@*": {
|
|
6823
6786
|
dependencies: {
|
|
@@ -6840,33 +6803,33 @@ var initSentry_default = () => {
|
|
|
6840
6803
|
const scope = Sentry3.getCurrentScope();
|
|
6841
6804
|
try {
|
|
6842
6805
|
scope.setUser({ email: getAuthConfig().email });
|
|
6843
|
-
} catch
|
|
6806
|
+
} catch {
|
|
6844
6807
|
}
|
|
6845
6808
|
try {
|
|
6846
6809
|
scope.setContext("os", {
|
|
6847
6810
|
name: import_os2.default.platform(),
|
|
6848
6811
|
version: import_os2.default.release()
|
|
6849
6812
|
});
|
|
6850
|
-
} catch
|
|
6813
|
+
} catch {
|
|
6851
6814
|
}
|
|
6852
6815
|
try {
|
|
6853
6816
|
scope.setContext("runtime", {
|
|
6854
6817
|
name: "Node.js",
|
|
6855
6818
|
version: process.version
|
|
6856
6819
|
});
|
|
6857
|
-
} catch
|
|
6820
|
+
} catch {
|
|
6858
6821
|
}
|
|
6859
6822
|
try {
|
|
6860
6823
|
scope.setContext("app", {
|
|
6861
6824
|
app_name: package_default.name,
|
|
6862
6825
|
app_version: package_default.version
|
|
6863
6826
|
});
|
|
6864
|
-
} catch
|
|
6827
|
+
} catch {
|
|
6865
6828
|
}
|
|
6866
6829
|
try {
|
|
6867
6830
|
const configResult = getProjectConfig();
|
|
6868
6831
|
scope.setExtra("config", configResult);
|
|
6869
|
-
} catch
|
|
6832
|
+
} catch {
|
|
6870
6833
|
}
|
|
6871
6834
|
};
|
|
6872
6835
|
|