feat: Enhance package manager detection script and improve type safety in components

- Updated `check-package-manager.js` to disable specific ESLint rules for better readability.
- Refactored `page.tsx` in the login module to remove unnecessary type assertions and improve state management.
- Modified `page.tsx` in the home module to enhance error handling, improve layout with grid system, and limit displayed items.
- Adjusted `PageLayout.tsx` to implement responsive layout changes for the play page.
- Improved `ThemeToggle.tsx` to ensure proper dependency tracking in useEffect.
- Enhanced `VideoCard.tsx` with better type definitions for favorites.
- Updated `db.client.ts` to rename legacy cache prefix for future migration.
- Added runtime configuration types in `types.ts` and extended global Window interface.
- Introduced a new Workbox service worker file for improved caching strategies.
This commit is contained in:
katelya
2025-09-01 21:23:45 +08:00
parent be5462cbb0
commit 4617b0199b
13 changed files with 118 additions and 61 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ const LEGACY_SEARCH_HISTORY_KEY = 'moontv_search_history';
// 缓存相关常量
const CACHE_PREFIX = 'katelyatv_cache_';
const LEGACY_CACHE_PREFIX = 'moontv_cache_';
const _LEGACY_CACHE_PREFIX = 'moontv_cache_'; // 保留用于将来的迁移功能
const CACHE_VERSION = '1.0.0';
const CACHE_EXPIRE_TIME = 60 * 60 * 1000; // 一小时缓存过期
+15
View File
@@ -95,3 +95,18 @@ export interface DoubanResult {
message: string;
list: DoubanItem[];
}
// Runtime配置类型
export interface RuntimeConfig {
STORAGE_TYPE?: string;
ENABLE_REGISTER?: boolean;
IMAGE_PROXY?: string;
DOUBAN_PROXY?: string;
}
// 全局Window类型扩展
declare global {
interface Window {
RUNTIME_CONFIG?: RuntimeConfig;
}
}