切换移动壳默认主站入口
Expo 移动壳默认 H5 地址改为线上主站 本机 Vite 地址仅通过环境变量显式启用 补充默认入口检查测试和架构文档
This commit is contained in:
@@ -8,6 +8,8 @@ const appPath = new URL('../App.tsx', import.meta.url);
|
||||
const appSource = fs.readFileSync(appPath, 'utf8');
|
||||
const bridgePath = new URL('../src/mobileHostBridge.ts', import.meta.url);
|
||||
const bridgeSource = fs.readFileSync(bridgePath, 'utf8');
|
||||
const mobileShellUrlPath = new URL('../src/mobileShellUrl.ts', import.meta.url);
|
||||
const mobileShellUrlSource = fs.readFileSync(mobileShellUrlPath, 'utf8');
|
||||
const sharedContractPath = new URL(
|
||||
'../../../packages/shared/src/contracts/hostBridge.ts',
|
||||
import.meta.url,
|
||||
@@ -138,6 +140,18 @@ if (appSource.includes('process.env.EXPO_PUBLIC_GENARRATIVE_WEB_URL ||')) {
|
||||
throw new Error('mobile shell App must normalize EXPO_PUBLIC_GENARRATIVE_WEB_URL');
|
||||
}
|
||||
|
||||
if (
|
||||
!mobileShellUrlSource.includes(
|
||||
"DEFAULT_MOBILE_SHELL_WEB_URL = 'https://app.genarrative.world/'",
|
||||
)
|
||||
) {
|
||||
throw new Error('mobile shell default H5 URL must point to the production web app');
|
||||
}
|
||||
|
||||
if (appSource.includes('127.0.0.1:3000')) {
|
||||
throw new Error('mobile shell App must not hard-code localhost as the default H5 URL');
|
||||
}
|
||||
|
||||
for (const dependency of [
|
||||
'expo-file-system',
|
||||
'expo-document-picker',
|
||||
|
||||
Reference in New Issue
Block a user