Bladeren bron

Major version update of Electron

And other surrounding packages.
Manav Rathi 1 jaar geleden
bovenliggende
commit
c3dfa46514
3 gewijzigde bestanden met toevoegingen van 88 en 42 verwijderingen
  1. 55 2
      desktop/docs/dependencies.md
  2. 4 4
      desktop/package.json
  3. 29 36
      desktop/yarn.lock

+ 55 - 2
desktop/docs/dependencies.md

@@ -27,7 +27,7 @@ There is also a third environment that gets temporarily created:
 -   The [preload script](../src/preload.ts) acts as a gateway between the _main_
     and the _renderer_ process. It runs in its own isolated environment.
 
-### electron-builder
+### Packaging
 
 [Electron Builder](https://www.electron.build) is used for packaging the app for
 distribution.
@@ -36,12 +36,17 @@ During the build it uses
 [electron-builder-notarize](https://github.com/karaggeorge/electron-builder-notarize)
 to notarize the macOS binary.
 
+### Updates
+
 [electron-updater](https://www.electron.build/auto-update#debugging), while a
 separate package, is also a part of Electron Builder. It provides an alternative
 to Electron's built in auto updater, with a more flexible API. It supports auto
 updates for the DMG, AppImage, DEB, RPM and NSIS packages.
 
-### electron-log
+[compare-versions](https://github.com/omichelsen/compare-versions) is used for
+semver comparisons when we decide when to trigger updates.
+
+### Logging
 
 [electron-log](https://github.com/megahertz/electron-log) is used for logging.
 Specifically, it allows us to log to a file (in addition to the console of the
@@ -54,6 +59,18 @@ This spins up a server for serving files using a protocol handler inside our
 Electron process. This allows us to directly use the output produced by
 `next build` for loading into our renderer process.
 
+### Others
+
+* [any-shell-escape](https://github.com/boazy/any-shell-escape) is for
+  escaping shell commands before we execute them (e.g. say when invoking the
+  embedded ffmpeg CLI).
+
+* [auto-launch](https://github.com/Teamwork/node-auto-launch) is for
+  automatically starting our app on login, if the user so wishes.
+
+* [electron-store](https://github.com/sindresorhus/electron-store) is used for
+  persisting user preferences and other arbitrary data.
+
 ## Dev
 
 See [web/docs/dependencies#DX](../../web/docs/dependencies.md#dev) for the
@@ -68,3 +85,39 @@ Some extra ones specific to the code here are:
 * [shx](https://github.com/shelljs/shx) for providing a portable way to use Unix
   commands in our `package.json` scripts. This allows us to use the same
   commands (like `ln`) across different platforms like Linux and Windows.
+
+## Functionality
+
+### Conversion
+
+The main tool we use is for arbitrary conversions is FFMPEG. To bundle a
+(platform specific) static binary of ffmpeg with our app, we use
+[ffmpeg-static](https://github.com/eugeneware/ffmpeg-static).
+
+> There is a significant (~20x) speed difference between using the compiled
+> FFMPEG binary and using the WASM one (that our renderer process already has).
+> Which is why we bundle it to speed up operations on the desktop app.
+
+In addition, we also bundle a static Linux binary of imagemagick in our extra
+resources (`build`) folder. This is used for thumbnail generation on Linux.
+
+On macOS, we use the `sips` CLI tool for conversion, but that is already
+available on the host machine, and is not bundled with our app.
+
+### Watch Folders
+
+[chokidar](https://github.com/paulmillr/chokidar) is used as a file system
+watcher for the watch folders functionality.
+
+### AI/ML
+
+* [onnxruntime-node](https://github.com/Microsoft/onnxruntime)
+* html-entities is used by the bundled clip-bpe-ts.
+* GGML binaries are bundled
+* We also use [jpeg-js](https://github.com/jpeg-js/jpeg-js#readme) for
+  conversion of all images to JPEG before processing.
+
+## ZIP
+
+[node-stream-zip](https://github.com/antelle/node-stream-zip) is used for
+reading of large ZIP files (e.g. during imports of Google Takeout ZIPs).

+ 4 - 4
desktop/package.json

@@ -24,9 +24,9 @@
         "auto-launch": "^5.0",
         "chokidar": "^3.6",
         "compare-versions": "^6.1",
-        "electron-log": "^4.3.5",
+        "electron-log": "^5.1",
         "electron-store": "^8.2",
-        "electron-updater": "^4.3.8",
+        "electron-updater": "^6.1",
         "ffmpeg-static": "^5.2",
         "html-entities": "^2.5",
         "jpeg-js": "^0.4",
@@ -40,8 +40,8 @@
         "@typescript-eslint/eslint-plugin": "^7",
         "@typescript-eslint/parser": "^7",
         "concurrently": "^8",
-        "electron": "^25.8.4",
-        "electron-builder": "^24.6.4",
+        "electron": "^29",
+        "electron-builder": "^24",
         "electron-builder-notarize": "^1.5",
         "eslint": "^8",
         "prettier": "^3",

+ 29 - 36
desktop/yarn.lock

@@ -302,7 +302,7 @@
   resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"
   integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==
 
-"@types/node@*":
+"@types/node@*", "@types/node@^20.9.0":
   version "20.11.30"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f"
   integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==
@@ -314,13 +314,6 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b"
   integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==
 
-"@types/node@^18.11.18":
-  version "18.19.26"
-  resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.26.tgz#18991279d0a0e53675285e8cf4a0823766349729"
-  integrity sha512-+wiMJsIwLOYCvUqSdKTrfkS8mpTp+MPINe6+Np4TAGFWWRWiBQ5kSq9nZGCSPkzx9mvT+uEukzpX4MOSCydcvw==
-  dependencies:
-    undici-types "~5.26.4"
-
 "@types/normalize-package-data@^2.4.0":
   version "2.4.4"
   resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901"
@@ -341,11 +334,6 @@
   dependencies:
     "@types/node" "*"
 
-"@types/semver@^7.3.6":
-  version "7.3.10"
-  resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73"
-  integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw==
-
 "@types/semver@^7.5.0":
   version "7.5.8"
   resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
@@ -733,12 +721,12 @@ buffer@^5.1.0:
     base64-js "^1.3.1"
     ieee754 "^1.1.13"
 
-builder-util-runtime@8.9.2:
-  version "8.9.2"
-  resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.9.2.tgz#a9669ae5b5dcabfe411ded26678e7ae997246c28"
-  integrity sha512-rhuKm5vh7E0aAmT6i8aoSfEjxzdYEFX7zDApK+eNgOhjofnWb74d9SRJv0H/8nsgOkos0TZ4zxW0P8J4N7xQ2A==
+builder-util-runtime@9.2.3:
+  version "9.2.3"
+  resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-9.2.3.tgz#0a82c7aca8eadef46d67b353c638f052c206b83c"
+  integrity sha512-FGhkqXdFFZ5dNC4C+yuQB9ak311rpGAw+/ASz8ZdxwODCv1GGMWgLDeofRkdi0F3VCHQEWy/aXcJQozx2nOPiw==
   dependencies:
-    debug "^4.3.2"
+    debug "^4.3.4"
     sax "^1.2.4"
 
 builder-util-runtime@9.2.4:
@@ -1161,7 +1149,7 @@ electron-builder-notarize@^1.5:
     js-yaml "^3.14.0"
     read-pkg-up "^7.0.0"
 
-electron-builder@^24.6.4:
+electron-builder@^24:
   version "24.13.3"
   resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-24.13.3.tgz#c506dfebd36d9a50a83ee8aa32d803d83dbe4616"
   integrity sha512-yZSgVHft5dNVlo31qmJAe4BVKQfFdwpRw7sFp1iQglDRCDD6r22zfRJuZlhtB5gp9FHUxCMEoWGq10SkCnMAIg==
@@ -1178,10 +1166,10 @@ electron-builder@^24.6.4:
     simple-update-notifier "2.0.0"
     yargs "^17.6.2"
 
-electron-log@^4.3.5:
-  version "4.4.8"
-  resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-4.4.8.tgz#fcb9f714dbcaefb6ac7984c4683912c74730248a"
-  integrity sha512-QQ4GvrXO+HkgqqEOYbi+DHL7hj5JM+nHi/j+qrN9zeeXVKy8ZABgbu4CnG+BBqDZ2+tbeq9tUC4DZfIWFU5AZA==
+electron-log@^5.1:
+  version "5.1.2"
+  resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-5.1.2.tgz#fb40ad7f4ae694dd0e4c02c662d1a65c03e1243e"
+  integrity sha512-Cpg4hAZ27yM9wzE77c4TvgzxzavZ+dVltCczParXN+Vb3jocojCSAuSMCVOI9fhFuuOR+iuu3tZLX1cu0y0kgQ==
 
 electron-notarize@^1.1.1:
   version "1.2.2"
@@ -1212,27 +1200,27 @@ electron-store@^8.2:
     conf "^10.2.0"
     type-fest "^2.17.0"
 
-electron-updater@^4.3.8:
-  version "4.6.5"
-  resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-4.6.5.tgz#e9a75458bbfd6bb41a58a829839e150ad2eb2d3d"
-  integrity sha512-kdTly8O9mSZfm9fslc1mnCY+mYOeaYRy7ERa2Fed240u01BKll3aiupzkd07qKw69KvhBSzuHroIW3mF0D8DWA==
+electron-updater@^6.1:
+  version "6.1.8"
+  resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-6.1.8.tgz#17637bca165322f4e526b13c99165f43e6f697d8"
+  integrity sha512-hhOTfaFAd6wRHAfUaBhnAOYc+ymSGCWJLtFkw4xJqOvtpHmIdNHnXDV9m1MHC+A6q08Abx4Ykgyz/R5DGKNAMQ==
   dependencies:
-    "@types/semver" "^7.3.6"
-    builder-util-runtime "8.9.2"
-    fs-extra "^10.0.0"
+    builder-util-runtime "9.2.3"
+    fs-extra "^10.1.0"
     js-yaml "^4.1.0"
     lazy-val "^1.0.5"
     lodash.escaperegexp "^4.1.2"
     lodash.isequal "^4.5.0"
-    semver "^7.3.5"
+    semver "^7.3.8"
+    tiny-typed-emitter "^2.1.0"
 
-electron@^25.8.4:
-  version "25.9.8"
-  resolved "https://registry.yarnpkg.com/electron/-/electron-25.9.8.tgz#7c125ccbddad02861736275b0d4a387c59a91469"
-  integrity sha512-PGgp6PH46QVENHuAHc2NT1Su8Q1qov7qIl2jI5tsDpTibwV2zD8539AeWBQySeBU4dhbj9onIl7+1bXQ0wefBg==
+electron@^29:
+  version "29.1.5"
+  resolved "https://registry.yarnpkg.com/electron/-/electron-29.1.5.tgz#b745b4d201c1ac9f84d6aa034126288dde34d5a1"
+  integrity sha512-1uWGRw/ffA62lcrklxGUgVxVtOHojsg/nwsYr+/F9cVjipZJn8iPv/ABGIIexhmUqWcho8BqfTJ4osCBa29gBg==
   dependencies:
     "@electron/get" "^2.0.0"
-    "@types/node" "^18.11.18"
+    "@types/node" "^20.9.0"
     extract-zip "^2.0.1"
 
 emoji-regex@^8.0.0:
@@ -2994,6 +2982,11 @@ text-table@^0.2.0:
   resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
   integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
 
+tiny-typed-emitter@^2.1.0:
+  version "2.1.0"
+  resolved "https://registry.yarnpkg.com/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz#b3b027fdd389ff81a152c8e847ee2f5be9fad7b5"
+  integrity sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==
+
 tmp-promise@^3.0.2:
   version "3.0.3"
   resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.3.tgz#60a1a1cc98c988674fcbfd23b6e3367bdeac4ce7"