♻️ refactor: reorganize project structure and centralize search engine config

- Move all source files from root to src/ directory for better organization
- Create src/config/searchEngines.ts to centralize search engine configurations
  - Define unified SearchEngineConfig interface
  - Support both JSONP and Fetch request methods
  - Implement response parsers for Google, Baidu, Bing, DuckDuckGo, and Bilibili
- Refactor src/utils/suggestions.ts to use centralized config
  - Simplify code from 126 lines to 81 lines
  - Support hybrid JSONP/Fetch mode (Bilibili uses Fetch via Vite proxy)
  - Remove duplicate URL construction and parsing logic
- Update path alias configuration
  - Change @/* from ./* to ./src/* in tsconfig.json
  - Update vite.config.ts alias to point to ./src
- Add Bilibili proxy configuration in vite.config.ts for development
- Remove Bilibili rewrites from vercel.json (use Vite proxy instead)
- Add @vercel/node to devDependencies
- Remove unused files: README.md, i18n/README.md, metadata.json, vite-env.d.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZyphrZero
2025-12-05 10:41:17 +08:00
parent aa46cd16b7
commit 2993f9b859
34 changed files with 1274 additions and 405 deletions

40
src/types.ts Normal file
View File

@@ -0,0 +1,40 @@
export interface SearchEngine {
name: string;
urlPattern: string;
icon?: string;
}
export type BackgroundType = 'image' | 'video';
export type WallpaperFit = 'cover' | 'contain' | 'fill' | 'repeat' | 'center';
export interface PresetWallpaper {
id?: string;
name: string;
type: BackgroundType;
url: string;
thumbnail?: string;
isCustom?: boolean;
}
export type Language = 'en' | 'zh';
export interface UserSettings {
use24HourFormat: boolean;
showSeconds: boolean;
backgroundBlur: number;
searchEngines: SearchEngine[];
selectedEngine: string;
themeColor: string;
searchOpacity: number;
enableMaskBlur: boolean;
backgroundUrl: string;
backgroundType: BackgroundType;
wallpaperFit: WallpaperFit;
customWallpapers: PresetWallpaper[];
enableSearchHistory: boolean;
searchHistory: string[];
language: Language;
}