版控体系重构(13 文件):
- 移除 build.mjs --personal/--enterprise 参数和 EDITION 环境变量
- 统一安装包文件名:船长-HeiXiu-{os}-{版本号}-Setup.{ext}
- 简化 package.json 构建脚本,移除 :enterprise 变体
- scripts/*.mjs 不再接受 edition 参数
- 移除 shared/constants/app.ts 的 parseEdition()
窗口标题动态版控:
- 新格式:船长-HeiXiu-{os}-{版本号}(登录前)/ ·{版控} 后缀(登录后)
- 链路:AppProvider(account_type) → useEffect → appRuntime IPC → main process
- 移除 updater.ts 更新检查 API 的 edition 查询参数
本地存储生命周期修正:
- 退出登录不再自动清空缓存(user_id 隔离,重新登录命中缓存)
- clearUserStorage 添加 isOpen() 竞态守卫
- 移除 closeDatabase() 避免退出→重新登录后数据库不可用
- 手动「清理缓存」按钮保留
文档:
- CHANGELOG.md 新增 0.0.24 条目
- TODO.md 新增已完成项
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
/// <reference types="vite-plugin-electron/electron-env" />
|
||
|
||
declare namespace NodeJS {
|
||
interface ProcessEnv {
|
||
/**
|
||
* The built directory structure
|
||
*
|
||
* ```tree
|
||
* ├─┬─┬ dist
|
||
* │ │ └── index.html
|
||
* │ │
|
||
* │ ├─┬ dist-electron
|
||
* │ │ ├── main.js
|
||
* │ │ └── preload.js
|
||
* │
|
||
* ```
|
||
*/
|
||
APP_ROOT: string;
|
||
/** /dist/ or /public/ */
|
||
VITE_PUBLIC: string;
|
||
}
|
||
}
|
||
|
||
// Used in Renderer process, expose in `preload.ts`
|
||
declare interface Window {
|
||
ipcRenderer: import('electron').IpcRenderer;
|
||
/** safeStorage 安全加密 API(基于 OS 原生密钥链) */
|
||
safeStorage: {
|
||
encrypt(plaintext: string): Promise<string | null>;
|
||
decrypt(encryptedBase64: string): Promise<string | null>;
|
||
};
|
||
/** 应用运行时 API */
|
||
appRuntime: {
|
||
/** 登录/登出后更新窗口标题中的版控后缀 */
|
||
setWindowEdition(edition: string | null): void;
|
||
};
|
||
}
|