收紧原生壳验收文档门禁
统一宿主壳协议和开发流程中的临时替身扫描口径 将决策记录的壳验收描述对齐到 H5 HostBridge 真实调用链 扩展原生壳总门禁覆盖方案文档、协议文档、开发流程和决策记录
This commit is contained in:
@@ -7,6 +7,11 @@ import path from 'node:path';
|
||||
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
const nativeShellPlanPath =
|
||||
'docs/【前端架构】ExpoReactNative与Tauri宿主壳方案-2026-06-17.md';
|
||||
const hostBridgeProtocolDocPath =
|
||||
'docs/【前端架构】宿主壳能力统一协议-2026-06-17.md';
|
||||
const developmentWorkflowDocPath =
|
||||
'docs/project-memory/shared-memory/development-workflow.md';
|
||||
const decisionLogDocPath = 'docs/project-memory/shared-memory/decision-log.md';
|
||||
|
||||
const productionShellScanRoots = [
|
||||
'apps/mobile-shell',
|
||||
@@ -347,8 +352,30 @@ function extractDocumentMethodTable(source) {
|
||||
);
|
||||
}
|
||||
|
||||
function assertNativeShellScaffoldScanWording(source, label) {
|
||||
if (
|
||||
source.includes('三端生产壳临时替身词扫描') ||
|
||||
source.includes('三端壳生产源码') ||
|
||||
source.includes('壳生产源码禁替身') ||
|
||||
!source.includes('H5 HostBridge 真实调用链的临时替身词扫描')
|
||||
) {
|
||||
throw new Error(
|
||||
`${label} must document production scaffold scanning for the H5 HostBridge call chain`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function assertNativeShellCapabilityPlan() {
|
||||
const planSource = fs.readFileSync(nativeShellPlanPath, 'utf8');
|
||||
const hostBridgeProtocolDocSource = fs.readFileSync(
|
||||
hostBridgeProtocolDocPath,
|
||||
'utf8',
|
||||
);
|
||||
const developmentWorkflowDocSource = fs.readFileSync(
|
||||
developmentWorkflowDocPath,
|
||||
'utf8',
|
||||
);
|
||||
const decisionLogDocSource = fs.readFileSync(decisionLogDocPath, 'utf8');
|
||||
if (
|
||||
planSource.includes('permissions` 必须只包含 `core:default`') ||
|
||||
planSource.includes('permissions=["core:default","allow-host-bridge-request"]')
|
||||
@@ -357,14 +384,19 @@ function assertNativeShellCapabilityPlan() {
|
||||
'native shell plan must not document core:default as a desktop capability permission',
|
||||
);
|
||||
}
|
||||
if (
|
||||
planSource.includes('三端生产壳临时替身词扫描') ||
|
||||
!planSource.includes('H5 HostBridge 真实调用链的临时替身词扫描')
|
||||
) {
|
||||
throw new Error(
|
||||
'native shell plan must document production scaffold scanning for the H5 HostBridge call chain',
|
||||
);
|
||||
}
|
||||
assertNativeShellScaffoldScanWording(planSource, 'native shell plan');
|
||||
assertNativeShellScaffoldScanWording(
|
||||
hostBridgeProtocolDocSource,
|
||||
'HostBridge protocol document',
|
||||
);
|
||||
assertNativeShellScaffoldScanWording(
|
||||
developmentWorkflowDocSource,
|
||||
'development workflow document',
|
||||
);
|
||||
assertNativeShellScaffoldScanWording(
|
||||
decisionLogDocSource,
|
||||
'decision log document',
|
||||
);
|
||||
|
||||
const mobileCapabilitySource = fs.readFileSync(
|
||||
'apps/mobile-shell/src/host-bridge/capabilities.ts',
|
||||
|
||||
Reference in New Issue
Block a user