锁定移动壳分发烟测门禁

移动壳配置检查反查根级 EAS 与 Expo 分发烟测

同步原生壳方案文档和共享决策记录
This commit is contained in:
2026-06-20 21:09:53 +08:00
parent 29256329e4
commit b9abc747da
3 changed files with 20 additions and 2 deletions
@@ -13,6 +13,11 @@ const expoExportSmokePath = new URL(
import.meta.url,
);
const expoExportSmokeSource = fs.readFileSync(expoExportSmokePath, 'utf8');
const nativeShellCheckPath = new URL(
'../../../scripts/check-native-shells.mjs',
import.meta.url,
);
const nativeShellCheckSource = fs.readFileSync(nativeShellCheckPath, 'utf8');
const shellAppTestPath = new URL('../src/shell/ShellApp.test.tsx', import.meta.url);
const shellAppTestSource = fs.readFileSync(shellAppTestPath, 'utf8');
const qrScannerOverlayPath = new URL('../src/shell/QrScannerOverlay.tsx', import.meta.url);
@@ -675,6 +680,19 @@ for (const snippet of [
}
}
for (const snippet of [
"label: 'mobile-shell-eas-build-config-smoke'",
"args: ['run', 'mobile-shell:build-config']",
"label: 'mobile-shell-expo-config-smoke'",
"args: ['run', 'mobile-shell:config']",
"label: 'mobile-shell-expo-export-smoke'",
"args: ['run', 'mobile-shell:export']",
]) {
if (!nativeShellCheckSource.includes(snippet)) {
throw new Error(`root native shell gate must keep mobile distribution smoke ${snippet}`);
}
}
assertNoDevScaffoldTerms(
productionSourceRoots.flatMap((root) => collectProductionSourceFiles(root)),
);
@@ -2974,7 +2974,7 @@
## 2026-06-20 移动壳 EAS 原生包构建 profile
- 背景:移动壳已能通过 Expo managed config 和 Metro production bundle smoke,但缺少原生安装包构建 profile;如果只保留 `expo export`,无法证明 Android / iOS 壳有进入原生分发链路的配置。
- 决策:新增 `apps/mobile-shell/eas.json``eas-cli` devDependency。Android `production` profile 使用本地 EAS build 产出内部 APKiOS `production-simulator` profile 产出 simulator release 包,避免在没有真实签名凭据时写入伪证书配置。两端 profile 都用本地 `app.json` 版本字段并设置 `EXPO_NO_DOTENV=1`,当前不配置商店提交、签名凭据来源、自动递增、OTA runtimeVersion 或 releaseChannel`check-eas-build-config.mjs` 必须从 `apps/mobile-shell` 目录执行本地 EAS CLI 版本检查,确认解析到受检版本。
- 决策:新增 `apps/mobile-shell/eas.json``eas-cli` devDependency。Android `production` profile 使用本地 EAS build 产出内部 APKiOS `production-simulator` profile 产出 simulator release 包,避免在没有真实签名凭据时写入伪证书配置。两端 profile 都用本地 `app.json` 版本字段并设置 `EXPO_NO_DOTENV=1`,当前不配置商店提交、签名凭据来源、自动递增、OTA runtimeVersion 或 releaseChannel`check-eas-build-config.mjs` 必须从 `apps/mobile-shell` 目录执行本地 EAS CLI 版本检查,确认解析到受检版本。`apps/mobile-shell/scripts/check-config.mjs` 必须反查根级门禁仍保留 EAS build profile、Expo config 和 Metro export 三个移动分发烟测。
- 影响范围:`apps/mobile-shell/eas.json``apps/mobile-shell/package.json``apps/mobile-shell/scripts/check-eas-build-config.mjs``apps/mobile-shell/scripts/check-config.mjs``scripts/check-native-shells.mjs`、原生壳方案和验收文档。
- 验证方式:`npm run mobile-shell:build-config``npm run mobile-shell:typecheck``npm run check:native-shells``npm run check:encoding``git diff --check`
@@ -511,7 +511,7 @@ GameBridge 禁止:
2026-06-18 追加:桌面壳 release 构建烟测进入统一验收。`npm run check:native-shells` 会在 H5 HostBridge、Expo 壳和 Tauri 单测通过后执行 `npm run desktop-shell:build -- --no-bundle`,确认根 `dist` H5 资产、Tauri release 入口、受控命令白名单、图标和 Rust release 编译可以共同产出桌面二进制;构建后还必须检查 `target/release/genarrative-desktop-shell` 存在、非空且符合当前平台可执行文件头。`apps/desktop-shell/scripts/check-config.mjs` 会反查根级门禁仍保留 release build smoke、二进制路径、Linux ELF / macOS Mach-O / Windows PE 文件头和可执行位检查,避免桌面产物验收被改成只看命令退出码。该烟测不生成平台安装包,避免把 Linux 本机缺少的系统打包器误判为 HostBridge 回归。
2026-06-18 追加:移动壳 Expo managed config 烟测进入统一验收。`npm run check:native-shells` 会执行 `npm run mobile-shell:config`,在 `apps/mobile-shell` 目录内调用 `expo config --type public --json`,校验 Expo CLI 实际解析结果中的包名、scheme、深链、ATS / cleartext / backup / 相机与麦克风权限、启动页、adaptive icon、插件配置和 HostBridge 版本没有漂移。
2026-06-18 追加:移动壳 Expo managed config 烟测进入统一验收。`npm run check:native-shells` 会执行 `npm run mobile-shell:config`,在 `apps/mobile-shell` 目录内调用 `expo config --type public --json`,校验 Expo CLI 实际解析结果中的包名、scheme、深链、ATS / cleartext / backup / 相机与麦克风权限、启动页、adaptive icon、插件配置和 HostBridge 版本没有漂移。`apps/mobile-shell/scripts/check-config.mjs` 会反查根级门禁仍保留 EAS build profile、Expo config 和 Metro export 三个移动分发烟测,避免移动壳验收退回到只看源码类型检查。
2026-06-18 追加:移动壳 Metro export 烟测进入统一验收。`npm run check:native-shells` 会执行 `npm run mobile-shell:export`,用 Expo CLI 分别为 Android 和 iOS 生成 production bundle,校验 Metro metadata 版本、单平台 `fileMetadata`、Hermes `AppEntry-*.hbc` bundle 路径、assets 数组、生产 H5 URL 和原生宿主上下文 token 后清理临时 `.expo-export-smoke/` 目录。该烟测不生成 APK、AAB 或 IPA,也不写商店资料,只证明移动壳入口、Expo/RN 依赖和平台差异代码能被真实生产 bundler 打包。