收口原生壳命令入口
移动壳配置检查锁定壳级和根级脚本入口 桌面壳配置检查锁定壳级和根级脚本入口 桌面壳配置检查锁定Tauri dev与build前置命令 宿主壳方案文档补充命令入口门禁 共享决策日志记录原生壳命令入口边界
This commit is contained in:
@@ -188,6 +188,15 @@ function assertNoBlockedMobileChannelSnippets() {
|
||||
}
|
||||
}
|
||||
|
||||
function assertPackageScript(packageJson, packageLabel, scriptName, expected) {
|
||||
const actual = packageJson.scripts?.[scriptName];
|
||||
if (actual !== expected) {
|
||||
throw new Error(
|
||||
`${packageLabel} script ${scriptName} drifted: expected ${expected} but got ${actual}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function collectProductionSourceFiles(entry) {
|
||||
const stats = fs.statSync(entry);
|
||||
if (stats.isDirectory()) {
|
||||
@@ -272,6 +281,28 @@ assertNoBlockedMobileChannelDependencies(packageConfig, 'mobile shell package');
|
||||
assertNoBlockedMobileChannelDependencies(rootPackageConfig, 'root H5 package');
|
||||
assertNoBlockedMobileChannelSnippets();
|
||||
|
||||
for (const [scriptName, expected] of Object.entries({
|
||||
dev: 'expo start',
|
||||
android: 'expo run:android',
|
||||
ios: 'expo run:ios',
|
||||
test: 'vitest run -c vitest.config.ts',
|
||||
'config:smoke': 'node scripts/check-expo-config.mjs',
|
||||
'export:smoke': 'node scripts/check-expo-export.mjs',
|
||||
typecheck: 'tsc -p tsconfig.json --noEmit && node scripts/check-config.mjs',
|
||||
})) {
|
||||
assertPackageScript(packageConfig, 'mobile shell package', scriptName, expected);
|
||||
}
|
||||
|
||||
for (const [scriptName, expected] of Object.entries({
|
||||
'mobile-shell:dev': 'npm --prefix apps/mobile-shell run dev',
|
||||
'mobile-shell:typecheck': 'npm --prefix apps/mobile-shell run typecheck',
|
||||
'mobile-shell:test': 'npm --prefix apps/mobile-shell run test',
|
||||
'mobile-shell:config': 'npm --prefix apps/mobile-shell run config:smoke',
|
||||
'mobile-shell:export': 'npm --prefix apps/mobile-shell run export:smoke',
|
||||
})) {
|
||||
assertPackageScript(rootPackageConfig, 'root package', scriptName, expected);
|
||||
}
|
||||
|
||||
const sharedCapabilities = extractStringArrayExport(
|
||||
sharedContractSource,
|
||||
'HOST_BRIDGE_CAPABILITIES',
|
||||
|
||||
Reference in New Issue
Block a user