@todesktop/cli 1.19.0-1 → 1.19.0-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 +38 -2
- package/dist/cli.js +234 -197
- package/dist/cli.js.map +4 -4
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1353,13 +1353,13 @@ var require_yup = __commonJS({
|
|
|
1353
1353
|
});
|
|
1354
1354
|
var isSchema = (obj) => obj && obj.__isYupSchema__;
|
|
1355
1355
|
var Condition = class _Condition {
|
|
1356
|
-
static fromOptions(refs,
|
|
1357
|
-
if (!
|
|
1356
|
+
static fromOptions(refs, config) {
|
|
1357
|
+
if (!config.then && !config.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
|
|
1358
1358
|
let {
|
|
1359
1359
|
is,
|
|
1360
1360
|
then,
|
|
1361
1361
|
otherwise
|
|
1362
|
-
} =
|
|
1362
|
+
} = config;
|
|
1363
1363
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
1364
1364
|
return new _Condition(refs, (values, schema) => {
|
|
1365
1365
|
var _branch;
|
|
@@ -1448,7 +1448,7 @@ var require_yup = __commonJS({
|
|
|
1448
1448
|
};
|
|
1449
1449
|
Reference.prototype.__isYupRef = true;
|
|
1450
1450
|
var isAbsent = (value) => value == null;
|
|
1451
|
-
function createValidation(
|
|
1451
|
+
function createValidation(config) {
|
|
1452
1452
|
function validate({
|
|
1453
1453
|
value,
|
|
1454
1454
|
path: path9 = "",
|
|
@@ -1462,7 +1462,7 @@ var require_yup = __commonJS({
|
|
|
1462
1462
|
params,
|
|
1463
1463
|
message: message2,
|
|
1464
1464
|
skipAbsent
|
|
1465
|
-
} =
|
|
1465
|
+
} = config;
|
|
1466
1466
|
let {
|
|
1467
1467
|
parent,
|
|
1468
1468
|
context,
|
|
@@ -1530,7 +1530,7 @@ var require_yup = __commonJS({
|
|
|
1530
1530
|
}
|
|
1531
1531
|
handleResult(result);
|
|
1532
1532
|
}
|
|
1533
|
-
validate.OPTIONS =
|
|
1533
|
+
validate.OPTIONS = config;
|
|
1534
1534
|
return validate;
|
|
1535
1535
|
}
|
|
1536
1536
|
function resolveParams(params, options) {
|
|
@@ -3494,18 +3494,18 @@ attempted value: ${formattedValue}
|
|
|
3494
3494
|
cast(value, options) {
|
|
3495
3495
|
return this._resolve(value, options).cast(value, options);
|
|
3496
3496
|
}
|
|
3497
|
-
asNestedTest(
|
|
3497
|
+
asNestedTest(config) {
|
|
3498
3498
|
let {
|
|
3499
3499
|
key,
|
|
3500
3500
|
index,
|
|
3501
3501
|
parent,
|
|
3502
3502
|
options
|
|
3503
|
-
} =
|
|
3503
|
+
} = config;
|
|
3504
3504
|
let value = parent[index != null ? index : key];
|
|
3505
3505
|
return this._resolve(value, Object.assign({}, options, {
|
|
3506
3506
|
value,
|
|
3507
3507
|
parent
|
|
3508
|
-
})).asNestedTest(
|
|
3508
|
+
})).asNestedTest(config);
|
|
3509
3509
|
}
|
|
3510
3510
|
validate(value, options) {
|
|
3511
3511
|
return catchValidationError(() => this._resolve(value, options).validate(value, options));
|
|
@@ -3785,11 +3785,11 @@ var allSuggestionTokens = Array.from(
|
|
|
3785
3785
|
"hook:todesktop:afterPack:*"
|
|
3786
3786
|
])
|
|
3787
3787
|
);
|
|
3788
|
-
function canonicalKey(
|
|
3789
|
-
if (
|
|
3790
|
-
return `phase:${
|
|
3788
|
+
function canonicalKey(config) {
|
|
3789
|
+
if (config.type === "phase") {
|
|
3790
|
+
return `phase:${config.id}`;
|
|
3791
3791
|
}
|
|
3792
|
-
return `hook:${
|
|
3792
|
+
return `hook:${config.id}:${config.position}`;
|
|
3793
3793
|
}
|
|
3794
3794
|
function levenshtein(a, b) {
|
|
3795
3795
|
if (a === b) {
|
|
@@ -3916,11 +3916,11 @@ function parseBreakpointList(input) {
|
|
|
3916
3916
|
function listBreakpointDefinitions() {
|
|
3917
3917
|
return breakpointDefinitions.slice();
|
|
3918
3918
|
}
|
|
3919
|
-
function formatBreakpoint(
|
|
3920
|
-
if (
|
|
3921
|
-
return
|
|
3919
|
+
function formatBreakpoint(config) {
|
|
3920
|
+
if (config.type === "phase") {
|
|
3921
|
+
return config.id;
|
|
3922
3922
|
}
|
|
3923
|
-
return `hook:${
|
|
3923
|
+
return `hook:${config.id}:${config.position}`;
|
|
3924
3924
|
}
|
|
3925
3925
|
function isHookBreakpointName(value) {
|
|
3926
3926
|
return hookNames.includes(value);
|
|
@@ -3994,10 +3994,10 @@ function BreakpointNotice({ plan }) {
|
|
|
3994
3994
|
var import_ink4 = require("ink");
|
|
3995
3995
|
var import_react2 = require("react");
|
|
3996
3996
|
|
|
3997
|
-
//
|
|
3997
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/package.json
|
|
3998
3998
|
var package_default = {
|
|
3999
3999
|
name: "@todesktop/shared",
|
|
4000
|
-
version: "7.
|
|
4000
|
+
version: "7.193.0",
|
|
4001
4001
|
description: "",
|
|
4002
4002
|
main: "./lib/cjs/index.js",
|
|
4003
4003
|
module: "./lib/esm/index.js",
|
|
@@ -4048,7 +4048,7 @@ var package_default = {
|
|
|
4048
4048
|
}
|
|
4049
4049
|
};
|
|
4050
4050
|
|
|
4051
|
-
//
|
|
4051
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/base.js
|
|
4052
4052
|
var WindowsEVOnboardingSteps;
|
|
4053
4053
|
(function(WindowsEVOnboardingSteps2) {
|
|
4054
4054
|
WindowsEVOnboardingSteps2["hasBeenVerified"] = "hasBeenVerified";
|
|
@@ -4069,7 +4069,7 @@ var WindowsHSMCertType;
|
|
|
4069
4069
|
WindowsHSMCertType2["file"] = "file";
|
|
4070
4070
|
})(WindowsHSMCertType || (WindowsHSMCertType = {}));
|
|
4071
4071
|
|
|
4072
|
-
//
|
|
4072
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/desktopify.js
|
|
4073
4073
|
var PlatformName;
|
|
4074
4074
|
(function(PlatformName3) {
|
|
4075
4075
|
PlatformName3["linux"] = "linux";
|
|
@@ -4108,13 +4108,13 @@ var ManifestCategory;
|
|
|
4108
4108
|
ManifestCategory2["versioned"] = "versioned";
|
|
4109
4109
|
})(ManifestCategory || (ManifestCategory = {}));
|
|
4110
4110
|
|
|
4111
|
-
//
|
|
4111
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/introspection/breakpoints.js
|
|
4112
4112
|
var MINUTE = 60 * 1e3;
|
|
4113
4113
|
var BREAKPOINT_DEFAULT_LEASE_MS = 20 * MINUTE;
|
|
4114
4114
|
var BREAKPOINT_RENEW_INCREMENT_MS = 10 * MINUTE;
|
|
4115
4115
|
var BREAKPOINT_MAX_REMAINING_MS = 20 * MINUTE;
|
|
4116
4116
|
|
|
4117
|
-
//
|
|
4117
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/introspection/status.js
|
|
4118
4118
|
function formatIntrospectionStatus(breakpointStatus, shellStatus) {
|
|
4119
4119
|
if (breakpointStatus === "paused") {
|
|
4120
4120
|
if (shellStatus === "connected") {
|
|
@@ -4149,7 +4149,7 @@ function formatIntrospectionStatus(breakpointStatus, shellStatus) {
|
|
|
4149
4149
|
return "status unknown";
|
|
4150
4150
|
}
|
|
4151
4151
|
|
|
4152
|
-
//
|
|
4152
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/plans.js
|
|
4153
4153
|
var PortalConfigKey;
|
|
4154
4154
|
(function(PortalConfigKey2) {
|
|
4155
4155
|
PortalConfigKey2["BuilderUpdateDev"] = "builder_update_dev";
|
|
@@ -4727,7 +4727,7 @@ var LegacyProductRecord = {
|
|
|
4727
4727
|
startup: { dev: dev.legacy.startup, prod: prod.legacy.startup }
|
|
4728
4728
|
};
|
|
4729
4729
|
|
|
4730
|
-
//
|
|
4730
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/validations.js
|
|
4731
4731
|
var import_is_regex = __toESM(require_is_regex());
|
|
4732
4732
|
var import_semver = __toESM(require("semver"));
|
|
4733
4733
|
var yup = __toESM(require_yup());
|
|
@@ -4815,7 +4815,7 @@ var appConfigValidation = yup.object({
|
|
|
4815
4815
|
}).required()
|
|
4816
4816
|
});
|
|
4817
4817
|
|
|
4818
|
-
//
|
|
4818
|
+
// ../../node_modules/.pnpm/@todesktop+shared@7.193.0/node_modules/@todesktop/shared/lib/esm/index.js
|
|
4819
4819
|
var schemaVersion = package_default.version;
|
|
4820
4820
|
|
|
4821
4821
|
// src/utilities/useInput.ts
|
|
@@ -4884,16 +4884,42 @@ var onUserAuth = (handler) => (0, import_auth.onAuthStateChanged)(auth, (user) =
|
|
|
4884
4884
|
var firestore_default = db;
|
|
4885
4885
|
|
|
4886
4886
|
// src/utilities/configStore.ts
|
|
4887
|
-
var fs = __toESM(require("fs"));
|
|
4888
|
-
var import_del = __toESM(require("del"));
|
|
4889
4887
|
var import_conf = __toESM(require("conf"));
|
|
4890
|
-
var
|
|
4891
|
-
var
|
|
4888
|
+
var customCwd = process.env.TODESKTOP_CONFIG_DIR;
|
|
4889
|
+
var ephemeralMode = false;
|
|
4890
|
+
var memoryStore = /* @__PURE__ */ new Map();
|
|
4891
|
+
var configInstance = null;
|
|
4892
|
+
var setConfigDir = (cwd) => {
|
|
4893
|
+
customCwd = cwd;
|
|
4894
|
+
};
|
|
4895
|
+
var setEphemeralMode = (enabled) => {
|
|
4896
|
+
ephemeralMode = enabled;
|
|
4897
|
+
};
|
|
4898
|
+
var getConfigInstance = () => {
|
|
4899
|
+
if (!configInstance) {
|
|
4900
|
+
configInstance = new import_conf.default({
|
|
4901
|
+
configName: "todesktop-cli",
|
|
4902
|
+
...customCwd && { cwd: customCwd }
|
|
4903
|
+
});
|
|
4904
|
+
}
|
|
4905
|
+
return configInstance;
|
|
4906
|
+
};
|
|
4892
4907
|
var accessTokenConfigKey = "accessToken";
|
|
4893
4908
|
var emailConfigKey = "email";
|
|
4894
4909
|
var jwtTokenConfigKey = "jwtToken";
|
|
4895
|
-
var setConfig = (key, value) =>
|
|
4896
|
-
|
|
4910
|
+
var setConfig = (key, value) => {
|
|
4911
|
+
if (ephemeralMode) {
|
|
4912
|
+
memoryStore.set(key, value);
|
|
4913
|
+
} else {
|
|
4914
|
+
getConfigInstance().set(key, value);
|
|
4915
|
+
}
|
|
4916
|
+
};
|
|
4917
|
+
var getConfig = (key) => {
|
|
4918
|
+
if (ephemeralMode) {
|
|
4919
|
+
return memoryStore.get(key);
|
|
4920
|
+
}
|
|
4921
|
+
return getConfigInstance().get(key);
|
|
4922
|
+
};
|
|
4897
4923
|
var setAuthConfig = (email, accessToken, jwtToken) => {
|
|
4898
4924
|
setConfig(emailConfigKey, email);
|
|
4899
4925
|
setConfig(accessTokenConfigKey, accessToken);
|
|
@@ -4906,20 +4932,17 @@ var getAuthConfig = () => {
|
|
|
4906
4932
|
return { accessToken, jwtToken, email };
|
|
4907
4933
|
};
|
|
4908
4934
|
var deleteAuthConfig = () => {
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
(0, import_del.default)(oldConfigPath, { force: true });
|
|
4919
|
-
} catch {
|
|
4920
|
-
(0, import_del.default)(oldConfigPath, { force: true });
|
|
4935
|
+
if (ephemeralMode) {
|
|
4936
|
+
memoryStore.delete(emailConfigKey);
|
|
4937
|
+
memoryStore.delete(accessTokenConfigKey);
|
|
4938
|
+
memoryStore.delete(jwtTokenConfigKey);
|
|
4939
|
+
} else {
|
|
4940
|
+
const config = getConfigInstance();
|
|
4941
|
+
config.delete(emailConfigKey);
|
|
4942
|
+
config.delete(accessTokenConfigKey);
|
|
4943
|
+
config.delete(jwtTokenConfigKey);
|
|
4921
4944
|
}
|
|
4922
|
-
}
|
|
4945
|
+
};
|
|
4923
4946
|
|
|
4924
4947
|
// src/utilities/getToDesktopPackageJson.ts
|
|
4925
4948
|
var import_pkg_up = __toESM(require("pkg-up"));
|
|
@@ -5028,7 +5051,7 @@ var flush = () => analytics == null ? void 0 : analytics.flush({ close: true });
|
|
|
5028
5051
|
|
|
5029
5052
|
// src/utilities/logger.ts
|
|
5030
5053
|
var import_bunyan = __toESM(require("bunyan"));
|
|
5031
|
-
var
|
|
5054
|
+
var fs = __toESM(require("fs"));
|
|
5032
5055
|
var os2 = __toESM(require("os"));
|
|
5033
5056
|
var path2 = __toESM(require("path"));
|
|
5034
5057
|
var Sentry = __toESM(require("@sentry/node"));
|
|
@@ -5089,7 +5112,7 @@ try {
|
|
|
5089
5112
|
"logs"
|
|
5090
5113
|
);
|
|
5091
5114
|
}
|
|
5092
|
-
|
|
5115
|
+
fs.mkdirSync(parentDirectory, { recursive: true });
|
|
5093
5116
|
logger = import_bunyan.default.createLogger({
|
|
5094
5117
|
name,
|
|
5095
5118
|
serializers: {
|
|
@@ -6144,9 +6167,9 @@ var import_pretty_bytes = __toESM(require("pretty-bytes"));
|
|
|
6144
6167
|
// src/utilities/postToFirebaseFunction.ts
|
|
6145
6168
|
var import_axios = __toESM(require("axios"));
|
|
6146
6169
|
var { TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE } = getEnvironmentVariables_default();
|
|
6147
|
-
async function postToFirebaseFunction(functionName, body = {},
|
|
6170
|
+
async function postToFirebaseFunction(functionName, body = {}, config = {}) {
|
|
6148
6171
|
logger_default.debug(
|
|
6149
|
-
{ scrub: { functionName, body, config
|
|
6172
|
+
{ scrub: { functionName, body, config } },
|
|
6150
6173
|
"postToFirebaseFunction"
|
|
6151
6174
|
);
|
|
6152
6175
|
let baseUrl = TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE;
|
|
@@ -6157,7 +6180,7 @@ async function postToFirebaseFunction(functionName, body = {}, config2 = {}) {
|
|
|
6157
6180
|
const response = await import_axios.default.post(
|
|
6158
6181
|
`${baseUrl}${functionName}`,
|
|
6159
6182
|
body,
|
|
6160
|
-
|
|
6183
|
+
config
|
|
6161
6184
|
);
|
|
6162
6185
|
logger_default.debug(
|
|
6163
6186
|
{ scrub: { responseData: response.data } },
|
|
@@ -6200,8 +6223,8 @@ function loadTypeScriptConfig(configPath) {
|
|
|
6200
6223
|
);
|
|
6201
6224
|
}
|
|
6202
6225
|
}
|
|
6203
|
-
const
|
|
6204
|
-
const sourceCode =
|
|
6226
|
+
const fs6 = require("fs");
|
|
6227
|
+
const sourceCode = fs6.readFileSync(configPath, "utf8");
|
|
6205
6228
|
const result = typescript.transpile(sourceCode, {
|
|
6206
6229
|
target: typescript.ScriptTarget.ES2018,
|
|
6207
6230
|
module: typescript.ModuleKind.CommonJS,
|
|
@@ -6233,14 +6256,14 @@ function loadTypeScriptConfig(configPath) {
|
|
|
6233
6256
|
configPath,
|
|
6234
6257
|
(0, import_path2.resolve)(configPath, "..")
|
|
6235
6258
|
);
|
|
6236
|
-
const
|
|
6237
|
-
if (!
|
|
6259
|
+
const config = module2.exports.default || module2.exports;
|
|
6260
|
+
if (!config || typeof config !== "object") {
|
|
6238
6261
|
throw new Error(
|
|
6239
|
-
`TypeScript configuration file must export a configuration object. Received: ${typeof
|
|
6262
|
+
`TypeScript configuration file must export a configuration object. Received: ${typeof config}`
|
|
6240
6263
|
);
|
|
6241
6264
|
}
|
|
6242
6265
|
logger_default.debug("Successfully loaded and compiled TypeScript configuration");
|
|
6243
|
-
return
|
|
6266
|
+
return config;
|
|
6244
6267
|
} catch (error) {
|
|
6245
6268
|
logger_default.error(
|
|
6246
6269
|
`Failed to load TypeScript configuration from ${configPath}:`,
|
|
@@ -6275,83 +6298,83 @@ function loadConfig(configPath) {
|
|
|
6275
6298
|
// src/utilities/projectConfig/resolveConfigPaths.ts
|
|
6276
6299
|
var path3 = __toESM(require("path"));
|
|
6277
6300
|
function resolveConfigPaths({
|
|
6278
|
-
config
|
|
6301
|
+
config,
|
|
6279
6302
|
projectRoot
|
|
6280
6303
|
}) {
|
|
6281
|
-
const appRoot =
|
|
6304
|
+
const appRoot = config.appPath ? path3.isAbsolute(config.appPath) ? config.appPath : path3.join(projectRoot, config.appPath) : projectRoot;
|
|
6282
6305
|
const transformIfExists = (value, transformer) => value ? transformer(value) : void 0;
|
|
6283
6306
|
const resolvePath = (filePath) => path3.isAbsolute(filePath) ? filePath : path3.join(projectRoot, filePath);
|
|
6284
6307
|
const result = {
|
|
6285
|
-
...
|
|
6308
|
+
...config,
|
|
6286
6309
|
appPath: appRoot,
|
|
6287
|
-
icon: resolvePath(
|
|
6310
|
+
icon: resolvePath(config.icon)
|
|
6288
6311
|
};
|
|
6289
|
-
if (
|
|
6312
|
+
if (config.extraContentFiles) {
|
|
6290
6313
|
result.extraContentFiles = transformIfExists(
|
|
6291
|
-
|
|
6314
|
+
config.extraContentFiles,
|
|
6292
6315
|
(extraContentFiles) => extraContentFiles.map((extraContentFile) => ({
|
|
6293
6316
|
...extraContentFile,
|
|
6294
6317
|
from: resolvePath(extraContentFile.from)
|
|
6295
6318
|
}))
|
|
6296
6319
|
);
|
|
6297
6320
|
}
|
|
6298
|
-
if (
|
|
6321
|
+
if (config.extraResources) {
|
|
6299
6322
|
result.extraResources = transformIfExists(
|
|
6300
|
-
|
|
6323
|
+
config.extraResources,
|
|
6301
6324
|
(extraResources) => extraResources.map((extraResource) => ({
|
|
6302
6325
|
...extraResource,
|
|
6303
6326
|
from: resolvePath(extraResource.from)
|
|
6304
6327
|
}))
|
|
6305
6328
|
);
|
|
6306
6329
|
}
|
|
6307
|
-
if (
|
|
6308
|
-
result.linux = { ...
|
|
6309
|
-
if (
|
|
6310
|
-
result.linux.icon = resolvePath(
|
|
6330
|
+
if (config.linux) {
|
|
6331
|
+
result.linux = { ...config.linux };
|
|
6332
|
+
if (config.linux.icon) {
|
|
6333
|
+
result.linux.icon = resolvePath(config.linux.icon);
|
|
6311
6334
|
}
|
|
6312
6335
|
}
|
|
6313
|
-
if (
|
|
6314
|
-
result.mac = { ...
|
|
6315
|
-
if (
|
|
6316
|
-
result.mac.entitlements = resolvePath(
|
|
6336
|
+
if (config.mac) {
|
|
6337
|
+
result.mac = { ...config.mac };
|
|
6338
|
+
if (config.mac.entitlements) {
|
|
6339
|
+
result.mac.entitlements = resolvePath(config.mac.entitlements);
|
|
6317
6340
|
}
|
|
6318
|
-
if (
|
|
6341
|
+
if (config.mac.entitlementsInherit) {
|
|
6319
6342
|
result.mac.entitlementsInherit = resolvePath(
|
|
6320
|
-
|
|
6343
|
+
config.mac.entitlementsInherit
|
|
6321
6344
|
);
|
|
6322
6345
|
}
|
|
6323
|
-
if (
|
|
6324
|
-
result.mac.requirements = resolvePath(
|
|
6346
|
+
if (config.mac.requirements) {
|
|
6347
|
+
result.mac.requirements = resolvePath(config.mac.requirements);
|
|
6325
6348
|
}
|
|
6326
|
-
if (
|
|
6327
|
-
result.mac.icon = resolvePath(
|
|
6349
|
+
if (config.mac.icon) {
|
|
6350
|
+
result.mac.icon = resolvePath(config.mac.icon);
|
|
6328
6351
|
}
|
|
6329
6352
|
}
|
|
6330
|
-
if (
|
|
6331
|
-
result.mas = { ...
|
|
6332
|
-
if (
|
|
6333
|
-
result.mas.entitlements = resolvePath(
|
|
6353
|
+
if (config.mas) {
|
|
6354
|
+
result.mas = { ...config.mas };
|
|
6355
|
+
if (config.mas.entitlements) {
|
|
6356
|
+
result.mas.entitlements = resolvePath(config.mas.entitlements);
|
|
6334
6357
|
}
|
|
6335
|
-
if (
|
|
6358
|
+
if (config.mas.entitlementsInherit) {
|
|
6336
6359
|
result.mas.entitlementsInherit = resolvePath(
|
|
6337
|
-
|
|
6360
|
+
config.mas.entitlementsInherit
|
|
6338
6361
|
);
|
|
6339
6362
|
}
|
|
6340
|
-
if (
|
|
6363
|
+
if (config.mas.provisioningProfile) {
|
|
6341
6364
|
result.mas.provisioningProfile = resolvePath(
|
|
6342
|
-
|
|
6365
|
+
config.mas.provisioningProfile
|
|
6343
6366
|
);
|
|
6344
6367
|
}
|
|
6345
6368
|
}
|
|
6346
|
-
if (
|
|
6347
|
-
if (
|
|
6348
|
-
result.dmg.background = resolvePath(
|
|
6369
|
+
if (config.dmg) {
|
|
6370
|
+
if (config.dmg.background) {
|
|
6371
|
+
result.dmg.background = resolvePath(config.dmg.background);
|
|
6349
6372
|
}
|
|
6350
6373
|
}
|
|
6351
|
-
if (
|
|
6352
|
-
result.windows = { ...
|
|
6353
|
-
if (
|
|
6354
|
-
result.windows.icon = resolvePath(
|
|
6374
|
+
if (config.windows) {
|
|
6375
|
+
result.windows = { ...config.windows };
|
|
6376
|
+
if (config.windows.icon) {
|
|
6377
|
+
result.windows.icon = resolvePath(config.windows.icon);
|
|
6355
6378
|
}
|
|
6356
6379
|
}
|
|
6357
6380
|
return result;
|
|
@@ -6365,7 +6388,7 @@ var import_better_ajv_errors2 = __toESM(require("better-ajv-errors"));
|
|
|
6365
6388
|
// src/utilities/projectConfig/addCustomKeywords.ts
|
|
6366
6389
|
var import_ajv2 = require("ajv");
|
|
6367
6390
|
var import_email_regex = __toESM(require("email-regex"));
|
|
6368
|
-
var
|
|
6391
|
+
var fs2 = __toESM(require("fs"));
|
|
6369
6392
|
var path4 = __toESM(require("path"));
|
|
6370
6393
|
var import_parse_author = __toESM(require("parse-author"));
|
|
6371
6394
|
var semver2 = __toESM(require("semver"));
|
|
@@ -6580,7 +6603,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
6580
6603
|
}
|
|
6581
6604
|
]);
|
|
6582
6605
|
}
|
|
6583
|
-
if (!
|
|
6606
|
+
if (!fs2.existsSync(filePath)) {
|
|
6584
6607
|
throw new import_ajv2.ValidationError([
|
|
6585
6608
|
{
|
|
6586
6609
|
keyword: mustBeDirectory ? "Directory" : "File",
|
|
@@ -6588,7 +6611,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
6588
6611
|
}
|
|
6589
6612
|
]);
|
|
6590
6613
|
}
|
|
6591
|
-
const stats =
|
|
6614
|
+
const stats = fs2.statSync(filePath);
|
|
6592
6615
|
if (mustBeDirectory && stats.isFile()) {
|
|
6593
6616
|
throw new import_ajv2.ValidationError([
|
|
6594
6617
|
{
|
|
@@ -6607,7 +6630,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
6607
6630
|
if (schema.mustBeElectronApp) {
|
|
6608
6631
|
const appRoot = path4.resolve(filePath);
|
|
6609
6632
|
const pkgPath = path4.join(appRoot, "package.json");
|
|
6610
|
-
if (!
|
|
6633
|
+
if (!fs2.existsSync(pkgPath)) {
|
|
6611
6634
|
throw new import_ajv2.ValidationError([
|
|
6612
6635
|
{
|
|
6613
6636
|
keyword: "App",
|
|
@@ -6631,7 +6654,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
6631
6654
|
const mainFilePath = pkg.main;
|
|
6632
6655
|
if (mainFilePath) {
|
|
6633
6656
|
const resolvedMainFilePath = path4.join(appRoot, mainFilePath);
|
|
6634
|
-
if (!
|
|
6657
|
+
if (!fs2.existsSync(resolvedMainFilePath)) {
|
|
6635
6658
|
throw new import_ajv2.ValidationError([
|
|
6636
6659
|
{
|
|
6637
6660
|
keyword: "App",
|
|
@@ -6639,7 +6662,7 @@ var addCustomKeywords_default = (ajv, context) => {
|
|
|
6639
6662
|
}
|
|
6640
6663
|
]);
|
|
6641
6664
|
}
|
|
6642
|
-
} else if (!
|
|
6665
|
+
} else if (!fs2.existsSync(path4.join(appRoot, "index.js"))) {
|
|
6643
6666
|
throw new import_ajv2.ValidationError([
|
|
6644
6667
|
{
|
|
6645
6668
|
keyword: "App",
|
|
@@ -7722,7 +7745,7 @@ var full_default = (context) => {
|
|
|
7722
7745
|
|
|
7723
7746
|
// src/utilities/projectConfig/validateConfig.ts
|
|
7724
7747
|
function validateConfig({
|
|
7725
|
-
config
|
|
7748
|
+
config,
|
|
7726
7749
|
projectRoot
|
|
7727
7750
|
}) {
|
|
7728
7751
|
const context = { projectRoot };
|
|
@@ -7731,7 +7754,7 @@ function validateConfig({
|
|
|
7731
7754
|
(0, import_ajv_formats2.default)(ajv);
|
|
7732
7755
|
addCustomKeywords_default(ajv, context);
|
|
7733
7756
|
const validate = ajv.compile(schema);
|
|
7734
|
-
if (
|
|
7757
|
+
if (config.productName) {
|
|
7735
7758
|
throw new Error(
|
|
7736
7759
|
`todesktop.json invalid.
|
|
7737
7760
|
|
|
@@ -7740,8 +7763,8 @@ The "productName" property is no longer supported in todesktop.json. Please remo
|
|
|
7740
7763
|
We made this change because Electron also uses the "productName" if it exists in your app's package.json. If you do not add it to your package.json, your app name will default to the value of the "name" property in your package.json.`
|
|
7741
7764
|
);
|
|
7742
7765
|
}
|
|
7743
|
-
if (!validate(
|
|
7744
|
-
const output = (0, import_better_ajv_errors2.default)(schema,
|
|
7766
|
+
if (!validate(config)) {
|
|
7767
|
+
const output = (0, import_better_ajv_errors2.default)(schema, config, validate.errors, {
|
|
7745
7768
|
indent: 2
|
|
7746
7769
|
});
|
|
7747
7770
|
throw new Error(
|
|
@@ -7815,13 +7838,13 @@ function getProjectConfig(configPath, flags) {
|
|
|
7815
7838
|
}
|
|
7816
7839
|
const projectRoot = (0, import_path5.dirname)(configPath);
|
|
7817
7840
|
const partialConfig = loadConfig(configPath);
|
|
7818
|
-
const
|
|
7819
|
-
validateConfig({ config
|
|
7820
|
-
const result = resolveConfigPaths({ config
|
|
7841
|
+
const config = computeFullProjectConfig(partialConfig, projectRoot, flags);
|
|
7842
|
+
validateConfig({ config, projectRoot });
|
|
7843
|
+
const result = resolveConfigPaths({ config, projectRoot });
|
|
7821
7844
|
if (process.env.TODESKTOP_CLI_APP_ID) {
|
|
7822
7845
|
result.id = process.env.TODESKTOP_CLI_APP_ID;
|
|
7823
7846
|
}
|
|
7824
|
-
return { config: result, unprocessedConfig:
|
|
7847
|
+
return { config: result, unprocessedConfig: config, projectRoot };
|
|
7825
7848
|
}
|
|
7826
7849
|
|
|
7827
7850
|
// src/utilities/shouldExitOnBuildFailure.ts
|
|
@@ -7856,10 +7879,10 @@ function removeNullDependencies(pkgJson) {
|
|
|
7856
7879
|
}
|
|
7857
7880
|
return pkgJson;
|
|
7858
7881
|
}
|
|
7859
|
-
function getAppPkgJson({ config
|
|
7860
|
-
const packageJsonFromConfig =
|
|
7882
|
+
function getAppPkgJson({ config }) {
|
|
7883
|
+
const packageJsonFromConfig = config.packageJson || {};
|
|
7861
7884
|
const extendsFrom = packageJsonFromConfig.extends || "package.json";
|
|
7862
|
-
const packageJsonFromFile = readJson(import_path6.default.join(
|
|
7885
|
+
const packageJsonFromFile = readJson(import_path6.default.join(config.appPath, extendsFrom));
|
|
7863
7886
|
return removeNullDependencies(
|
|
7864
7887
|
(0, import_lodash3.default)({}, packageJsonFromFile, packageJsonFromConfig)
|
|
7865
7888
|
);
|
|
@@ -7971,7 +7994,7 @@ function buildHasSettled(build) {
|
|
|
7971
7994
|
|
|
7972
7995
|
// src/commands/build/utilities/uploadApplicationSource.ts
|
|
7973
7996
|
var import_fast_glob2 = __toESM(require("fast-glob"));
|
|
7974
|
-
var
|
|
7997
|
+
var fs5 = __toESM(require("fs"));
|
|
7975
7998
|
var path8 = __toESM(require("path"));
|
|
7976
7999
|
|
|
7977
8000
|
// src/commands/build/utilities/generateS3Key.ts
|
|
@@ -8148,8 +8171,8 @@ var DEFAULT_IGNORE_GLOBS = [
|
|
|
8148
8171
|
];
|
|
8149
8172
|
async function prepareWorkspaceBundle(input) {
|
|
8150
8173
|
var _a2;
|
|
8151
|
-
const { config
|
|
8152
|
-
if (!((_a2 =
|
|
8174
|
+
const { config, appPkgJson, appPath } = input;
|
|
8175
|
+
if (!((_a2 = config.bundleWorkspacePackages) == null ? void 0 : _a2.enabled)) {
|
|
8153
8176
|
return {
|
|
8154
8177
|
appPackageJson: appPkgJson,
|
|
8155
8178
|
entries: [],
|
|
@@ -8779,7 +8802,7 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
|
|
|
8779
8802
|
if (appPkgJson.main) {
|
|
8780
8803
|
mainFilePath = path8.join(mainFilePath, appPkgJson.main);
|
|
8781
8804
|
}
|
|
8782
|
-
if (
|
|
8805
|
+
if (fs5.statSync(mainFilePath).isDirectory()) {
|
|
8783
8806
|
mainFilePath = path8.join(mainFilePath, "index.js");
|
|
8784
8807
|
}
|
|
8785
8808
|
if (!absolutePaths.includes(mainFilePath)) {
|
|
@@ -8799,7 +8822,7 @@ async function uploadApplicationSource({
|
|
|
8799
8822
|
appId,
|
|
8800
8823
|
appPkgJson,
|
|
8801
8824
|
buildId,
|
|
8802
|
-
config
|
|
8825
|
+
config,
|
|
8803
8826
|
onProgress
|
|
8804
8827
|
}) {
|
|
8805
8828
|
var _a2;
|
|
@@ -8809,7 +8832,7 @@ async function uploadApplicationSource({
|
|
|
8809
8832
|
appId,
|
|
8810
8833
|
appPkgJson,
|
|
8811
8834
|
buildId,
|
|
8812
|
-
config
|
|
8835
|
+
config,
|
|
8813
8836
|
onProgress
|
|
8814
8837
|
}
|
|
8815
8838
|
},
|
|
@@ -8820,9 +8843,9 @@ async function uploadApplicationSource({
|
|
|
8820
8843
|
let workspaceEntries = [];
|
|
8821
8844
|
try {
|
|
8822
8845
|
const workspaceBundle = await prepareWorkspaceBundle({
|
|
8823
|
-
appPath:
|
|
8846
|
+
appPath: config.appPath,
|
|
8824
8847
|
appPkgJson,
|
|
8825
|
-
config
|
|
8848
|
+
config
|
|
8826
8849
|
});
|
|
8827
8850
|
effectiveAppPkgJson = workspaceBundle.appPackageJson;
|
|
8828
8851
|
workspaceEntries = workspaceBundle.entries;
|
|
@@ -8835,8 +8858,8 @@ async function uploadApplicationSource({
|
|
|
8835
8858
|
App files (stored in app/ in the ZIP)
|
|
8836
8859
|
*/
|
|
8837
8860
|
...await getAppFiles(
|
|
8838
|
-
|
|
8839
|
-
|
|
8861
|
+
config.appFiles,
|
|
8862
|
+
config.appPath,
|
|
8840
8863
|
effectiveAppPkgJson
|
|
8841
8864
|
),
|
|
8842
8865
|
/*
|
|
@@ -8846,7 +8869,7 @@ async function uploadApplicationSource({
|
|
|
8846
8869
|
also any file paths in our todesktop.json that are outside of the
|
|
8847
8870
|
project directory
|
|
8848
8871
|
*/
|
|
8849
|
-
...(
|
|
8872
|
+
...(config.extraContentFiles || []).map(({ from, to = "." }) => {
|
|
8850
8873
|
return {
|
|
8851
8874
|
from,
|
|
8852
8875
|
to: path8.join("extraContentFiles", to, path8.basename(from))
|
|
@@ -8856,7 +8879,7 @@ async function uploadApplicationSource({
|
|
|
8856
8879
|
Optional extra resources (stored in extraResources/ in the ZIP).
|
|
8857
8880
|
Similar to extra content files above
|
|
8858
8881
|
*/
|
|
8859
|
-
...(
|
|
8882
|
+
...(config.extraResources || []).map(({ from, to = "." }) => {
|
|
8860
8883
|
return {
|
|
8861
8884
|
from,
|
|
8862
8885
|
to: path8.join("extraResources", to, path8.basename(from))
|
|
@@ -8866,24 +8889,24 @@ async function uploadApplicationSource({
|
|
|
8866
8889
|
Icons (more may be added below)
|
|
8867
8890
|
*/
|
|
8868
8891
|
{
|
|
8869
|
-
from:
|
|
8870
|
-
to: path8.join("icons", "appIcon" + path8.extname(
|
|
8892
|
+
from: config.icon,
|
|
8893
|
+
to: path8.join("icons", "appIcon" + path8.extname(config.icon))
|
|
8871
8894
|
}
|
|
8872
8895
|
];
|
|
8873
|
-
if (
|
|
8874
|
-
if (
|
|
8896
|
+
if (config.linux) {
|
|
8897
|
+
if (config.linux.icon) {
|
|
8875
8898
|
files.push({
|
|
8876
|
-
from:
|
|
8899
|
+
from: config.linux.icon,
|
|
8877
8900
|
to: path8.join(
|
|
8878
8901
|
"icons",
|
|
8879
|
-
"appIcon-linux" + path8.extname(
|
|
8902
|
+
"appIcon-linux" + path8.extname(config.linux.icon)
|
|
8880
8903
|
)
|
|
8881
8904
|
});
|
|
8882
8905
|
}
|
|
8883
8906
|
}
|
|
8884
|
-
if (Array.isArray(
|
|
8907
|
+
if (Array.isArray(config.fileAssociations)) {
|
|
8885
8908
|
const possibleIcons = [];
|
|
8886
|
-
for (const fa of
|
|
8909
|
+
for (const fa of config.fileAssociations) {
|
|
8887
8910
|
if (fa.icon) {
|
|
8888
8911
|
const icon = path8.parse(fa.icon);
|
|
8889
8912
|
possibleIcons.push(
|
|
@@ -8903,73 +8926,73 @@ async function uploadApplicationSource({
|
|
|
8903
8926
|
})
|
|
8904
8927
|
);
|
|
8905
8928
|
}
|
|
8906
|
-
if (
|
|
8907
|
-
if (
|
|
8929
|
+
if (config.mac) {
|
|
8930
|
+
if (config.mac.entitlements) {
|
|
8908
8931
|
files.push({
|
|
8909
|
-
from:
|
|
8932
|
+
from: config.mac.entitlements,
|
|
8910
8933
|
to: path8.join("other", "mac", "entitlements.mac.plist")
|
|
8911
8934
|
});
|
|
8912
8935
|
}
|
|
8913
|
-
if (
|
|
8936
|
+
if (config.mac.entitlementsInherit) {
|
|
8914
8937
|
files.push({
|
|
8915
|
-
from:
|
|
8938
|
+
from: config.mac.entitlementsInherit,
|
|
8916
8939
|
to: path8.join("other", "mac", "entitlementsInherit.mac.plist")
|
|
8917
8940
|
});
|
|
8918
8941
|
}
|
|
8919
|
-
if (
|
|
8942
|
+
if (config.mac.icon) {
|
|
8920
8943
|
files.push({
|
|
8921
|
-
from:
|
|
8922
|
-
to: path8.join("icons", "appIcon-mac" + path8.extname(
|
|
8944
|
+
from: config.mac.icon,
|
|
8945
|
+
to: path8.join("icons", "appIcon-mac" + path8.extname(config.mac.icon))
|
|
8923
8946
|
});
|
|
8924
8947
|
}
|
|
8925
|
-
if (
|
|
8948
|
+
if (config.mac.requirements) {
|
|
8926
8949
|
files.push({
|
|
8927
|
-
from:
|
|
8950
|
+
from: config.mac.requirements,
|
|
8928
8951
|
to: path8.join("other", "mac", "requirements.txt")
|
|
8929
8952
|
});
|
|
8930
8953
|
}
|
|
8931
8954
|
}
|
|
8932
|
-
if (
|
|
8933
|
-
if (
|
|
8955
|
+
if (config.mas) {
|
|
8956
|
+
if (config.mas.entitlements) {
|
|
8934
8957
|
files.push({
|
|
8935
|
-
from:
|
|
8958
|
+
from: config.mas.entitlements,
|
|
8936
8959
|
to: path8.join("other", "mac", "entitlements.mas.plist")
|
|
8937
8960
|
});
|
|
8938
8961
|
}
|
|
8939
|
-
if (
|
|
8962
|
+
if (config.mas.entitlementsInherit) {
|
|
8940
8963
|
files.push({
|
|
8941
|
-
from:
|
|
8964
|
+
from: config.mas.entitlementsInherit,
|
|
8942
8965
|
to: path8.join("other", "mac", "entitlementsInherit.mas.plist")
|
|
8943
8966
|
});
|
|
8944
8967
|
}
|
|
8945
|
-
if (
|
|
8968
|
+
if (config.mas.provisioningProfile) {
|
|
8946
8969
|
files.push({
|
|
8947
|
-
from:
|
|
8970
|
+
from: config.mas.provisioningProfile,
|
|
8948
8971
|
to: path8.join("other", "mac", "mas.provisionprofile")
|
|
8949
8972
|
});
|
|
8950
8973
|
}
|
|
8951
8974
|
}
|
|
8952
|
-
if (
|
|
8953
|
-
if (
|
|
8975
|
+
if (config.dmg) {
|
|
8976
|
+
if (config.dmg.background) {
|
|
8954
8977
|
files.push({
|
|
8955
|
-
from:
|
|
8978
|
+
from: config.dmg.background,
|
|
8956
8979
|
to: path8.join("other", "mac", "dmg-background.tiff")
|
|
8957
8980
|
});
|
|
8958
8981
|
}
|
|
8959
8982
|
}
|
|
8960
|
-
if (
|
|
8961
|
-
if (
|
|
8983
|
+
if (config.windows) {
|
|
8984
|
+
if (config.windows.icon) {
|
|
8962
8985
|
files.push({
|
|
8963
|
-
from:
|
|
8986
|
+
from: config.windows.icon,
|
|
8964
8987
|
to: path8.join(
|
|
8965
8988
|
"icons",
|
|
8966
|
-
"appIcon-windows" + path8.extname(
|
|
8989
|
+
"appIcon-windows" + path8.extname(config.windows.icon)
|
|
8967
8990
|
)
|
|
8968
8991
|
});
|
|
8969
8992
|
}
|
|
8970
|
-
if (
|
|
8993
|
+
if (config.windows.nsisInclude) {
|
|
8971
8994
|
files.push({
|
|
8972
|
-
from:
|
|
8995
|
+
from: config.windows.nsisInclude,
|
|
8973
8996
|
to: path8.join("other", "installer.nsh")
|
|
8974
8997
|
});
|
|
8975
8998
|
}
|
|
@@ -8978,15 +9001,15 @@ async function uploadApplicationSource({
|
|
|
8978
9001
|
files.push(...workspaceEntries);
|
|
8979
9002
|
}
|
|
8980
9003
|
return uploadToS3_default({
|
|
8981
|
-
bucket:
|
|
9004
|
+
bucket: config.bucket || void 0,
|
|
8982
9005
|
inputStream: await zip({
|
|
8983
9006
|
files,
|
|
8984
|
-
fileSizeLimit:
|
|
9007
|
+
fileSizeLimit: config.uploadSizeLimit,
|
|
8985
9008
|
onError: (e) => {
|
|
8986
9009
|
throw e;
|
|
8987
9010
|
},
|
|
8988
|
-
onProgress({ fs:
|
|
8989
|
-
totalBytes =
|
|
9011
|
+
onProgress({ fs: fs6 }) {
|
|
9012
|
+
totalBytes = fs6.totalBytes;
|
|
8990
9013
|
},
|
|
8991
9014
|
appPkgJson: effectiveAppPkgJson
|
|
8992
9015
|
}),
|
|
@@ -9002,7 +9025,7 @@ async function uploadApplicationSource({
|
|
|
9002
9025
|
}
|
|
9003
9026
|
async function exists(filePath) {
|
|
9004
9027
|
try {
|
|
9005
|
-
await
|
|
9028
|
+
await fs5.promises.access(filePath);
|
|
9006
9029
|
return true;
|
|
9007
9030
|
} catch {
|
|
9008
9031
|
return false;
|
|
@@ -9021,11 +9044,11 @@ async function runBuild({
|
|
|
9021
9044
|
updateState({ breakpointPlan: flags.breakpointPlan });
|
|
9022
9045
|
}
|
|
9023
9046
|
const primaryUserId = (_a2 = currentUser()) == null ? void 0 : _a2.uid;
|
|
9024
|
-
const { config
|
|
9047
|
+
const { config, unprocessedConfig } = getProjectConfig(configPath, {
|
|
9025
9048
|
build: flags
|
|
9026
9049
|
});
|
|
9027
|
-
const appId =
|
|
9028
|
-
const appPkgJson = getPackageJson_default({ config
|
|
9050
|
+
const appId = config.id;
|
|
9051
|
+
const appPkgJson = getPackageJson_default({ config });
|
|
9029
9052
|
const buildObserver = spyBuild();
|
|
9030
9053
|
buildObserver.onUpdate(({ build: build2 }) => updateState({ build: build2 }));
|
|
9031
9054
|
updateState({
|
|
@@ -9043,13 +9066,13 @@ async function runBuild({
|
|
|
9043
9066
|
appPkgName: appPkgJson.name,
|
|
9044
9067
|
appPkgProductName: appPkgJson.productName,
|
|
9045
9068
|
appVersion: appPkgJson.version,
|
|
9046
|
-
id:
|
|
9069
|
+
id: config.id,
|
|
9047
9070
|
onBuildFinishedWebhook: flags.onBuildFinishedWebhook,
|
|
9048
9071
|
projectConfig: unprocessedConfig,
|
|
9049
9072
|
shouldCodeSign: flags.shouldCodeSign !== false,
|
|
9050
9073
|
shouldRelease: false,
|
|
9051
9074
|
userId: primaryUserId,
|
|
9052
|
-
versionControlInfo: await getVersionControlInfo_default(
|
|
9075
|
+
versionControlInfo: await getVersionControlInfo_default(config.appPath),
|
|
9053
9076
|
introspect: flags.introspect,
|
|
9054
9077
|
breakpoints: (_b = flags.breakpointPlan) == null ? void 0 : _b.breakpoints,
|
|
9055
9078
|
idToken: await ((_c = currentUser()) == null ? void 0 : _c.getIdToken())
|
|
@@ -9072,7 +9095,7 @@ async function runBuild({
|
|
|
9072
9095
|
appId,
|
|
9073
9096
|
appPkgJson,
|
|
9074
9097
|
buildId,
|
|
9075
|
-
config
|
|
9098
|
+
config,
|
|
9076
9099
|
onProgress(progress, uploadedSize) {
|
|
9077
9100
|
const preparationState = {
|
|
9078
9101
|
preparationProgress: 0.05 + progress / 100 * 0.95,
|
|
@@ -9091,16 +9114,16 @@ async function runBuild({
|
|
|
9091
9114
|
logForCI("Kicking off build...");
|
|
9092
9115
|
try {
|
|
9093
9116
|
await postToFirebaseFunction("kickOffBuild", {
|
|
9094
|
-
appBuilderLibVersion:
|
|
9117
|
+
appBuilderLibVersion: config.appBuilderLibVersion,
|
|
9095
9118
|
appId,
|
|
9096
9119
|
appPkgName: appPkgJson.name,
|
|
9097
9120
|
appVersion: appPkgJson.version,
|
|
9098
9121
|
buildId,
|
|
9099
9122
|
idToken: await ((_d = currentUser()) == null ? void 0 : _d.getIdToken()),
|
|
9100
|
-
linuxImageVersion: (_e =
|
|
9101
|
-
nodeVersion:
|
|
9102
|
-
npmVersion:
|
|
9103
|
-
pnpmVersion:
|
|
9123
|
+
linuxImageVersion: (_e = config.linux) == null ? void 0 : _e.imageVersion,
|
|
9124
|
+
nodeVersion: config.nodeVersion,
|
|
9125
|
+
npmVersion: config.npmVersion,
|
|
9126
|
+
pnpmVersion: config.pnpmVersion,
|
|
9104
9127
|
sourceArchiveDetails,
|
|
9105
9128
|
userId: primaryUserId
|
|
9106
9129
|
});
|
|
@@ -9646,17 +9669,17 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
|
|
|
9646
9669
|
(0, import_react14.useEffect)(() => {
|
|
9647
9670
|
let firebaseUnsubscribe;
|
|
9648
9671
|
async function viewBuild() {
|
|
9649
|
-
let
|
|
9672
|
+
let config;
|
|
9650
9673
|
try {
|
|
9651
|
-
|
|
9674
|
+
config = getProjectConfig(configPath).config;
|
|
9652
9675
|
} catch (e) {
|
|
9653
9676
|
setState((previousState) => ({ ...previousState, error: e }));
|
|
9654
9677
|
return;
|
|
9655
9678
|
}
|
|
9656
|
-
const { id: userId } = await findAppUserId_default(
|
|
9679
|
+
const { id: userId } = await findAppUserId_default(config.id);
|
|
9657
9680
|
const subscribe = (buildId) => {
|
|
9658
9681
|
subscribeToBuild_default({
|
|
9659
|
-
appId:
|
|
9682
|
+
appId: config.id,
|
|
9660
9683
|
buildId,
|
|
9661
9684
|
onDataReceived: (data) => {
|
|
9662
9685
|
if (!data) {
|
|
@@ -9668,7 +9691,7 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
|
|
|
9668
9691
|
}
|
|
9669
9692
|
setState((prevState) => ({
|
|
9670
9693
|
...prevState,
|
|
9671
|
-
appId:
|
|
9694
|
+
appId: config.id,
|
|
9672
9695
|
build: data,
|
|
9673
9696
|
isLoading: false
|
|
9674
9697
|
}));
|
|
@@ -9681,7 +9704,7 @@ var ViewBuild = ({ commandUsed, id, configPath }) => {
|
|
|
9681
9704
|
if (id) {
|
|
9682
9705
|
subscribe(id);
|
|
9683
9706
|
} else {
|
|
9684
|
-
getLatestBuildId({ appId:
|
|
9707
|
+
getLatestBuildId({ appId: config.id, userId }).catch(onError).then((latestBuildId) => {
|
|
9685
9708
|
if (!latestBuildId) {
|
|
9686
9709
|
setState((previousState) => ({
|
|
9687
9710
|
...previousState,
|
|
@@ -10288,17 +10311,17 @@ var ViewBuilds = ({
|
|
|
10288
10311
|
...previousState,
|
|
10289
10312
|
isLoading: true
|
|
10290
10313
|
}));
|
|
10291
|
-
let
|
|
10314
|
+
let config;
|
|
10292
10315
|
try {
|
|
10293
|
-
|
|
10316
|
+
config = projectConfig || getProjectConfig(configPath).config;
|
|
10294
10317
|
} catch (e) {
|
|
10295
10318
|
setState((previousState) => ({ ...previousState, error: e }));
|
|
10296
10319
|
return;
|
|
10297
10320
|
}
|
|
10298
10321
|
const pageSize = count || 5;
|
|
10299
|
-
const user2 = await findAppUserId_default(
|
|
10322
|
+
const user2 = await findAppUserId_default(config.id);
|
|
10300
10323
|
getBuilds({
|
|
10301
|
-
appId:
|
|
10324
|
+
appId: config.id,
|
|
10302
10325
|
limit: pageSize + 1,
|
|
10303
10326
|
startAfter,
|
|
10304
10327
|
userId: user2.id
|
|
@@ -10309,7 +10332,7 @@ var ViewBuilds = ({
|
|
|
10309
10332
|
hasMoreToLoad: buildsResult.length > pageSize,
|
|
10310
10333
|
isInitialLoadComplete: true,
|
|
10311
10334
|
isLoading: false,
|
|
10312
|
-
projectConfig:
|
|
10335
|
+
projectConfig: config,
|
|
10313
10336
|
startAfter: null,
|
|
10314
10337
|
user: user2
|
|
10315
10338
|
};
|
|
@@ -12949,7 +12972,7 @@ var package_default2 = {
|
|
|
12949
12972
|
access: "public"
|
|
12950
12973
|
},
|
|
12951
12974
|
name: "@todesktop/cli",
|
|
12952
|
-
version: "1.19.0-
|
|
12975
|
+
version: "1.19.0-3",
|
|
12953
12976
|
license: "MIT",
|
|
12954
12977
|
author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
|
|
12955
12978
|
homepage: "https://todesktop.com/cli",
|
|
@@ -13034,7 +13057,7 @@ var package_default2 = {
|
|
|
13034
13057
|
},
|
|
13035
13058
|
devDependencies: {
|
|
13036
13059
|
"@todesktop/dev-config": "workspace:*",
|
|
13037
|
-
"@todesktop/shared": "
|
|
13060
|
+
"@todesktop/shared": "^7.193.0",
|
|
13038
13061
|
"@types/bunyan": "^1.8.11",
|
|
13039
13062
|
"@types/ink-testing-library": "^1.0.4",
|
|
13040
13063
|
"@types/is-ci": "^3.0.4",
|
|
@@ -13149,8 +13172,8 @@ async function continueBreakpoint({
|
|
|
13149
13172
|
ignoreExtendsErrors
|
|
13150
13173
|
}) {
|
|
13151
13174
|
const projectConfigFlags = ignoreExtendsErrors === true ? { build: { ignoreExtendsErrors: true } } : void 0;
|
|
13152
|
-
const { config
|
|
13153
|
-
const appId =
|
|
13175
|
+
const { config } = getProjectConfig(configPath, projectConfigFlags);
|
|
13176
|
+
const appId = config.id;
|
|
13154
13177
|
if (!buildId) {
|
|
13155
13178
|
throw new Error("A build ID is required when using --continue");
|
|
13156
13179
|
}
|
|
@@ -13193,7 +13216,21 @@ var configOption = new import_commander.Option(
|
|
|
13193
13216
|
}
|
|
13194
13217
|
return value;
|
|
13195
13218
|
});
|
|
13196
|
-
import_commander.program.name("todesktop").version(getCliVersion_default())
|
|
13219
|
+
import_commander.program.name("todesktop").version(getCliVersion_default()).option(
|
|
13220
|
+
"--config-dir <path>",
|
|
13221
|
+
"Custom directory for storing CLI configuration and credentials. Can also be set via TODESKTOP_CONFIG_DIR environment variable"
|
|
13222
|
+
).option(
|
|
13223
|
+
"--ephemeral",
|
|
13224
|
+
"Do not persist any configuration or credentials to disk. Useful for CI environments where credentials are provided via environment variables"
|
|
13225
|
+
).hook("preAction", (thisCommand) => {
|
|
13226
|
+
const opts = thisCommand.opts();
|
|
13227
|
+
if (opts.configDir) {
|
|
13228
|
+
setConfigDir(opts.configDir);
|
|
13229
|
+
}
|
|
13230
|
+
if (opts.ephemeral) {
|
|
13231
|
+
setEphemeralMode(true);
|
|
13232
|
+
}
|
|
13233
|
+
});
|
|
13197
13234
|
import_commander.program.command("build").description(
|
|
13198
13235
|
"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."
|
|
13199
13236
|
).option(
|
|
@@ -13221,7 +13258,7 @@ import_commander.program.command("build").description(
|
|
|
13221
13258
|
async ({
|
|
13222
13259
|
async,
|
|
13223
13260
|
codeSign,
|
|
13224
|
-
config
|
|
13261
|
+
config,
|
|
13225
13262
|
webhook,
|
|
13226
13263
|
ignoreExtendsErrors,
|
|
13227
13264
|
introspect,
|
|
@@ -13247,7 +13284,7 @@ import_commander.program.command("build").description(
|
|
|
13247
13284
|
await continueBreakpoint({
|
|
13248
13285
|
buildId: continueBuildId,
|
|
13249
13286
|
platform: resolvedPlatform,
|
|
13250
|
-
configPath:
|
|
13287
|
+
configPath: config,
|
|
13251
13288
|
ignoreExtendsErrors: ignoreExtendsErrors === true
|
|
13252
13289
|
});
|
|
13253
13290
|
} catch (err) {
|
|
@@ -13281,7 +13318,7 @@ import_commander.program.command("build").description(
|
|
|
13281
13318
|
breakpointPlan = resolution;
|
|
13282
13319
|
}
|
|
13283
13320
|
runCommand(BuildCommand, {
|
|
13284
|
-
configPath:
|
|
13321
|
+
configPath: config,
|
|
13285
13322
|
flags: {
|
|
13286
13323
|
exitAfterUploading: async === true,
|
|
13287
13324
|
shouldCodeSign: codeSign !== "false",
|
|
@@ -13298,9 +13335,9 @@ import_commander.program.command("builds").description("View your builds").argum
|
|
|
13298
13335
|
).option(
|
|
13299
13336
|
"--exit",
|
|
13300
13337
|
"Disable dynamic pagination and exit the process once the build data has been displayed"
|
|
13301
|
-
).action((id, { config
|
|
13338
|
+
).action((id, { config, count, exit, format, latest }) => {
|
|
13302
13339
|
runCommand(BuildsCommand_default, {
|
|
13303
|
-
configPath:
|
|
13340
|
+
configPath: config,
|
|
13304
13341
|
count,
|
|
13305
13342
|
exit,
|
|
13306
13343
|
format,
|
|
@@ -13311,16 +13348,16 @@ import_commander.program.command("builds").description("View your builds").argum
|
|
|
13311
13348
|
import_commander.program.command("logout").description("Logs you out").action(() => {
|
|
13312
13349
|
runCommand(LogoutCommand_default, null, { exitIfOutOfDate: false });
|
|
13313
13350
|
});
|
|
13314
|
-
import_commander.program.command("release").description("Release a build").argument("[id]", "A specific build ID to release").option("--force", "Skips interactive confirmation step").option("--latest", "Release the latest build").addOption(configOption).action((id, { config
|
|
13351
|
+
import_commander.program.command("release").description("Release a build").argument("[id]", "A specific build ID to release").option("--force", "Skips interactive confirmation step").option("--latest", "Release the latest build").addOption(configOption).action((id, { config, force, latest }) => {
|
|
13315
13352
|
runCommand(ReleaseCommand, {
|
|
13316
|
-
configPath:
|
|
13353
|
+
configPath: config,
|
|
13317
13354
|
shouldConfirm: !force,
|
|
13318
13355
|
buildId: latest ? "latest" : id
|
|
13319
13356
|
});
|
|
13320
13357
|
});
|
|
13321
|
-
import_commander.program.command("smoke-test").description("Check whether the build works and can be successfully updated").argument("[id]", "A specific build ID to test").option("--latest", "Release the latest build").addOption(configOption).action((id, { config
|
|
13358
|
+
import_commander.program.command("smoke-test").description("Check whether the build works and can be successfully updated").argument("[id]", "A specific build ID to test").option("--latest", "Release the latest build").addOption(configOption).action((id, { config, latest }) => {
|
|
13322
13359
|
runCommand(SmokeTestCommand, {
|
|
13323
|
-
configPath:
|
|
13360
|
+
configPath: config,
|
|
13324
13361
|
buildId: latest ? "latest" : id
|
|
13325
13362
|
});
|
|
13326
13363
|
});
|