Cleanup Electron App + Dependency Update (#139)

* electron: clean-up / remove unused code in main process, including:
- remove native plugin init (no longer supported)
- remove auto-js-ipfs (used in render process)
- remove ipfs handling logic (handled in render process)
- use custom file2:// scheme for loading files, instead of custom prefix
- proxyLive supports POST requests, using original UA (if set, for archiveweb.page)
- webpack: remove unused __IPFS_CORE_URL__
- ci: add lint check

* dependency update:
- update to wabac.js 2.13.15 for latest auto-js-ipfs (2.1.0) and wombat (3.3.13)
- update to electron 22.0
- update webpack + electron updater to latest

* bump to 1.7.8
This commit is contained in:
Ilya Kreymer
2022-12-07 13:33:36 -08:00
committed by GitHub
parent 591753d6d8
commit e6f837df13
11 changed files with 931 additions and 887 deletions
-14
View File
@@ -7,11 +7,6 @@ const CopyPlugin = require("copy-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const package_json = require("./package.json");
// fake url used in app to serve files
// can not use custom scheme due to service worker issues
const APP_FILE_SERVE_PREFIX = "http://files.replayweb.page/";
//const APP_FILE_SERVE_PREFIX = "file://files.replayweb.page";
// helper proxy URL, run locally for app
const HELPER_PROXY = "https://helper-proxy.webrecorder.workers.dev";
@@ -66,9 +61,7 @@ const electronMainConfig = (/*env, argv*/) => {
},
plugins: [
new webpack.DefinePlugin({
__APP_FILE_SERVE_PREFIX__ : JSON.stringify(APP_FILE_SERVE_PREFIX),
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY),
__IPFS_CORE_URL__: JSON.stringify("")
}),
new webpack.BannerPlugin(BANNER_TEXT),
new CopyPlugin({
@@ -98,12 +91,6 @@ const electronPreloadConfig = (/*env, argv*/) => {
optimization,
plugins: [
new webpack.BannerPlugin(BANNER_TEXT),
// this needs to be defined, but not actually used, as electron app uses
// ipfs-core from node
new webpack.DefinePlugin({
__IPFS_CORE_URL__: JSON.stringify("")
}),
]
};
};
@@ -152,7 +139,6 @@ const browserConfig = (/*env, argv*/) => {
new MiniCssExtractPlugin(),
new webpack.DefinePlugin({
__SW_NAME__: JSON.stringify("sw.js"),
__APP_FILE_SERVE_PREFIX__ : JSON.stringify(APP_FILE_SERVE_PREFIX),
__HELPER_PROXY__ : JSON.stringify(HELPER_PROXY),
__GDRIVE_CLIENT_ID__ : JSON.stringify(GDRIVE_CLIENT_ID),
__VERSION__: JSON.stringify(package_json.version),