锁定移动壳能力清单共享来源
读取移动壳 capabilities 源码进入单端检查 要求移动基础能力直接引用共享 Expo profile 要求 iOS 移动能力直接引用共享 Expo profile
This commit is contained in:
@@ -46,6 +46,11 @@ const badgePath = new URL('../src/host-bridge/badge.ts', import.meta.url);
|
||||
const badgeSource = fs.readFileSync(badgePath, 'utf8');
|
||||
const badgeTestPath = new URL('../src/host-bridge/badge.test.ts', import.meta.url);
|
||||
const badgeTestSource = fs.readFileSync(badgeTestPath, 'utf8');
|
||||
const capabilitiesPath = new URL(
|
||||
'../src/host-bridge/capabilities.ts',
|
||||
import.meta.url,
|
||||
);
|
||||
const capabilitiesSource = fs.readFileSync(capabilitiesPath, 'utf8');
|
||||
const capabilitiesTestPath = new URL(
|
||||
'../src/host-bridge/capabilities.test.ts',
|
||||
import.meta.url,
|
||||
@@ -1163,6 +1168,15 @@ for (const profileSource of [
|
||||
}
|
||||
}
|
||||
|
||||
for (const snippet of [
|
||||
'export const MOBILE_HOST_CAPABILITIES =\n HOST_BRIDGE_EXPO_MOBILE_BASE_CAPABILITIES;',
|
||||
'export const IOS_MOBILE_HOST_CAPABILITIES =\n HOST_BRIDGE_EXPO_MOBILE_IOS_CAPABILITIES;',
|
||||
]) {
|
||||
if (!capabilitiesSource.includes(snippet)) {
|
||||
throw new Error(`mobile shell capability profile must stay directly shared: ${snippet}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
/export const MOBILE_HOST_CAPABILITIES[^=]*= \[/.test(hostBridgeSource) ||
|
||||
/export const IOS_MOBILE_HOST_CAPABILITIES[^=]*= \[/.test(hostBridgeSource)
|
||||
|
||||
Reference in New Issue
Block a user