diff --git a/apps/mobile-shell/scripts/check-config.mjs b/apps/mobile-shell/scripts/check-config.mjs index 7b0d34b24..771db3f5f 100644 --- a/apps/mobile-shell/scripts/check-config.mjs +++ b/apps/mobile-shell/scripts/check-config.mjs @@ -102,6 +102,7 @@ const productionSourceRoots = [ new URL('../App.tsx', import.meta.url), new URL('../app.json', import.meta.url), new URL('../package.json', import.meta.url), + new URL('../scripts/', import.meta.url), new URL('../src/', import.meta.url), ]; const productionFileExtensions = new Set(['.json', '.mjs', '.ts', '.tsx']); @@ -136,6 +137,11 @@ const requiredMobileShellSourceModules = [ 'shell/webViewHistory.ts', 'shell/webViewPolicy.ts', ]; +const requiredMobileShellScriptModules = [ + 'check-eas-build-config.mjs', + 'check-expo-config.mjs', + 'check-expo-export.mjs', +]; const devScaffoldTerms = [ 'mo' + 'ck', 'fa' + 'ke', @@ -440,7 +446,7 @@ function collectProductionSourceFiles(entry) { if (!productionFileExtensions.has(extension)) { return []; } - if (path.includes('.test.') || path.includes('/scripts/check-')) { + if (path.includes('.test.') || path.endsWith('/scripts/check-config.mjs')) { return []; } @@ -512,6 +518,17 @@ assertSameList( requiredMobileShellSourceModules, 'mobile shell source modules', ); +assertSameList( + fs + .readdirSync(new URL('../scripts/', import.meta.url), { + withFileTypes: true, + }) + .filter((entry) => entry.isFile() && entry.name !== 'check-config.mjs') + .map((entry) => entry.name) + .sort(), + requiredMobileShellScriptModules, + 'mobile shell smoke scripts', +); assertNoDevScaffoldTerms( productionSourceRoots.flatMap((root) => collectProductionSourceFiles(root)), diff --git a/docs/project-memory/shared-memory/decision-log.md b/docs/project-memory/shared-memory/decision-log.md index 00478b1fe..abf99e525 100644 --- a/docs/project-memory/shared-memory/decision-log.md +++ b/docs/project-memory/shared-memory/decision-log.md @@ -2901,6 +2901,13 @@ - 影响范围:`scripts/check-native-shells.mjs`、原生壳方案文档。 - 验证方式:`npm run check:native-shells`、`npm run check:encoding`、`git diff --check`。 +## 2026-06-20 移动壳 smoke 脚本进入生产扫描 + +- 背景:移动壳 `check-eas-build-config.mjs`、`check-expo-config.mjs` 和 `check-expo-export.mjs` 已经成为原生包构建、Expo managed config 和 Metro production bundle 的验收入口;如果它们不进入单端结构清单和替身词扫描,后续可能在验收脚本里留下临时绕过逻辑而不被发现。 +- 决策:`apps/mobile-shell/scripts/check-config.mjs` 必须把上述三个 smoke 脚本登记为受控生产验收脚本,并纳入 mock / fake / placeholder / stub / TODO / FIXME / 占位 / 模拟 / 伪造 / 未实现 / 临时 扫描;`check-config.mjs` 本身继续由根级门禁调用,不自扫自身。 +- 影响范围:`apps/mobile-shell/scripts/check-config.mjs`、原生壳方案文档。 +- 验证方式:`npm run mobile-shell:typecheck`、`npm run check:native-shells`、`npm run check:encoding`、`git diff --check`。 + ## 2026-06-20 移动壳 ShellApp HostBridge 事件注入必须可执行覆盖 - 背景:Expo 移动壳声明 `host.events`、`app.lifecycle`、`network.statusChanged` 和 `navigation.canGoBack`,但 ShellApp 真实 AppState、Network 和 WebView 返回栈注入链路需要和扫码链路一样有可执行测试覆盖,不能只靠字符串门禁。 diff --git a/docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md b/docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md index 9c4548a3c..0ff5df013 100644 --- a/docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md +++ b/docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md @@ -493,7 +493,7 @@ GameBridge 禁止: 2026-06-18 追加:登录 / 支付能力伪声明进入门禁。`auth.requestLogin` 和 `payment.request` 保留在共享 HostBridge 契约中供未来真实接入,但 Expo 与 Tauri 壳在没有真实 SDK、渠道流程和后端契约前不得声明这些 capability,也不得把它们写入 `hostCapabilities`;请求到达壳层时必须返回明确 `unsupported_method`,让 H5 fallback 承接。两端壳测试会直接覆盖这两个 method,避免后续半接入时返回伪成功。 -2026-06-18 追加:微信 / Expo / Tauri 三端壳的生产源码和配置禁止出现 mock / fake / placeholder / stub / TODO / FIXME / 占位 / 模拟 / 伪造 / 未实现 / 临时 等脚手架或替身词;测试文件仍可使用 `vi.mock` 或等价测试替身。`apps/mobile-shell/scripts/check-config.mjs` 与 `apps/desktop-shell/scripts/check-config.mjs` 会扫描各自生产入口、配置和壳实现;根级 `npm run check:native-shells` 会统一扫描 `miniprogram`、`apps/mobile-shell`、`apps/desktop-shell`、H5 HostBridge transport 和共享 HostBridge 契约生产源码,防止把临时替身或占位文案带进可分发壳。 +2026-06-18 追加:微信 / Expo / Tauri 三端壳的生产源码和配置禁止出现 mock / fake / placeholder / stub / TODO / FIXME / 占位 / 模拟 / 伪造 / 未实现 / 临时 等脚手架或替身词;测试文件仍可使用 `vi.mock` 或等价测试替身。`apps/mobile-shell/scripts/check-config.mjs` 与 `apps/desktop-shell/scripts/check-config.mjs` 会扫描各自生产入口、配置和壳实现;移动壳 EAS / Expo config / Metro export smoke 脚本也属于可分发验收入口,必须纳入移动壳单端结构清单和替身词扫描。根级 `npm run check:native-shells` 会统一扫描 `miniprogram`、`apps/mobile-shell`、`apps/desktop-shell`、H5 HostBridge transport 和共享 HostBridge 契约生产源码,防止把临时替身或占位文案带进可分发壳。 2026-06-19 追加:H5 HostBridge 真实调用链扫描改为自动发现。根级 `npm run check:native-shells` 会从 `src/` 生产文件里收集直接导入并调用真实宿主能力 facade 的文件,以及 `useHostLifecycleActive`、`useHostNetworkOnline`、`platformProfileHostClipboard` 等薄 wrapper 的消费者;新增 `reloadHostWebView`、`showHostLocalNotification`、`setHostAppBadgeCount`、`importHostTextFile`、`importHostImageFile`、`captureHostImageFile`、`subscribeHostImageDrop`、`readHostClipboardText`、`openHostExternalUrl` 等 H5 调用点时,不再手工维护单个扫描文件清单。登录与支付外链属于敏感跳转路径,`src/services/authService.ts` 和 `src/services/payment/paymentRedirect.ts` 额外列入必扫清单,防止后续绕回裸浏览器跳转却脱离 HostBridge 调用链门禁。H5 业务文件允许正常表单 `placeholder` 属性、业务占位图文案和真实兼容 / 故障语义中的“未实现”“临时”表述,但仍会拒绝 mock / fake / stub / TODO / FIXME / 模拟 / 伪造等替身痕迹。