diff --git a/packages/main/package.json b/packages/main/package.json index 3021033d..1fd303ff 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -2,6 +2,7 @@ "name": "main", "version": "0.1.0", "description": "在线视频下载器", + "type": "module", "main": "main/index.js", "scripts": { "postinstall": "electron-rebuild -f -w", @@ -21,6 +22,7 @@ "devDependencies": { "@electron/rebuild": "^3.6.0", "@rushstack/eslint-patch": "^1.10.3", + "@types/electron-devtools-installer": "^2.2.5", "@types/fs-extra": "^11.0.4", "@types/gulp": "^4.0.17", "@types/lodash": "^4.17.4", diff --git a/packages/main/src/app.ts b/packages/main/src/app.ts index 54f9527b..67f48d4e 100644 --- a/packages/main/src/app.ts +++ b/packages/main/src/app.ts @@ -1,18 +1,18 @@ import { inject, injectable } from "inversify"; -import { DownloadStatus } from "./interfaces"; -import { TYPES } from "./types"; +import { DownloadStatus } from "./interfaces.ts"; +import { TYPES } from "./types.ts"; import { Menu, Tray, app, nativeImage, nativeTheme } from "electron"; import TrayIcon from "./tray-icon.png"; import path from "path"; -import MainWindow from "./windows/MainWindow"; -import WebviewService from "./services/WebviewService"; -import VideoRepository from "./repository/VideoRepository"; -import ElectronDevtools from "./vendor/ElectronDevtools"; -import ElectronStore from "./vendor/ElectronStore"; -import ElectronUpdater from "./vendor/ElectronUpdater"; -import TypeORM from "./vendor/TypeORM"; -import ProtocolService from "./core/protocol"; -import IpcHandlerService from "./core/ipc"; +import MainWindow from "./windows/MainWindow.ts"; +import WebviewService from "./services/WebviewService.ts"; +import VideoRepository from "./repository/VideoRepository.ts"; +import ElectronDevtools from "./vendor/ElectronDevtools.ts"; +import ElectronStore from "./vendor/ElectronStore.ts"; +import ElectronUpdater from "./vendor/ElectronUpdater.ts"; +import TypeORM from "./vendor/TypeORM.ts"; +import ProtocolService from "./core/protocol.ts"; +import IpcHandlerService from "./core/ipc.ts"; @injectable() export default class ElectronApp { diff --git a/packages/main/src/controller/DownloadController.ts b/packages/main/src/controller/DownloadController.ts index 0362cb14..5cd09311 100644 --- a/packages/main/src/controller/DownloadController.ts +++ b/packages/main/src/controller/DownloadController.ts @@ -1,19 +1,19 @@ import { IpcMainEvent } from "electron/main"; import { inject, injectable } from "inversify"; -import { handle } from "../helper"; +import { handle } from "../helper/index.ts"; import { type Controller, DownloadItem, DownloadItemPagination, Task, DownloadStatus, -} from "../interfaces"; -import { TYPES } from "../types"; -import MainWindow from "../windows/MainWindow"; -import ElectronStore from "../vendor/ElectronStore"; -import DownloadService from "../services/DownloadService"; -import VideoRepository from "../repository/VideoRepository"; -import WebviewService from "../services/WebviewService"; +} from "../interfaces.ts"; +import { TYPES } from "../types.ts"; +import MainWindow from "../windows/MainWindow.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import DownloadService from "../services/DownloadService.ts"; +import VideoRepository from "../repository/VideoRepository.ts"; +import WebviewService from "../services/WebviewService.ts"; @injectable() export default class DownloadController implements Controller { diff --git a/packages/main/src/controller/HomeController.ts b/packages/main/src/controller/HomeController.ts index 417f9d1c..68321931 100644 --- a/packages/main/src/controller/HomeController.ts +++ b/packages/main/src/controller/HomeController.ts @@ -8,21 +8,21 @@ import { shell, clipboard, } from "electron"; -import { Favorite } from "../entity/Favorite"; -import { convertToAudio, db, workspace } from "../helper"; +import { Favorite } from "../entity/Favorite.ts"; +import { convertToAudio, db, workspace } from "../helper/index.ts"; import { inject, injectable } from "inversify"; -import { AppStore, EnvPath } from "../main"; +import { AppStore, EnvPath } from "../main.ts"; import path from "path"; -import { handle, getLocalIP } from "../helper"; -import { type Controller } from "../interfaces"; -import { TYPES } from "../types"; +import { handle, getLocalIP } from "../helper/index.ts"; +import { type Controller } from "../interfaces.ts"; +import { TYPES } from "../types.ts"; import fs from "fs-extra"; -import MainWindow from "../windows/MainWindow"; -import BrowserWindow from "../windows/BrowserWindow"; -import ElectronStore from "../vendor/ElectronStore"; -import WebviewService from "../services/WebviewService"; -import FavoriteRepository from "../repository/FavoriteRepository"; -import VideoRepository from "../repository/VideoRepository"; +import MainWindow from "../windows/MainWindow.ts"; +import BrowserWindow from "../windows/BrowserWindow.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import WebviewService from "../services/WebviewService.ts"; +import FavoriteRepository from "../repository/FavoriteRepository.ts"; +import VideoRepository from "../repository/VideoRepository.ts"; @injectable() export default class HomeController implements Controller { diff --git a/packages/main/src/controller/WebviewController.ts b/packages/main/src/controller/WebviewController.ts index ba2c3d92..071a72c7 100644 --- a/packages/main/src/controller/WebviewController.ts +++ b/packages/main/src/controller/WebviewController.ts @@ -5,12 +5,12 @@ import { MenuItemConstructorOptions, } from "electron"; import { inject, injectable } from "inversify"; -import { handle } from "../helper"; -import { type Controller } from "../interfaces"; -import { TYPES } from "../types"; -import WebviewService from "../services/WebviewService"; -import ElectronStore from "../vendor/ElectronStore"; -import { SniffingHelper } from "../services/SniffingHelperService"; +import { handle } from "../helper/index.ts"; +import { type Controller } from "../interfaces.ts"; +import { TYPES } from "../types.ts"; +import WebviewService from "../services/WebviewService.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import { SniffingHelper } from "../services/SniffingHelperService.ts"; @injectable() export default class WebviewController implements Controller { diff --git a/packages/main/src/core/ipc.ts b/packages/main/src/core/ipc.ts index 5a6ee55a..ac349190 100644 --- a/packages/main/src/core/ipc.ts +++ b/packages/main/src/core/ipc.ts @@ -1,9 +1,9 @@ import { ipcMain } from "electron"; import { inject, injectable, multiInject } from "inversify"; -import { Controller } from "../interfaces"; -import { TYPES } from "../types"; -import ElectronLogger from "../vendor/ElectronLogger"; -import { error, success } from "../helper/utils"; +import { Controller } from "../interfaces.ts"; +import { TYPES } from "../types.ts"; +import ElectronLogger from "../vendor/ElectronLogger.ts"; +import { error, success } from "../helper/utils.ts"; @injectable() export default class IpcHandlerService { diff --git a/packages/main/src/core/protocol.ts b/packages/main/src/core/protocol.ts index 8088064f..f9293138 100644 --- a/packages/main/src/core/protocol.ts +++ b/packages/main/src/core/protocol.ts @@ -4,7 +4,7 @@ import { pathExists, readFile } from "fs-extra"; import { injectable } from "inversify"; import { join } from "path"; import { URL } from "url"; -import { defaultScheme } from "../helper"; +import { defaultScheme } from "../helper/index.ts"; import mime from "mime-types"; @injectable() diff --git a/packages/main/src/entity/Video.ts b/packages/main/src/entity/Video.ts index 552565d5..137b65c2 100644 --- a/packages/main/src/entity/Video.ts +++ b/packages/main/src/entity/Video.ts @@ -1,4 +1,4 @@ -import { DownloadStatus, DownloadType } from "../interfaces"; +import { DownloadStatus, DownloadType } from "../interfaces.ts"; import { Column, CreateDateColumn, diff --git a/packages/main/src/helper/ffmpeg.ts b/packages/main/src/helper/ffmpeg.ts index 37a6dbb3..309fc03d 100644 --- a/packages/main/src/helper/ffmpeg.ts +++ b/packages/main/src/helper/ffmpeg.ts @@ -1,5 +1,5 @@ import { spawn } from "child_process"; -import { ffmpegPath } from "./variables"; +import { ffmpegPath } from "./variables.ts"; export const convertToAudio = async ( input: string, diff --git a/packages/main/src/helper/index.ts b/packages/main/src/helper/index.ts index 75ffeffa..d2694564 100644 --- a/packages/main/src/helper/index.ts +++ b/packages/main/src/helper/index.ts @@ -34,8 +34,8 @@ function fetchWrapper(url: string) { return fetch(url, options); } -export { sleep, formatHeaders } from "./utils"; -export * from "./variables"; -export { on, handle } from "./decorator"; -export { convertToAudio } from "./ffmpeg"; +export { sleep, formatHeaders } from "./utils.ts"; +export * from "./variables.ts"; +export { on, handle } from "./decorator.ts"; +export { convertToAudio } from "./ffmpeg.ts"; export { fetchWrapper as fetch }; diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 85be7241..12e257c6 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -1,9 +1,9 @@ import "reflect-metadata"; import { app, protocol } from "electron"; -import { defaultScheme } from "./helper"; -import { container } from "./inversify.config"; -import { TYPES } from "./types"; -import ElectronApp from "./app"; +import { defaultScheme } from "./helper/index.ts"; +import { container } from "./inversify.config.ts"; +import { TYPES } from "./types.ts"; +import ElectronApp from "./app.ts"; const gotTheLock = app.requestSingleInstanceLock(); const start = async (): Promise => { diff --git a/packages/main/src/inversify.config.ts b/packages/main/src/inversify.config.ts index 2745de55..829e1fde 100644 --- a/packages/main/src/inversify.config.ts +++ b/packages/main/src/inversify.config.ts @@ -1,24 +1,24 @@ -import DownloadController from "./controller/DownloadController"; -import HomeController from "./controller/HomeController"; -import WebviewController from "./controller/WebviewController"; +import DownloadController from "./controller/DownloadController.ts"; +import HomeController from "./controller/HomeController.ts"; +import WebviewController from "./controller/WebviewController.ts"; import { Container } from "inversify"; -import FavoriteRepository from "./repository/FavoriteRepository"; -import VideoRepository from "./repository/VideoRepository"; -import WebviewService from "./services/WebviewService"; -import ElectronApp from "./app"; -import { Controller } from "./interfaces"; -import { TYPES } from "./types"; -import MainWindow from "./windows/MainWindow"; -import BrowserWindow from "./windows/BrowserWindow"; -import { SniffingHelper } from "./services/SniffingHelperService"; -import DownloadService from "./services/DownloadService"; -import ElectronLogger from "./vendor/ElectronLogger"; -import ElectronUpdater from "./vendor/ElectronUpdater"; -import TypeORM from "./vendor/TypeORM"; -import ElectronDevtools from "./vendor/ElectronDevtools"; -import ElectronStore from "./vendor/ElectronStore"; -import IpcHandler from "./core/ipc"; -import ProtocolService from "./core/protocol"; +import FavoriteRepository from "./repository/FavoriteRepository.ts"; +import VideoRepository from "./repository/VideoRepository.ts"; +import WebviewService from "./services/WebviewService.ts"; +import ElectronApp from "./app.ts"; +import { Controller } from "./interfaces.ts"; +import { TYPES } from "./types.ts"; +import MainWindow from "./windows/MainWindow.ts"; +import BrowserWindow from "./windows/BrowserWindow.ts"; +import { SniffingHelper } from "./services/SniffingHelperService.ts"; +import DownloadService from "./services/DownloadService.ts"; +import ElectronLogger from "./vendor/ElectronLogger.ts"; +import ElectronUpdater from "./vendor/ElectronUpdater.ts"; +import TypeORM from "./vendor/TypeORM.ts"; +import ElectronDevtools from "./vendor/ElectronDevtools.ts"; +import ElectronStore from "./vendor/ElectronStore.ts"; +import IpcHandler from "./core/ipc.ts"; +import ProtocolService from "./core/protocol.ts"; const container = new Container({ skipBaseClassChecks: true, diff --git a/packages/main/src/preload.ts b/packages/main/src/preload.ts index 411cc117..c922ee97 100644 --- a/packages/main/src/preload.ts +++ b/packages/main/src/preload.ts @@ -1,13 +1,13 @@ import { contextBridge, ipcRenderer } from "electron/renderer"; import { shell } from "electron/common"; -import { AppStore, BrowserStore, EnvPath } from "./main"; -import { type Favorite } from "./entity/Favorite"; +import { AppStore, BrowserStore, EnvPath } from "./main.ts"; +import { type Favorite } from "./entity/Favorite.ts"; import { VideoResponse, type DownloadItem, type DownloadItemPagination, -} from "./interfaces"; -import { Video } from "./entity/Video"; +} from "./interfaces.ts"; +import { Video } from "./entity/Video.ts"; const apiFunctions: Record = {}; diff --git a/packages/main/src/repository/FavoriteRepository.ts b/packages/main/src/repository/FavoriteRepository.ts index 63bf4543..0fefe7bd 100644 --- a/packages/main/src/repository/FavoriteRepository.ts +++ b/packages/main/src/repository/FavoriteRepository.ts @@ -1,7 +1,7 @@ import { inject, injectable } from "inversify"; -import { TYPES } from "../types"; -import { Favorite } from "../entity/Favorite"; -import TypeORM from "../vendor/TypeORM"; +import { TYPES } from "../types.ts"; +import { Favorite } from "../entity/Favorite.ts"; +import TypeORM from "../vendor/TypeORM.ts"; @injectable() export default class FavoriteRepository { diff --git a/packages/main/src/repository/VideoRepository.ts b/packages/main/src/repository/VideoRepository.ts index 9f6c2a6a..2591e0e8 100644 --- a/packages/main/src/repository/VideoRepository.ts +++ b/packages/main/src/repository/VideoRepository.ts @@ -1,14 +1,14 @@ -import { Video } from "../entity/Video"; +import { Video } from "../entity/Video.ts"; import { inject, injectable } from "inversify"; import { DownloadFilter, DownloadItem, DownloadItemPagination, DownloadStatus, -} from "../interfaces"; -import { TYPES } from "../types"; +} from "../interfaces.ts"; +import { TYPES } from "../types.ts"; import { In, Not } from "typeorm"; -import TypeORM from "../vendor/TypeORM"; +import TypeORM from "../vendor/TypeORM.ts"; @injectable() export default class VideoRepository { diff --git a/packages/main/src/services/DownloadService.ts b/packages/main/src/services/DownloadService.ts index f409a185..b5eba602 100644 --- a/packages/main/src/services/DownloadService.ts +++ b/packages/main/src/services/DownloadService.ts @@ -5,12 +5,16 @@ import { DownloadProgress, DownloadStatus, Task, -} from "../interfaces"; -import { TYPES } from "../types"; -import ElectronLogger from "../vendor/ElectronLogger"; -import ElectronStore from "../vendor/ElectronStore"; -import VideoRepository from "../repository/VideoRepository"; -import { Platform, biliDownloaderBin, m3u8DownloaderBin } from "../helper"; +} from "../interfaces.ts"; +import { TYPES } from "../types.ts"; +import ElectronLogger from "../vendor/ElectronLogger.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import VideoRepository from "../repository/VideoRepository.ts"; +import { + Platform, + biliDownloaderBin, + m3u8DownloaderBin, +} from "../helper/index.ts"; import * as pty from "node-pty"; import stripAnsi from "strip-ansi"; diff --git a/packages/main/src/services/SniffingHelperService.ts b/packages/main/src/services/SniffingHelperService.ts index f36004e4..4580d8f5 100644 --- a/packages/main/src/services/SniffingHelperService.ts +++ b/packages/main/src/services/SniffingHelperService.ts @@ -1,10 +1,10 @@ import { inject, injectable } from "inversify"; -import { DownloadType } from "../interfaces"; -import { TYPES } from "../types"; -import ElectronLogger from "../vendor/ElectronLogger"; +import { DownloadType } from "../interfaces.ts"; +import { TYPES } from "../types.ts"; +import ElectronLogger from "../vendor/ElectronLogger.ts"; import EventEmitter from "events"; import { session } from "electron"; -import { PERSIST_WEBVIEW } from "../helper"; +import { PERSIST_WEBVIEW } from "../helper/index.ts"; import { OnCompletedListenerDetails } from "electron/main"; export interface SourceParams { diff --git a/packages/main/src/services/WebviewService.ts b/packages/main/src/services/WebviewService.ts index c7e1d75d..231568b3 100644 --- a/packages/main/src/services/WebviewService.ts +++ b/packages/main/src/services/WebviewService.ts @@ -1,15 +1,21 @@ import { WebContentsView, session } from "electron"; import { inject, injectable } from "inversify"; -import { TYPES } from "../types"; +import { TYPES } from "../types.ts"; import isDev from "electron-is-dev"; -import { PERSIST_WEBVIEW, fetch, mobileUA, pcUA, pluginPath } from "../helper"; +import { + PERSIST_WEBVIEW, + fetch, + mobileUA, + pcUA, + pluginPath, +} from "../helper/index.ts"; import { ElectronBlocker } from "@cliqz/adblocker-electron"; -import ElectronLogger from "../vendor/ElectronLogger"; -import ElectronStore from "../vendor/ElectronStore"; -import MainWindow from "../windows/MainWindow"; -import BrowserWindow from "../windows/BrowserWindow"; -import VideoRepository from "../repository/VideoRepository"; -import { SniffingHelper } from "./SniffingHelperService"; +import ElectronLogger from "../vendor/ElectronLogger.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import MainWindow from "../windows/MainWindow.ts"; +import BrowserWindow from "../windows/BrowserWindow.ts"; +import VideoRepository from "../repository/VideoRepository.ts"; +import { SniffingHelper } from "./SniffingHelperService.ts"; import { resolve } from "path"; import { readFileSync } from "fs-extra"; diff --git a/packages/main/src/vendor/ElectronDevtools.ts b/packages/main/src/vendor/ElectronDevtools.ts index 1ca71533..1cabaafb 100644 --- a/packages/main/src/vendor/ElectronDevtools.ts +++ b/packages/main/src/vendor/ElectronDevtools.ts @@ -1,12 +1,12 @@ import { inject, injectable } from "inversify"; -import { TYPES } from "../types"; +import { TYPES } from "../types.ts"; import isDev from "electron-is-dev"; -import installExtension, { +import install, { REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS, } from "electron-devtools-installer"; -import ElectronLogger from "./ElectronLogger"; -import { Vendor } from "../core/vendor"; +import ElectronLogger from "./ElectronLogger.ts"; +import { Vendor } from "../core/vendor.ts"; @injectable() export default class DevToolsService implements Vendor { @@ -26,7 +26,7 @@ export default class DevToolsService implements Vendor { try { this.logger.debug("当前环境为开发环境,开始加载开发者工具"); - await installExtension([REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS]); + await install([REDUX_DEVTOOLS, REACT_DEVELOPER_TOOLS]); this.logger.debug("加载开发者工具成功"); } catch (err: unknown) { this.logger.error("加载开发者工具失败", err); diff --git a/packages/main/src/vendor/ElectronLogger.ts b/packages/main/src/vendor/ElectronLogger.ts index eed769e8..0bf66478 100644 --- a/packages/main/src/vendor/ElectronLogger.ts +++ b/packages/main/src/vendor/ElectronLogger.ts @@ -2,8 +2,8 @@ import logger, { Logger } from "electron-log"; import { injectable } from "inversify"; import dayjs from "dayjs"; import path from "path"; -import { appName, workspace } from "../helper"; -import { Vendor } from "../core/vendor"; +import { appName, workspace } from "../helper/index.ts"; +import { Vendor } from "../core/vendor.ts"; @injectable() export default class ElectronLogger implements Vendor { diff --git a/packages/main/src/vendor/ElectronStore.ts b/packages/main/src/vendor/ElectronStore.ts index 101be339..df016662 100644 --- a/packages/main/src/vendor/ElectronStore.ts +++ b/packages/main/src/vendor/ElectronStore.ts @@ -1,9 +1,9 @@ import Store from "electron-store"; import { injectable } from "inversify"; -import { AppStore } from "../main"; -import { download, workspace } from "../helper"; -import { AppLanguage, AppTheme } from "../types"; -import { Vendor } from "../core/vendor"; +import { AppStore } from "../main.ts"; +import { download, workspace } from "../helper/index.ts"; +import { AppLanguage, AppTheme } from "../types.ts"; +import { Vendor } from "../core/vendor.ts"; @injectable() export default class StoreService extends Store implements Vendor { diff --git a/packages/main/src/vendor/ElectronUpdater.ts b/packages/main/src/vendor/ElectronUpdater.ts index 1d9c6605..e3423ddb 100644 --- a/packages/main/src/vendor/ElectronUpdater.ts +++ b/packages/main/src/vendor/ElectronUpdater.ts @@ -1,9 +1,9 @@ import { autoUpdater } from "electron-updater"; import { inject, injectable } from "inversify"; -import { TYPES } from "../types"; +import { TYPES } from "../types.ts"; import isDev from "electron-is-dev"; -import ElectronLogger from "./ElectronLogger"; -import { Vendor } from "../core/vendor"; +import ElectronLogger from "./ElectronLogger.ts"; +import { Vendor } from "../core/vendor.ts"; @injectable() export default class UpdateService implements Vendor { diff --git a/packages/main/src/vendor/TypeORM.ts b/packages/main/src/vendor/TypeORM.ts index 97485d99..ab948ba7 100644 --- a/packages/main/src/vendor/TypeORM.ts +++ b/packages/main/src/vendor/TypeORM.ts @@ -1,11 +1,11 @@ -import { db } from "../helper"; +import { db } from "../helper/index.ts"; import { inject, injectable } from "inversify"; import { DataSource, EntityManager } from "typeorm"; -import { TYPES } from "../types"; -import { Video } from "../entity/Video"; -import { Favorite } from "../entity/Favorite"; -import ElectronLogger from "./ElectronLogger"; -import { Vendor } from "../core/vendor"; +import { TYPES } from "../types.ts"; +import { Video } from "../entity/Video.ts"; +import { Favorite } from "../entity/Favorite.ts"; +import ElectronLogger from "./ElectronLogger.ts"; +import { Vendor } from "../core/vendor.ts"; @injectable() export default class DatabaseService implements Vendor { diff --git a/packages/main/src/windows/BrowserWindow.ts b/packages/main/src/windows/BrowserWindow.ts index 112a38f8..7cf50b32 100644 --- a/packages/main/src/windows/BrowserWindow.ts +++ b/packages/main/src/windows/BrowserWindow.ts @@ -1,10 +1,10 @@ import isDev from "electron-is-dev"; import { inject, injectable } from "inversify"; import { resolve } from "path"; -import { TYPES } from "../types"; +import { TYPES } from "../types.ts"; import _ from "lodash"; -import Window from "../core/window"; -import ElectronStore from "../vendor/ElectronStore"; +import Window from "../core/window.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; @injectable() export default class BrowserWindow extends Window { diff --git a/packages/main/src/windows/MainWindow.ts b/packages/main/src/windows/MainWindow.ts index db07c8f3..fe824345 100644 --- a/packages/main/src/windows/MainWindow.ts +++ b/packages/main/src/windows/MainWindow.ts @@ -2,15 +2,15 @@ import { Menu, Notification, app } from "electron"; import isDev from "electron-is-dev"; import { inject, injectable } from "inversify"; import { resolve } from "path"; -import { TYPES } from "../types"; -import { DownloadProgress } from "../interfaces"; +import { TYPES } from "../types.ts"; +import { DownloadProgress } from "../interfaces.ts"; import _ from "lodash"; -import Window from "../core/window"; -import ElectronLogger from "../vendor/ElectronLogger"; -import DownloadService from "../services/DownloadService"; -import ElectronStore from "../vendor/ElectronStore"; -import VideoRepository from "../repository/VideoRepository"; -import { isWin } from "../helper"; +import Window from "../core/window.ts"; +import ElectronLogger from "../vendor/ElectronLogger.ts"; +import DownloadService from "../services/DownloadService.ts"; +import ElectronStore from "../vendor/ElectronStore.ts"; +import VideoRepository from "../repository/VideoRepository.ts"; +import { isWin } from "../helper/index.ts"; @injectable() export default class MainWindow extends Window { diff --git a/packages/main/tsconfig.json b/packages/main/tsconfig.json index b3ca8087..52374e7e 100644 --- a/packages/main/tsconfig.json +++ b/packages/main/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2015", - "module": "CommonJS", + "module": "NodeNext", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, @@ -9,13 +9,14 @@ "resolveJsonModule": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, - "moduleResolution": "Node", + "moduleResolution": "NodeNext", "strictPropertyInitialization": false, "typeRoots": ["node_modules/@types"], "declaration": true, "emitDeclarationOnly": true, "declarationDir": "./types", - "outDir": "app/output/build/main" + "outDir": "app/output/build/main", + "allowImportingTsExtensions": true }, "include": ["src"], "references": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26238886..8e6d9720 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,6 +150,9 @@ importers: '@rushstack/eslint-patch': specifier: ^1.10.3 version: 1.10.3 + '@types/electron-devtools-installer': + specifier: ^2.2.5 + version: 2.2.5 '@types/fs-extra': specifier: ^11.0.4 version: 11.0.4 @@ -1795,6 +1798,9 @@ packages: '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/electron-devtools-installer@2.2.5': + resolution: {integrity: sha512-DhH8z0dadKuDolvH4TiW40Vp7H3VyZbOoZv98hhBaUfnxmvvcXTjkZjzw/54xvAmuG4KFzExOGAiVLg3jM2ojQ==} + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -7751,6 +7757,8 @@ snapshots: dependencies: '@types/ms': 0.7.34 + '@types/electron-devtools-installer@2.2.5': {} + '@types/estree@1.0.5': {} '@types/expect@1.20.4': {}