Refactor UUID generation, remove unused logger and encryption utilities, and clean up request handling
- Updated `generateUUID` function for improved readability and performance. - Deleted `logger.ts`, `other.ts`, `request.ts`, `storage.ts`, `tansParams.ts`, and `validate.ts` as they were no longer needed. - Simplified TypeScript configuration by removing unnecessary paths and aliases. - Enhanced Vite configuration for better project structure and maintainability.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { BrowserWindow, ipcMain } from 'electron'
|
||||
import type { ConfigKeys, IConfig } from '@lib/types'
|
||||
import { CONFIG_KEYS, IPC_EVENTS } from '@lib/constants'
|
||||
import { debounce } from '@lib/utils'
|
||||
import type { ConfigKeys, IConfig } from '@runtime/lib/types'
|
||||
import { CONFIG_KEYS, IPC_EVENTS } from '@runtime/lib/constants'
|
||||
import { debounce } from '@runtime/lib/utils'
|
||||
|
||||
import logManager from '@electron/service/logger'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IPC_EVENTS } from '@lib/constants';
|
||||
import { IPC_EVENTS } from '@runtime/lib/constants';
|
||||
import { promisify } from 'util';
|
||||
import { app, ipcMain } from 'electron';
|
||||
import log from 'electron-log';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ipcMain, Menu, type MenuItemConstructorOptions } from 'electron';
|
||||
import { CONFIG_KEYS, IPC_EVENTS } from '@lib/constants';
|
||||
import { cloneDeep } from '@lib/utils';
|
||||
import { CONFIG_KEYS, IPC_EVENTS } from '@runtime/lib/constants';
|
||||
import { cloneDeep } from '@runtime/lib/utils';
|
||||
import { createTranslator } from '@electron/utils'
|
||||
import logManager from '@electron/service/logger'
|
||||
import configManager from '@electron/service/config-service'
|
||||
|
||||
@@ -2,12 +2,12 @@ import { app } from 'electron';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import logManager from '@electron/service/logger';
|
||||
import { PROVIDER_TYPE_INFO } from '@lib/providers';
|
||||
import { PROVIDER_TYPE_INFO } from '@runtime/lib/providers';
|
||||
import type {
|
||||
ProviderAccount,
|
||||
ProviderVendorInfo,
|
||||
ProviderWithKeyInfo,
|
||||
} from '@lib/providers';
|
||||
} from '@runtime/lib/providers';
|
||||
|
||||
interface ProviderStore {
|
||||
accounts: ProviderAccount[];
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
getScriptPathById,
|
||||
updateLastRun,
|
||||
} from '@electron/service/script-store-service';
|
||||
import type { ScriptExecutionResult } from '@lib/script-types';
|
||||
import type { ScriptExecutionResult } from '@runtime/lib/script-types';
|
||||
|
||||
const executor = new executeScriptService();
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
ScriptMetaItem,
|
||||
ScriptsMeta,
|
||||
ScriptSaveInput,
|
||||
} from '@lib/script-types';
|
||||
} from '@runtime/lib/script-types';
|
||||
|
||||
const META_FILENAME = 'scripts.meta.json';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BrowserView, BrowserWindow, ipcMain, IpcMainInvokeEvent } from 'electron'
|
||||
import { randomUUID } from 'crypto'
|
||||
import { IPC_EVENTS } from '@lib/constants'
|
||||
import { IPC_EVENTS } from '@runtime/lib/constants'
|
||||
import path from 'node:path'
|
||||
|
||||
declare const MAIN_WINDOW_VITE_DEV_SERVER_URL: string | undefined;
|
||||
@@ -231,4 +231,4 @@ export class TabManager {
|
||||
canGoForward: wc.canGoForward()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ipcMain } from 'electron'
|
||||
import { IPC_EVENTS } from '@lib/constants'
|
||||
import { IPC_EVENTS } from '@runtime/lib/constants'
|
||||
import { spawn } from 'child_process'
|
||||
|
||||
|
||||
|
||||
export function runTaskOperationService() {}
|
||||
export function runTaskOperationService() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BrowserWindow, ipcMain, nativeTheme } from 'electron'
|
||||
import { configManager } from '@electron/service/config-service'
|
||||
import { logManager } from '@electron/service/logger'
|
||||
import { IPC_EVENTS, CONFIG_KEYS } from '@lib/constants'
|
||||
import { IPC_EVENTS, CONFIG_KEYS } from '@runtime/lib/constants'
|
||||
|
||||
class ThemeService {
|
||||
private static _instance: ThemeService;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Tray, Menu, ipcMain, app } from 'electron'
|
||||
import { createTranslator, createLogo } from '@electron/utils'
|
||||
import { CONFIG_KEYS, IPC_EVENTS, WINDOW_NAMES, MAIN_WIN_SIZE } from '@lib/constants'
|
||||
import { CONFIG_KEYS, IPC_EVENTS, WINDOW_NAMES, MAIN_WIN_SIZE } from '@runtime/lib/constants'
|
||||
|
||||
import logManager from '@electron/service/logger'
|
||||
// TODO: shortcutManager
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import { BrowserWindow, ipcMain, app } from 'electron';
|
||||
import { IPC_EVENTS } from '@lib/constants';
|
||||
import { IPC_EVENTS } from '@runtime/lib/constants';
|
||||
|
||||
export class AppUpdater {
|
||||
private mainWindow: BrowserWindow | null = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { WindowNames } from '@lib/types'
|
||||
import type { WindowNames } from '@runtime/lib/types'
|
||||
|
||||
import { CONFIG_KEYS, IPC_EVENTS, WINDOW_NAMES } from '@lib/constants'
|
||||
import { CONFIG_KEYS, IPC_EVENTS, WINDOW_NAMES } from '@runtime/lib/constants'
|
||||
import { BrowserWindow, BrowserWindowConstructorOptions, ipcMain, IpcMainInvokeEvent, type IpcMainEvent } from 'electron'
|
||||
import { createLogo } from '@electron/utils'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user