Upgrade deps (#1213)

* refactor dependencies

* upgrade forge

* refresh yarn.lock

* fix test
This commit is contained in:
an-lee
2024-11-28 16:21:28 +08:00
committed by GitHub
parent f0e7fd7c38
commit 5ab0ecf9a2
10 changed files with 627 additions and 669 deletions

View File

@@ -1,13 +1,9 @@
import { ipcMain } from "electron";
import path from "path";
import log from "@main/logger";
import url from "url";
import { Sequelize, DataType } from "sequelize-typescript";
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");
const logger = log.scope("camdict");

View File

@@ -42,14 +42,12 @@ import {
} from "./handlers";
import os from "os";
import path from "path";
import url from "url";
import { i18n } from "@main/i18n";
import { UserSettingKeyEnum } from "@/types/enums";
import log from "@main/logger";
import fs from "fs-extra";
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __dirname = import.meta.dirname;
const logger = log.scope("DB");
const db = {

View File

@@ -33,13 +33,10 @@ Echogarden.setGlobalOption(
"https://hf-mirror.com/echogarden/echogarden-packages/resolve/main/"
);
const __filename = url.fileURLToPath(import.meta.url);
/*
* sample files will be in /app.asar.unpacked instead of /app.asar
*/
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");
const logger = log.scope("echogarden");
class EchogardenWrapper {

View File

@@ -16,10 +16,7 @@ import { enjoyUrlToPath, pathToEnjoyUrl } from "@main/utils";
*/
Ffmpeg.setFfmpegPath(ffmpegPath.replace("app.asar", "app.asar.unpacked"));
Ffmpeg.setFfprobePath(ffprobePath.replace("app.asar", "app.asar.unpacked"));
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");
const logger = log.scope("ffmpeg");
export default class FfmpegWrapper {

View File

@@ -18,7 +18,6 @@ import { REPO_URL, WS_URL } from "@/constants";
import { AudibleProvider, TedProvider, YoutubeProvider } from "@main/providers";
import Ffmpeg from "@main/ffmpeg";
import { Waveform } from "./waveform";
import url from "url";
import echogarden from "./echogarden";
import camdict from "./camdict";
import dict from "./dict";
@@ -26,10 +25,8 @@ import mdict from "./mdict";
import decompresser from "./decompresser";
import { UserSetting } from "@main/db/models";
import { platform } from "os";
import { t } from "i18next";
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __dirname = import.meta.dirname;
const logger = log.scope("window");

View File

@@ -6,15 +6,10 @@ import os from "os";
import log from "@main/logger";
import snakeCase from "lodash/snakeCase";
import settings from "@main/settings";
import url from "url";
import mainWin from "@main/window";
const __filename = url.fileURLToPath(import.meta.url);
// youtubedr bin file will be in /app.asar.unpacked instead of /app.asar
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");
const logger = log.scope("YOUTUBEDR");