锁定移动壳EAS本地版本
移动壳构建配置检查执行本地 EAS CLI 版本校验 同步原生壳方案文档和共享决策记录
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import fs from 'node:fs';
|
||||
import {spawnSync} from 'node:child_process';
|
||||
|
||||
const shellRoot = new URL('../', import.meta.url);
|
||||
const easConfigPath = new URL('eas.json', shellRoot);
|
||||
@@ -6,6 +7,7 @@ const packagePath = new URL('package.json', shellRoot);
|
||||
|
||||
const easConfig = JSON.parse(fs.readFileSync(easConfigPath, 'utf8'));
|
||||
const packageConfig = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
||||
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
|
||||
function assertObject(value, label) {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
||||
@@ -28,6 +30,33 @@ if (easConfig.cli.version !== '>= 20.3.0') {
|
||||
throw new Error('mobile shell EAS CLI version gate must stay pinned to the checked devDependency floor');
|
||||
}
|
||||
|
||||
if (packageConfig.devDependencies?.['eas-cli'] !== '^20.3.0') {
|
||||
throw new Error('mobile shell package must declare the checked EAS CLI devDependency');
|
||||
}
|
||||
|
||||
const easVersionResult = spawnSync(npmCommand, ['exec', 'eas', '--', '--version'], {
|
||||
cwd: shellRoot,
|
||||
encoding: 'utf8',
|
||||
});
|
||||
|
||||
if (easVersionResult.error) {
|
||||
throw new Error(`failed to start local EAS CLI version check: ${easVersionResult.error.message}`);
|
||||
}
|
||||
|
||||
if (easVersionResult.signal) {
|
||||
throw new Error(`local EAS CLI version check was terminated by signal ${easVersionResult.signal}`);
|
||||
}
|
||||
|
||||
if ((easVersionResult.status ?? 0) !== 0) {
|
||||
process.stdout.write(easVersionResult.stdout ?? '');
|
||||
process.stderr.write(easVersionResult.stderr ?? '');
|
||||
process.exit(easVersionResult.status ?? 1);
|
||||
}
|
||||
|
||||
if (!(easVersionResult.stdout ?? '').trim().startsWith('eas-cli/20.3.0 ')) {
|
||||
throw new Error('mobile shell local EAS CLI version drifted');
|
||||
}
|
||||
|
||||
if (easConfig.cli.appVersionSource !== 'local') {
|
||||
throw new Error('mobile shell EAS builds must use local app.json version fields');
|
||||
}
|
||||
|
||||
@@ -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 产出内部 APK;iOS `production-simulator` profile 产出 simulator release 包,避免在没有真实签名凭据时写入伪证书配置。两端 profile 都用本地 `app.json` 版本字段并设置 `EXPO_NO_DOTENV=1`,当前不配置商店提交、签名凭据来源、自动递增、OTA runtimeVersion 或 releaseChannel。
|
||||
- 决策:新增 `apps/mobile-shell/eas.json` 和 `eas-cli` devDependency。Android `production` profile 使用本地 EAS build 产出内部 APK;iOS `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`、`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`。
|
||||
|
||||
|
||||
@@ -515,7 +515,7 @@ GameBridge 禁止:
|
||||
|
||||
2026-06-18 追加:移动壳 Metro export 烟测进入统一验收。`npm run check:native-shells` 会执行 `npm run mobile-shell:export`,用 Expo CLI 分别为 Android 和 iOS 生成 production bundle,校验 Metro metadata 与 `AppEntry` bundle 已产出后清理临时 `.expo-export-smoke/` 目录。该烟测不生成 APK、AAB 或 IPA,也不写商店资料,只证明移动壳入口、Expo/RN 依赖和平台差异代码能被真实生产 bundler 打包。
|
||||
|
||||
2026-06-20 追加:移动壳新增 EAS 原生包构建 profile。`apps/mobile-shell/eas.json` 固定 EAS CLI 下限、使用本地 `app.json` 版本字段,并提供 Android `production` 本地构建脚本产出可安装 APK、iOS `production-simulator` 本地构建脚本产出 release simulator 包;两者都设置 `EXPO_NO_DOTENV=1`,避免本机 `.env` 把开发 H5 URL 或私密配置带进可分发包。当前仍不写商店提交 profile、签名凭据来源、自动递增、OTA runtimeVersion 或 releaseChannel;`npm run check:native-shells` 只跑 `mobile-shell:build-config` 校验构建 profile 和脚本,真实 `mobile-shell:build:android` / `mobile-shell:build:ios` 作为具备 Android SDK、Xcode / simulator 环境和 EAS 本地构建依赖时的分发构建命令。
|
||||
2026-06-20 追加:移动壳新增 EAS 原生包构建 profile。`apps/mobile-shell/eas.json` 固定 EAS CLI 下限、使用本地 `app.json` 版本字段,并提供 Android `production` 本地构建脚本产出可安装 APK、iOS `production-simulator` 本地构建脚本产出 release simulator 包;两者都设置 `EXPO_NO_DOTENV=1`,避免本机 `.env` 把开发 H5 URL 或私密配置带进可分发包。当前仍不写商店提交 profile、签名凭据来源、自动递增、OTA runtimeVersion 或 releaseChannel;`npm run check:native-shells` 只跑 `mobile-shell:build-config` 校验构建 profile、脚本、本地 `eas-cli` devDependency 和从 `apps/mobile-shell` 目录解析到的 EAS CLI 版本,真实 `mobile-shell:build:android` / `mobile-shell:build:ios` 作为具备 Android SDK、Xcode / simulator 环境和 EAS 本地构建依赖时的分发构建命令。
|
||||
|
||||
2026-06-18 追加:登录 / 支付能力伪声明进入门禁。`auth.requestLogin` 和 `payment.request` 保留在共享 HostBridge 契约中供未来真实接入,但 Expo 与 Tauri 壳在没有真实 SDK、渠道流程和后端契约前不得声明这些 capability,也不得把它们写入 `hostCapabilities`;请求到达壳层时必须返回明确 `unsupported_method`,让 H5 fallback 承接。两端壳测试会直接覆盖这两个 method,避免后续半接入时返回伪成功。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user