@todesktop/cli 1.12.0 → 1.12.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 CHANGED
@@ -951,6 +951,12 @@ Default: Default to the common name from your code signing certificate.
951
951
 
952
952
  The publisher name, exactly as in your code signing certificate. Several names can be provided. Defaults to common name from your code signing certificate. You should typically not include this property in your configuration unless you wish to transition to a new certificate in the future.
953
953
 
954
+ ### `appBuilderLibVersion` - (optional) string
955
+
956
+ Example: `22.14.13`.
957
+
958
+ The version of app-builder-lib that ToDesktop should use for building your app. This can be useful if you need to use a specific version that includes certain features or fixes.
959
+
954
960
  ## Build lifecycle hooks (package.json scripts)
955
961
 
956
962
  Sometimes you want to do something before or during the build process. For example, you might want to run a script before the build starts, or you might want to run a script after the files have been packaged. Our lifecycle hooks provide a way to do this.
@@ -1195,6 +1201,14 @@ Now, when we build your app on ToDesktop servers, it will also run your custom `
1195
1201
 
1196
1202
  ## Changelog
1197
1203
 
1204
+ ### v1.12.2
1205
+
1206
+ - Fix: Update `appFiles` to not error when no `*.js` files are found (but `*.ts` files are present)
1207
+
1208
+ ### v1.12.1
1209
+
1210
+ - Remove sensitive data when logging to `main.log`
1211
+
1198
1212
  ### v1.12.0
1199
1213
 
1200
1214
  - Add support for custom `updateUrlBase` in config to specify a custom auto-update URL
package/dist/cli.js CHANGED
@@ -50,6 +50,40 @@ var os = __toESM(require("os"));
50
50
  var path = __toESM(require("path"));
51
51
  var Sentry = __toESM(require("@sentry/node"));
52
52
  var logger;
53
+ var SENSITIVE_FIELD_KEY_SUBSTRINGS = [
54
+ "token",
55
+ "password",
56
+ "secret",
57
+ "credentials",
58
+ "environmentVariable"
59
+ ];
60
+ function isJWT(str) {
61
+ const jwtPattern = /^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/;
62
+ return typeof str === "string" && str.length > 20 && jwtPattern.test(str);
63
+ }
64
+ function sanitizeFields(obj) {
65
+ if (!obj || typeof obj !== "object") {
66
+ if (typeof obj === "string" && isJWT(obj)) {
67
+ return "[REDACTED JWT]";
68
+ }
69
+ return obj;
70
+ }
71
+ const copy = Array.isArray(obj) ? [...obj] : { ...obj };
72
+ for (const key of Object.keys(copy)) {
73
+ const lowerKey = key.toLowerCase();
74
+ const value = copy[key];
75
+ if (SENSITIVE_FIELD_KEY_SUBSTRINGS.some(
76
+ (substring) => lowerKey.includes(substring) && !lowerKey.startsWith("$")
77
+ )) {
78
+ copy[key] = "[REDACTED]";
79
+ } else if (typeof value === "string" && isJWT(value)) {
80
+ copy[key] = "[REDACTED JWT]";
81
+ } else if (typeof value === "object") {
82
+ copy[key] = sanitizeFields(value);
83
+ }
84
+ }
85
+ return copy;
86
+ }
53
87
  try {
54
88
  const name = "todesktop-cli";
55
89
  let parentDirectory;
@@ -72,7 +106,9 @@ try {
72
106
  fs.mkdirSync(parentDirectory, { recursive: true });
73
107
  logger = import_bunyan.default.createLogger({
74
108
  name,
75
- src: true,
109
+ serializers: {
110
+ scrub: (data) => sanitizeFields(data)
111
+ },
76
112
  streams: [
77
113
  {
78
114
  level: "debug",
@@ -462,7 +498,6 @@ var isPlatformBuildRunning = (platformBuild) => {
462
498
  var import_jsx_runtime3 = require("react/jsx-runtime");
463
499
  var logForCIThrottled = (0, import_lodash.default)(logForCI_default, 60 * 1e3, { trailing: true });
464
500
  var BuildProgress = ({ build, onBuildFailure }) => {
465
- logger_default.debug("BuildProgress component: render");
466
501
  const exit = useExit_default();
467
502
  const [{ hasKickedOff }, setState] = (0, import_react2.useState)({
468
503
  hasKickedOff: false
@@ -814,7 +849,6 @@ var MainLayout = ({
814
849
  commandUsed,
815
850
  hasBuildEverFailed
816
851
  }) => {
817
- logger_default.debug("MainLayout component: render");
818
852
  const onInput = useInput_default();
819
853
  const { isRawModeSupported } = (0, import_ink10.useStdin)();
820
854
  const [
@@ -953,7 +987,10 @@ var import_pretty_bytes = __toESM(require("pretty-bytes"));
953
987
  var import_axios = __toESM(require("axios"));
954
988
  var { TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE } = getEnvironmentVariables_default();
955
989
  async function postToFirebaseFunction_default(functionName, body = {}, config2 = {}) {
956
- logger_default.debug({ functionName, body, config: config2 }, "postToFirebaseFunction");
990
+ logger_default.debug(
991
+ { scrub: { functionName, body, config: config2 } },
992
+ "postToFirebaseFunction"
993
+ );
957
994
  try {
958
995
  const response = await import_axios.default.post(
959
996
  `${TODESKTOP_CLI_FIREBASE_FUNCTIONS_BASE}${functionName}`,
@@ -961,7 +998,7 @@ async function postToFirebaseFunction_default(functionName, body = {}, config2 =
961
998
  config2
962
999
  );
963
1000
  logger_default.debug(
964
- { responseData: response.data },
1001
+ { scrub: { responseData: response.data } },
965
1002
  "postToFirebaseFunction: success"
966
1003
  );
967
1004
  return response.data;
@@ -2448,9 +2485,11 @@ var getAppFiles = async (globsInput, appPath, appPkgJson) => {
2448
2485
  }
2449
2486
  if (!absolutePaths || !absolutePaths.length) {
2450
2487
  throw new Error("No files found to upload");
2451
- } else if (!absolutePaths.filter((absolutePath) => absolutePath.endsWith(".js")).length) {
2488
+ } else if (!absolutePaths.filter(
2489
+ (absolutePath) => absolutePath.endsWith(".js") || absolutePath.endsWith(".ts")
2490
+ ).length) {
2452
2491
  throw new Error(
2453
- `No .js files found to upload (${absolutePaths[0]}). There's likely an issue with the appFiles option. Learn more at https://www.npmjs.com/package/@todesktop/cli#appfiles----optional-array-of-glob-patterns. If this is not the case, please contact us.`
2492
+ `No .js/.ts files found to upload (${absolutePaths[0]}). There's likely an issue with the appFiles option. Learn more at https://www.npmjs.com/package/@todesktop/cli#appfiles----optional-array-of-glob-patterns. If this is not the case, please contact us.`
2454
2493
  );
2455
2494
  } else {
2456
2495
  let mainFilePath = appPath;
@@ -2483,11 +2522,13 @@ async function uploadApplicationSource({
2483
2522
  var _a;
2484
2523
  logger_default.debug(
2485
2524
  {
2486
- appId,
2487
- appPkgJson,
2488
- buildId,
2489
- config: config2,
2490
- onProgress
2525
+ scrub: {
2526
+ appId,
2527
+ appPkgJson,
2528
+ buildId,
2529
+ config: config2,
2530
+ onProgress
2531
+ }
2491
2532
  },
2492
2533
  "uploadApplicationSource"
2493
2534
  );
@@ -5466,7 +5507,7 @@ var package_default = {
5466
5507
  access: "public"
5467
5508
  },
5468
5509
  name: "@todesktop/cli",
5469
- version: "1.12.0-1",
5510
+ version: "1.12.1",
5470
5511
  license: "MIT",
5471
5512
  author: "Dave Jeffery <dave@todesktop.com> (http://www.todesktop.com/)",
5472
5513
  homepage: "https://todesktop.com/cli",