收口原生外观查询边界

将 Expo 系统配色读取收口到 appearance 模块

将 Tauri 窗口主题读取收口到 appearance 模块

同步原生壳结构门禁和架构文档清单
This commit is contained in:
2026-06-19 21:51:28 +08:00
parent b92b9bbc29
commit f04daee4a4
11 changed files with 118 additions and 31 deletions
+18 -2
View File
@@ -10,6 +10,8 @@ const shellAppPath = new URL('../src/shell/ShellApp.tsx', import.meta.url);
const shellAppSource = fs.readFileSync(shellAppPath, 'utf8');
const qrScannerOverlayPath = new URL('../src/shell/QrScannerOverlay.tsx', import.meta.url);
const qrScannerOverlaySource = fs.readFileSync(qrScannerOverlayPath, 'utf8');
const appearancePath = new URL('../src/host-bridge/appearance.ts', import.meta.url);
const appearanceSource = fs.readFileSync(appearancePath, 'utf8');
const bridgePath = new URL('../src/host-bridge/bridge.ts', import.meta.url);
const bridgeSource = fs.readFileSync(bridgePath, 'utf8');
const badgePath = new URL('../src/host-bridge/badge.ts', import.meta.url);
@@ -77,6 +79,7 @@ const productionSourceRoots = [
const productionFileExtensions = new Set(['.json', '.mjs', '.ts', '.tsx']);
const requiredMobileShellSourceModules = [
'env.d.ts',
'host-bridge/appearance.ts',
'host-bridge/badge.ts',
'host-bridge/bridge.ts',
'host-bridge/capabilities.ts',
@@ -1835,8 +1838,21 @@ for (const snippet of [
}
}
if (!dispatchSource.includes('Appearance.getColorScheme()')) {
throw new Error('mobile shell HostBridge must read the native color scheme');
if (
!dispatchSource.includes('getMobileAppearanceColorScheme()') ||
dispatchSource.includes('Appearance.getColorScheme()') ||
dispatchSource.includes('normalizeHostBridgeColorScheme')
) {
throw new Error('mobile shell appearance HostBridge method must delegate to appearance module');
}
for (const snippet of [
'Appearance.getColorScheme()',
'normalizeHostBridgeColorScheme',
'getMobileAppearanceColorScheme',
]) {
if (!appearanceSource.includes(snippet)) {
throw new Error(`mobile shell appearance module is missing ${snippet}`);
}
}
if (!dispatchSource.includes('openMobileShellExternalNavigation(Linking, externalUrlPayload.url)')) {