refactor: 修改结构 功能动态从后端获取

This commit is contained in:
2026-08-16 19:41:44 +08:00
parent 8a8e36602f
commit 481518500e
27 changed files with 760 additions and 107 deletions
@@ -0,0 +1,32 @@
/**
* 远程功能包入口(IIFE 构建)。
* 当前阶段导出元数据;真正 UI 仍由壳内 embedded 模块挂载。
* 后续可将 FloatingPanel 整包打入此入口并在 main world 执行。
*/
const FEATURE_ID = 'pdd-ad-fee';
export interface RemoteFeatureExport {
id: string;
version: string;
executionWorld: 'extension';
}
const meta: RemoteFeatureExport = {
id: FEATURE_ID,
version: '0.1.0',
executionWorld: 'extension',
};
declare global {
interface Window {
__ECBI_FEATURES__?: Record<string, RemoteFeatureExport>;
}
}
const g = globalThis as typeof globalThis & {
__ECBI_FEATURES__?: Record<string, RemoteFeatureExport>;
};
g.__ECBI_FEATURES__ = g.__ECBI_FEATURES__ ?? {};
g.__ECBI_FEATURES__[FEATURE_ID] = meta;
export default meta;