- 添加生产环境服务器地址配置支持内外网切换 - 实现采购列表只看我创建的功能开关 - 更新构建脚本中的默认生产环境API地址 - 优化采购单表格单元格编辑体验改用自动补全组件 - 调整应用更新检查逻辑增强生产环境兼容性 - 修复开发服务器切换时的一些验证问题 - 增强应用启动时的服务地址配置灵活性
20 lines
1.4 KiB
JavaScript
20 lines
1.4 KiB
JavaScript
import { execFileSync } from 'node:child_process';
|
|
import { readFile,writeFile } from 'node:fs/promises';
|
|
import { createRequire } from 'node:module';
|
|
const require=createRequire(import.meta.url);
|
|
const cli=require.resolve('expo/bin/cli');
|
|
const updates=require.resolve('expo-updates/bin/cli.js');
|
|
const env={...process.env,EXPO_NO_TELEMETRY:'1',CI:'1'};
|
|
const runtime=JSON.parse(execFileSync(process.execPath,[updates,'runtimeversion:resolve','--platform','android'],{env,encoding:'utf8'})).runtimeVersion;
|
|
execFileSync(process.execPath,[cli,'export','--platform','android','--output-dir','dist'],{env,stdio:'inherit'});
|
|
const config=JSON.parse(execFileSync(process.execPath,[cli,'config','--type','public','--json'],{env,encoding:'utf8'}));
|
|
const after=JSON.parse(execFileSync(process.execPath,[updates,'runtimeversion:resolve','--platform','android'],{env,encoding:'utf8'})).runtimeVersion;
|
|
if(runtime!==after)throw Error('Native configuration changed during export; rebuild before publishing');
|
|
config.runtimeVersion=runtime;
|
|
// Never ship build-machine paths or private signing material in the manifest.
|
|
delete config._internal;
|
|
await writeFile('dist/resolved-config.json',JSON.stringify(config,null,2));
|
|
await writeFile('dist/runtime-version.txt',runtime);
|
|
await writeFile('dist/update-notes.json',await readFile(new URL('../release-notes.json',import.meta.url),'utf8'));
|
|
console.log(`Exported Android update for native runtime ${runtime}`);
|